Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 95d0750b58 - Show all commits

View File

@ -2,6 +2,7 @@ import bpy
from bpy import context from bpy import context
from ..naming import get_basename from ..naming import get_basename
from ..drivers import find_drivers, copy_driver from ..drivers import find_drivers, copy_driver
from ..visibility import override_obj_visability
from .transfer_util import ( from .transfer_util import (
transfer_data_clean, transfer_data_clean,
transfer_data_item_is_missing, 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): for target_mod_i, target_mod in enumerate(target_obj.modifiers):
if target_mod.name == name_prev: if target_mod.name == name_prev:
idx = target_mod_i + 1 idx = target_mod_i + 1
with override_obj_visability(obj=target_obj):
with context.temp_override(object=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) mod_target = target_obj.modifiers.get(mod.name)
props = [p.identifier for p in mod.bl_rna.properties if not p.is_readonly] props = [p.identifier for p in mod.bl_rna.properties if not p.is_readonly]
for prop in props: for prop in props:
@ -310,6 +314,7 @@ def transfer_constraint(constraint_name, target_obj, source_obj):
# TODO use toggle visibility here # TODO use toggle visibility here
if idx != i: if idx != i:
with override_obj_visability(obj=target_obj):
with context.temp_override(object=target_obj): with context.temp_override(object=target_obj):
bpy.ops.constraint.move_to_index( bpy.ops.constraint.move_to_index(
constraint=constraint_new.name, index=idx constraint=constraint_new.name, index=idx