Brushstroke Tools: Initial Version #328
@ -19,6 +19,8 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
|||||||
object = context.object
|
object = context.object
|
||||||
if not object:
|
if not object:
|
||||||
return False
|
return False
|
||||||
|
if not object in context.selected_objects:
|
||||||
|
return False
|
||||||
return object.type in ['MESH', 'CURVE', 'CURVES', 'GREASEPENCIL']
|
return object.type in ['MESH', 'CURVE', 'CURVES', 'GREASEPENCIL']
|
||||||
|
|
||||||
def new_brushstrokes_object(self, context, name):
|
def new_brushstrokes_object(self, context, name):
|
||||||
|
@ -172,7 +172,16 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
|||||||
else:
|
else:
|
||||||
surface_object = context.object
|
surface_object = context.object
|
||||||
|
|
||||||
layout.label(text=f'{surface_object.name}' if surface_object else 'No Surface Object', icon='OUTLINER_OB_SURFACE')
|
surface_row = layout.row()
|
||||||
|
if surface_object:
|
||||||
|
valid_surface = surface_object.type in ['MESH'] and (surface_object in context.selected_objects or context.object in context.selected_objects)
|
||||||
|
else:
|
||||||
|
valid_surface = False
|
||||||
|
if valid_surface:
|
||||||
|
surface_row.label(text=f'{surface_object.name}', icon='OUTLINER_OB_SURFACE')
|
||||||
|
else:
|
||||||
|
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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user