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 12 additions and 1 deletions
Showing only changes of commit a7be999291 - Show all commits

View File

@ -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):

View File

@ -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)