Brushstroke Tools: Initial Version #328
@ -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_description = "Create new brushstrokes object of selected type with all the necessary setup in place"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
method: bpy.props.StringProperty(default='SURFACE_FILL')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
object = context.object
|
object = context.object
|
||||||
@ -25,6 +27,8 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
|||||||
|
|
||||||
def new_brushstrokes_object(self, context, name):
|
def new_brushstrokes_object(self, context, name):
|
||||||
settings = context.scene.BSBST_settings
|
settings = context.scene.BSBST_settings
|
||||||
|
settings.brushstroke_method = self.method
|
||||||
|
|
||||||
if settings.curve_mode == 'GP':
|
if settings.curve_mode == 'GP':
|
||||||
bpy.ops.object.grease_pencil_add(type='EMPTY')
|
bpy.ops.object.grease_pencil_add(type='EMPTY')
|
||||||
context.object.name = name
|
context.object.name = name
|
||||||
|
@ -237,9 +237,13 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
|||||||
surface_row.alert = True
|
surface_row.alert = True
|
||||||
surface_row.label(text='No Valid Surface Object', icon='OUTLINER_OB_SURFACE')
|
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, new_advanced_panel = layout.panel("new_advanced", default_closed=True)
|
||||||
new_advanced_header.label(text='Advanced')
|
new_advanced_header.label(text='Advanced')
|
||||||
|
Loading…
Reference in New Issue
Block a user