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
Showing only changes of commit 5a3424c998 - Show all commits

View File

@ -341,6 +341,26 @@ class BSBST_OT_duplicate_brushstrokes(bpy.types.Operator):
flow_object.select_set(True)
bpy.ops.object.duplicate_move()
# reshuffle seed
for ob in context.selected_editable_objects:
for mod in ob.modifiers:
if not mod.type=='NODES':
continue
if not mod.node_group:
continue
for v in mod.node_group.interface.items_tree.values():
if type(v) not in utils.linkable_sockets:
continue
if not ob.modifier_info[mod.name].socket_info[v.identifier].link_context:
continue
# initialize linked context parameters
link_context_type = ob.modifier_info[mod.name].socket_info[v.identifier].link_context_type
if link_context_type=='RANDOM':
vmin = v.min_value
vmax = v.max_value
val = vmin + random.random() * (vmax - vmin)
mod[f'{v.identifier}'] = type(ob.modifiers[mod.name][f'{v.identifier}'])(val)
return {'FINISHED'}
class BSBST_OT_copy_brushstrokes(bpy.types.Operator):