Making animated IMVU pets using Blender - Create Mode Assembly
Once all the Pet is exported from Blender its time to grab the files and reconstruct the item in IMVU's Create Mode. Aside from the files output from Blender, nothing else is needed (other than the IMVU Client).
The following makes use of Create Mode, part of IMVU's chat client. A basic understanding of product creation generally is ideal as the following does not go into detail on this particular aspect of developing content for IMVU (click here to read how items should be put together in Create Mode and the extra options available).
Pets in IMVU are largely the same as other products in terms of what can be done with them, the only difference really is in how they are utilised by the end User. In other words, an animated Pet functionally is the same as an animated seat or other item, they all require the same fundamental parts to work correctly in IMVU. With this in mind once the export process has been completed from Blender a series of text-based XML files will be available; a mesh as "*.XMF" ("tomato.xmf"), a skeleton as "*.XSF" ("tomato.xsf"), an animation file as "*.XAF" ("tomato.xaf"), and optionally a texture or material file as an "*.XRF" ("tomato.xrf").
Design note: depending on the Pets complexity there may be several of each, typically there are several animation (xaf) and material (xrf) files each representing a different element of the overall product - separate xaf files for each animation sequence, run, jump, blink etc., and xrf files for different texture usages. Aside from mesh data its also possible to bring in audio and sound files ("*.ogg" audio files) which are generally loaded into the Client directly without the use of an associated XML file.
Once export from Blender is complete a set of text-based XML files become available, ready for reassembly in IMVU's Create Mode
Product Deriving ^
As with all other products in the IMVU catalogue, Pets must be derived from another 'root' item. When uploading a completely new mesh this is best done using one of IMVU's root products, typically the Male or Female Accessory items; "Glasses Space Lagoon" #682 (F) and "Glasses King Gold" #669 (M). For Pets either item works. When IMVU starts and Create Mode is activated click the yellow "Derive New Product" button on the left of the "Advanced Tools" section. In the "Derive a new 3D product" dialogue that appears select either/or "Female" or "Male" then select the "Accessory" item to set the product derivation base. Once the item listing appears click "Go" (lower-right) to start the derivation process.
Design note: Pets are considered 'accessory' items so don't have the dedicated root derivable product typical of other items types. When deriving the IMVU item set as the base should be the Male or Female Accessory.
Pets don't have a dedicated derivable because they're essentially "Accessory" items. Select that option from the "Derive a new 3D product" dialogue (Female or Male items can be used)
Once the Accessory item is selected the avatar loads in Create Mode wearing the item. From this point on the various XML files will be loaded in to replace the defaults associated with the glasses
Replacing the mesh (XMF) ^
Assembling Pets is the same as for other product types, its simply a process of replacing the defaults loaded in with the derived item with those belonging to the new one, i.e., replacing 'sunglasses' with 'pet'.
Design note: the derived item acts as a container of sorts, each element being a temporary placeholder for their replacements. Once this is done the older references are essentially discarded in favour of the new (see below re: cleanup).
Once the Accessory item loads into Create Mode along with the avatar, click the "meshes" tab to access mesh properties, then on the "+ Add .XMF" button. In the Windows File Browser that appears, browse to and select the *.xmf file and load. Click the "Apply Changes" button to swap meshes. The replacement will then appear in the main window.
Design note: if more than one mesh needs to be loaded click the "+Add" button top-left of the section, this adds another mesh 'slot' into which a secondary XMF can be loaded. Repeat for the number of sub elements required.
When the mesh loads Create Mode also automatically updates the "Materials" subsection, listing all instance referenced in the XMF. To replace or add new textures to the mesh simply click the "Edit" button per material shown, browse to, select and load each slots respective *.jpg, *.png or *.gif. Click "Apply Changes" to update.
Design note: Create Mode no longer requires XRF files be loaded to explicitly update material slots as images can now be opened directly (they are now given a unique session name/identified). In addition if using Blender 2.49, bitmap images need to be inverted (flipped upside-down) beforehand else they display incorrectly in IMVU - an incompatibility between the older version of Blender and IMVU that has to be compensated for.
To replace the glasses click "meshes" then "+Add XMF" to browse, select and load the replacement. This also updates the "Materials" section which can be replaced directly without needing to use XRF files - click the "Edit" button, browse, select and load. Click "Apply Changes" to update the product
Replacing the skeleton (XSF) ^
By default the mesh added above will behave as though its a pair of glasses because its rooted to the same bone, "AttachmentRoot", used by such head-based accessories - when the head moves so too does AttachmentRoot and anything linked to it. This is typically addressed by loading in the skeleton exported from Blender, and attaching it to a different bone.
Design note: the bone used as that attachment point differs depending upon requirements, a head mounted pet can be rooted to "AttachmentRoot" whereas a 'shoulder' pet might be rooted to "shoulder.R" which in turn localises the pets location and behaviour relative to the avatars right shoulder.
Click "config" to access skeletons properties. To replace the XSF associated with the derived item click "+Add .XSF". In the File Browser that opens select and then load the replacement XSF file. Click "Apply Changes" to update. This will modify the product replacing the derived skeleton with the new. However, this doesn't change the Pets position. If that's required because the pet stands on the ground, in "Attachment Node:" type the name of the bone that's to act as the pet root or anchor, for example "Female03MasterRoot" to root the pets skeleton to the avatars feet. Upon updating the project the pet will relocate based on the bone name entered.
Design note: if the pet is to be available to both Male and Female avatar, in the "Compatible Body Pattern PID:" input field type a comma "," immediately after "80" then type "191", i.e., the input field should be as follows "80, 191". This ensures the same pet is usable to both.
Replacing the default derived items skeleton with that of the pets - click "config" to access the panel then click "+Add .XSF". Browse to, select and load the *.xsf file then update the project. Depending on placement change "Attachment Node:" to the bone anchoring the pet, e.g., "Female03MasterRoot". And if the Pet can be used by both Male and Female avatars change "Compatible Body Pattern ID:" to "80, 191"
Replacing/Adding an Action (XAF) ^
Accessories don't generally animate to the root derivable, the glasses, don't include any animation files that need replacing. If the pet animates in some way this means loading in a brand new function. For this click the "actions" tab to access the appropriate properties. The panel will be blank besides an "+ Add" button top-left of the section. Click it to populate the panel with "Action 0". In the "Ensembles" area (salmon background colour) and the "Skeletal Animation" subsection click the "+ Add .XAF" button and browse to, select and load an *.xaf file.
Design note: getting animation to work in IMVU is a two part process; the file is first loaded into the Action, then a trigger is set to activate it appropriately. This has to be manually set in the "actions" panel.
Once imported, the animation can be set to play automatically though an 'on load' event or triggered manually by having the User type a command. First in "Action Parameters", some basic behavioural properties need to be set. In "# ensembles played:" type a numerical value in the input box to set the number of times the "Ensembles" below plays, "0" will infinitely loop the selection, "1" will play through it once, "99" will repeat the sequences ninety nine times then stop. In "After Playing:" set "Pick same Ensemble" from the options available.
Design note: if an individual "Ensembles" collection contains more than one item, i.e., "0: [XAF name]", "1: [XAF name]", "2: [XAF name]" etc., they will be played sequentially as part of the larger group depending on what "After Playing:" is set to, and a set number of times depending on the value attributed to "# ensembles played". In other words, if "# ensembles played" is set to "4" and "Pick same Ensemble" is selected, the ensemble will repeat the initial sequence found, e.g., "0: [XAF name]", four times. Similarly "Pick new Ensemble" will randomly select another member of the 'ensemble' group (there should be three or more items up for selection), with "Cycle through Ensembles" playing sequentially through each.
Once the initial sequence to play is set the action will need to be triggered. If the pet is to animate as soon as it loads into the scene, in the "Trigger" input field (under "Action Parameters") type "stance.Idle". Alternatively if the animation is to be manually triggered by the User type "petwalk" or other appropriate word/phrase (all triggers are CaSeSENsitIve).
Design note: aside from "stance.Idle" actions can also be automatically activated using "stance.Sitting" and "stance.Standing" which correspond to the avatar sitting down or standing up (essentially sitting and standing pose-spots). When using manual triggers its best to keep the words or phrases simply but appropriate to the product to avoid accidentally triggering other products, for example using "walk" may trigger other items whereas "petwalk" only triggers the pet, and to make it easier for non-English/native language speakers to use.
Finally in the "Ensembles" section again change the "Playback speed:" to speed up, or slow down the sequence, lower numbers result in slower animation, higher, faster. Next set "Composition:" to "Replace" and then under "Skeletal Frame Controls" set "# loops" to a value representing the number of times the individual XAF sequence plays.
Design note: for playback speed "25" represents the standard rate at which sequences play through, so lower numbers, i.e. "12", would result in an animation at approximately half the original speed, whereas "50" doubles the original making it twice as fast. When setting the number of time individual XAF files play via "# loops", the setting can be used distinctly from "# ensembles played" such that a given XAF can be set to 'loop' three times, whilst the 'ensemble it belongs to can be set to play twice. The results would be a animated action that actually plays six times, 2 x 3 = 6. Using these settings it's possible to create sequences of prolonged length or variation (determined by "After Playing:").
Once all the settings edited click "Apply Changes" to update the file. If more animations are needed first clicking the "+ Add" button top-left placing a new Action before then repeating the process.
Products can be animated using the XAF files added to an "Action" property. First click "actions" then the "+ Add" button to create "Action [n]". Then et whether the animation starts automatically when the product loads, or is User activated in "Action Parameters". Finally set the actions duration (number of times it plays) and speed. Each animation generally uses a separate "Action" unless they are sequential in which case they are loaded sequentially as "Ensembles" within the same Action
Removing Unused assets ^
Before uploading to IMVU the project will likely need to be checked for 'unused' assets, files that belonged to the original item, or extras loaded in during production but no longer needed. In either case they should be removed to ensure the products final file size is as small as possible. For this simply click the "assets" tab and select the items marked "UNUSED". They highlight yellow. Once done click the "Remove" button bottom-left to delete.
Design note: multiple entries can be selected holding down "Ctrl" whilst clicking.
Once this is done, save the file and upload.
Highlighted yellow, the selected "UNUSED" assets need to be removed to keep the file size down else they will be included with the product when its uploaded - click select and the click "Remove"