mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-22 11:50:53 +00:00
feat(Blenvy:Blender): fixed issue with duplicate objects when using parenting in blender
This commit is contained in:
parent
55a4deac1c
commit
ab7a0cab65
@ -81,11 +81,14 @@ def generate_temporary_scene_and_export(settings, gltf_export_settings, gltf_out
|
|||||||
# copies the contents of a collection into another one while replacing library instances with empties
|
# copies the contents of a collection into another one while replacing library instances with empties
|
||||||
def copy_hollowed_collection_into(source_collection, destination_collection, parent_empty=None, filter=None, blueprints_data=None, settings={}):
|
def copy_hollowed_collection_into(source_collection, destination_collection, parent_empty=None, filter=None, blueprints_data=None, settings={}):
|
||||||
collection_instances_combine_mode = getattr(settings.auto_export, "collection_instances_combine_mode")
|
collection_instances_combine_mode = getattr(settings.auto_export, "collection_instances_combine_mode")
|
||||||
|
|
||||||
for object in source_collection.objects:
|
for object in source_collection.objects:
|
||||||
if object.name.endswith("____bak"): # some objects could already have been handled, ignore them
|
if object.name.endswith("____bak"): # some objects could already have been handled, ignore them
|
||||||
continue
|
continue
|
||||||
if filter is not None and filter(object) is False:
|
if filter is not None and filter(object) is False:
|
||||||
continue
|
continue
|
||||||
|
if object.parent is not None: # if there is a parent, this object is not a direct child of the collection, and should be ignored (it will get picked up by the recursive scan inside duplicate_object)
|
||||||
|
continue
|
||||||
#check if a specific collection instance does not have an ovveride for combine_mode
|
#check if a specific collection instance does not have an ovveride for combine_mode
|
||||||
combine_mode = object['_combine'] if '_combine' in object else collection_instances_combine_mode
|
combine_mode = object['_combine'] if '_combine' in object else collection_instances_combine_mode
|
||||||
parent = parent_empty
|
parent = parent_empty
|
||||||
|
Loading…
Reference in New Issue
Block a user