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
2 changed files with 21 additions and 3 deletions
Showing only changes of commit 863687830d - Show all commits

View File

@ -123,9 +123,10 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
# attach surface object pointer
if surface_object:
brushstrokes_object['BSBST_surface_object'] = surface_object
if flow_object:
flow_object['BSBST_surface_object'] = surface_object
utils.set_surface_object(brushstrokes_object, surface_object)
# brushstrokes_object['BSBST_surface_object'] = surface_object
# if flow_object:
# flow_object['BSBST_surface_object'] = surface_object
if flow_object:
brushstrokes_object['BSBST_flow_object'] = flow_object
brushstrokes_object['BSBST_active'] = True

View File

@ -452,6 +452,23 @@ def get_surface_object(bs):
def set_surface_object(bs, ob):
if not bs:
return
# assign surface pointer
for mod in bs.modifiers:
mod_info = bs.modifier_info.get(mod.name)
if not mod_info:
continue
for s in mod_info.socket_info:
if not s.link_context:
continue
if not s.link_context_type == 'SURFACE_OBJECT':
continue
mod[s.name] = ob
ob.update_tag()
if bs.type == 'CURVES':
bs.data.surface = ob
bs.data.surface_uv_map = ob.data.uv_layers.active.name
bs['BSBST_surface_object'] = ob
def get_flow_object(bs):