Brushstroke Tools: Initial Version #328

Merged
Simon Thommes merged 229 commits from SimonThommes/blender-studio-tools:brushstroke_tools-initial-version into main 2024-11-06 15:03:47 +01:00
2 changed files with 50 additions and 1 deletions
Showing only changes of commit d35bc52414 - Show all commits

View File

@ -456,7 +456,7 @@ classes = [
def register():
for c in classes:
bpy.utils.register_class(c)
bpy.utils.register_class(c)
def unregister():
for c in reversed(classes):

View File

@ -279,15 +279,64 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
else:
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 = [
BSBST_UL_brushstroke_objects,
BSBST_PT_brushstroke_tools_panel,
BSBST_MT_PIE_brushstroke_data_marking,
BSBST_OT_brushstroke_data_marking,
]
def register():
for c in classes:
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():
for c in reversed(classes):
bpy.utils.unregister_class(c)