Skip to content

Commit b053ba7

Browse files
committed
Auto reset constructed object origin to Cursor3D
1 parent 1f3db00 commit b053ba7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
<h1>Requires</h1>
3232
<p>Blender 2.80 obviously, since this is the version that introduced collections.</p>
3333

34-
<h1>To do:</h1>
35-
<p>Automatically set output's object origin to 3D cursor.<p>
36-
3734
<h1>Credits</h1>
3835
<p>bmesh combine function taken from from https://github.com/nortikin/sverchok (GPL3 license)<p>
3936
<p>Models used in gif:</p>

utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ def join_collection(context, recursive):
103103

104104
final_obj = bpy.data.objects.new(final_object_name, mesh_data)
105105
sel_collection.objects.link(final_obj)
106+
107+
#delect all and select constructed object
108+
for obj in bpy.context.scene.objects:
109+
obj.select_set(False)
106110
final_obj.select_set(True)
111+
bpy.context.view_layer.objects.active = final_obj
112+
#set origin to cursor
113+
bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
107114

108115
return True

0 commit comments

Comments
 (0)