Animated Art Assets Tutorial
- This is an advanced level tutorial for artists, that should be accomplished after the Static Art Assets Tutorial.
An animated asset is almost the same as a static asset, except that it has some sort of motion associated with it. This motion can be created using a variety of means, including helpers and constraints, expressions, bone rigging, or straight keyframe animation to create and drive the motion. LODs do not apply to animated assets, so there is no need to create them. Occluders can be applied to an animated asset; however, it really doesn't make sense, so occluders are generally not needed with animated assets either, except in very rare and unusual situations.
Once artists have created an animated model in 3ds Max, it must then be exported as an animated asset. This page provides information on how to accomplish this.
Note: Specific details on how to get clean error free exports are here Hero Export Guide.
Build the geometry
First thing to do is to build yourself a piece of geometry in 3ds Max. Remember to name it and to make sure it is clean. The example used here has several components that are separate animated objects in max.
- transforms and scale should be reset
- Polygons are single sided
- Pivot point should be placed where you want it relative to the object
- Object should be 1 single mesh or 1 group of meshes
- File should contain motion that is generated either by keyframes, constraints, or any other rigging you can dream up.
- Any helpers(3ds Max)/locators(Maya), IKs, etc. should be hidden before export to keep file size down and the resulting file clean
- you may want to keep the bones/joints visible and in the group since they drive the motion of the objects.
Use a HeroMaterial
Next add a HeroMaterial to your Geometry. Materials are added within 3ds Max using a custom material, The HeroMaterial. If you need more than one HeroMaterial that is fine, you can assign a Multi/Sub-Object material with as many hero sub materials as you want or you can just assign individual HeroMaterials directly to the appropriate polygons. This is an Example of using a a Multi/Sub-Object material with two HeroMaterials, One for the main texture and a second for a glow texture.
- Use a HeroMaterial or Multi/Sub-Object material made up of multiple HeroMaterials
- Materials should use .dds files
- NOTE, the following example of the hero material is shown in 3ds Max, however, the same setting can be applied to the Maya Hero Shader for the same results.
- LOD's are not supported by Animated Assets.
- Occluder Geometry is not supported on Animated Assets.
If you intend on adding snap setting so that the engine can move your asset on the snap grid, then please look at the Tile Sets page. This is rare for animated assets, but say you have a dungeon room with a permanent animated pendulum or something, adding snap settings would then be appropriate.
Last but not least, export your asset through the Hero Export. Set the mode as Animated Asset and make sure that post processing is always on. Export unhidden is the most common way of exporting whats viewable in your view port. Remember to hide any unwanted helper or rigging objects. They will only add weight and confusion to your file.
- Export using *Static Asset setting on Hero Export
- Hide any unwanted objects/helpers in the background before export
Now that your asset is exported, upload your resulting animated mesh file and .dds textures using the Repository Browser and then add your asset into HeroEngine.
Animation Callbacks To Script
Animated Assets authored in 3DS Max may embed note tracks just like in character animations (Maya does not support note tracks). If there are note tracks present in the asset, HeroEngine will perform a callback provided one of the classes making up the node within the engine implements the following method.
method onAnimationNote(note as String, time as Float)
Please note, you must GLOM a class that implements this method onto the node for the callback to be made and only ONE class comprising the node may implement the method.
If the node's LW_FIELD_SCRIPT property is set, HeroEngine will attempt to call a function implemented in that script regardless of the existence of note tracks to indicate the animation has ended.
// Return true to freeze the animation at the end function onAnimationEnd() as boolean
Controlling the Animation of an Animated Object
Animated Objects only have one animation, but it can be controlled from script:
external function ResetAnimation(modelNode as NodeRef) external function PauseAnimation(modelNode as NodeRef, paused as Boolean) external function GetAnimationDuration(modelNode as NodeRef) as Float external function SetAnimationLooping(modelNode as NodeRef, looping as Boolean) external function SetModelAnimationSpeed(modelNode as NodeRef, speed as Float)