create shape in rihg picker collections

This commit is contained in:
2025-06-10 16:53:14 +02:00
parent 747cfa0f7a
commit e1abb88b7e
2 changed files with 17 additions and 8 deletions
+13 -2
View File
@@ -20,6 +20,14 @@ class RP_OT_create_shape(Operator):
@classmethod
def poll(cls, context):
return (context.object and context.object.mode == 'POSE')
def invoke(self, context, event):
return context.window_manager.invoke_props_dialog(self)
def draw(self, context):
for col in bpy.data.collections:
if col.rig_picker.enabled:
self.layout.prop(col.rig_picker, 'link_shape', text=col.name)
def execute(self,context):
scn = context.scene
@@ -40,8 +48,11 @@ class RP_OT_create_shape(Operator):
mesh.from_pydata(verts, edges, faces)
for c in scn.rig_picker.canvas.users_collection:
c.objects.link(ob)
for col in bpy.data.collections:
if col.rig_picker.link_shape:
col.objects.link(ob)
else:
scn.collection.objects.link(ob)
ob.location.z = 0.05
ob.location.x = offset