Making animated IMVU pets using Blender - advanced Prep & Export
Making a pet for IMVU is just as easy as making any other item as also requires a 'mesh' (the object itself) and a 'skeleton' (the armature everything is 'attached' to - also referred to as a "rig").
The images below show the top, side and front view of two animated Pets made for IMVU using Blender 3D - "Monster in a Box" and "Tomato Joker". Although both show Armatures with a number of bones it's not a requirement they have as many as shown (three is the bare minimum - the avatar root, the pet root and a final bone to which the pet is directly linked through vertex grouping).
What's needed to make an IMVU pet? ^
In order for any item to work in IMVU it has three requirements;
Mesh - the mesh can be composed of a number of separate objects and materials during construction, however, the mesh objects need to be joined together into a single mesh before exporting; this results in one single object with one or many material and/or texture references.
Armature - only a single armature will be exported. Make sure that it a number of armature have been used and animation action created that those animation play correctly when applied to the 'joined' master armature that's needed for export to CAL3D.
Action - animation actions can be of any number and any length. Keep in mind that the longer the animation the larger the resulting file after export; although text based and easily compressed into a product *.cfl, it's best to keep in mind the overall 2MB file size limit on the *.cfl files saved and used by IMVU product system.
The 'mesh' component ^
The mesh needs to have at least one material applied and one texture UVW mapped to it. It also needs to be vertex weighted and parented to the armature - by default only one vertex group is need, however, if the pet is to be animated in some fashion a vertex group per bone name may be necessary (depending on the results wanted).
POsition of the Pet 'root' anchor point ("zHead") relative to the avatars overall 'root' ("Female03MasterRoot") - the relationship allows pets to remain unaffected by what the avatar is doing. e.g., if the character jumps the pet will remain where it is
'Pet' placement relative to the two main 'root' bones in the IMVU avatars master skeleton (shows only "Female03MasterRoot" and "zHead"); where a pet appears in IMVU's chat client is dependant on these two bones.
The image above displays the two 'master' or 'root' bones - "Female03MasterRoot" and "zHead" - both of which can act as a 'root' location point of reference for the positioning of the pet as well as the generally accepted 'zones' (the pink boxes) where pet meshes actually sit when used in the chat client; "Position 1" and "Position 2" are the primary locations used to place pets but they can, in theory, be placed anywhere around the avatar.
Design note: pets are placed to the side of the avatar by default to prevent their intersection with other avatars as Users interact. When animating the pet the distance should be compensated for but is not a prerequisite.
A mesh must be vertex parented to the individual bones of the master armature used by the pet. The number of vertex groups created depends on the number of bones in an armature and/or if any given bone has an effect on the mesh (for example, 'arm' bones moving an 'arm' mesh section). Select the mesh and press "TAB" to enter "EDIT mode". Press "A" to select all faces/vertexes (may need to do this twice, once to clear any previously selected faces, and again to reselect everything). In the editing buttons window (F9) find the panel titled "Links and Materials" and within that find "Vertex Groups". Click "New" to create a new vertex group and in the text box that appears type "Female03MasterRoot" and hit keyboard "return/enter".
Important note: names are case sensitive; "female03masterroot" is not the same as "Female03MasterRoot"
Once the new group has been created click the "Assign" button; this will then assign the new vertex group to the selected faces/vertexes of the mesh. This can be tested by clicking the "Deselect" and "Select" buttons to see if the mesh faces are selected and de-selected. Repeat the above steps for each bone used to animate part of the pet mesh. If the pet is 'static', in that it doesn't animate, then only one vertex group needs to be created, which is named (parented) after the armatures root bone.
Design note: The above step needs to be repeated for every part of the mesh that is controlled by a bone and able to move as a result. Vertex groups are an important part of 'animation'.
The ' armature' component ^
The armature needs to have a minimum of two bones; a 'root' and an 'ancillary' bone (note; "ancillary" bone can be named something else). Both are required; if the pet is to be animated in some fashion then more bones may be necessary, each of which needs to be uniquely named with an associated vertex group present in the mesh.
The basic Pet 'rigs' positioned relative to where they might expect pets to appear in the chat client - the respective anchor points are occupied by the pets 'root' bone, whereas the pets position, what's seen by the User, is placed relative to one of four 'zones'
Relative positions of normal armature placement for pets (shown in Blender 2.49)
Pet position - Ground Based Pet ^
Has an armature root approximate to 'feet' of the avatar. A ground based pet will shift and move when ever the avatar itself moves location, i.e. when carrying out an action with another avatar, the pet will move to the same location the avatar does.
The root bone is "Female03MasterRoot"
Position of a pet relative to the lower or ground of the avatar - this might include pets like cats, dogs and other limbed creatures, or pets that fly or otherwise move around the avatars feet or lower-body
Pet position - Shoulder Height ^
Has an armature root approximate to the 'head' of the avatar. Similar to the above, except the pet will also carry out similar 'actions' - that is, ranges of movement - based on what the avatar does, i.e. if the avatar does a back-flip, the pet will also do one.
The root bone is "Head", "zHead", "AttachmentRoot" or "AttachmentNode" depending on what range of motion is required.
The generic zones pets are typically placed relative to the upper body of the avatar - note the pets 'root' bone connects to the neck which allows pets to be attached to, and react in sync with the avatars head when it moves
Pet position - Shoulder Height, Non-moving ^
Has an armature root at the 'feet' of the avatar but the actual pet approximate to the 'head'. This allows the pet to appear at shoulder height but not be effected by any movement based on what the avatar does except when carrying out 'global' actions (moving from one spot to another).
The root bone is "Female03MasterRoot".
Position of a Pet if its to remain static or unaffected by the avatar actions - pet Armature is rooted to the root bone of the avatar "Female03MasterRoot" - note the differences between 'static' and 'animated' pets and their respective Armatures
Placement and naming ^
The final placement of the pet relative to the avatar is done in the IMVU client and Create Mode so the root bone does not necessarily need to be called "Female03MasterRoot", however, for practical reasons it's often convenient to call it that or something that makes it clear its the pets 'ROOT' bone.
Design note: when creating the pet in Blender however, it's best to think of, position and work on the pet based around its position, where it will appear in the client and to which avatar bone its to be parented to (see above).
The reason for this is that if working on a flying pet that has a root bone placed at the avatars feet (Female03MasterRoot) but subsequently connected to "zHead" in Create Mode will result in the pet being placed far above the avatars head - this is due to the distance between the pet itself and root bone being constructed in Blender relative to a pet that should have been connected to Female03MasterRoot, not zHead.
THe relative position of the 'root' bones for a pet - the 'virtual' at "zHead" and the actual at "Female03MasterRoot", which is positioned at "AttachmentRoot" bone, lower-neck ("Female03MasterRoot" is the actual 'root' bone as its the bone that physically links to an avatar bones)
Bone relationships and 'parents' ^
The root bone ("Female03MasterRoot" in this instance) must not have any 'parents', it should be the top of the bone chain - everything links to it and not the other way around, so "Root « body « bouncy-bit" would be the correct format, not, "body « Root « bouncy-bit".
Avatar and pet mesh in relation to one-another and "Female03MasterRoot", shown as the 'root' or 'master' bone to which
everything is connected (same model shown in Blender 2.49 above-bottom, both indicated by dashed lines) - pet Armature has it's own 'local' root, which is connected (parented) to the actual root, "Female..."
Top view showing bone relationships and their respective positions (indicated by dashed line)
Front view (relative to pet) showing bone relationships (indicated by dashed line)
Bone Rotation, Orientation ^
What pets do, the actions they perform, depends on bone behaviour relative to their initial or default orientation (their position relative to the pet and avatar). To ensure bones 'stand' when added to the Scene switch to "Top" view ("NumPad 7") as this ensures each bones respective "Y" axis points upwards. In other words the following should generally be used;
- "Y axis" points up (to the top of the screen)
- "X axis" points to screen right
- "Z axis" points outwards (towards the User)
Design note: the general exception to this is "Female03MasterRoot", and the 'root' bone of the pet itself, which both tend to lie flat with "Z" pointing up.
Bone orientation may affect the degree to which bones can be manipulated and still make sense in IMVU, often necessitating animation be kept relative simple to avoid errors
Design note: for Blender 2.49 limitations and problems with the CAL3D export script require bones be added to the Scene from the "Top" view ("NumPad 7") regardless as to their standing or lying, and that they undergo limited manipulation to prevent rotational issues. In other words bones should be placed so that;
- "Y axis" points 'up' (to the top of the screen)
- "X axis" points to the 'right'
- "Z axis" points 'out' (towards the viewer so it can't be seen)
IMVU 'pet' ("Box Monster") looking down from "Top" view ("NumPad 7") showing bone axis orientations in 'orthographic' view - note the 'root' bones lie flat to mimic IMVU requirements whilst other bones are upright as ordinarily expected (avatar dummy shown on the left)
Perspective view of "Box Monster" IMVU 'pet' show bone orientation - 'root' bone again lie flat to match the expectations of IMVU, whilst other bones stand upright as expected
An Action ^
This is distinct from the section above about bone positions as this is related to what the pet does rather than where it does it. What this means is that there are two types of 'movement' achievable with pets;
- Only moves when the avatar moves - a 'static' pet.
- Moves independently of the avatar - an 'animated' pet.
This is further augmented by;
- Static: remains in a fixed position unaffected by what the avatar does.
- Active: moves with and in relation to the avatar.
To be successfully exported from Blender, and subsequently rebuilt in Create Mode both do require an "Action" (animation sequence) be present and assigned to the Armature before export to CAL3D. The latter, creating a pet that animates independently of the avatar, is a little more involved as it means generating extended animations, sequences that progress along the timeline for several seconds or minutes depending on the desired results.
Design note: the only difference between an animated item and anything else is simply related to using more keyframes and more time to carry out a movement or motion and then using the resulting *.XAF file in IMVU.
To make an extended animation then, open the Action Editor ("Shift+F12" or select "Dope Sheet » Action Editor" from the "Current editor type..." list). To the right of "Browse Action to be linked" left-click the "+" button which adds a new datablock (typically titled "Action.001" if a sequence already exists). Move the green timeline marker to frame "1". In "Pose Mode" manipulate the Armature, select all the bones then press "I" to "Insert" the "LocRot" coordinates to the timeline. A marker appears confirming the inclusion. Move the frame marker to a different position in the timeline and repeat the pose and insertion procedure making sure there's a difference between the frames necessary to represent a 'walk', 'run' jump' etc.
Design note: for Blender 2.49 the process differs slightly only so much as the "Action Editor" is accessed directly as an option from the "Display current window type..." selector, and adding a new Action means clicking the "Browses existing choices or add NEW" selector and clicking "ADD NEW" at the very top to place a new sequence into the editor. Once available the process is the same as the above. For more information on the animation process generally the following tutorial provide extended, detailed explanations;
Creating a new Action in Blender 2.49 can be done left-clicking the "Browse existing choices..." menu and selecting "ADD NEW". This duplicates the active sequence which then needs to be cleared of old frame markers
Once the new Action has been created make sure the "F" button is active ensuring Blender saves the data with a "Fake" User otherwise it will not be saved (data will be lost)
To create a new Action sequence left-click the "+" button to the right of "Browse Action to be linked". This duplicates the active sequence and gives it a 'unique' name (appends a numerical reference)...
... then once available, press "A" to select the old data and "Delete" it from the timeline clearing the way for a new set of frames to be inserted (ensure "F" is active else Blender won't save the new Action)
Exporting the Pets animation's ^
Once a series of separate animation 'Actions' has been made they can be exported one-at-a-time.
Design note: each pet action the pet performs needs to be exported separately - it's not possible to 'batch' export animation data so each action has to go through the CAL3D export process on it's own.
To export a set of Actions; (Shift+)RMB select the armature (in either 'Pose' or 'Object' mode), or select the mesh and then the Armature if this is the first export in a series. Next select from the drop down list in the Action Editor the appropriate animation to apply to the armature and then 'play' it (mouse over the 3D window, then press keyboard "Alt+A") to make sure all is correct before export.
Design note: exporting requires each Action be swapped out to be the 'active' datablock assigned to the Armature.
With sequence active in the Action Editor and assigned to the Armature, click "File » Export » Export Cal3D for IMVU". In the "File Browse" window that appears give the file a name then set the export options in the "Export Cal3D for IMVU" options bottom-left; select "Export skeleton (.XSF)", "Export mesh (.XMF)", "Export animations (.XAF)" and optionally "Export materials (.XRF)".
Design note: materials are optional for IMVU as Create Mode is able to load images directly without the need to use XRF files.
Once the options are set click the "Export to Cal3D for IMVU" button top-right to complete the process. Repeat the steps above for each individual Action/animation that's needed. At the end of this process there will be a number of different *.xaf files, each one being a specific export of a particular animation Action. These new files now need to be put together in IMVU's Create Mode.
Design note: when exporting from Blender 2.49 similar settings are required; a file path has to be manually entered (files save to project folder by default); a 'scale' ("S") value ("0" disables and exports actual size); a 'framerate ("F") if an animation is being exported (defaults to "25"); the "Export to XML" setting enabled to ensure text-based output (compiles a binary file otherwise unusable in IMVU); and "X" through "_RF" being active to ensure properly formatted "X__" files.
When exporting to IMVU from Blender 2.49 set the file path, set the "Scale:" to "0" (ensures exports is actual size), enable "Export to XML" (text file output) and select "X", "_SF", "_AF", "_MF", and "_RF" before then clicking the "Export (E)" button
When exporting select the mesh and Armature, making sure the latter has an Action assigned, and in the "Export Cal3D for IMVU" options select "Export skeleton (.XSF)", "Export mesh (.XMF)", "Export animations (.XAF)" and optionally "Export materials (.XRF)", name the file and choose a location for it to be saved before clicking the "Export Cal3D for IMVU" button top-right