chinedufn / landon

A collection of tools, data structures and methods for exporting Blender data (such as meshes and armatures) and preparing it for your rendering pipeline.
https://chinedufn.github.io/landon/
147 stars 17 forks source link

blender_mesh.armature_name doesn't match blender_armature keys #25

Open kevzettler opened 2 years ago

kevzettler commented 2 years ago

I'm using the rust API to export a mesh and armature. The BlenderMesh.armature_name() output is: "armature":"PS1 Boy"

The keys on Result<HashMap<&str, &BlenderArmature> structure look like: {"Boy.001": BlenderArmature { name: "PS1 Boy.001",.

These don't match what i'm seeing in the blender file. Seems there is a .001 appended? image

chinedufn commented 2 years ago

Yeah sorry.

Right now the export process duplicates your armature before transforming and then exporting it.

https://github.com/chinedufn/landon/blob/master/crates/iks-to-fks/convert-ik-to-fk.py#L86-L93

Blender automatically appends a .001 to the names of the duplicated armatures.

So in your exported data you're seeing the names of that duplicated armature, not your original one.


It'd be nice to have the landon solve for this (perhaps by renaming the duplicated names back to the originals or something..)

But as a quick hack you can just trim the .001 from the names.