Enfusion Blender Tools: Import/Export Animation – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}Animations for Enfusion are exported into an intermediate human-readable format TXA. This format needs to be further compiled by the Enfusion engine into ANM - a binary format used during the runtime.
Animations for Enfusion are exported into an intermediate human-readable format TXA.
==Animation==
This format needs to be further compiled by the Enfusion engine into ANM - a binary format used during the runtime.
===Export animations from Blender===
<!--
TXA Export is available in top section of 3D viewport. To perform export, following things are necessary:
{{Feature|informative|
See the following formats documentation:
* TXA format
* APR format
* APR naming convention
}}
-->


{{Feature|important|Before going any further, make sure that [[Arma_Reforger:Enfusion_Blender_Tools#Installation|'''Enfusion Blender Tools Data''']] is installed correctly. Without it, '''export profiles will be missing'''!}}
*at least one '''Armature''' & '''Action''' present in the current scene
*at least one folder is defined in '''Export Profile Folder'''  with some valid animation export profiles ''(see [[Arma_Reforger:Enfusion_Blender_Tools#Installation|'''Enfusion Blender Tools''']] page for instructions)''
*
*running '''Workbench''' with '''net API enabled''' ''(see '''[[Arma_Reforger:Enfusion_Blender_Tools#Installation|Enfusion Blender Tools]]''' page for instructions)''


APR files are used for animations export. These files contain export profiles. Profiles can be found in {{hl|anims\export_profiles}}.
If all above conditions are meet, from top bar select '''Enfusion Tools -> Export -> Enfusion Animation (.txa)''' to initiate animation export.
The export profile defines which bones to export and how to export them. Export profiles have to correspond with the used skeleton in the take.


It exports animation data for Enfusion. To have an animation created in Blender in Enfusion, follow these steps:
[[Image:armareforger-blender-txa-export-toolbar.jpg|800px]]


# [[#Export_FBX_from_Blender  |Export the FBX model from Blender with an armature matching the animation you want to export]]
Once that button is pressed, following window should be visible:
# [[#Import_FBX_to_Enfusion|Import the FBX model into Enfusion]]
# [[#Export_Animation_from_Blender|Export the animation from Blender (TXA format)]]
# [[#Import_Animation_to_Enfusion|Import the animation TXA file into the Enfusion]]


{{Feature|informative|If you are trying to make animation to already existing character then you can skip directly to [[#Export_Animation_from_Blender|Export Animation from Blender ]] paragraph}}
[[File:armareforger-blender-txa-export-animation3.png|frameless|800x800px]]


== FBX ==
====Top section====
[[File:armareforger-blender-txa-export-animation-top-section.png]]


=== Export FBX from Blender ===
Top section contains following things:


<gallery mode="packed-hover" heights=500px style="text-align:left" >
*'''Save location''' - folder where the exported actions will be stored. You can either type in the location or use '''Change save location''' button located on the right side
Image:armareforger-blender-txa-export-rest-position.png|Rest position
**When changing location, it is possible to use '''relative path''' for saving the TXA - this is useful feature when collaborating with multiple people
Image:armareforger-blender-txa-export-fbx-export.jpg|Blender FBX export settings
*'''Folder with export profiles -''' folder with animation export profiles which should be currently used. This list populated through '''Export Profile Folder''' parameter located in  '''Enfusion Blender Tools settings.'''
</gallery>
*'''Armature name -''' name of the armature which will be used for export. Bone transformations from this armature are processed by the exporter and stored in exported TXA file. This parameter is only visible if you have more than one armature in the scene
*'''Secondary armature name''' ''(optional)'' '''-''' name of the secondary armature which will be used during export . This is parameter is useful when armature which you want to export, is constrained to another armature and doesn't have any motion itself and you want to export multiple actions at once. In case of Rigify rig, in this field should be selected name of the Rigify control rig. This parameter is only visible if you have more than one armature in the scene
*'''Hide -'''  Collapses export profiles in all actions
*'''Show''' - Expands export profiles in all actions
*'''Disable''' - Disables export profiles in all '''visible''' (''expanded)'' actions
*'''Enable''' - Disables export profiles in all '''visible''' (''expanded)'' actions
*'''Search''' [[File:armareforger-blender-txa-search-icon.png|22x22px]] - Filter visible actions. '''Confirm filtering by pressing enter.''' Only '''visible''' and '''expanded''' export profiles will be exported
*'''Toggle Compact View''' [[File:armareforger-blender-txa-toggle-compact-view.png]] - Toggles between regular and more compact list of all actions


Set the pose mode to rest for a given skeleton to export the rig. When exporting this FBX, make sure that you uncheck '''Add leaf bones''' option.  
====Action list====
[[File:armareforger-blender-txa-export-animation-list.png]]


=== Import FBX to Enfusion ===
'''Action list''' contains '''actions''' (marked in orange) found in the scene. [https://docs.blender.org/manual/en/latest/files/asset_libraries/introduction.html#bpy-ops-asset-mark Actions marked as assets] are hidden from this list. Each individual action has an '''arrow''', which controls the visibility of '''Action Export List''' - this option is quite useful when dealing with large amount of actions like on example picture above.


[[Image:armareforger-blender-txa-export-fbx-import.jpg|thumb|right|x500px|Import settings inside Workbench]]
Please note that only '''expanded & visible''' actions are exported{{Feature|important|If you '''don't see any action in the action list''', make sure your action is not marked as asset. See above description for more details}}
[[Image:armareforger-blender-txa-export-register-as-anim.png]]


Import the model "As Model" and afterwards set import to import skinning too.
====Action export list====
{{Clear}}
[[File:armareforger-blender-txa-export-export-list.png]]


== Animation ==
Action export list is the hear of TXA exporter. Over there it is possible to '''add exports''' & define '''how those actions will be processed'''. New entries in that list can be added by clicking on '''+ Add''' button located on the right side. Removal of exports can be done in similar way by pressing '''X''' button on the right side. 


=== Export Animation from Blender ===
*'''Enable checkbox -''' control if this export is active or not. In inactive state '''no txa''' will be generated
*'''Profile -''' [[Arma Reforger:Animation Export Profiles|animation export profile]] which will be used on this export. By default, assuming [[Arma_Reforger:Enfusion_Blender_Tools#Installation|Enfusion Blender Tools Data]] was correctly installed, there should be dozens of available animation exports which were used on Reforger assets. Selected profile has to correspond with the skeleton - otherwise no animation will be exported.
*'''File''' - name of resulting txa file
*'''Diff pose''' ''(optional)'' - name of the action which will be used as difference target for additive transformations. If you are using animation profile which doesn't have any additive transformations, you can leave that field empty
*'''Diff pose frame''' ''(optional)'' -  frame of '''diff pose''' which will be used as a base for additive animations export
*'''Additional armature''' ''(''optional'')'' - Bones from this armature will be considered during the export. It can be used in export of vehicle animation, where you have door & character movement keyframed in single action - this way you don't have to switch between main Armature names
{{Feature|warning|Selecting proper '''export profile''' is crucial for correct export of animation! In case of custom rig, it might be necessary to create '''custom animation export profiles'''}}


TXA Export is available in top section of viewport. From there, select '''Enfusion Tools -> Export -> Enfusion Animation (.txa)''' to initiate animation export.


[[Image:armareforger-blender-txa-export-toolbar.jpg|800px]]
Once all desired animation actions are selected and properly configured for export (meaning they have '''correct animation export profile''' selected), it is now possible to finally perform export to TXA. To do so, press '''OK''' button in bottom section of the export window.


Once that button is pressed, following window should be visible:
===Import animation to Enfusion===


[[Image:armareforger-blender-txa-export-animation.jpg]]


In '''export section''' all animation takes related to selected Armature (picked in '''Armature name''' option) should be listed. By clicking on '''Show exports''' checkbox next to desired action name, it is possible to enable export of that animation and further define what action should be exported.
By default, '''Enfusion Blender Tools''' will try to '''automatically register & import animation''' if save location is located in one of the currently loaded addons.


In '''export options''' section it is possible to change following things:
If you are using '''symbolic links''', then it might be necessary to manually register and import TXA animation - there are two ways how to do it:
* Pick animation '''export profile'''. All the profiles have to be in {{hl|anims\export_profiles}} or in a subdirectory. By default, assuming [[Arma_Reforger:Enfusion_Blender_Tools#Installation|Enfusion Blender Tools Data]] was correctly installed, there should be dozens of available animation exports which were used on Reforger assets. Selected profile has to correspond with the skeleton - otherwise no animation will be exported.
* Select animation for difference animations. This is only used if additive animation export profile is used.
* Change '''file name''' of exported animation. If this field is empty, plugin will use action name for creation of new txa


{{Feature|warning|Selecting proper '''export profile''' is crucial for correct export of animation! In case of custom rig, it might be necessary to create '''custom animation export profiles'''}}
* Drag and drop the TXA file into the [[Arma Reforger:Resource Manager|Resource Browser]].
* Click on TXA with Right Mouse Button and select '''"Register and Import"''' option from the Context Menu.


Location of where TXA files will be generated can be changed by selecting different directory in the '''save location''' field in the top section of export window.
Once animation is imported, .ANM file will be automatically regenerated every time Workbench detects change in .TXA. If TXA was modified when Workbench was closed, manual reimport might be necessary.
 
Once all desired animation actions are selected and properly configured for export (meaning they have '''correct animation export profile''' selected), it is now possible to finally perform export to TXA. To do so, press '''Export TXA''' button in bottom right section of the export window.
 
{{Feature|important|Deepening on complexity of the animation (''character animations can be especially demanding''), export can take up to 4 minutes while using 100% of the CPU.}}


=== Troubleshooting ===


==== Incorrect save location ====


=== Import Animation to Enfusion ===
* Make sure that location exist
* Make sure that correct type of slashes are used when copy pasting path
* Make sure that relative path option is disabled if you are trying to save TXA file on different drive than blend file is located


Once TXA is generated, there are two ways how to convert TXA into .ANM file:
==== TXA registration failed (Unable to translate to relative path) ====
* Drag and drop the TXA file into the [[Arma Reforger:Resource Manager|Resource Browser]].
Possible causes:
* Click on TXA with Right Mouse Button and select '''"Register and Import"''' option from the Context Menu.
 
Once animation is imported, .ANM file will be automatically regenerated every time Workbench detects change in .TXA. If TXA was modified when Workbench was closed, manual reimport might be necessary.


* Save location is outside of loaded projects in Workbench
* Symbolic links are used


{{GameCategory|armaR|Modding|Tutorials|Official Tools|Enfusion Blender Tools}}
If you see this warning, then be aware that automatic registration of txa animation is not going to work and you might need to manually register & import such file in '''Resource Manager'''.
Currently tool is not able to resolve s{{GameCategory|armaR|Modding|Tutorials|Official Tools|Enfusion Blender Tools}}ymbolic links and won't be able to automatically register files in such cases. If such files

Latest revision as of 13:20, 3 September 2024

Animations for Enfusion are exported into an intermediate human-readable format TXA. This format needs to be further compiled by the Enfusion engine into ANM - a binary format used during the runtime.

Animation

Export animations from Blender

TXA Export is available in top section of 3D viewport. To perform export, following things are necessary:

  • at least one Armature & Action present in the current scene
  • at least one folder is defined in Export Profile Folder with some valid animation export profiles (see Enfusion Blender Tools page for instructions)
  • running Workbench with net API enabled (see Enfusion Blender Tools page for instructions)

If all above conditions are meet, from top bar select Enfusion Tools -> Export -> Enfusion Animation (.txa) to initiate animation export.

armareforger-blender-txa-export-toolbar.jpg

Once that button is pressed, following window should be visible:

armareforger-blender-txa-export-animation3.png

Top section

armareforger-blender-txa-export-animation-top-section.png

Top section contains following things:

  • Save location - folder where the exported actions will be stored. You can either type in the location or use Change save location button located on the right side
    • When changing location, it is possible to use relative path for saving the TXA - this is useful feature when collaborating with multiple people
  • Folder with export profiles - folder with animation export profiles which should be currently used. This list populated through Export Profile Folder parameter located in Enfusion Blender Tools settings.
  • Armature name - name of the armature which will be used for export. Bone transformations from this armature are processed by the exporter and stored in exported TXA file. This parameter is only visible if you have more than one armature in the scene
  • Secondary armature name (optional) - name of the secondary armature which will be used during export . This is parameter is useful when armature which you want to export, is constrained to another armature and doesn't have any motion itself and you want to export multiple actions at once. In case of Rigify rig, in this field should be selected name of the Rigify control rig. This parameter is only visible if you have more than one armature in the scene
  • Hide - Collapses export profiles in all actions
  • Show - Expands export profiles in all actions
  • Disable - Disables export profiles in all visible (expanded) actions
  • Enable - Disables export profiles in all visible (expanded) actions
  • Search armareforger-blender-txa-search-icon.png - Filter visible actions. Confirm filtering by pressing enter. Only visible and expanded export profiles will be exported
  • Toggle Compact View armareforger-blender-txa-toggle-compact-view.png - Toggles between regular and more compact list of all actions

Action list

armareforger-blender-txa-export-animation-list.png

Action list contains actions (marked in orange) found in the scene. Actions marked as assets are hidden from this list. Each individual action has an arrow, which controls the visibility of Action Export List - this option is quite useful when dealing with large amount of actions like on example picture above.

Please note that only expanded & visible actions are exported

If you don't see any action in the action list, make sure your action is not marked as asset. See above description for more details

Action export list

armareforger-blender-txa-export-export-list.png

Action export list is the hear of TXA exporter. Over there it is possible to add exports & define how those actions will be processed. New entries in that list can be added by clicking on + Add button located on the right side. Removal of exports can be done in similar way by pressing X button on the right side.

  • Enable checkbox - control if this export is active or not. In inactive state no txa will be generated
  • Profile - animation export profile which will be used on this export. By default, assuming Enfusion Blender Tools Data was correctly installed, there should be dozens of available animation exports which were used on Reforger assets. Selected profile has to correspond with the skeleton - otherwise no animation will be exported.
  • File - name of resulting txa file
  • Diff pose (optional) - name of the action which will be used as difference target for additive transformations. If you are using animation profile which doesn't have any additive transformations, you can leave that field empty
  • Diff pose frame (optional) - frame of diff pose which will be used as a base for additive animations export
  • Additional armature (optional) - Bones from this armature will be considered during the export. It can be used in export of vehicle animation, where you have door & character movement keyframed in single action - this way you don't have to switch between main Armature names
Selecting proper export profile is crucial for correct export of animation! In case of custom rig, it might be necessary to create custom animation export profiles


Once all desired animation actions are selected and properly configured for export (meaning they have correct animation export profile selected), it is now possible to finally perform export to TXA. To do so, press OK button in bottom section of the export window.

Import animation to Enfusion

By default, Enfusion Blender Tools will try to automatically register & import animation if save location is located in one of the currently loaded addons.

If you are using symbolic links, then it might be necessary to manually register and import TXA animation - there are two ways how to do it:

  • Drag and drop the TXA file into the Resource Browser.
  • Click on TXA with Right Mouse Button and select "Register and Import" option from the Context Menu.

Once animation is imported, .ANM file will be automatically regenerated every time Workbench detects change in .TXA. If TXA was modified when Workbench was closed, manual reimport might be necessary.

Troubleshooting

Incorrect save location

  • Make sure that location exist
  • Make sure that correct type of slashes are used when copy pasting path
  • Make sure that relative path option is disabled if you are trying to save TXA file on different drive than blend file is located

TXA registration failed (Unable to translate to relative path)

Possible causes:

  • Save location is outside of loaded projects in Workbench
  • Symbolic links are used

If you see this warning, then be aware that automatic registration of txa animation is not going to work and you might need to manually register & import such file in Resource Manager. Currently tool is not able to resolve symbolic links and won't be able to automatically register files in such cases. If such files