diff options
author | Dalai Felinto <dalai@blender.org> | 2022-06-15 14:01:39 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2022-06-15 14:53:37 +0300 |
commit | 15b4120064f192c29ed5b324bf8e63aa49b95ca6 (patch) | |
tree | 6e33a2a62b5d5c76d1286ca0743e779016972fbe /release | |
parent | 41053deba4d305f753d73b0ece68cfe1f6dd4ab2 (diff) |
Make Instance Face: Support instanced collections too
Differential Revision: https://developer.blender.org/D15204
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/object.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 60f534b3ab6..6e08d557353 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -596,6 +596,8 @@ class MakeDupliFace(Operator): for obj in context.selected_objects: if obj.type == 'MESH': linked[obj.data].append(obj) + elif obj.type == 'EMPTY' and obj.instance_type == 'COLLECTION' and obj.instance_collection: + linked[obj.instance_collection].append(obj) for data, objects in linked.items(): face_verts = [axis for obj in objects @@ -621,7 +623,12 @@ class MakeDupliFace(Operator): ob_new = bpy.data.objects.new(mesh.name, mesh) context.collection.objects.link(ob_new) - ob_inst = bpy.data.objects.new(data.name, data) + if type(data) is bpy.types.Collection: + ob_inst = bpy.data.objects.new(data.name, None) + ob_inst.instance_type = 'COLLECTION' + ob_inst.instance_collection = data + else: + ob_inst = bpy.data.objects.new(data.name, data) context.collection.objects.link(ob_inst) ob_new.instance_type = 'FACES' |