create shape in rihg picker collections
This commit is contained in:
parent
747cfa0f7a
commit
e1abb88b7e
@ -21,6 +21,14 @@ class RP_OT_create_shape(Operator):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return (context.object and context.object.mode == 'POSE')
|
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):
|
def execute(self,context):
|
||||||
scn = context.scene
|
scn = context.scene
|
||||||
vl = context.view_layer
|
vl = context.view_layer
|
||||||
@ -40,8 +48,11 @@ class RP_OT_create_shape(Operator):
|
|||||||
|
|
||||||
mesh.from_pydata(verts, edges, faces)
|
mesh.from_pydata(verts, edges, faces)
|
||||||
|
|
||||||
for c in scn.rig_picker.canvas.users_collection:
|
for col in bpy.data.collections:
|
||||||
c.objects.link(ob)
|
if col.rig_picker.link_shape:
|
||||||
|
col.objects.link(ob)
|
||||||
|
else:
|
||||||
|
scn.collection.objects.link(ob)
|
||||||
|
|
||||||
ob.location.z = 0.05
|
ob.location.z = 0.05
|
||||||
ob.location.x = offset
|
ob.location.x = offset
|
||||||
|
@ -44,15 +44,14 @@ class RP_PG_object_ui_settings(bpy.types.PropertyGroup):
|
|||||||
name: StringProperty()
|
name: StringProperty()
|
||||||
|
|
||||||
|
|
||||||
class RP_PG_scene_ui_settings(bpy.types.PropertyGroup):
|
class RP_PG_collection_ui_settings(bpy.types.PropertyGroup):
|
||||||
enabled : BoolProperty(default=False)
|
enabled : BoolProperty(default=False)
|
||||||
rig: PointerProperty(type=bpy.types.Object)
|
rig: PointerProperty(type=bpy.types.Object)
|
||||||
canvas: PointerProperty(type=bpy.types.Object)
|
canvas: PointerProperty(type=bpy.types.Object)
|
||||||
symmetry: PointerProperty(type=bpy.types.Object)
|
symmetry: PointerProperty(type=bpy.types.Object)
|
||||||
#idname: EnumProperty(items=[])
|
|
||||||
destination: StringProperty(subtype='FILE_PATH')
|
destination: StringProperty(subtype='FILE_PATH')
|
||||||
#bone_list: bpy.props.EnumProperty(items = bones_item
|
|
||||||
use_pick_bone : BoolProperty(default=False)
|
use_pick_bone : BoolProperty(default=False)
|
||||||
|
link_shape : BoolProperty(default=False)
|
||||||
|
|
||||||
|
|
||||||
class RP_OT_operator_selector(bpy.types.Operator):
|
class RP_OT_operator_selector(bpy.types.Operator):
|
||||||
@ -78,7 +77,7 @@ class RP_OT_operator_selector(bpy.types.Operator):
|
|||||||
classes = (
|
classes = (
|
||||||
RP_PG_picker_source,
|
RP_PG_picker_source,
|
||||||
RP_PG_object_ui_settings,
|
RP_PG_object_ui_settings,
|
||||||
RP_PG_scene_ui_settings,
|
RP_PG_collection_ui_settings,
|
||||||
RP_PG_armature_ui_settings,
|
RP_PG_armature_ui_settings,
|
||||||
RP_OT_operator_selector,
|
RP_OT_operator_selector,
|
||||||
)
|
)
|
||||||
@ -89,8 +88,7 @@ def register():
|
|||||||
|
|
||||||
bpy.types.Armature.rig_picker = bpy.props.PointerProperty(type=RP_PG_armature_ui_settings)
|
bpy.types.Armature.rig_picker = bpy.props.PointerProperty(type=RP_PG_armature_ui_settings)
|
||||||
bpy.types.Object.rig_picker = bpy.props.PointerProperty(type=RP_PG_object_ui_settings)
|
bpy.types.Object.rig_picker = bpy.props.PointerProperty(type=RP_PG_object_ui_settings)
|
||||||
bpy.types.Scene.rig_picker = bpy.props.PointerProperty(type=RP_PG_scene_ui_settings)
|
bpy.types.Collection.rig_picker = bpy.props.PointerProperty(type=RP_PG_collection_ui_settings)
|
||||||
bpy.types.Collection.rig_picker = bpy.props.PointerProperty(type=RP_PG_scene_ui_settings)
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
del bpy.types.Scene.rig_picker
|
del bpy.types.Scene.rig_picker
|
||||||
|
Loading…
x
Reference in New Issue
Block a user