Housekeeping (bug fixes)

NEW FEATURES:
- added apply shapekey to basis from Cats
  - now that pesky thing I keep going back to cats for is in Avatar Toolkit.

BUG FIXES:
- now we push armature santizers into functions where they are needed
  - this prevents the methods from mirroring changes while working, causing them to blow up when mirror mode is on
  - more changes to come for armature setting santitizers
- fixed error reporting
  - now methods when catching errors will return full error tracebacks
  - this will help make debugging and finding user issues easier.
This commit is contained in:
989onan
2025-07-10 18:44:42 -04:00
parent 89fc8bc9c8
commit 6d9f751a16
27 changed files with 663 additions and 143 deletions
+10 -9
View File
@@ -18,6 +18,7 @@ from ...core.common import (
ProgressTracker
)
from ...core.armature_validation import validate_armature
import traceback
def textures_match(tex1: ShaderNodeTexImage, tex2: ShaderNodeTexImage) -> bool:
"""Compare two texture nodes for matching properties and image data"""
@@ -112,24 +113,24 @@ class AvatarToolkit_OT_CombineMaterials(Operator):
with ProgressTracker(context, 4, "Combining Materials") as progress:
try:
num_combined = self.consolidate_materials(meshes)
except Exception as e:
logger.error(f"Material consolidation failed: {str(e)}")
except Exception:
logger.error(f"Material consolidation failed: {traceback.format_exc()}")
self.report({'ERROR'}, t("Optimization.error.consolidation"))
return {'CANCELLED'}
progress.step("Consolidated materials")
try:
num_cleaned = self.clean_material_slots(meshes)
except Exception as e:
logger.error(f"Material slot cleanup failed: {str(e)}")
except Exception:
logger.error(f"Material slot cleanup failed: {traceback.format_exc()}")
self.report({'ERROR'}, t("Optimization.error.slot_cleanup"))
return {'CANCELLED'}
progress.step("Cleaned material slots")
try:
num_removed = clear_unused_data_blocks()
except Exception as e:
logger.error(f"Data block cleanup failed: {str(e)}")
except Exception:
logger.error(f"Data block cleanup failed: {traceback.format_exc()}")
self.report({'ERROR'}, t("Optimization.error.data_cleanup"))
return {'CANCELLED'}
progress.step("Removed unused data blocks")
@@ -141,9 +142,9 @@ class AvatarToolkit_OT_CombineMaterials(Operator):
return {'FINISHED'}
except Exception as e:
logger.error(f"Failed to combine materials: {str(e)}")
self.report({'ERROR'}, t("Optimization.error.combine_materials", error=str(e)))
except Exception:
logger.error(f"Failed to combine materials: {traceback.format_exc()}")
self.report({'ERROR'}, t("Optimization.error.combine_materials", error=traceback.format_exc()))
return {'CANCELLED'}
def consolidate_materials(self, meshes: List[Object]) -> int: