Brushstroke Tools: Initial Version #328
@ -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
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user