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