Blender 2.71 FBX binary exporter bone naming problem

Hey everyone!

With the new FBX binary exporter that came with Blender 2.71 came a problem as well. Even though everything exports nicely and much better than with the ASCII FBX exporter, the problem with the binary one is that it renames your bones to “NameOfArmature|NameOfBone”, which can cause a couple of problems when trying to use animations with a certain skeleton in say Unreal 4 or Unity. If you have a skeleton that has bones, which are named normally, you can’t import animation for that skeleton, because the exporter renames your bones, even though inside of blender your bones are named the same as those of the skeleton.

Now I know that mont29 said that he will take a look at it after 2.71 here: https://developer.blender.org/T40719

But what I would like is if anyone is willing to take a look at the python file of the exporter and to remove or change the command that appends the armature name to the bone name, if that is possible. If not, I could try it myself(even though I’m not a programmer), if anyone has any guidelines what to look for.

I’ve spend about an hour looking at the script, but it doesn’t make any sense to me.

Thanks for your time,

toast

Ok, so by experimenting for some time, I think I have found a solution to this. I don’t know if it messes up anything, but it certainly removes the “armature|” part from the name of the bone.

So you have to go to …Program Files\Blender Foundation\Blender\2.71\scripts\addons\io_scene_fbx
You right click on fbx_utils.py and change your permissions for it so that it’s not write protected(so that it’s not read only).

Then go to the line number 667, where it says:


<b>        else:  # isinstance(bdata, (Bone, PoseBone)):            if isinstance(bdata, PoseBone):
                bdata = armature.data.bones[bdata.name]
            self._tag = 'BO'
            self.name = get_blenderID_name((armature, bdata))      &lt;--THIS IS LINE 667
            self.bdata = bdata
            self._ref = armature</b>

and change


<b>self.name = get_blenderID_name((armature, bdata))</b>

to


<b>self.name = get_blenderID_name((bdata))</b>

As far as I know, what get_blenderID_name, does is it joins two object names and puts an “|” between them.
It’s definition is:

<b>def get_blenderID_name(bid):    if isinstance(bid, Iterable):
        return "|".join(e.name for e in bid)
    else:
        return bid.name</b>

So by removing armature from the arguments of get_blenderID_name, the function doesn’t add the armature object’s name to the bone name.