Animating Weapons: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(First version of page.)
 
(general clarification (child vs parent, etc.))
Line 1: Line 1:
This page describes how to setup ''world models'' (in Maya) so that they can animate. Animating ''view model'' weapons is a much simpler case, described elsewhere. By getting your world model weapons to animate, you can create weapons which are more dynamic and not just glued to the character's hand.
This page describes how to setup ''world models'' (Maya-specific; generally applicable to other modeling applications) so that they can animate. Animating ''view model'' weapons is a much simpler case, described elsewhere. By animating your world model weapons, you can create weapons which are dynamic and not just glued to the character's hand.




== 3rd person weapon animation requirements ==
== 3rd person weapon animation requirements ==


For when a weapon that is attached as a separate object (by code) needs rotation or translation in the animation.
When a weapon that is attached as a separate object (by code) needs rotation or translation in the animation.




== Weapon ==
== Weapon ==


Skin the weapon with the necessary bones need for the particular type of animation you require. Save this an individual entity and export as your weapon reference.
Add the necessary bones to the weapon model for the particular type of animation you require and skin the model. Save this an individual entity and export it as your weapon reference.
   
   


== Character for animation ==
== Character for animation ==


Import the weapon you have created which is skinned and position and parent it to the relevant bone in which it will be attached by code. This will make the rig ready for animation and you can animate the weapon as a separate entity within the scene. As the weapon is skinned then the bone information that is attached will be exported through the animation smd.
Open the character reference and import the weapon you have created which is skinned and positioned. Attach it to the relevant character bone to which it is to be attached by code. This will make the rig ready for animation and you can animate the weapon as a separate model within the scene. As the weapon is skinned then the bone information that is attached will be exported through the animation smd.
Save your file as something different from your reference.
Save your file as something different from the original character reference.
   
   


Line 26: Line 26:


Take the character file just created with the weapon attached.
Take the character file just created with the weapon attached.
If you exported the character now as is then the weapons geometry will be exported along with the character. As it is attached via code you should then delete all polygons apart from one, so the mesh is almost completely gone apart from the few faces which carry the skin information which allow the bones to be exported and in turn allow the animation to drive the attached weapon if thee is any animation applied.
If you exported the character now then the weapons geometry would be exported along with the character. As the weapon model is attached via code, you should delete all the weapon model polygons apart from one, so the mesh is almost completely gone apart from the few faces which carry the skin information. This allows the bones to be exported and, in turn, allows the animation to drive the attached weapon if there is any animation applied.
   
   


== Basic rules ==
== Basic rules ==


All bones need skin applied to be read by the exporter (as far as I know)
All bones need skin applied to be read by the exporter (as far as I know).
All names should match up from the character reference through to animation and weapon reference.
The names of the character reference, animation and weapon reference should all match.

Revision as of 09:21, 24 May 2006

This page describes how to setup world models (Maya-specific; generally applicable to other modeling applications) so that they can animate. Animating view model weapons is a much simpler case, described elsewhere. By animating your world model weapons, you can create weapons which are dynamic and not just glued to the character's hand.


3rd person weapon animation requirements

When a weapon that is attached as a separate object (by code) needs rotation or translation in the animation.


Weapon

Add the necessary bones to the weapon model for the particular type of animation you require and skin the model. Save this an individual entity and export it as your weapon reference.


Character for animation

Open the character reference and import the weapon you have created which is skinned and positioned. Attach it to the relevant character bone to which it is to be attached by code. This will make the rig ready for animation and you can animate the weapon as a separate model within the scene. As the weapon is skinned then the bone information that is attached will be exported through the animation smd. Save your file as something different from the original character reference.


Note:

Delete the prefix on the imported geometry and bones so they match that of the weapon exported for attachment by code.


Character for Reference

Take the character file just created with the weapon attached. If you exported the character now then the weapons geometry would be exported along with the character. As the weapon model is attached via code, you should delete all the weapon model polygons apart from one, so the mesh is almost completely gone apart from the few faces which carry the skin information. This allows the bones to be exported and, in turn, allows the animation to drive the attached weapon if there is any animation applied.


Basic rules

All bones need skin applied to be read by the exporter (as far as I know). The names of the character reference, animation and weapon reference should all match.