Brushstroke Tools: Initial Version #328
@ -279,15 +279,64 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
|||||||
else:
|
else:
|
||||||
style_panel.operator('object.modifier_add', text='Add Modifier', icon='ADD')
|
style_panel.operator('object.modifier_add', text='Add Modifier', icon='ADD')
|
||||||
|
|
||||||
|
class BSBST_MT_PIE_brushstroke_data_marking(bpy.types.Menu):
|
||||||
|
bl_idname= "BSBST_MT_PIE_brushstroke_data_marking"
|
||||||
|
bl_label = "Mark Brushstroke Flow"
|
||||||
|
|
||||||
|
items = {
|
||||||
|
"Brush Flow - Mark": ['FORCE_WIND'],
|
||||||
|
"Brush Flow - Clear": ['NONE'],
|
||||||
|
"Brush Break - Mark": ['MOD_PHYSICS'],
|
||||||
|
"Brush Break - Clear": ['NONE'],
|
||||||
|
"Brush Ignore - Mark": ['X'],
|
||||||
|
"Brush Ignore - Clear": ['NONE'],
|
||||||
|
}
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
pie = layout.menu_pie()
|
||||||
|
|
||||||
|
for name, info in self.items.items():
|
||||||
|
pie.alert=True
|
||||||
|
op = pie.operator("geometry.execute_node_group", text=name, icon=info[0])
|
||||||
|
op.asset_library_type='CUSTOM'
|
||||||
|
op.asset_library_identifier=utils.asset_lib_name
|
||||||
|
op.relative_asset_identifier=f"brushstroke_tools-resources.blend/NodeTree/{name}"
|
||||||
|
|
||||||
|
class BSBST_OT_brushstroke_data_marking(bpy.types.Operator):
|
||||||
|
"""
|
||||||
|
Call pie menu for operators to mark brushstroke data on the surface mesh
|
||||||
|
"""
|
||||||
|
bl_idname = "brushstroke_tools.data_marking"
|
||||||
|
bl_label = "Mark Brushstroke Data"
|
||||||
|
bl_description = " Call pie menu for operators to mark brushstroke data on the surface mesh"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return context.mode == 'EDIT_MESH'
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
bpy.ops.wm.call_menu_pie('INVOKE_DEFAULT', name=BSBST_MT_PIE_brushstroke_data_marking.bl_idname)
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
classes = [
|
classes = [
|
||||||
BSBST_UL_brushstroke_objects,
|
BSBST_UL_brushstroke_objects,
|
||||||
BSBST_PT_brushstroke_tools_panel,
|
BSBST_PT_brushstroke_tools_panel,
|
||||||
|
BSBST_MT_PIE_brushstroke_data_marking,
|
||||||
|
BSBST_OT_brushstroke_data_marking,
|
||||||
]
|
]
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
for c in classes:
|
for c in classes:
|
||||||
bpy.utils.register_class(c)
|
bpy.utils.register_class(c)
|
||||||
|
|
||||||
|
# Register UI shortcuts
|
||||||
|
wm = bpy.context.window_manager
|
||||||
|
if wm.keyconfigs.addon is not None:
|
||||||
|
km = wm.keyconfigs.addon.keymaps.new(name="Mesh")
|
||||||
|
kmi = km.keymap_items.new("brushstroke_tools.data_marking","F", "PRESS",shift=False, ctrl=True, alt=True)
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
for c in reversed(classes):
|
for c in reversed(classes):
|
||||||
bpy.utils.unregister_class(c)
|
bpy.utils.unregister_class(c)
|
||||||
|
Loading…
Reference in New Issue
Block a user