Brushstroke Tools: Initial Version #328
@ -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):
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user