Brushstroke Tools: Initial Version #328
@ -129,6 +129,9 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
||||
if flow_object:
|
||||
flow_object.parent = surface_object
|
||||
|
||||
if not settings.preset_object:
|
||||
bpy.ops.brushstroke_tools.init_preset()
|
||||
|
||||
# assign preset material
|
||||
preset_material = getattr(settings.preset_object, '["BSBST_material"]', None)
|
||||
|
||||
@ -139,10 +142,7 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
||||
bpy.ops.object.material_slot_add()
|
||||
brushstrokes_object.material_slots[0].material = preset_material
|
||||
settings.context_material = preset_material
|
||||
brushstrokes_object['BSBST_material'] = preset_material
|
||||
|
||||
if not settings.preset_object:
|
||||
bpy.ops.brushstroke_tools.init_preset()
|
||||
brushstrokes_object['BSBST_material'] = settings.context_material
|
||||
|
||||
# transfer preset modifiers to new brushstrokes TODO: refactor to deduplicate
|
||||
for mod in settings.preset_object.modifiers:
|
||||
@ -780,7 +780,7 @@ class BSBST_OT_init_preset(bpy.types.Operator):
|
||||
mat = bpy.data.materials.get('Brush Material')
|
||||
if not mat:
|
||||
mat = utils.import_brushstroke_material()
|
||||
settings.context_material = bpy.data.materials['Brush Material']
|
||||
settings.context_material = mat
|
||||
preset_object['BSBST_material'] = settings.context_material
|
||||
|
||||
return {"FINISHED"}
|
||||
|
Loading…
Reference in New Issue
Block a user