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 40 additions and 0 deletions
Showing only changes of commit 16fdf85722 - Show all commits

View File

@ -484,6 +484,41 @@ def set_brushstrokes_deformable(bs_ob, deformable):
return return
utils.set_deformable(flow_ob, deformable) utils.set_deformable(flow_ob, deformable)
class BSBST_OT_copy_flow(bpy.types.Operator):
"""
"""
bl_idname = "brushstroke_tools.copy_flow"
bl_label = "Copy Flow from Existing"
bl_description = "Copy the flow object from another brushstroke layer."
bl_options = {"REGISTER", "UNDO"}
source_bs: bpy.props.StringProperty(name="Brushstroke Layers")
@classmethod
def poll(cls, context):
settings = context.scene.BSBST_settings
return bool(settings.context_brushstrokes)
def execute(self, context):
settings = context.scene.BSBST_settings
bs_ob = utils.get_active_context_brushstrokes_object(context)
if not bs_ob:
return {"CANCELLED"}
# get target object
# set flow object
# delete old flow
return {"FINISHED"}
def draw(self, context):
settings = context.scene.BSBST_settings
layout = self.layout
layout.prop_search(self, 'source_bs', settings, 'context_brushstrokes')
def invoke(self, context, event):
return context.window_manager.invoke_props_dialog(self)
class BSBST_OT_switch_deformable(bpy.types.Operator): class BSBST_OT_switch_deformable(bpy.types.Operator):
""" """
""" """
@ -883,6 +918,7 @@ classes = [
BSBST_OT_delete_brushstrokes, BSBST_OT_delete_brushstrokes,
BSBST_OT_duplicate_brushstrokes, BSBST_OT_duplicate_brushstrokes,
BSBST_OT_copy_brushstrokes, BSBST_OT_copy_brushstrokes,
BSBST_OT_copy_flow,
BSBST_OT_switch_deformable, BSBST_OT_switch_deformable,
BSBST_OT_select_surface, BSBST_OT_select_surface,
BSBST_OT_init_preset, BSBST_OT_init_preset,

View File

@ -224,11 +224,15 @@ class BSBST_MT_bs_context_menu(bpy.types.Menu):
op = layout.operator('brushstroke_tools.copy_brushstrokes', text='Copy to Selected Objects') op = layout.operator('brushstroke_tools.copy_brushstrokes', text='Copy to Selected Objects')
op.copy_all = False op.copy_all = False
op = layout.operator('brushstroke_tools.copy_brushstrokes', text='Copy All to Selected Objects') op = layout.operator('brushstroke_tools.copy_brushstrokes', text='Copy All to Selected Objects')
op.copy_all = True op.copy_all = True
op = layout.operator('brushstroke_tools.switch_deformable') op = layout.operator('brushstroke_tools.switch_deformable')
op.switch_all = False op.switch_all = False
op = layout.operator('brushstroke_tools.copy_flow')
class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel): class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
bl_space_type = 'VIEW_3D' bl_space_type = 'VIEW_3D'
bl_region_type = 'UI' bl_region_type = 'UI'