Vertical bar ("pipe" character) in action names on FBX export #72680

Open
opened 2019-12-24 19:44:11 +01:00 by Adam · 22 comments

When exporting an FBX with an action the action will be named the armature name + "|" + action name.

This does not cause problems in blender itself but for programs like Unity the vertical bar (|) is an illegal character.

This means that action names have to be manually renamed in unity and other programs in order to be usable outside the FBX, i.e. being applied to another rig.

I tried modifying the FBX import and export code to replace the | with another character but this resulted in the FBX being invalid.

When exporting an FBX with an action the action will be named the armature name + "|" + action name. This does not cause problems in blender itself but for programs like Unity the vertical bar (|) is an illegal character. This means that action names have to be manually renamed in unity and other programs in order to be usable outside the FBX, i.e. being applied to another rig. I tried modifying the FBX import and export code to replace the | with another character but this resulted in the FBX being invalid.
Author

Added subscriber: @09williamsad

Added subscriber: @09williamsad

blender/blender#90991 was marked as duplicate of this issue

blender/blender#90991 was marked as duplicate of this issue
Adam changed title from No vertical bar in action names on FBX export to Vertical bar in action names on FBX export 2019-12-24 19:44:29 +01:00
Member

Added subscriber: @mont29

Added subscriber: @mont29

This is a design issue, there is no bug here from Blender pov…

Changing/removing the | is trivial code-wise, but it might give issues:

  • Are some users/usages relying on current name scheme?
  • Is it useful or not to keep a separation between data-block names in such 'composed' FBX data identifiers?

Depending on the answers to those questions, we can:

  • Keep current behavior, either as default one or behind an option (and vice-versa for new behavior), or remove it completely.
  • Define new name scheme either by just concatenating ID names (with an _ separator e.g.), or try to find another, uncommon yet 'valid' char (!?§*%+@#&::… e.g.).

This needs input from users of this tool before we can take any action…

This *is* a design issue, there is no bug here from Blender pov… Changing/removing the `|` is trivial code-wise, but it might give issues: - Are some users/usages relying on current name scheme? - Is it useful or not to keep a separation between data-block names in such 'composed' FBX data identifiers? Depending on the answers to those questions, we can: - Keep current behavior, either as default one or behind an option (and vice-versa for new behavior), or remove it completely. - Define new name scheme either by just concatenating ID names (with an `_` separator e.g.), or try to find another, uncommon yet 'valid' char (`!?§*%+@#&::`… e.g.). This needs input from users of this tool before we can take any action…
Author

In #72680#839478, @mont29 wrote:
This is a design issue, there is no bug here from Blender pov…

Changing/removing the | is trivial code-wise, but it might give issues:

Are some users/usages relying on current name scheme?

Is it useful or not to keep a separation between data-block names in such 'composed' FBX data identifiers?

Depending on the answers to those questions, we can:

Keep current behavior, either as default one or behind an option (and vice-versa for new behavior), or remove it completely.

Define new name scheme either by just concatenating ID names (with an _ separator e.g.), or try to find another, uncommon yet 'valid' char (!?§*%+@#&::… e.g.).

This needs input from users of this tool before we can take any action…

Can you advise which lines of code would need to be changed for this?
I attemped this myself the but resulting FBX was invalid.

> In #72680#839478, @mont29 wrote: > This *is* a design issue, there is no bug here from Blender pov… > > Changing/removing the `|` is trivial code-wise, but it might give issues: > > # Are some users/usages relying on current name scheme? > # Is it useful or not to keep a separation between data-block names in such 'composed' FBX data identifiers? > > Depending on the answers to those questions, we can: > > # Keep current behavior, either as default one or behind an option (and vice-versa for new behavior), or remove it completely. > # Define new name scheme either by just concatenating ID names (with an `_` separator e.g.), or try to find another, uncommon yet 'valid' char (`!?§*%+@#&::`… e.g.). > > This needs input from users of this tool before we can take any action… Can you advise which lines of code would need to be changed for this? I attemped this myself the but resulting FBX was invalid.

@09williamsad would expect a search & replace over "|" (replacing the pipe char by something else, or even an empty string) to work, in the fbx_utils.py file?

@09williamsad would expect a search & replace over `"|"` (replacing the pipe char by something else, or even an empty string) to work, in the `fbx_utils.py` file?
Author

In #72680#860228, @mont29 wrote:
@09williamsad would expect a search & replace over "|" (replacing the pipe char by something else, or even an empty string) to work, in the fbx_utils.py file?

That is what I tried using the lines that have "|" and action name, it resulting in an invalid FBX.

> In #72680#860228, @mont29 wrote: > @09williamsad would expect a search & replace over `"|"` (replacing the pipe char by something else, or even an empty string) to work, in the `fbx_utils.py` file? That is what I tried using the lines that have "|" and action name, it resulting in an invalid FBX.

Added subscriber: @lamoot

Added subscriber: @lamoot

There is a workaround for this that I've been using for a few years now. If you assign the animations to the rig object in the NLA editor and then use the appropriate settings in the FBX exporter, the animations will be exported as separate clips (within the same fbx file) into Unity and without the "armature name + |" prefix.

The animation clips will take the name and visual result of the clips (meaning clip scaling and modifiers get taken into account). Also make sure there is at least a single frame gap between the clips, so they don't interfere with one another's first/last frames.

anim_as_nla.png

FBXExport_nla_anim.png

Perhaps this issue could be solved with better documentation, as the exporter already provides a way to export animations without the mentioned prefix.

There is a workaround for this that I've been using for a few years now. If you assign the animations to the rig object in the NLA editor and then use the appropriate settings in the FBX exporter, the animations will be exported as separate clips (within the same fbx file) into Unity and without the "armature name + |" prefix. The animation clips will take the name and visual result of the clips (meaning clip scaling and modifiers get taken into account). Also make sure there is at least a single frame gap between the clips, so they don't interfere with one another's first/last frames. ![anim_as_nla.png](https://archive.blender.org/developer/F8308411/anim_as_nla.png) ![FBXExport_nla_anim.png](https://archive.blender.org/developer/F8308415/FBXExport_nla_anim.png) Perhaps this issue could be solved with better documentation, as the exporter already provides a way to export animations without the mentioned prefix.
Author

I just tried that but in my case I am handling tens of animations per file so making sure each assigned correctly is time consuming and changing the NLA strips without that has no effect.

I just tried that but in my case I am handling tens of animations per file so making sure each assigned correctly is time consuming and changing the NLA strips without that has no effect.

Right, forgot to mention that if you mute individual NLA strips or if you mute the whole track that they are on, they will not be exported. So once you have the animations added to the NLA tracks, you simply mute whichever animations you don't need and unmute them after export.

I hope the discussion isn't going too much into user support direction, but so far the fbx exporter worked well for me with this way of working. Regardless, I'm not advocating to not solve this by changing the exporter, just that it's already possible to work with it.

Right, forgot to mention that if you mute individual NLA strips or if you mute the whole track that they are on, they will not be exported. So once you have the animations added to the NLA tracks, you simply mute whichever animations you don't need and unmute them after export. I hope the discussion isn't going too much into user support direction, but so far the fbx exporter worked well for me with this way of working. Regardless, I'm not advocating to not solve this by changing the exporter, just that it's already possible to work with it.

Added subscriber: @Jayanam

Added subscriber: @Jayanam

It's very annoying, Unity just declined my asset because of this, now I have to change all the imported actions manually (> 60)

It's very annoying, Unity just declined my asset because of this, now I have to change all the imported actions manually (> 60)
Philipp Oeser changed title from Vertical bar in action names on FBX export to Vertical bar ("pipe" character) in action names on FBX export 2021-09-01 08:19:21 +02:00
Member

Added subscribers: @MattCROK, @lichtwerk

Added subscribers: @MattCROK, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @BClark

Added subscriber: @BClark
Member

hanging/removing the | is trivial code-wise, but it might give issues:

1. Are some users/usages relying on current name scheme?
2. Is it useful or not to keep a separation between data-block names in such 'composed' FBX data identifiers?

By default:
I can't answer part 1, except for myself, I never want the name changed/added to and have to work around/rename it all the time when dealing with it.
So to answer part 2, knowing what "owns the action" by name is very blender spesfic and isn't an issue once it leaves blender, and even in Blender, having the extra name makes it very hard to deal with because the action editor can't display longer names... so it is in the way in Blender also. I have in my own test file, removed any action name change on import so I get in exactly the name of the animation from the FBX..but now I can't get it back out to the same name.

Requested change:
The FBX export should export an action name as it is, it shouldn't be adding prefixes or | characters to it.

If you need or want the old behavior could be toggled back on as a preference or an option if we want to support possible situations where it is expecting that behavior.

hanging/removing the | is trivial code-wise, but it might give issues: 1. Are some users/usages relying on current name scheme? 2. Is it useful or not to keep a separation between data-block names in such 'composed' FBX data identifiers? **By default:** I can't answer part 1, except for myself, I never want the name changed/added to and have to work around/rename it all the time when dealing with it. So to answer part 2, knowing what "owns the action" by name is very blender spesfic and isn't an issue once it leaves blender, and even in Blender, having the extra name makes it very hard to deal with because the action editor can't display longer names... so it is in the way in Blender also. I have in my own test file, removed any action name change on import so I get in exactly the name of the animation from the FBX..but now I can't get it back out to the same name. **Requested change:** The FBX export should export an action name as it is, it shouldn't be adding prefixes or | characters to it. If you need or want the old behavior could be toggled back on as a preference or an option if we want to support possible situations where it is expecting that behavior.

Added subscriber: @ChristiaanMoleman

Added subscriber: @ChristiaanMoleman

Added subscriber: @elamhut

Added subscriber: @elamhut

As a Pipeline developer for both Unity and Unreal this issue is a bit non-trivial for the reasons stated above and I'd love to see a way for us to manually set Animation names by ourselves for each Action.

In games we usually reuse animations across many rigs/characters so having an Animation's name ALWAYS linked to its Rig can cause confusion and pipeline problems.

In my opinion Auto Rig Pro has the perfect answer to this:
blender_aDLiX0KUgT.png

You can select which separator fits best for your needs and in the last enum option you can just export without the Rig name, just the Action name. Which would fit PERFECTLY for my case, since I can just manually set my Action names by script.

Please give this issue some more thought.

As a Pipeline developer for both Unity and Unreal this issue is a bit non-trivial for the reasons stated above and I'd love to see a way for us to manually set Animation names by ourselves for each Action. In games we usually reuse animations across many rigs/characters so having an Animation's name ALWAYS linked to its Rig can cause confusion and pipeline problems. In my opinion Auto Rig Pro has the perfect answer to this: ![blender_aDLiX0KUgT.png](https://archive.blender.org/developer/F13132852/blender_aDLiX0KUgT.png) You can select which separator fits best for your needs and in the last enum option you can just export without the Rig name, just the Action name. Which would fit PERFECTLY for my case, since I can just manually set my Action names by script. Please give this issue some more thought.

Is there any workaround available for this issue?
As in my bug report described it not only affects actions but also appears when you link a collection from another .blend. For a working pipeline to UE or Unity it is crucial to have standardized naming convention in export formats.

The easiest universal solution would be a checkbox for a "short naming" selection or the AutoRigPro way as described, so default doesn't break pipeline for user who rely on the full name and users to engines can check the box.

Is there any workaround available for this issue? As in my bug report described it not only affects actions but also appears when you link a collection from another .blend. For a working pipeline to UE or Unity it is crucial to have standardized naming convention in export formats. The easiest universal solution would be a checkbox for a "short naming" selection or the AutoRigPro way as described, so default doesn't break pipeline for user who rely on the full name and users to engines can check the box.

This naming behavior also effects the usability of UCX Meshes (Collision in UnrealEngine)
When nesting a collection from different .blend files and export to fbx the renaming of the objects destroys the assignment.

Example:

I've got a wall named
SM_Wall_R

and corresponding collision meshes:
UCX_SM_Wall_R_001
UCX_SM_Wall_R_002

The exporter renames all to:
CollectionName|SM_Wall_R + _L_FileName|SomeWeiredStuff
CollectionName|UCX_SM_Wall_R_001 + _L_FileName|SomeWeiredStuff
CollectionName|UCX_SM_Wall_R_002 + _L_FileName|SomeWeiredStuff

On import UE can not detect the corresponding meshes anymore.

This naming behavior also effects the usability of UCX Meshes (Collision in UnrealEngine) When nesting a collection from different .blend files and export to fbx the renaming of the objects destroys the assignment. Example: I've got a wall named SM_Wall_R and corresponding collision meshes: UCX_SM_Wall_R_001 UCX_SM_Wall_R_002 The exporter renames all to: CollectionName|SM_Wall_R + _L_FileName|SomeWeiredStuff CollectionName|UCX_SM_Wall_R_001 + _L_FileName|SomeWeiredStuff CollectionName|UCX_SM_Wall_R_002 + _L_FileName|SomeWeiredStuff On import UE can not detect the corresponding meshes anymore.
Sign in to join this conversation.
No Milestone
No project
No Assignees
11 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#72680
No description provided.