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 10 additions and 2 deletions
Showing only changes of commit 88aec437fc - Show all commits

View File

@ -14,6 +14,8 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
bl_description = "Create new brushstrokes object of selected type with all the necessary setup in place"
bl_options = {"REGISTER", "UNDO"}
method: bpy.props.StringProperty(default='SURFACE_FILL')
@classmethod
def poll(cls, context):
object = context.object
@ -25,6 +27,8 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
def new_brushstrokes_object(self, context, name):
settings = context.scene.BSBST_settings
settings.brushstroke_method = self.method
if settings.curve_mode == 'GP':
bpy.ops.object.grease_pencil_add(type='EMPTY')
context.object.name = name

View File

@ -237,9 +237,13 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
surface_row.alert = True
surface_row.label(text='No Valid Surface Object', icon='OUTLINER_OB_SURFACE')
layout.prop(settings, 'brushstroke_method', expand=True)
#layout.prop(settings, 'brushstroke_method', expand=True)
layout.operator("brushstroke_tools.new_brushstrokes", icon='ADD')
row = layout.row(align=True)
op = row.operator("brushstroke_tools.new_brushstrokes", text='Fill', icon='OUTLINER_OB_FORCE_FIELD')
op.method = 'SURFACE_FILL'
op = row.operator("brushstroke_tools.new_brushstrokes", text='Draw', icon='LINE_DATA')
op.method = 'SURFACE_DRAW'
new_advanced_header, new_advanced_panel = layout.panel("new_advanced", default_closed=True)
new_advanced_header.label(text='Advanced')