create shape in rihg picker collections
This commit is contained in:
+13
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user