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
Showing only changes of commit 548f92ebeb - Show all commits

View File

@ -164,9 +164,13 @@ def transfer_modifier(modifier_name, target_obj, source_obj):
setattr(target_bake, prop, value)
def is_brushstrokes_object(object):
if not object:
return False
return 'BSBST_active' in object.keys()
def is_surface_object(object):
if not object:
return False
for ob in bpy.data.objects:
if 'BSBST_surface_object' not in ob.keys():
continue
@ -175,6 +179,8 @@ def is_surface_object(object):
return False
def is_flow_object(object):
if not object:
return False
for ob in bpy.data.objects:
if 'BSBST_flow_object' not in ob.keys():
continue
@ -183,11 +189,15 @@ def is_flow_object(object):
return False
def get_surface_object(bs):
if not bs:
return None
if 'BSBST_surface_object' not in bs.keys():
return None
return bs['BSBST_surface_object']
def get_flow_object(bs):
if not bs:
return None
if 'BSBST_flow_object' not in bs.keys():
return None
return bs['BSBST_flow_object']
@ -213,6 +223,8 @@ def edit_active_brushstrokes(context):
active_object = bs_ob
if flow_object:
active_object = flow_object
if not active_object:
return {"CANCELLED"}
context.view_layer.objects.active = active_object
for ob in bpy.data.objects: