save startup blend for animation tab & whatnot
This commit is contained in:
2026-04-08 12:10:18 -06:00
parent 57a652524a
commit 692e200ffe
180 changed files with 12336 additions and 3431 deletions
@@ -9,7 +9,7 @@ from bpy.types import Operator
from bpy.props import StringProperty, BoolProperty
from bpy.props import StringProperty, IntProperty
from ..utils import collection_containing_armature
from ..utils.remove_original import resolve_collection_for_remove_original
ADDON_NAME = __package__.rsplit(".", 1)[0] if "." in __package__ else __package__
@@ -305,7 +305,7 @@ class DLM_OT_migrator_migrate_nla(Operator):
return {"CANCELLED"}
try:
from ..ops.migrator import run_mig_nla
run_mig_nla(orig, rep, report=self.report)
run_mig_nla(orig, rep, report=self.report, context=context)
return {"FINISHED"}
except Exception as e:
self.report({"ERROR"}, str(e))
@@ -399,7 +399,16 @@ class DLM_OT_migrator_basebody_shapekeys(Operator):
from ..utils import descendants
rep_descendants = descendants(rep)
run_mig_bbody_shapekeys(orig, rep, rep_descendants, context)
self.report({"INFO"}, "Migrate BaseBody shapekeys done.")
props = context.scene.dynamic_link_manager
if props.migbbody_manual_override and (
not props.migbbody_orig_body or not props.migbbody_rep_body
):
self.report(
{"WARNING"},
"MigBBody: no CC-style base mesh matched. Pick Original/Replacement body meshes, then run again.",
)
else:
self.report({"INFO"}, "Migrate BaseBody shapekeys done.")
return {"FINISHED"}
except Exception as e:
self.report({"ERROR"}, str(e))
@@ -531,9 +540,10 @@ class DLM_OT_migrator_remove_original(Operator):
if removed_actions:
self.report({"INFO"}, f"Removed {len(removed_actions)} action(s) from original")
props = context.scene.dynamic_link_manager
rig_family = getattr(props, "migrator_rig_family", "RIGIFY")
try:
# Try to find and delete the collection containing the original character
coll = collection_containing_armature(orig)
coll = resolve_collection_for_remove_original(orig, rig_family, context.scene, rep)
if coll:
coll_name = coll.name # Store name BEFORE removal (RNA invalidates after remove)
context.scene.dynamic_link_manager.original_character = None
@@ -541,10 +551,14 @@ class DLM_OT_migrator_remove_original(Operator):
bpy.data.collections.remove(coll)
self.report({"INFO"}, f"Removed collection: {coll_name}")
except Exception as remove_err:
# Collection may have already been removed by another process
self.report({"WARNING"}, f"Collection {coll_name} removal issue: {remove_err}")
try:
bpy.data.objects.remove(orig, do_unlink=True)
self.report({"INFO"}, f"Removed original object: {name}")
except Exception as e2:
self.report({"ERROR"}, f"Could not remove original after collection failure: {e2}")
return {"CANCELLED"}
else:
# Fallback: just delete the armature object
bpy.data.objects.remove(orig, do_unlink=True)
context.scene.dynamic_link_manager.original_character = None
self.report({"INFO"}, f"Removed original character: {name}")