Gap filling, improvements for character pipeline

This commit is contained in:
2026-05-25 01:42:28 +03:00
parent c7ef9283cd
commit eea50adfcb
10 changed files with 507 additions and 26 deletions
+23 -3
View File
@@ -268,6 +268,17 @@ for mapping in[CommandLineMapping()]:
elif mapping.auto_discover and ob.type == 'MESH' and ob.name not in mapping.objs:
if not ob.name.endswith("-noimp"):
ob.name = ob.name + "-noimp"
# Remove .001 suffixed duplicates that may have leaked from consolidate step
# These are objects that have the same base name as an object in mapping.objs
# but with a .001 suffix (e.g., BodyBottom.001 when BodyBottom is in mapping.objs)
if mapping.auto_discover:
for ob in list(bpy.data.objects):
if ob.type == 'MESH' and ob.name.endswith('.001'):
base_name = ob.name[:-4]
if base_name in mapping.objs:
print(f"Removing duplicate '{ob.name}' (base '{base_name}' already in export list)")
bpy.data.objects.remove(ob, do_unlink=True)
print("Removing original armature and actions...")
orig_arm = bpy.data.objects[mapping.armature_name + '_orig']
@@ -327,9 +338,18 @@ for mapping in[CommandLineMapping()]:
obj = bpy.data.objects.get(name)
if obj and obj.type == 'MESH':
# 1. Rename Mesh Data
if not obj.data.name.startswith(prefix):
obj.data.name = prefix + obj.data.name
# 1. Rename Mesh Data to match object name (not mesh data name)
# This prevents .001 suffixed mesh data names (e.g., BodyBottom.001)
# from becoming male_BodyBottom.001 and clashing with male_BodyBottom.
new_mesh_name = prefix + name
if obj.data.name != new_mesh_name:
# Check if another mesh data already has this name
if new_mesh_name in bpy.data.meshes and bpy.data.meshes[new_mesh_name] != obj.data:
old = bpy.data.meshes[new_mesh_name]
old.name = new_mesh_name + "_old"
print(f"Renamed conflicting mesh data '{old.name}' for object '{name}'")
obj.data.name = new_mesh_name
print(f"Renamed mesh data from '{obj.data.name}' to '{new_mesh_name}' for object '{name}'")
# 2. Iterate through all Material Slots on the object
for slot in obj.material_slots: