Weapon Animation/Setup – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix)
No edit summary
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
This part of the tutorial covers the basics of setting up the animation workspace.
=Weapon animations - Animation workspace and prefab setup=
You might expect to find information on how to create an animation workspace using one of the existing workspaces as a base.
This means that this tutorial will not go into depth on creating new custom graphs, creating new nodes, and so on.
In any case, following these instructions, you should be able to have a fully animated weapon in the game.


==Introduction==
{{Feature|informative|'''Previous part '''- [[Arma_Reforger:Weapon_Animation|Weapon animations]]}}


== Prepare the Animation Workspace ==
This part of the tutorial covers the basics of setting up the animation workspace. You might expect to find information on how to create an animation workspace using one of the existing workspaces as a base. This means that this tutorial will not go into depth on creating new custom graphs, creating new nodes, and so on. In any case, following these instructions, you should be able to have a fully animated weapon in the game.
==Animation Editor==
===Preparing animation workspace===


=== Creating Animation Workspace ===
====Creating animation workspace ====
{{Messagebox|'''Recommended read:''' Before going any further, it is recommended to make yourself familiar with [[Arma_Reforger:Animation_Editor|'''Animation Editor documentation''']].|📖|lightgrey}}First step in creating animation for weapons is preparing new '''animation workspace '''for asset that is being worked on. To do so, navigate to '''File→ New Workspace '''in top bar or use '''{{Controls|Ctrl|N}} '''shortcut. Once that is pressed, '''Create New Workspace '''window where it is necessary to fill location where new workspace will be created.


Before going any further, it is recommended to make yourself familiar with '''[[Arma_Reforger:Animation_Editor|Animation Editor documentation]]'''.
In Reforger, workspaces files for multiple similar assets are placed in asset folder one level higher than the asset is located in - f.e. '''Assets/Weapons/Rifles/Workspaces. '''In this tutorial, '''sampleweapon_01.aw '''workspace was created in '''Assets/Weapons/Rifles/Workspaces '''inside '''SampleMod_NewWeapon''' addon.
{{Feature|informative|2=Vanilla Reforger assets are using '''name of the weapon '''as '''name of various animation files'''. For instance:


First step in creating animation for weapons is preparing new '''animation workspace''' for asset that is being worked on.
* [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.aw ak74.aw] - Animation Workspace for AK74
To do so, navigate to '''File → New Workspace''' in top bar or use the {{Controls|Ctrl|N}} shortcut.
Once that is pressed, '''Create New Workspace''' window where it is necessary to fill location where new workspace will be created.


In Reforger, workspaces files for multiple similar assets are placed in asset folder one level higher than the asset is located in - f.e. '''Assets/Weapons/Rifles/Workspaces'''.
*[https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.ast ak74.ast] - Animation Template for AK74
In this tutorial, '''sampleweapon_01.aw''' workspace was created in '''Assets/Weapons/Rifles/Workspaces''' inside '''SampleMod_NewWeapon''' addon.
*[https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.agr ak74.agr] - Animation Graph File
*[https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.agf ak74.agf] - Animation Graph
*[https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74_weapon.asi ak74_weapon.asi] - Animation Instance - Weapon part
*[https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74_player.asi ak74_player.asi] - Animation Instance - Character part}}


Once location & name of the file are confirmed, an empty '''sampleweapon_01.aw  '''workspace should be automatically opened in '''Animation Editor'''.


Once location & name of the file are confirmed, an empty '''sampleweapon_01.aw ''' workspace should be automatically opened in '''Animation Editor'''.
[[File:armareforger-new-weapon-animation-animation-editor.png|800x800px]]


=== Setup Animation Instance Template ===
====Creating animation instance template (or reusing existing)====
{{Messagebox|'''Recommended read''': [[Arma Reforger:Animation Editor: Templates and Instances Tutorial|Animation Editor: Templates and Instances Tutorial]]
|📖|lightgrey}}


'''Recommended read''': [https://community.bistudio.com/wiki/Arma_Reforger:Animation_Editor:_Templates_and_Instances_Tutorial Animation Editor: Templates and Instances Tutorial]
Next thing on the list will be configuration of '''Animation Template.''' That file contains [[Arma Reforger:Animation Editor#Anim Set|template animation set]] - '''animation groups, columns and rows '''which are then used by all '''Animation Instances '''in current '''Animation Workspace. '''


Next thing on the list will be configuration of '''Animation Template'''.
Now, there are few possibilities when it comes configuring '''Animation Template - '''it is possible to '''use existing template''', create '''duplicate of it '''or '''create new template from scratch'''. Both have its pros and cons and it all depends on various factors. If for instance new weapon is yet another variant of AK74, it might be possible to reuse existing animation template without any problems.
That file contains [[Arma_Reforger:Animation_Editor#Anim_Set|template animation set]] - '''animation groups, columns and rows''' which are then used by all '''Animation Instances''' in current '''Animation Workspace.'''


Now, there are few possibilities when it comes to configure '''Animation Template''' - it is possible to '''use existing template''', create '''duplicate of it''' or '''create new template from scratch'''.
=====Creating new template=====
Both have their pros and cons and it all depends on various factors.
If for instance new weapon is yet another variant of AK74, it might be possible to reuse existing animation template without any problems.


==== Create New Template ====
*{{Icon|unchecked}} All entries in animation template has to be set from scratch
* {{Icon|unchecked}} All entries in animation template has to be set from scratch
*{{Icon|checked}} New animation groups & rows can be added or deleted
* {{Icon|checked}} New animation groups & rows can be added or deleted
*{{Icon|warning}} Need to be manually updated in case there is some change in vanilla date
* {{Icon|unknown}} Needs to be manually updated in case there is some change in vanilla data


==== Use Existing Template ====
* {{Icon|checked}} Minimal amount of work required to get it working
* {{Icon|unchecked}} Cannot be modified - it is not possible to add new groups or rows. Might be problematic if weapon is quite non standard
* {{Icon|question}} Creates dependency on vanilla content - if it gets updated it can break your animation workspace but sometimes it might help you updating your content to latest standards


==== Use Duplicated Template ====
[[File:armareforger-new-weapon-animation-creating-new-template.png]]
* {{Icon|checked}} Relatively easy to set up but requires few more steps compared to using existing Animation Template
* {{Icon|checked}} New animation groups & rows can be added or deleted
* {{Icon|question}} Needs to be manually updated in case there is some change in vanilla date


In this tutorial, a '''duplicated animation template is used''', since '''Sample New Weapon''' is going to use logic similar to already existing in-game weapon - AK74.
To create new template, click with '''Right Mouse Button '''on '''Animation Template '''line in '''Workspace '''window and then select '''New Template... '''option from the menu. After that, you will be asked where new file should be created.
To do so, follow below steps:


# Navigate to '''Animation Template''' that you want to duplicated. '''Animation Templates''' are using .ast extension. In this case [enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.ast ak74.ast] was used
===== Using existing template=====
# Use '''[[Arma_Reforger:Data_Modding_Basics#Using_.22Override_in....22_function|Override in addon]]''' functionality on that file
# Click on overridden file (''ak74.ast'') located in target addon (''SampleMod_NewWeapon'') and selected '''Show In Explorer''' option
# Remove .meta file located next to overridden file. In this case ''ak74.ast.meta'' file was removed
# Rename overridden file. In this case ''ak74.ast'' was renamed to ''sampleweapon_01.ast''
# Go back to '''Workbench''', find ''sampleweapon_01.ast'' in '''Resource Browser''' and click on it with '''Right Mouse Button'''
# Select '''Register''' option from the context menu


{{Feature|important|See the [[Arma_Reforger:Data_Modding_Basics#Using_.22Duplicate_to....22_function|Duplicate to addon functionality]].}}
*{{Icon|checked}} Minimal amount of work required to get it working
*{{Icon|unchecked}} Cannot be modified - it is not possible to add new groups or rows. Might be problematic if weapon is quite non standard
*{{Icon|warning}} Creates dependency on vanilla content - if it gets updated it can break your animation workspace but sometimes it might help you updating your content to latest standards
[[File:armareforger-new-weapon-animation-using-existing-template.png]]


After those steps are completed, it is possible to use this template in '''sampleweapon_01.aw''' workspace.
To use existing Animation Template, click with Right Mouse Button on Animation Template line in Workspace window and then pick '''Assign Existing Template... '''option from the context menu. After picking this option, you will be asked to locate '''Animation Template '''file (''files using .ast extension'')
To do so, follow the instructions mentioned in '''using existing template paragraph''' and select '''sampleweapon_01.ast''' when asked for existing template.


=== Create Animation Instance for Player and Weapon ===
===== Using duplicated template=====


Once animation template is configured, it is right time to move to preparing '''Animation Instances'''.
*{{Icon|checked}} Relatively easy to set up but requires few more steps compared to using existing Animation Template
As mentioned in [https://community.bistudio.com/wiki/Arma_Reforger:Animation_Editor#Workspace Animation Editor] documentation, '''Animation Instances ''' are unique sets of animations which share same logic.
*{{Icon|checked}} New animation groups & rows can be added or deleted
*{{Icon|warning}} Need to be manually updated in case there is some change in vanilla date


Weapons are using two animation instances - one for '''player''' and one for '''weapon'''.
In this tutorial, a '''duplicated animation template is used''', since '''Sample New Weapon '''is going to use logic similar to already existing in-game weapon - AK74. To do so, follow below steps:# Navigate to '''Animation Template '''that you want to duplicated. '''Animation Templates '''are using .ast extension. In this case [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.ast ak74.ast] was used
'''Player animation instance''' is applied to character which is holding the weapon and '''weapon animation instance''' is applied to the weapon itself.
#Use [[Arma Reforger:Data Modding Basics#Using .22Override in....22 function|Override in addon]] functionality on that file
When character is holding a weapon, both of those sets are played simultaneously, therefore it is quite important to keep both animations with same length so they stay synchronized.
# Click on overridden file ([enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.ast ak74.ast]) located in target addon (''SampleMod_NewWeapon'') and selected '''Show In Explorer '''option
Some more info about power instances can be found on the '''[[Arma_Reforger:Animation_Editor:_Templates_and_Instances_Tutorial|Animation Editor: Templates and Instances Tutorial]]''' page (it is a recommended read nevertheless!).
#Remove .meta file located next to overridden file. In this case ''ak74.ast.meta ''file was removed
{{Feature|important|Please note that not all animations have to be synchronized between instances but those are exceptions!}}
#Rename overridden file. In this case ''ak74.ast ''was renamed to ''sampleweapon_01.ast''
#Go back to '''Workbench''', find ''sampleweapon_01.ast ''in '''Resource Browser '''and click on it with '''Right Mouse Button'''
#Select '''Register '''option from the context menu
{{Feature|warning|2=This flow should be improved in future versions of the Workbench and regular [[Arma_Reforger:Data_Modding_Basics#Using_.22Duplicate_to....22_function Duplicate to addon|'''Duplicate to addon''']] functionality should be available. '''Below is video showing improved flow '''{{Icon|warning}}}}


Creating new animation instances is fairly straightforward and involves the following actions:
[[File:armareforger-new-weapon-animation-duplicate-template.gif]]
 
After those steps are completed, it is possible to use this template in '''sampleweapon_01.aw '''workspace. To do so, follow the instructions mentioned in '''using existing template paragraph '''and select '''sampleweapon_01.ast '''when asked for existing template.
====Creating animation instance for player & weapon====


* Click with '''Right Mouse Button''' on '''Animation Instances''' field in '''Workspaces''' window
Once animation template is configured, it is right time to move to preparing '''Animation Instances'''. As mentioned in [[Arma_Reforger:Animation_Editor#Workspace Animation Editor|Animation Editor]] documentation, '''Animation Instances  '''are unique sets of animations which share same logic. 
* Select '''New Animation Instance...''' option from the context menu
* Select new animation instance '''name & location''' and then confirm with '''Ok''' button
** It is recommended to use _''player & _weapon'' suffixes for animation instances to keep data readable (it is not mandatory though)


As it was mentioned before, weapon requires two animation sets and in case of sample weapon, following animation instances were created:
Weapons are using two animation instances - one for '''player '''and one for '''weapon.''' '''Player animation instance '''is applied to character which is holding the weapon and '''weapon animation instance '''is applied to the weapon itself. When character is holding a weapon, both of those sets are played simultaneously, therefore it is quite important to keep both animations with same length so they stay synchronized. Some more info about power instances can be found on [[Arma_Reforger:Animation_Editor:_Templates_and_Instances_Tutorial|Animation Editor: Templates and Instances Tutorial]] page (it is a recommended read nevertheless!)


* '''sampleweapon_01_player.asi''' - animation instance containing character related animations
Please note that not all animations have to be synchronized between instances but those are '''exceptions'''!
* '''sampleweapon_01_weapon.asi''' - animation instance containing weapon related animations


[[File:armareforger-new-weapon-animation-new-animation-instance.png|right]]
Creating new animation instances is fairly straightforward and involves the following actions:
*Click with '''Right Mouse Button '''on '''Animation Instances '''field in '''Workspaces '''window
*Select '''New Animation Instance... '''option from the context menu
*Select new animation instance '''name & location '''and then confirm with '''Ok '''button
**It is recommended to use _''player & _weapon ''suffixes for animation instances to keep data readable (it is not mandatory though)<br />
As it was mentioned before, weapon requires two animation sets and in case of sample weapon, following animation instances were created:* '''sampleweapon_01_player.asi '''- animation instance containing character related animations
*'''sampleweapon_01_weapon.asi '''- animation instance containing weapon related animations
Both sets of animations are empty at this stage, and we will come back to fill them in as soon as we have some animations ready to use.
Both sets of animations are empty at this stage, and we will come back to fill them in as soon as we have some animations ready to use.
[[File:armareforger-new-weapon-animation-anim-sets-window.png|none|thumb|867x867px|'''Anim Sets''' inside '''Sample New Weapon''' animation workspace]]
====Setting animation graph====


=== Setup Animation Graph ===
Animation Graph consist of '''Graph (.agr) '''and '''Graph File (.agf)'''. '''Graph '''itself contains all '''Variables''', '''Commands '''and '''IK Chains''' that would be available to all animations graph plus link to '''Graph File(s)'''.


Animation Graph consist of '''Graph (.agr)''' and '''Graph File (.agf)'''. '''Graph''' itself contains all '''Variables''', '''Commands''' and '''IK Chains''' that would be available to all animations graph plus link to '''Graph File(s)'''.
'''Graph File '''contain '''Sheets '''and those sheets contain actual '''animation graph '''with [[Arma_Reforger:Animation_Editor:_Nodes|Animation Nodes]].


'''Graph File''' contain '''Sheets''' and those sheets contain actual '''animation graph''' with '''[[Arma_Reforger:Animation_Editor:_Nodes|Animation Nodes]]'''.
Similar as with animation template, there are few possibilities when it comes to graph creation and again, same as with '''Animation Template, '''there are some pros and cons of such solution. If you intend to create a weapon that is similar to one of the existing weapons, then duplicating the animation graph is the suggested approach - unless the weapon you are preparing doesn't require any tweaks in the graph compared to the vanilla data.


Similar as with animation template, there are few possibilities when it comes to graph creation and again, same as with '''Animation Template''', there are some pros and cons of such solution.
Of course, if weapon is sort of '''unique '''(let's say bolt action rifle or some clip loaded rifles) then '''new graph might be necessary '''- in such scenario though it would be still wise to use existing weapon graph as reference.
If you intend to create a weapon that is similar to one of the existing weapons, then duplicating the animation graph is the suggested approach - unless the weapon you are preparing doesn't require any tweaks in the graph compared to the vanilla data.
=====Creating new graph=====
[[File:armareforger-new-weapon-animation-new-graph.png|left]]
To create new graph, click with '''Right Mouse Button '''on '''Graph '''line in '''Workspace '''window and then select '''New Graph... '''option from the menu. After that, you will be asked where new file should be created.{{Clear}}


Of course, if weapon is sort of '''unique''' (let's say bolt action rifle or some clip loaded rifles) then '''new graph might be necessary''' - in such scenario though it would be still wise to use existing weapon graph as reference.
=====Using existing graph=====
[[File:armareforger-new-weapon-animation-existing-graph.png|left]]
To create new graph, click with '''Right Mouse Button '''on '''Graph '''line in '''Workspace '''window and then select '''Assign Existing Graph... '''option from the menu. After picking this option, you will be asked to locate '''Graph '''file (''files using .agr extension''){{Clear}}


==== Create New Graph ====
=====Duplicating existing graph=====
To create new graph, click with '''Right Mouse Button''' on '''Graph''' line in '''Workspace''' window and then select '''New Graph...''' option from the menu.
Process of duplicating '''Graph '''is exactly same as with '''Animation Template '''described before. Similar as with animation template, '''duplication of existing graph was chosen - '''mainly to save time required to define '''variables '''and mandatory '''commands'''. Even if you are doing some custom weapon In this case, [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.agr ak74.agr] was picked to be duplicated into '''sampleweapon_01.agr'''.
After that, you will be asked where new file should be created.


==== Use Existing Graph ====
Once duplication is completed and new graph is assigned to '''Graph '''property, it will be necessary to remove reference to old '''Graph File''' and this can be done by clicking with '''Right Mouse Button '''on '''Files '''entry ([https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.agf ak74.agf] in this case'') in '''Graph '''section of the Workspace and then selecting '''Remove '''option from the context menu.''
To create new graph, click with '''Right Mouse Button''' on '''Graph''' line in '''Workspace''' window and then select the '''Assign Existing Graph...''' option from the menu.
After picking this option, you will be asked to locate '''Graph''' file (''files using .agr extension'')


==== Duplicate existing graph ====
====Creating Graph File====
Process of duplicating '''Graph''' is exactly same as with '''Animation Template''' described before.
Similar as with animation template, '''duplication of existing graph was chosen''' - mainly to save time required to define '''variables''' and mandatory '''commands'''.
Even if you are doing some custom weapon In this case, '''[enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.agr ak74.agr]''' was picked to be duplicated into '''sampleweapon_01.agr'''.


Once duplication is completed and new graph is assigned to '''Graph''' property, it will be necessary to remove reference to old '''Graph File''' and this can be done by clicking with '''Right Mouse Button''' on '''Files''' entry (''[enfusion://ResourceManager/~ArmaReforger:Assets/Weapons/Rifles/workspaces/ak74.agf ak74.agf] in this case'') in '''Graph''' section of the Workspace and then selecting '''Remove''' option from the context menu.
[[Image:image-2023-1-6_15-0-41.png?version=1&modificationDate=1673341140000&api=v2&effects=drop-shadowImage25.png|top|link=Special:FilePath/image-2023-1-6_15-0-41.png%3Fversion=1&modificationDate=1673341140000&api=v2&effects=drop-shadowImage25.png]]


=== Create Graph File ===
Process of creating '''Graph File '''is almost exactly the same as with graph or template. Creating new '''Graph File '''is done through context menu which is available after clicking with '''Right Mouse Button '''on '''Files '''property in '''Graph '''section. Over there, you can either select''' Create Graph File...''' or '''Add Existing Graph File... '''options


Process of creating '''Graph File''' is almost exactly the same as with graph or template. Creating new '''Graph File''' is done through context menu which is available after clicking with '''Right Mouse Button''' on '''Files''' property in '''Graph''' section. Over there, you can either select '''Create Graph File...''' or '''Add Existing Graph File...''' options.


{{Feature|informative|In case of creating new '''Graph File''', it is necessary to '''create a new sheet''' - this can be done by clicking on '''Graph File''' with Right Mouse Button and then selecting the '''New Sheet...''' option from the context menu. After that, a new pop will appear asking for sheet name. In this case, it is recommend to use "Master" for the main sheet.}}


==== Setup Graph File ====
[[Image:image-2023-1-6_15-54-40.png?version=1&modificationDate=1673341139000&api=v2&effects=border-simple,blur-borderImage26.png|top|link=Special:FilePath/image-2023-1-6_15-54-40.png%3Fversion=1&modificationDate=1673341139000&api=v2&effects=border-simple,blur-borderImage26.png]]
'''Duplication''' approach can be also used to create a '''Graph File''' and since it is in many cases the '''easiest and fastest way''', this solution was used to configure '''Sample Weapon''' animation workspace.


Perhaps it is worth mentioning here, that it is also possible to copy and paste animation nodes between Animation Graphs.
In case of creating new '''Graph File''', it is necessary to '''create new sheet - '''this can be done by clicking on '''Graph File '''with Right Mouse Button and then selecting&nbsp;'''New Sheet... '''option from the context menu. After that, a new pop will appear asking for sheet name. In this case, it is recommend to use "Master" for main sheet
To do so, open second instance of '''Animation Editor''' and then open '''Animation Workspace''' of your choice.
Once it is loaded, select all nodes in '''Animation Graph''' window with mouse by holding {{Controls|LMB}} which you want to copy paste, press {{Controls|Ctrl|C}} to copy those nodes, select again '''Animation Editor''' containing your weapon, click once with '''Left Mouse Button''' in '''Animation Graph''' inside of that '''Animation Editor''' and finally, press {{Controls|Ctrl|V}} to paste all those nodes.


=== Setup Preview Models ===
=====Setting graph file =====


It might be also quite handy to set '''Preview Models''' in current animation workspace - this will allow to quickly verify if animations are playing correctly and see if interpolations between nodes are working as intended in graph debug mode. Only '''one preview model''' can be active in '''Anim Editor Preview''' window'''''', so it will be necessary to set two sets of preview models - one for debugging of '''weapon animation instance''' and second for debug of '''player animation instance'''.
'''Duplication '''approach can be also used to create a '''Graph File '''and since it is in many cases the '''easiest and fastest way''', this solution was used to configure '''Sample Weapon '''animation workspace.


==== Weapon Preview Models ====
Perhaps it is worth mentioning here, that it is also possible to copy and paste animation nodes between Animation Graphs. To do so, open second instance of '''Animation Editor '''and then open '''Animation Workspace '''of your choice. Once it is loaded, select all nodes in '''Animation Graph '''window with mouse by holding {{Controls|LMB}}which you want to copy paste, press '''{{Controls|Ctrl|C}} '''to copy those nodes''', '''select again '''Animation Editor '''containing your weapon, click once with '''Left Mouse Button''' in '''Animation Graph '''inside of&nbsp;that '''Animation Editor '''and finally, press '''{{Controls|Ctrl|V}} '''to paste all those nodes.
Beginning with setting preview model for weapon, following steps has to be performed to add:


* Click with '''Right Mouse Button on Preview Models''' line in '''Workspace''' window and then select '''Add Preview Model...''' option.<!--
[[File:armareforger-new-weapon-animation-copy-paste-graph.gif|1800x1800px]]
--> After that a proper model (.xob) has to be selected. In this case '''[enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/SampleWeapon_01/SampleWeapon_01.xob SampleWeapon_01.xob]''' was selected.
====Setting up preview models====


{{Feature|informative|It is possible to disable background ground model in Anim Editor Preview window by clicking on '''Options''' in the top right corner of the viewport and unchecking '''Ground property''' in the '''Scene settings''' tab.}}
It might be also quite handy to set '''Preview Models '''in current animation workspace - this will allow to quickly verify if animations are playing correctly and see if interpolations between nodes are working as intended in graph debug mode. Only '''one preview model '''can be active in''' Anim Editor Preview '''window''', '''so it will be necessary to set two sets of preview models - one for debugging of '''weapon animation instance '''and second for debug of '''player animation instance.'''


Next, it might be nice to have (but not essential) to add magazine to the weapon by adding child model, to do so, click with '''Right Mouse Button''' on '''entry''' in '''Preview Models''' list (''f.e. [enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/SampleWeapon_01/SampleWeapon_01.xob SampleWeapon_01.xob])'', then select from context menu option '''Add Child Model...''' and finally, pick the magazine's model (''[enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Magazines/SampleWeapon_01/Magazine_65x39c_SampleWeapon_01_30rnd.xob Magazine_65x39c_SampleWeapon_01_30rnd.xob]'') from the list.
=====Weapon preview models =====


By default, child model will be created at 0,0,0 and most likely such state in desired.
Beginning with setting preview model for weapon, following steps has to be performed to add:* Click with '''Right Mouse Button on Preview Models '''line in '''Workspace '''window and then select '''Add Preview Model... '''option.&nbsp; After that a proper model (.xob) has to be selected. In this case [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/SampleWeapon_01/SampleWeapon_01.xob SampleWeapon_01.xob] was selected.
It is possible to attach such child model to some bone in parent bone by changing '''Bone''' parameter in '''Properties''' window.
In case of the magazine, it is possible to snap it to '''slot_magazine''' bone, which should result in model nicely sitting in magazine well.


{{Feature|informative|Magazine model's visibility can be toggled clicking on the '''Enabled''' property in the '''Properties''' window when the magazine in '''Preview Models''' list is selected or by clicking on the little eye icon which is visible when the mouse is hovering above the child preview model.}}


==== Character Preview Model ====
Adding of character preview is using basically same principle as weapon but this time there will be two child models attached to it.
Starting with character model itself, click with '''Right Mouse Button''' on '''Preview Models''' field and then select '''Add Preview Model...''' option.
After that, you can pick one of the characters models in xob model. Vanilla data contains two models with some equipment merged in:


* AnimTestChar_USSR_01.xob - character with USSR uniform
[[Image:image-2023-1-6_16-14-21.png?version=1&modificationDate=1673341139000&api=v2&effects=drop-shadowImage28.png|top|link=Special:FilePath/image-2023-1-6_16-14-21.png%3Fversion=1&modificationDate=1673341139000&api=v2&effects=drop-shadowImage28.png]]
* AnimTestChar_US_01.xob - character with US Army uniform


Once character model is present in Preview Models list, it is possible to add two child models:
'''Tip''': It is possible to disable background ground model in '''Anim Editor Preview '''window by clicking on '''Options '''in top right corner of the view port and then unchecking '''Ground property '''in '''Scene settings '''tab.


* Weapon ([enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/SampleWeapon_01/SampleWeapon_01.xob ''SampleWeapon_01.xob'']) attached to '''Right Hand Prop'''
Next, it might be nice to have (but not essential) to add magazine to the weapon by adding child model, to do so, click with '''Right Mouse Button''' on '''entry '''in '''Preview Models '''list (''f.e. [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/SampleWeapon_01/SampleWeapon_01.xob SampleWeapon_01.xob]), ''then select from context menu option '''Add Child Model...&nbsp; '''and finally, pick model of the magazine ([https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Magazines/SampleWeapon_01/Magazine_65x39c_SampleWeapon_01_30rnd.xob Magazine_65x39c_SampleWeapon_01_30rnd.xob]) from the list.
* Magazine ([enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Magazines/SampleWeapon_01/Magazine_65x39c_SampleWeapon_01_30rnd.xob ''Magazine_65x39c_SampleWeapon_01_30rnd.xob'']) attached to '''Left Hand Prop''' - this should allow for previewing reload magazine animations.


Currently active preview models can be either switched in two ways:


* Through context menu which appears after clicking on it with '''Right Mouse Button''' entry in '''Preview Models''' list and then selecting '''Set as current''' option
* By double clicking on it


Active preview model is marked with '''bolded text'''.
By default, child model will be created at 0,0,0 and most likely such state in desired. It is possible to attach such child model to some bone in parent bone by changing '''Bone '''parameter in '''Properties '''window. In case of the magazine, it is possible to snap it to '''slot_magazine '''bone, which should result in model nicely sitting in magazine well.


Above set of preview models should be enough to preview all necessary weapon animations (both character and weapon itself) once '''Animation Workspace''' is filled with actual animations.
[[File:armareforger-new-weapon-animation-set-child-bone-preview.gif|1800x1800px]]


'''Tip''': Magazine model visibility can be toggled clicking on '''Enabled '''property in '''Properties '''window when magazine in '''Preview Models '''list is selected or by clicking on little '''eye icon '''which is visible when mouse is hovering above '''child preview model'''.
=====Character preview model=====


== Assign Animation Workspace to Prefab ==
Adding of character preview is using basically same principle as weapon but this time there will be two child models attached to it. Starting with character model itself, click with '''Right Mouse Button''' on '''Preview Models''' field and then select '''Add Preview Model... '''option. After that, you can pick one of the characters models in xob model. Vanilla data contains two models with some equipment merged in:


If everything went fine, the new weapon animation workspace should be ready to be plugged into the weapon.
*[enfusion://ResourceManager/~ArmaReforger:Assets/Characters/Animation/AnimTestChar_USSR_01.xob AnimTestChar_USSR_01.xob ] - character with USSR uniform
*[enfusion://ResourceManager/~ArmaReforger:Assets/Characters/Animation/AnimTestChar_US_01.xob AnimTestChar_US_01.xob] -&nbsp; character with US Army uniform


Most of the weapon animation configuration is located in '''WeaponAnimationComponent'''.
Once character model is present in Preview Models list, it is possible to add two child models:
Unless weapon prefab is duplicate of some existing weapon, such component might not exist in a prefab which just inherits from '''[enfusion://ResourceManager/~ArmaReforger:Prefabs/Weapons/Core/Rifle_Base.et Rifle_Base.et]''' prefab.
In this case, it will be necessary to add such component to the prefab first. This can be done in few steps:


* Load weapon prefab (''[enfusion://ResourceManager/~SampleMod_NewWeapon:Prefabs/Weapons/Rifles/SampleWeapon_01_base.et SampleWeapon_01_base.et]'') in World Editor - either by using '''Edit Prefab''' button in '''Resource Manager''' or by drag and dropping weapon prefab into World Editor view port
* Weapon ([https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/SampleWeapon_01/SampleWeapon_01.xob SampleWeapon_01.xob]) attached to '''Right Hand Prop'''
* Locate '''WeaponComponent''' in '''Object Properties''' window of the weapon
*Magazine ([https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Magazines/SampleWeapon_01/Magazine_65x39c_SampleWeapon_01_30rnd.xob Magazine_65x39c_SampleWeapon_01_30rnd.xob]) attached to '''Left Hand Prop - '''this should allow for previewing reload magazine animations.
* Click on '''WeaponComponent''' with '''Right Mouse Button''' and select '''Add child component''' option from the context menu
Currently active preview models can be either switched in two ways:* Through context menu which appears after clicking on it with '''Right Mouse Button''' entry in&nbsp;'''Preview Models&nbsp;'''list and then selecting&nbsp;'''Set as current''' option
* Select '''WeaponAnimationComponent''' from the list of components
*By double clicking on it


After that, '''WeaponAnimationComponent''' should be ready for further configuration. If component
Active preview model is marked with '''bolded text.'''


=== Setup Weapon Animation Instance ===
[[File:armareforger-new-weapon-animation-set-preview-active.gif]]


First, let's begin with general weapon animations and weapon graph & animation instance.
Above set of preview models should be enough to preview all necessary weapon animations (both character and weapon itself) once '''Animation Workspace '''is filled with actual animations.
These two things are controlled by following parameters which can be found in '''WeaponAnimationComponent'''


* '''Anim Graph''' → This parameter expects '''animation graph''' used in animation workspace. In this case [enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01.agr '''sampleweapon_01.agr'''] was used
===Assigning animation workspace to prefab===
* '''Anim Instance''' → This parameter expects '''animation instance''' of the '''weapon'''. Over here [enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01_weapon.asi '''sampleweapon_01_weapon.asi'''] should be assigned
[[File:armareforger-new-weapon-animation-component-setup.png|thumb|501x501px|Content of '''WeaponAnimationComponent''']]If everything went fine, the new weapon animation workspace should be ready to be plugged into the weapon.


It is also necessary to switch those two parameters to on, to ensure proper working of the component
Most of the weapon animation configuration is located in '''WeaponAnimationComponent. '''Unless weapon prefab is duplicate of some existing weapon, such component might not exist in a prefab which just inherits from [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Prefabs/Weapons/Core/Rifle_Base.et Rifle_Base.et] prefab. In this case, it will be necessary to add such component to the prefab first. This can be done in few steps:* Load weapon prefab ([https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Prefabs/Weapons/Rifles/SampleWeapon_01_base.et SampleWeapon_01_base.et]) in World Editor - either by using '''Edit Prefab '''button in '''Resource Manager '''or by drag and dropping weapon prefab into World Editor view port
*Locate '''WeaponComponent '''in '''Object Properties '''window of the weapon
*Click on '''WeaponComponent '''with '''Right Mouse Button '''and select '''Add child component '''option from the context menu
*Select '''WeaponAnimationComponent '''from the list of components
After that, '''WeaponAnimationComponent '''should be ready for further configuration. If component


* '''Always Active'''
====Setting weapon animation instance====
* '''Bind With Injection'''


=== Setup Player Animation Instance ===
First, let's begin with general weapon animations and weapon graph & animation instance. Those two things are controlled by following parameters which can be found in '''WeaponAnimationComponentn'''* '''Anim Graph '''→&nbsp; This parameter expects '''animation graph '''used in animation workspace. In this case [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01.agr sampleweapon_01.agr] was used
*'''Anim Instance '''→ This parameter expects '''animation instance '''of the '''weapon'''. Over here [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01_weapon.asi sampleweapon_01_weapon.asi] should be assigned


Next, we can move to character animations configuration and to do so, click on '''set class''' button next to '''Anim Injection''' property.
It is also necessary to switch those two parameters to on, to ensure proper working of the component* '''Always Active '''
This will add new class to the component where you can configure following options:
*'''Bind With Injection'''


* '''Anim Graph''' → Same as before, this parameter expects '''animation graph''' used in animation workspace. In this case '''[enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01.agr sampleweapon_01.agr]''' was used again
====Setting player animation instance====
* '''Animation Instance''' →This parameter expects '''animation instance''' of the '''character'''. Over here '''[enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01_player.asi sampleweapon_01_player.asi]''' should be assigned
* '''Binding Name''' → Binding name in root graph. Type here '''Weapon'''


That's it for now! Now we are going to leave the '''Animation Editor''' for a while and move on to the '''creation of the actual animations'''.
Next, we can move to character animations configuration and to do so, click on '''set class '''button next to '''Anim Injection '''property. This will add new class to the component where you can configure following options:* '''Anim Graph '''→&nbsp; Same as before, this parameter expects '''animation graph '''used in animation workspace. In this case [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01.agr sampleweapon_01.agr] was used again
*'''Animation Instance '''→This parameter expects '''animation instance '''of the '''character. '''Over here [https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~SampleMod_NewWeapon:Assets/Weapons/Rifles/Workspaces/sampleweapon_01_player.asi sampleweapon_01_player.asi] should be assigned
*'''Binding Name '''→ Binding name in root graph. Type here '''Weapon'''


That's it for now! Now we are going to leave the '''Animation Editor '''for a while and move on to the '''creation of the actual animations'''.{{Clear}}
==Continuation==


{{GameCategory|armaR|Modding|Tutorials|Assets}}
'''Next part '''- &nbsp;{{Feature|informative|'''Previous part '''- [[Arma_Reforger:Weapon_Animation_Basic_Creation|Weapon Animation Basic Creation]]
}}

Revision as of 11:16, 22 February 2023

Weapon animations - Animation workspace and prefab setup

Introduction

Previous part - Weapon animations

This part of the tutorial covers the basics of setting up the animation workspace. You might expect to find information on how to create an animation workspace using one of the existing workspaces as a base. This means that this tutorial will not go into depth on creating new custom graphs, creating new nodes, and so on. In any case, following these instructions, you should be able to have a fully animated weapon in the game.

Animation Editor

Preparing animation workspace

Creating animation workspace

📖
Recommended read: Before going any further, it is recommended to make yourself familiar with Animation Editor documentation.

First step in creating animation for weapons is preparing new animation workspace for asset that is being worked on. To do so, navigate to File→ New Workspace in top bar or use Ctrl + N shortcut. Once that is pressed, Create New Workspace window where it is necessary to fill location where new workspace will be created.

In Reforger, workspaces files for multiple similar assets are placed in asset folder one level higher than the asset is located in - f.e. Assets/Weapons/Rifles/Workspaces. In this tutorial, sampleweapon_01.aw workspace was created in Assets/Weapons/Rifles/Workspaces inside SampleMod_NewWeapon addon.

Vanilla Reforger assets are using name of the weapon as name of various animation files. For instance:
  • ak74.aw - Animation Workspace for AK74

Once location & name of the file are confirmed, an empty sampleweapon_01.aw  workspace should be automatically opened in Animation Editor.

armareforger-new-weapon-animation-animation-editor.png

Creating animation instance template (or reusing existing)

Next thing on the list will be configuration of Animation Template. That file contains template animation set - animation groups, columns and rows which are then used by all Animation Instances in current Animation Workspace.

Now, there are few possibilities when it comes configuring Animation Template - it is possible to use existing template, create duplicate of it or create new template from scratch. Both have its pros and cons and it all depends on various factors. If for instance new weapon is yet another variant of AK74, it might be possible to reuse existing animation template without any problems.

Creating new template
  • Unchecked All entries in animation template has to be set from scratch
  • Checked New animation groups & rows can be added or deleted
  • Warning Need to be manually updated in case there is some change in vanilla date


armareforger-new-weapon-animation-creating-new-template.png

To create new template, click with Right Mouse Button on Animation Template line in Workspace window and then select New Template... option from the menu. After that, you will be asked where new file should be created.

Using existing template
  • Checked Minimal amount of work required to get it working
  • Unchecked Cannot be modified - it is not possible to add new groups or rows. Might be problematic if weapon is quite non standard
  • Warning Creates dependency on vanilla content - if it gets updated it can break your animation workspace but sometimes it might help you updating your content to latest standards

armareforger-new-weapon-animation-using-existing-template.png

To use existing Animation Template, click with Right Mouse Button on Animation Template line in Workspace window and then pick Assign Existing Template... option from the context menu. After picking this option, you will be asked to locate Animation Template file (files using .ast extension)

Using duplicated template
  • Checked Relatively easy to set up but requires few more steps compared to using existing Animation Template
  • Checked New animation groups & rows can be added or deleted
  • Warning Need to be manually updated in case there is some change in vanilla date

In this tutorial, a duplicated animation template is used, since Sample New Weapon is going to use logic similar to already existing in-game weapon - AK74. To do so, follow below steps:# Navigate to Animation Template that you want to duplicated. Animation Templates are using .ast extension. In this case ak74.ast was used

  1. Use Override in addon functionality on that file
  2. Click on overridden file (ak74.ast) located in target addon (SampleMod_NewWeapon) and selected Show In Explorer option
  3. Remove .meta file located next to overridden file. In this case ak74.ast.meta file was removed
  4. Rename overridden file. In this case ak74.ast was renamed to sampleweapon_01.ast
  5. Go back to Workbench, find sampleweapon_01.ast in Resource Browser and click on it with Right Mouse Button
  6. Select Register option from the context menu
This flow should be improved in future versions of the Workbench and regular Duplicate to addon functionality should be available. Below is video showing improved flow Warning

armareforger-new-weapon-animation-duplicate-template.gif

After those steps are completed, it is possible to use this template in sampleweapon_01.aw workspace. To do so, follow the instructions mentioned in using existing template paragraph and select sampleweapon_01.ast when asked for existing template.

Creating animation instance for player & weapon

Once animation template is configured, it is right time to move to preparing Animation Instances. As mentioned in Animation Editor documentation, Animation Instances  are unique sets of animations which share same logic. 

Weapons are using two animation instances - one for player and one for weapon. Player animation instance is applied to character which is holding the weapon and weapon animation instance is applied to the weapon itself. When character is holding a weapon, both of those sets are played simultaneously, therefore it is quite important to keep both animations with same length so they stay synchronized. Some more info about power instances can be found on Animation Editor: Templates and Instances Tutorial page (it is a recommended read nevertheless!)

Please note that not all animations have to be synchronized between instances but those are exceptions!

armareforger-new-weapon-animation-new-animation-instance.png

Creating new animation instances is fairly straightforward and involves the following actions:

  • Click with Right Mouse Button on Animation Instances field in Workspaces window
  • Select New Animation Instance... option from the context menu
  • Select new animation instance name & location and then confirm with Ok button
    • It is recommended to use _player & _weapon suffixes for animation instances to keep data readable (it is not mandatory though)

As it was mentioned before, weapon requires two animation sets and in case of sample weapon, following animation instances were created:* sampleweapon_01_player.asi - animation instance containing character related animations

  • sampleweapon_01_weapon.asi - animation instance containing weapon related animations

Both sets of animations are empty at this stage, and we will come back to fill them in as soon as we have some animations ready to use.

Anim Sets inside Sample New Weapon animation workspace

Setting animation graph

Animation Graph consist of Graph (.agr) and Graph File (.agf). Graph itself contains all Variables, Commands and IK Chains that would be available to all animations graph plus link to Graph File(s).

Graph File contain Sheets and those sheets contain actual animation graph with Animation Nodes.

Similar as with animation template, there are few possibilities when it comes to graph creation and again, same as with Animation Template, there are some pros and cons of such solution. If you intend to create a weapon that is similar to one of the existing weapons, then duplicating the animation graph is the suggested approach - unless the weapon you are preparing doesn't require any tweaks in the graph compared to the vanilla data.

Of course, if weapon is sort of unique (let's say bolt action rifle or some clip loaded rifles) then new graph might be necessary - in such scenario though it would be still wise to use existing weapon graph as reference.

Creating new graph
armareforger-new-weapon-animation-new-graph.png

To create new graph, click with Right Mouse Button on Graph line in Workspace window and then select New Graph... option from the menu. After that, you will be asked where new file should be created.

Using existing graph
armareforger-new-weapon-animation-existing-graph.png

To create new graph, click with Right Mouse Button on Graph line in Workspace window and then select Assign Existing Graph... option from the menu. After picking this option, you will be asked to locate Graph file (files using .agr extension)

Duplicating existing graph

Process of duplicating Graph is exactly same as with Animation Template described before. Similar as with animation template, duplication of existing graph was chosen - mainly to save time required to define variables and mandatory commands. Even if you are doing some custom weapon In this case, ak74.agr was picked to be duplicated into sampleweapon_01.agr.

Once duplication is completed and new graph is assigned to Graph property, it will be necessary to remove reference to old Graph File and this can be done by clicking with Right Mouse Button on Files entry (ak74.agf in this case) in Graph section of the Workspace and then selecting Remove option from the context menu.

Creating Graph File

File:image-2023-1-6 15-0-41.png?version=1&modificationDate=1673341140000&api=v2&effects=drop-shadowImage25.png

Process of creating Graph File is almost exactly the same as with graph or template. Creating new Graph File is done through context menu which is available after clicking with Right Mouse Button on Files property in Graph section. Over there, you can either select Create Graph File... or Add Existing Graph File... options


File:image-2023-1-6 15-54-40.png?version=1&modificationDate=1673341139000&api=v2&effects=border-simple,blur-borderImage26.png

In case of creating new Graph File, it is necessary to create new sheet - this can be done by clicking on Graph File with Right Mouse Button and then selecting New Sheet... option from the context menu. After that, a new pop will appear asking for sheet name. In this case, it is recommend to use "Master" for main sheet

Setting graph file

Duplication approach can be also used to create a Graph File and since it is in many cases the easiest and fastest way, this solution was used to configure Sample Weapon animation workspace.

Perhaps it is worth mentioning here, that it is also possible to copy and paste animation nodes between Animation Graphs. To do so, open second instance of Animation Editor and then open Animation Workspace of your choice. Once it is loaded, select all nodes in Animation Graph window with mouse by holding Left Mouse Buttonwhich you want to copy paste, press Ctrl + C to copy those nodes, select again Animation Editor containing your weapon, click once with Left Mouse Button in Animation Graph inside of that Animation Editor and finally, press Ctrl + V to paste all those nodes.

armareforger-new-weapon-animation-copy-paste-graph.gif

Setting up preview models

It might be also quite handy to set Preview Models in current animation workspace - this will allow to quickly verify if animations are playing correctly and see if interpolations between nodes are working as intended in graph debug mode. Only one preview model can be active in Anim Editor Preview window, so it will be necessary to set two sets of preview models - one for debugging of weapon animation instance and second for debug of player animation instance.

Weapon preview models

Beginning with setting preview model for weapon, following steps has to be performed to add:* Click with Right Mouse Button on Preview Models line in Workspace window and then select Add Preview Model... option.  After that a proper model (.xob) has to be selected. In this case SampleWeapon_01.xob was selected.


File:image-2023-1-6 16-14-21.png?version=1&modificationDate=1673341139000&api=v2&effects=drop-shadowImage28.png

Tip: It is possible to disable background ground model in Anim Editor Preview window by clicking on Options in top right corner of the view port and then unchecking Ground property in Scene settings tab.

Next, it might be nice to have (but not essential) to add magazine to the weapon by adding child model, to do so, click with Right Mouse Button on entry in Preview Models list (f.e. SampleWeapon_01.xob), then select from context menu option Add Child Model...  and finally, pick model of the magazine (Magazine_65x39c_SampleWeapon_01_30rnd.xob) from the list.


By default, child model will be created at 0,0,0 and most likely such state in desired. It is possible to attach such child model to some bone in parent bone by changing Bone parameter in Properties window. In case of the magazine, it is possible to snap it to slot_magazine bone, which should result in model nicely sitting in magazine well.

armareforger-new-weapon-animation-set-child-bone-preview.gif

Tip: Magazine model visibility can be toggled clicking on Enabled property in Properties window when magazine in Preview Models list is selected or by clicking on little eye icon which is visible when mouse is hovering above child preview model.

Character preview model

Adding of character preview is using basically same principle as weapon but this time there will be two child models attached to it. Starting with character model itself, click with Right Mouse Button on Preview Models field and then select Add Preview Model... option. After that, you can pick one of the characters models in xob model. Vanilla data contains two models with some equipment merged in:

Once character model is present in Preview Models list, it is possible to add two child models:

Currently active preview models can be either switched in two ways:* Through context menu which appears after clicking on it with Right Mouse Button entry in Preview Models list and then selecting Set as current option

  • By double clicking on it

Active preview model is marked with bolded text.

armareforger-new-weapon-animation-set-preview-active.gif

Above set of preview models should be enough to preview all necessary weapon animations (both character and weapon itself) once Animation Workspace is filled with actual animations.

Assigning animation workspace to prefab

Content of WeaponAnimationComponent

If everything went fine, the new weapon animation workspace should be ready to be plugged into the weapon.

Most of the weapon animation configuration is located in WeaponAnimationComponent. Unless weapon prefab is duplicate of some existing weapon, such component might not exist in a prefab which just inherits from Rifle_Base.et prefab. In this case, it will be necessary to add such component to the prefab first. This can be done in few steps:* Load weapon prefab (SampleWeapon_01_base.et) in World Editor - either by using Edit Prefab button in Resource Manager or by drag and dropping weapon prefab into World Editor view port

  • Locate WeaponComponent in Object Properties window of the weapon
  • Click on WeaponComponent with Right Mouse Button and select Add child component option from the context menu
  • Select WeaponAnimationComponent from the list of components

After that, WeaponAnimationComponent should be ready for further configuration. If component

Setting weapon animation instance

First, let's begin with general weapon animations and weapon graph & animation instance. Those two things are controlled by following parameters which can be found in WeaponAnimationComponentn* Anim Graph →  This parameter expects animation graph used in animation workspace. In this case sampleweapon_01.agr was used

  • Anim Instance → This parameter expects animation instance of the weapon. Over here sampleweapon_01_weapon.asi should be assigned

It is also necessary to switch those two parameters to on, to ensure proper working of the component* Always Active

  • Bind With Injection

Setting player animation instance

Next, we can move to character animations configuration and to do so, click on set class button next to Anim Injection property. This will add new class to the component where you can configure following options:* Anim Graph →  Same as before, this parameter expects animation graph used in animation workspace. In this case sampleweapon_01.agr was used again

  • Animation Instance →This parameter expects animation instance of the character. Over here sampleweapon_01_player.asi should be assigned
  • Binding Name → Binding name in root graph. Type here Weapon

That's it for now! Now we are going to leave the Animation Editor for a while and move on to the creation of the actual animations.

Continuation

Next part -