Asset Pipeline v2 #145
@ -147,26 +147,30 @@ def transfer_modifier(modifier_name, target_obj, source_obj):
|
||||
if not mod.is_bound:
|
||||
continue
|
||||
for i in range(2):
|
||||
bpy.ops.object.surfacedeform_bind(
|
||||
{"object": target_obj, "active_object": target_obj},
|
||||
modifier=mod.name,
|
||||
)
|
||||
with override_obj_visability(obj=target_obj):
|
||||
with context.temp_override(
|
||||
object=target_obj, active_object=target_obj
|
||||
):
|
||||
bpy.ops.object.surfacedeform_bind(modifier=mod.name)
|
||||
elif mod.type == 'MESH_DEFORM':
|
||||
if not mod.is_bound:
|
||||
continue
|
||||
for i in range(2):
|
||||
bpy.ops.object.meshdeform_bind(
|
||||
{"object": target_obj, "active_object": target_obj},
|
||||
modifier=mod.name,
|
||||
)
|
||||
with override_obj_visability(obj=target_obj):
|
||||
with context.temp_override(
|
||||
object=target_obj, active_object=target_obj
|
||||
):
|
||||
bpy.ops.object.meshdeform_bind(modifier=mod.name)
|
||||
elif mod.type == 'CORRECTIVE_SMOOTH':
|
||||
if not mod.is_bind:
|
||||
continue
|
||||
for i in range(2):
|
||||
bpy.ops.object.correctivesmooth_bind(
|
||||
{"object": target_obj, "active_object": target_obj},
|
||||
modifier=mod.name,
|
||||
)
|
||||
# TODO Create override for modifier visibility in these cases
|
||||
with override_obj_visability(obj=target_obj):
|
||||
with context.temp_override(
|
||||
object=target_obj, active_object=target_obj
|
||||
):
|
||||
bpy.ops.object.correctivesmooth_bind(modifier=mod.name)
|
||||
fcurves = find_drivers(source_obj, 'modifiers', modifier_name)
|
||||
for fcurve in fcurves:
|
||||
copy_driver(from_fcurve=fcurve, target=target_obj)
|
||||
|
Loading…
Reference in New Issue
Block a user