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

View File

@ -168,7 +168,7 @@ class BSBST_OT_make_preset(bpy.types.Operator):
@classmethod
def poll(cls, context):
return 'BSBST_surface_object' in context.object.keys()
return utils.is_brushstrokes_object(context.object)
def execute(self, context):

View File

@ -86,6 +86,38 @@ def transfer_modifier(modifier_name, target_obj, source_obj):
value = getattr(source_bake, prop)
setattr(target_bake, prop, value)
def is_brushstrokes_object(object):
return 'BSBST_active' in object.keys()
def is_surface_object(object):
for ob in bpy.data.objects:
if not 'BSBST_surface_object' in ob.keys():
continue
if ob['BSBST_surface_object'] == object:
return True
return False
def is_flow_object(object):
for ob in bpy.data.objects:
if not 'BSBST_flow_object' in ob.keys():
continue
if ob['BSBST_flow_object'] == object:
return True
return False
def get_surface_object(bs):
if not 'BSBST_surface_object' in bs.keys():
return None
return bs['BSBST_surface_object']
def get_flow_object(bs):
if not 'BSBST_flow_object' in bs.keys():
return None
return bs['BSBST_flow_object']
def context_brushstrokes(context):
settings = context.scene.BSBST_settings
return settings.context_brushstrokes
def register():
bpy.app.handlers.depsgraph_update_post.append(refresh_preset)