Models tool is useful to apply some operations on models such as:
- Add/remove/modify model nodes,
- add/remove animations,
- add/remove/edit physics/collision geometry,
- edit vertices and normals.
To open the model tool click on the models icon as showed in the following image:
As showed in the following image the models tool is composed by 3 panels:
- Model View: View that shows the model.
- Model edit panel: the main panel where you can add/remove/edit all features of the model.
- Animation tracks panel: Here you can manage model animations
These 3 models tool panels and independent. You can hide, close, move them independently basing on your needs. For example you may want to switch to SceneView while maintaining the model edit panel.
When you want to view and edit a model with models tool you have 3 possibilities:
Drag&drop the model icon from models browser into ModelView
Click right mouse button on model icon inside models browser and click on inspect
If an object instance into the scene owns the model, and you have already opened the models tool, you can directly select the object in the SceneView
Nodes
To show nodes tool click on the Nodes icon of the Model Tool panel as showed into the following image
Nodes are the basic components of a model. They can be of 2 different types:
- Bone node: a node of a skeleton, it hasn’t drawable geometry but can own joint capsule for collision detection. in the hierarchy inspector they are marked with folder icon if have child's or with red ball icon if they are leafs.
- Geometry node: a node containing a rigid mesh or a deformable skin. In the Hierarchy inspector they are marked with a grey solid triangle icon.
To show nodes of the model inside the ModelView click on Nodes button as showed in the following image. NOTE THAT only bone nodes are showed:
Nodes are drawed as Green cubes connected with green lines. You can select a model node in 2 ways:
- by clicking directly on the green cube
- by clicking on an item of the nodes list of the Hierarchy Inspector.
When you select a node of the model you can do some operation on that node:
- Change its name by editing the Name input box
- If it is a geometry node you can change its materials by clicking on the Materials combo box
- Translate it by checking the translate icon
- Rotate it by checking the rotate icon
- Scale it by checking the scale icon
- Show/hide it by checking Visible box (if it is a geometry node)
- Make it cast shadows by checking the Shadows box (if it is a geometry node)
- If the model is a single mesh model (only one node) you can also use the Reset Xform button that collapse node transformations
Other special operations can be made on the nodes of a model hierarchy using hierarchy inspector buttons:
Add item : Lets you to load an additional model and add it to the current selected node.
- Attention
- NOTE that IN THIS VERSION this is only used as reference for best posing the node, it isn’t used for adding new features to the model
Add new node : add a node as child of the current selected node.
Delete node : delete the current selected node.
Add parent node : add a node as parent of the current selected node.
ModelScript and Animations
When import a model animation it is not automatically applied to the model: you have to add it manually using the animations tool tab.
When a model is opened in Model Tool it is automatically created a resource called ModelScript (.ms2) that contains information about all animations the model can play, the definition of keyframes and animations masks. All that data is created and stored by using Animations tool tab.
- Warning
- Modelscript is a resource file, once defined it must be linked to the object containing the model that can play referred animations. Many objects have
modelscript
parameter, so you can link it by using ClassInspector or prefabInspector.
without modelscript an object cannot play animations
To show animations tab click on the Anims icon of the Model Tool panel as showed into the following image:
Animations (so Modelscripts) are managed using
Animations tool tab
- List of animations currently added to the model
- Add new animation, delete existing animation
- Set animation speed. If speed is negative, animation is reversed
- Animation mask list. You can add/remove masks
- Start node of the mask
- List of mask end nodes
- List of nodes excluded from the mask
Tracks panel
- Currently selected animation name
- Add/ remove animation key frame
- Apply masking on the currently playing animation model and blend the current animation with another using the mask (it is used to view the effect of a created mask)
- Play, Stop, Pause of the current selected animation. If the animation is in pause you can change the timeline and view the effects on the model, if animation is stopped no effect are showed.
- Timeline Zoom
- Timeline scroll
- Timeline thumb. Drag it for changing the animation current time
- Current animation time. NOTE that animations are normalized,so the animation time goes from 0 to 1.
Add animation
To add a new animation compose the name you want the animation must have into the inputBox showed in the picture below:
Then press on the AddAnim button as showed in the next image:
The animation browser dialog appears. Choose the animation you want to apply to the model (usually you find it into the folder you have specified before importing).
The animation will be added to the Animation list box: you will see the animation name you have specified in the list box. Then, to see the animation applied to the model select it from the Animation list (by clicking on the name) as showed in the next image:
Now you are ready to play the animation and see it on the model. Click on the Play button of the animation track panel as showed in the image below:
Edit Animation Keyframes
Animations can have some frames marked as key. When an animation is performed the animated entity sends a message to itself when a keyframe is reached.
The name of the message is: AnimTime.
The elements of content of the message are:
- Name of the playing animation containing the keyframe.
- Progressive index of the reached keyframe (for example if you have a walk animation at index 0 will be the first step and at index 1 will be the second step).
- The weight of the animation
- Number of the playing channel
Then you can process the message inside the Message() function of the script associated to the animated entity. To add a keyframe to an animation, you have to use the Tracks panel:
Place the timeline thumb on the time you want to add the keyframe. Click on the AddKey button.
Animation Mask
Physics Joints
Vertex Editing