Asset Pipeline v2 #145
@ -229,6 +229,9 @@ def init_constraints(scene, obj):
|
|||||||
|
|
||||||
|
|
||||||
def transfer_constraint(constraint_name, target_obj, source_obj):
|
def transfer_constraint(constraint_name, target_obj, source_obj):
|
||||||
|
# TODO DEBUG WHY TARGETS DISAPPEAR
|
||||||
|
context = bpy.context # TODO PASS CONTEXT
|
||||||
|
|
||||||
# remove old and sync existing modifiers
|
# remove old and sync existing modifiers
|
||||||
old_mod = target_obj.constraints.get(constraint_name)
|
old_mod = target_obj.constraints.get(constraint_name)
|
||||||
if old_mod:
|
if old_mod:
|
||||||
@ -248,8 +251,9 @@ def transfer_constraint(constraint_name, target_obj, source_obj):
|
|||||||
):
|
):
|
||||||
if target_constraint.name == name_prev:
|
if target_constraint.name == name_prev:
|
||||||
idx = target_mod_i + 1
|
idx = target_mod_i + 1
|
||||||
|
with context.temp_override(object=target_obj):
|
||||||
bpy.ops.constraint.move_to_index(
|
bpy.ops.constraint.move_to_index(
|
||||||
{'object': target_obj}, constraint=constraint_new.name, index=idx
|
constraint=constraint_new.name, index=idx
|
||||||
)
|
)
|
||||||
constraint_target = target_obj.constraints.get(constraint.name)
|
constraint_target = target_obj.constraints.get(constraint.name)
|
||||||
props = [
|
props = [
|
||||||
|
Loading…
Reference in New Issue
Block a user