Brushstroke Tools: Initial Version #328
Binary file not shown.
@ -147,7 +147,7 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
|||||||
if not settings.preset_object:
|
if not settings.preset_object:
|
||||||
bpy.ops.brushstroke_tools.init_preset()
|
bpy.ops.brushstroke_tools.init_preset()
|
||||||
|
|
||||||
# transfer preset modifiers to new brushstrokes
|
# transfer preset modifiers to new brushstrokes TODO: refactor to deduplicate
|
||||||
for mod in settings.preset_object.modifiers:
|
for mod in settings.preset_object.modifiers:
|
||||||
utils.transfer_modifier(mod.name, brushstrokes_object, settings.preset_object)
|
utils.transfer_modifier(mod.name, brushstrokes_object, settings.preset_object)
|
||||||
|
|
||||||
@ -165,6 +165,9 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
|||||||
elif link_context_type=='MATERIAL':
|
elif link_context_type=='MATERIAL':
|
||||||
brushstrokes_object.modifiers[mod.name][f'{v.identifier}'] = settings.context_material
|
brushstrokes_object.modifiers[mod.name][f'{v.identifier}'] = settings.context_material
|
||||||
elif link_context_type=='UVMAP':
|
elif link_context_type=='UVMAP':
|
||||||
|
if type(brushstrokes_object.modifiers[mod.name][f'{v.identifier}']) == str:
|
||||||
|
brushstrokes_object.modifiers[mod.name][f'{v.identifier}'] = surface_object.data.uv_layers.active.name
|
||||||
|
else:
|
||||||
brushstrokes_object.modifiers[mod.name][f'{v.identifier}_use_attribute'] = True
|
brushstrokes_object.modifiers[mod.name][f'{v.identifier}_use_attribute'] = True
|
||||||
brushstrokes_object.modifiers[mod.name][f'{v.identifier}_attribute_name'] = surface_object.data.uv_layers.active.name
|
brushstrokes_object.modifiers[mod.name][f'{v.identifier}_attribute_name'] = surface_object.data.uv_layers.active.name
|
||||||
elif link_context_type=='RANDOM':
|
elif link_context_type=='RANDOM':
|
||||||
@ -389,7 +392,7 @@ class BSBST_OT_copy_brushstrokes(bpy.types.Operator):
|
|||||||
new_bs = list(set(bpy.data.objects[:]) - all_obj)
|
new_bs = list(set(bpy.data.objects[:]) - all_obj)
|
||||||
del all_obj
|
del all_obj
|
||||||
|
|
||||||
# remap surface pointers and context linked data
|
# remap surface pointers and context linked data TODO: refactor to deduplicate
|
||||||
for ob in new_bs:
|
for ob in new_bs:
|
||||||
ob.parent = surface_object
|
ob.parent = surface_object
|
||||||
utils.set_surface_object(ob, surface_object)
|
utils.set_surface_object(ob, surface_object)
|
||||||
@ -412,6 +415,9 @@ class BSBST_OT_copy_brushstrokes(bpy.types.Operator):
|
|||||||
if link_context_type=='SURFACE_OBJECT':
|
if link_context_type=='SURFACE_OBJECT':
|
||||||
ob.modifiers[mod.name][f'{v.identifier}'] = surface_object
|
ob.modifiers[mod.name][f'{v.identifier}'] = surface_object
|
||||||
elif link_context_type=='UVMAP':
|
elif link_context_type=='UVMAP':
|
||||||
|
if type(ob.modifiers[mod.name][f'{v.identifier}']) == str:
|
||||||
|
ob.modifiers[mod.name][f'{v.identifier}'] = surface_object.data.uv_layers.active.name
|
||||||
|
else:
|
||||||
ob.modifiers[mod.name][f'{v.identifier}_use_attribute'] = True
|
ob.modifiers[mod.name][f'{v.identifier}_use_attribute'] = True
|
||||||
ob.modifiers[mod.name][f'{v.identifier}_attribute_name'] = surface_object.data.uv_layers.active.name
|
ob.modifiers[mod.name][f'{v.identifier}_attribute_name'] = surface_object.data.uv_layers.active.name
|
||||||
elif link_context_type=='RANDOM':
|
elif link_context_type=='RANDOM':
|
||||||
|
@ -18,6 +18,7 @@ linkable_sockets = [
|
|||||||
bpy.types.NodeTreeInterfaceSocketVector,
|
bpy.types.NodeTreeInterfaceSocketVector,
|
||||||
bpy.types.NodeTreeInterfaceSocketFloat,
|
bpy.types.NodeTreeInterfaceSocketFloat,
|
||||||
bpy.types.NodeTreeInterfaceSocketInt,
|
bpy.types.NodeTreeInterfaceSocketInt,
|
||||||
|
bpy.types.NodeTreeInterfaceSocketString,
|
||||||
]
|
]
|
||||||
|
|
||||||
asset_lib_name = 'Brushstroke Tools Library'
|
asset_lib_name = 'Brushstroke Tools Library'
|
||||||
|
Loading…
Reference in New Issue
Block a user