Skip to content

Commit

Permalink
Fix unit-test failures for empty materials
Browse files Browse the repository at this point in the history
  • Loading branch information
araistrick committed May 25, 2024
1 parent e0a6e25 commit 857c9be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions infinigen/assets/fruits/general_fruit.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def create_asset(self, **params):
obj.scale *= normal(1, 0.1) * self.scale * scale_multiplier
butil.apply_transform(obj)

# TODO remove when empty materials from geonodes is debugged
butil.purge_empty_materials(obj)

tag_object(obj, 'fruit_'+self.name)
return obj

Expand Down
1 change: 1 addition & 0 deletions infinigen/assets/leaves/leaf_pine.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def create_asset(self, **params):
obj = bpy.context.object
obj.scale *= normal(1, 0.05) * self.scale
butil.apply_transform(obj)
butil.purge_empty_materials(obj) # TODO remove when geonodes emptymats solved
tag_object(obj, 'leaf_pine')

return obj
Expand Down
5 changes: 3 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ def import_item(name):

def load_txt_list(path):
res = (Path(__file__).parent/path).read_text().splitlines()
res = [f for f in res if not f.startswith('#')]
return res
res = [f.strip() for f in res if not f.startswith('#')]
res = [f for f in res if len(f) > 0]
return sorted(res)

def check_factory_runs(fac_class, seed1=0, seed2=0, distance_m=50):
butil.clear_scene()
Expand Down

0 comments on commit 857c9be

Please sign in to comment.