From 331b4e5e8b3d84f8a31f395c8a344df20844195e Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 5 Mar 2024 15:24:17 -0500 Subject: [PATCH] Hotfix v1.2.4: Fix TreeFactory(season='winter'), fix join_objects ignoring empty meshes --- docs/CHANGELOG.md | 5 ++++- infinigen/__init__.py | 2 +- infinigen/core/util/blender.py | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c398593fc..591777a4f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -22,4 +22,7 @@ v1.1.0 - Add unit tests v1.2.0 -- Integrate OcMesher terrain option - see https://github.com/princeton-vl/OcMesher \ No newline at end of file +- Integrate OcMesher terrain option - see https://github.com/princeton-vl/OcMesher + +v1.2.4 +- Fix TreeFactory crash for season='winter' \ No newline at end of file diff --git a/infinigen/__init__.py b/infinigen/__init__.py index 8d06ce59c..7bf64aaba 100644 --- a/infinigen/__init__.py +++ b/infinigen/__init__.py @@ -1,3 +1,3 @@ import logging -__version__ = "1.2.3" +__version__ = "1.2.4" diff --git a/infinigen/core/util/blender.py b/infinigen/core/util/blender.py index 2e0fb568b..ba2593edf 100644 --- a/infinigen/core/util/blender.py +++ b/infinigen/core/util/blender.py @@ -553,6 +553,10 @@ def join_objects(objs, check_attributes=False): else: join_target.data.attributes.new(att.name, att.data_type, att.domain) + empty_objs = [o for o in objs if len(o.data.vertices) == 0] + objs = [o for o in objs if len(o.data.vertices) > 0] + delete(empty_objs) + select(objs) bpy.context.view_layer.objects.active = objs[0] bpy.ops.object.join()