Jump to content
DegmanCro

AnimExport - Blender to model.cfg (complex multi-bone animations for objects/vehicles/weapons/etc.)

Recommended Posts

AnimExport - only a few clicks between Blender and complex multi-bone model.cfg animation(s)

 

KOoR37W.gif

If you're looking for an alternative to manually writing down every bone movement in model.cfg, then AnimExport is the thing for you.

What does it do ?

 

The plugin will convert values from active Blender animation into parameters usable in Arma 3's model.cfg. All you have to do is include the generated .hpp file into your model's animations class. 

 

How is it different than anim2cfg ?

 

anim2cfg requires a lot of preparation and setup work in order to export a single bone's animation (time consuming), whereas animExport only requires you to select an armature and make active your desired animation; full animation exported with every single bone included ! All setup work is done automatically by the plugin.

 

How does it work ?

 

1. Download and install AnimExport plugin for Blender. In order to install, you will need to open your Blender and navigate to Edit > Preferences > AddOns > Install. There, you will select the .py script and click "Install Addon". Once complete, make sure you 'tick' the box next to newly installed plugin in order to activate it.

 

Spoiler

bnCRnfT.png

 

2. Open the scene containing your armature and animation(s). Make active the animation you wish to export. If you use the NLA system, then in order to do so you will need to right-click on desired action and select "Start editing stashed action". This animation's keyframes should now be visible in Dope Sheet, which confirms it is currently active.

Spoiler

 

GViLGLL.png

 

lBeKs6m.png

 

 

3. Presumed your animation is ready to go, navigate to File > Export > Arma 3 model.cfg (.cfg/.cpp) and populate the export menu with desired values.

 

Spoiler

SXA2h3E.png

'Parent Object': Animations will be exported relative to this object. When not set the origin will be used.

'Armature Object': If set, armature of this object will be used. Bone names are used as selection names.

'Start Frame': Starting frame to export.

'End Frame': End frame to export.

'Selection Name': Selection names to be used in the model.cfg. Defaults to the name of the objects. Automatically retrieved from chosen objects in the Outliner. DONE AUTOMATICALLY FOR EACH BONE BY THE PLUGN AS OF THE NEW VERSION.

'Source Name': Source name to be used in the model.cfg. 

'minValue': minValue to be used in the model.cfg for the first animation.

'maxValue': maxValue to be used in the model.cfg for the last animation.

'Precision': Number of decimal places.

'Add Folder': Whether or not a folder will be created for additional subfiles.(If only one bone exists, no folder will be created.)

'Folder Name': Name of the generated folder. If unset, Source name will be used as folder name. If folder with same name exists, that folder will be used.

navigate the directory tree and set/select the file name (existing files will be OVERWRITTEN)

'Export model.cfg'

 

4. The plugin has now generated a .hpp file with animations for each bone. This means if your armature is consist of 5x bones, then 5x .hpp files will be created based off values from the export menu. Those will be inside your newly created folder, if you opted for it. In addition, another .hpp file is created which has all generated .hpp #included in it. This means you can simply #include that single file into your model.cfg, because it already has all other .hpp files #included in it.

 

Example below:

 

bridge_deploy.hpp 

- the main .hpp file generated by plugin. All .hpp subfiles are included inside.

Spoiler


Wt5GhjI.png

Spoiler

#include "bridge_deploy\bridge_deploy_jnt_root_main.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone8.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone9.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_cradle.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_cradle_rail.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone10.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_root2.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_elbow2.hpp"
#include "bridge_deploy\bridge_deploy_joint24.hpp"
#include "bridge_deploy\bridge_deploy_joint23.hpp"
#include "bridge_deploy\bridge_deploy_joint25.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone11.hpp"
#include "bridge_deploy\bridge_deploy_joint26.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_04.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone4.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone5.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm02_cradle.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm02_cradle_rail.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_03.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone7.hpp"
#include "bridge_deploy\bridge_deploy_joint22.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone6.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_root1.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_elbow1.hpp"
#include "bridge_deploy\bridge_deploy_joint20.hpp"
#include "bridge_deploy\bridge_deploy_joint19.hpp"
#include "bridge_deploy\bridge_deploy_joint21.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone1.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm03_cradle.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm03_cradle_rail.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone2.hpp"
#include "bridge_deploy\bridge_deploy_joint2.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone3.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_root.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_elbow.hpp"
#include "bridge_deploy\bridge_deploy_joint17.hpp"
#include "bridge_deploy\bridge_deploy_joint5.hpp"
#include "bridge_deploy\bridge_deploy_joint18.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_02.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone12.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone13.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm04_cradle.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm04_cradle_rail.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone14.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_root3.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_elbow3.hpp"
#include "bridge_deploy\bridge_deploy_joint28.hpp"
#include "bridge_deploy\bridge_deploy_joint27.hpp"
#include "bridge_deploy\bridge_deploy_joint29.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone15.hpp"
#include "bridge_deploy\bridge_deploy_joint30.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_05.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone16.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone17.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm05_cradle.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm05_cradle_rail.hpp"
#include "bridge_deploy\bridge_deploy_ANIMATED_bone18.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_root4.hpp"
#include "bridge_deploy\bridge_deploy_IK_arm_elbow4.hpp"
#include "bridge_deploy\bridge_deploy_joint32.hpp"
#include "bridge_deploy\bridge_deploy_joint31.hpp"
#include "bridge_deploy\bridge_deploy_joint33.hpp"
#include "bridge_deploy\bridge_deploy_jnt_arm01_06.hpp"

#include "bridge_deploy\bridge_deploy_ANIMATED_bone19.hpp"

Spoiler

 

NuWwDLw.png

 


 

Example content of .hpp subfile:

 

- this is where actual arma3 model.cfg animations are stored (direct translations/rotations)

 

Spoiler

bVYjVp4.png

 

 

5. Now with your animation exported, it's time that you create a model.cfg file and configure CfgSkeletons and CfgModels. Thankfully, our friend Talya_Taya has created a separate plugin that can export a list of all bones from a selected armature, ensuring you do not need to type them in manually. Note: when using AnimExport, your bones must NOT be parent/children of each other. This will break the animation.

 

Download skelExport

 

Guide:

- Install the same way as AnimExport.

- File > Export > Arma3 skeleton (.hpp)

- Untick (IMPORTANT) retrieve parents option (as mentioned above: parenting will break this type of animations)

 

You can still create additional bones and make them children to animExport-exported bones, but the bones affected by original animExport animations must not be made children of any other bones (unless for "hide" purposes).

 

Spoiler

Zi5aAy7.png

 

6. With our CfgSkeletons and CfgModels configured, we can now #include the main .hpp file into the Animations class of our model.

 

Spoiler

m1imn6J.png

 

7. Open your .p3d and start Bulldozer. Watch your beautiful animation play upon the specified animation source. 😁

 

If you have any questions regarding this tutorial or the plugins provided, please do not hesitate to ask. I am hoping to create a complete process video tutorial as well (once the things at work get a bit less busy).

 

Meanwhile, you may download this example addon that should make things more clear to you serving as a practical example. 

 

Credits:

 

Talya_Taya - animExport & skelExport plugin (quite plenty of, to me magical stuff)

4d4a5852 - anim2cfg plugin (value conversion (Blender to model.cfg direct animations) formula used as foundation & greatly expanded upon by Talya_Taya)

Degman - feature demands & guidance during the plugin's development

 

Please read the license.

 

Kind regards,

Deg

 

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

The thread updated per new plugin release. New tutorial and example addon available. ☺️

  • Like 1

Share this post


Link to post
Share on other sites

OMG😳 Why did it appear only this year... Finally, there will be no need to write everything by hand and wait until the bulldozer is "slowed down" to process everything. Keep it up! Will test! Waiting for the video ☺️

Edited by Major_Cookie

Share this post


Link to post
Share on other sites

Did You solve method in this tool for nonlinear animations with not 100 weights vertex too?

Share this post


Link to post
Share on other sites

Direct animation type does not support vertex weights, neither does rotation or translation. Vertex is either a part of selection manipulated by an animation and moves 100%, or it isn't, therefore animation has no effect on it. 

.rtm type animation for man class (also animals) supports weights, but you don't need this tool for it.

  • Like 1

Share this post


Link to post
Share on other sites
On 11/30/2023 at 7:52 PM, DegmanCro said:

Direct animation type does not support vertex weights, neither does rotation or translation. Vertex is either a part of selection manipulated by an animation and moves 100%, or it isn't, therefore animation has no effect on it. 

.rtm type animation for man class (also animals) supports weights, but you don't need this tool for it.


They do support it (not in buldozer though). the skeleton just needs isDiscrete = 0 parameter 

Share this post


Link to post
Share on other sites

Thanks a lot - I will experiment with it - is binarisation of P3d needed to make it work or just make  PBO and engine run with mlod format?

Share this post


Link to post
Share on other sites
Posted (edited)

Had a issue with the export plugin the other day and spent couple of days poking at it from all the angles. Even went on to bother @talya_taya for clues on what I had missed so I'll log in the main points of my journey here in case someone else encounters same issue.

The solution as often in these things was stupidly simple.

But lets start with the problem

After having a nice animation done in Blender I wanted to throw it into model.cfg and see it in buldozer. ezpez I thought. but no.

Expecation was that the grenade would go nicely in to the chamber
giphy.gif


But result was way off the mark
giphy.gif



So I went out into the wilderness to find the other deep holes where other modders who do weird stuff dwell and luckily I found a fellow who could confirm the plugin should work and he could try out my test case I compiled.




Public shoutout to mr Ranger (you probably are here too arent you, one of the many users called Ranger 😅)  

So he confirmed that my test case basically worked as is. He just had to export the better movement sequence I had in the sample file and it "just worked"

So off I go test the files he sent me back just to make sure we are both on same page, but ALAS results are still poor
image2.png

so Im thinking is buldozer bugging on my end? does it not refresh something or read something correctly?
I thought to test if its reading the right file (no idea why it would not) by inserting a bit of extra mesh into the scene. Result was pretty major wtf moment as the animation went even wilder
image.png
This did leave into memory connection that this kind of behavior feels like autocentering issue. But why would dozer do that?

The reason was simple. Sometime in the past (5 years maybe) I have turned on autocenter in the launch options... 🤯 Setting it back to default "Center to Pin" and restarting dozer resulted in magically everything working as it should.

So if you encounter unexpected looking movements with the plugins export, check your dozer launch settings for starters.

screen.PNG



 

Edited by HorribleGoat
Edit. again updated the images. Discord seems to be poor with external linking. if they vanish again I'll have to upload them somewhere else
  • Thanks 1

Share this post


Link to post
Share on other sites

I had the same problem with this :) and few animations wouldn't work properly with autocenter setting of model.

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×