Asset Pipeline v2 #145
@ -2,6 +2,7 @@ import bpy
|
||||
from bpy import context
|
||||
from ..naming import get_basename
|
||||
from ..drivers import find_drivers, copy_driver
|
||||
from ..visibility import override_obj_visability
|
||||
from .transfer_util import (
|
||||
transfer_data_clean,
|
||||
transfer_data_item_is_missing,
|
||||
@ -223,8 +224,11 @@ def transfer_modifier(modifier_name, target_obj, source_obj):
|
||||
for target_mod_i, target_mod in enumerate(target_obj.modifiers):
|
||||
if target_mod.name == name_prev:
|
||||
idx = target_mod_i + 1
|
||||
with override_obj_visability(obj=target_obj):
|
||||
with context.temp_override(object=target_obj):
|
||||
bpy.ops.object.modifier_move_to_index(modifier=mod_new.name, index=idx)
|
||||
bpy.ops.object.modifier_move_to_index(
|
||||
modifier=mod_new.name, index=idx
|
||||
)
|
||||
mod_target = target_obj.modifiers.get(mod.name)
|
||||
props = [p.identifier for p in mod.bl_rna.properties if not p.is_readonly]
|
||||
for prop in props:
|
||||
@ -310,6 +314,7 @@ def transfer_constraint(constraint_name, target_obj, source_obj):
|
||||
|
||||
# TODO use toggle visibility here
|
||||
if idx != i:
|
||||
with override_obj_visability(obj=target_obj):
|
||||
with context.temp_override(object=target_obj):
|
||||
bpy.ops.constraint.move_to_index(
|
||||
constraint=constraint_new.name, index=idx
|
||||
|
Loading…
Reference in New Issue
Block a user