KatsBits
Creating 3D models, meshes & game content
3D modelling & meshing, level editing and textures making
Hints, tips and tutorials for 3D modelling & content creation

[back]Quick guide to building IMVU rooms using Blender 3D

Resources

If you get stuck you can ask questions on either my IMvu dev group or my forums, both of which are good places to get information on developing and/or using Blender 3D to do so.

Contents
Forward ^

You will need a basic understanding of Blender to properly utilise this guide. It's also been written with Blender version 2.45 (with Python 2.5.x optionally installed) in mind, so whilst certain things may work using other older versions, the results are not confirmed. Keep in mind this Guide is not going to tell you how to use Blender 3D, there are other resources on the Internet that are more appropriate and more effective for that.

Be aware that this process isn't necessarily for the faint of heart so be prepared to spend a lot of time on this so patience and longevity are required; you will not be building rooms in a couple of hours if you are new to developing content for IMVU.

Building rooms with Blender 3D for IMVU ^

Building a room is similar to building furniture items for IMVU except there are one or two additions that need to be considered. With that in mind rooms can be broken down into the same basic units as furniture, namely a 'mesh' and an 'armature'.

The Mesh

The mesh is the same in many respects as it is for furniture items, so it needs to be parented and vertex grouped to the Armature in a similar way, i.e. once you have your mesh (UVWmapped and textured) nothing else needs doing to it except it's connecting to the Armature.

HOW TO : Select the mesh first, then the Armature, then Ctrl+P to Parent - select "Parent to Armature" and then "Don't create groups"

The Armature

This is where things are different to furniture items, mainly because there are a couple of extra features that need to be used; "lighting" and "cameras" (for more extensive details on these read IMVUs own documentation).

Design note : the name of the Armature 'object' (that's the Armature itself) isn't important except as a name reference used by Blender when parenting the mesh to it. The name of the bones 'contained' in the Armature are important; see below.

  • Lighting

    Because we're building a room, it's more than likely going to need some lighting at some point; whilst working this means adding one of Blenders many light types - 'Sun', 'Hemisphere', 'Area' and so on - although IMVU does support 3 different types of light (not necessarily the ones just listed) the most common to use is a 'lamp'.

    Design note : replace the Blender light object with a bone (it's easier to replace the object with Armature and then connect that to the main mesh once done) and call it "omni[n]" (where [n] is a number). Armature/bones for lights can be added in front, side or top view of the 3D view.

  • Camera

    Rooms need a camera; this acts as a focus point when first loading into a room. As above, whilst working one can use Blenders own camera system as well as using 'empties' as camera targets.

    Design note : replace the Blender camera objects with a bones, calling the camera replacement "camera.01.01.root" and target "camera.01.01.root.Target". Camera armature/bones should be added in side view.

VERY IMPORTANT NOTE

It's very important to understand here that although you can work with Blender camera, light and other objects as you develop your room, they all need to be 'converted' into (armature) bones before use in IMVU. What that means is, they each need to be swapped out and replaced with a bone; you cannot (using the currently available CAL3D export scripts for Blender) use any of Blenders internal objects within IMVU.

The make up of an IMVU rooms armature ^

As established above, the Armature of a room is slightly different to that of furniture and it's this difference that makes them special. In a nut shell an IMVU room Armature is composed of the following;

  • An 'origin' point
  • Furniture nodes
  • Camera
  • Lighting
  • Animation (scene animation is optional)

Everything is connected or 'parented' to the 'origin' bone in one way or another in what's called a "hierarchy". The full hierarchy for a room looks similar to the following (coloured for clarity);

  • skeleton.Scene
    • node.scene
      • omni1*
    • camera.01.01.root*
    • camera.01.01.root.Target*
    • furniture.Floor.01
    • ... +floor
    • furniture.Wall.01
    • ... +wall
    • furniture.Ceiling.01
    • ... +ceiling
    • seat01.Standing
    • Pitcher.Standing
    • Catcher.Standing
    • Handle01
    • seat02.Sitting
    • Pitcher.Sitting
    • Catcher.Sitting
    • Handle02

Design note : * as noted above these bones are the replaced versions of Blender objects that represent 'lights' and ' cameras' So after replacing Blender objects with bones you should have the following;

  • "omni[n]" (where [n] is a number, e.g.."omni1")
  • "camera.01.01.root"
  • "camera.01.01.root.Target"

VERY IMPORTANT NOTE

Bone names are case sensitive; "Seat01" is not the same a "seat01"

Design note 2 : Note also from the above that the hierarchy is set up with a number of differences to the way it's done in 3D Studio Max (the tool IMVU use), this is the correct way for Blender; it's important to get the relationship correctly set up otherwise the room won't load or work correctly.

Design note 3 : the bare minimum requirement for a working room is "skeleton.Scene" and "node.Scene". For a furniture room a furniture node is required as the presence of those are (appear to be) what the client uses to distinguish 'locked' and 'open' rooms. If no seat or camera nodes are present the client defaults to adding them approximate to the position of the origin of the armature.

Notes on a rooms Armature ^

If when setting up the armature for a room, if you find it easier to create separate armature objects for each of the parts required (for example a separate armature for a seat set, walls set and so on) then do so but note that they will need merging into one main armature; each bone therein will need to be corerctly named and parented to the root bone - skeleton.Scene - correctly (as shown above).

  • Root bones

    skeleton.Scene: When you initially add the armature for the 'root' (skeleton.Scene and node.Scene), it needs to be added whilst in 'top' view (numPad '7') for it's orientation to be correctly set up ('Z' should always point up). Armature are always added automatically in 'EDIT MODE' and after the initial bone placement Blender will assume a 'chain' of bones, cancel this action by Right Mouse Button (RMB) clicking.

    node.Scene : can be added as a separate armature (to then be joined together at a later point) or simple select the already drawn bone from the precess above and Shift+D to duplicate it.

    Design note : please note that bones need to be named, they are not called "skeleton.Scene" or anything else by default.

  • Seating

    WARNING : DO NOT TAMPER with the SEATING Armature objects except to rotate, position & connect them to the main product Armature. DO NOT scale or otherwise muck about with the SEATING Armatures themselves or the individual bones contained within the armature except to rename and parent them to Skeleton.Scene once connected to the main Armature. Ignoring the above warning will render the seating nodes useless.

    NUMBERING : Seating is named sequentially irrespective as to the type of seat; having two standing and one sitting seat should be numbered similar to the following (note there is no "00");

    seat01.Sitting
    Handle01
    Pitcher01.Sitting
    Catcher01.Sitting

    seat02.Standing
    Handle02
    Pitcher02.Standing
    Catcher02.Standing

    seat03.Sitting
    Handle03
    Pitcher03.Sitting
    Catcher03.Sitting

    The 10th seat should be named "seat10.[type]", the 100th, "seat100.[type]" (where "[type]" is either "Sitting" or "Standing"); not that there is no '0' in front of the numbers, placing one there will result in a broken bone.

    PARENTING : All the bones of a seat node are parented to "skeleton.Scene";

    • skeleton.Scene
      • seat01
      • seat02
      • etc..

    ORIENTATION : seating can be orientated in any direction based on the desired position of that avatars; upside-down, turned, pitched or rolled.

    Seating positions can be placed in any position
    Seating positions can be placed in any position

  • Furniture

    NUMBERING : Furniture bones need to be added to the armature when in top down view for their orientation to be correct relative to the scene. They are also numbered sequentially according to their type; so having 200 floor, 20 wall and 10 ceiling nodes would be numbered/named (note there is no "00" bone named);

    • furniture.Floor.01 > 201
    • furniture.Wall.01 > 21
    • furniture.Ceiling.01 > 11

    PARENTING : All furniture bones are parented directly to the rooms root bone "skeleton.Scene";

    • skeleton.Scene
      • furniture.Floor.01
      • furniture.Wall.01
      • furniture.Ceiling.01

    ORIENTATION : The orientation of the individual bones is important, get this wrong and furniture items appear in the client incorrectly (see here for known current issues on this subject).

    • Floor bones should lie flat with the 'Z' axis pointing up into the room; the bone itself typically lies flat along the floor surface and itself points at the top of the 3D window in Blender.

    • Wall bones should stand upright with the 'Z' axis pointing into the room.

    • Ceiling bones should lie flat and be placed in a similar way to Wall bones when near the edges of the ceiling and similar to floor ones when on the inner surfaces of the ceiling. Ceiling bones need a "Roll" value of 180º.

      Design note : Blender will 'reset' the "roll" value of bones to "-180.000" when doing this to a bone so in order to stop that from happening you need to use "179.999" as the roll value.

    Bone orientation in Blender for IMVU rooms
    Bone orientation in Blender for IMVU rooms
Exporting a mesh and armature to CAL3D for IMVU ^

Exporting from Blender is the same for a room as it is for furniture because they essentially use the same components; a mesh and an armature, the only real difference is one of functionality in the chat client.

PREPPING : make sure the following checklist is done (not necessarily in order);

  • Armature
    • "Apply Scale & Rotation" (Ctrl+A) is applied to the Armature
    • Individual Armatures used during build are 'joined' (Shift+J) into a single Unit
    • All bones correctly parented to skeleton.Scene
    • Bones are correctly named and number sequenced
    • Bones are orientated correctly relative to their function and the room itself
    • The position of skeleton.Scene is sitting relative to Blenders 0,0,0 grid
  • Mesh
    • "Apply Scale & Rotation" applied to mesh
    • Mesh parented to Armature
    • Mesh has a vertex group named "skeleton.Scene" (assuming a standard none animated room)
    • Mesh is UVWmapped
    • Mesh has a material (materials) applied and is textured
    • Mesh is 'triangulated' (select all ['A'] then Ctrl+T)

ACTION : This needs to be added to the Armature in order for the export to complete successfully. Add a keyframe for each bone in 'Pose' mode (Ctrl+TAB) by selecting all of them (A), press 'I' and click "LocRotScale"; this will create an action with a default name in which all the bones selected will have a keyframe present in the timeline (exit pose mode once done).

Design note : if you're adding an actual animation to the room, it's set up will likely need altering accordingly;
  • Bone or bones to be animated need separate 'Action' animations
  • Animated bones still need to be part of the main rooms Armature (if animation is part of the actual scene/room).
  • Any parts of the main room mesh that need to move need to be 'connected' to the animated bone/s by the use of an appropriately named 'vertex group' - a group of vertices of the mesh should carry the same name as the animated bone.
  • Animation needs a separate export, so a individual *.xaf animation file is generated. Required per animation. Version save each animation so you don't overwrite previously saved work (default is to save the *.cfg file using the name of the file itself).

EXPORTING : Select the mesh first, then the armature and then select "File > Export > CAL3D" from the file menu. Leave everything as is and just click 'ok' in the popup that appears. A few seconds will pass and the process will have completed with the various XML files being generated in the projects development folder.

Building the room in IMVU's Previewer tool ^

To keep file size to a minimum derive from IMVU's Basic beach Head scene - product number 512 - it will cost the full derivation fee to do this however, but it's worth the minor cost to keep file size down to a minimum for rooms as they can soon bloat in size.

Open that product in the Preview tool and then replace the various default components with the newly exported CAL files for your room; the mesh in the 'Geometry' page; the skeleton in the 'Specials' page and the texture images in the 'Materials' page. Save the file using an appropriate name.

Rooms can only be properly tested in the chat client itself (the Previewer tool is very limited at this moment in time) so you will need to upload the product to the catalogue which means paying the appropriate submission fees. Hide the product at this point. Once everything checks out make it live.

Notes on final preparation of rooms ^

For Blender created scenes and room there are a couple of 'problems' that need to be address and fixed outside of both Blender and IMVU previewer tool;

  • No vertex colours/mesh painting

    IMVU itself does support the presense of vertex colours painted onto meshes, however, at this point in time the Blender CAL3D exporters do not, meaning they do not export any vertex painting/colouration applied to meshes.

  • Texture displays incorrectly on mesh
  • This is easy to fix in your photo editing application by simply flipping all texture images from top to bottom (so they effectively are turned upside-down). CAL3D uses inverted texture space which often result in textures being applied to meshes inverted. Correct as above (you should not need to flip left to right).

    Design note : it's important to point out here that you should be making your rooms and scenes in exatly the same way you would normally because images that are flipped and saved in your photoeditor will effectively be re-flipped by IMVU so they appear the right way up when applied to the mesh in the client.

    Problems with opacity maps in IMVU rooms see here

  • No lighting
  • Because the scene in Blender was set up the way it was (as explained above), one of the side effects of this is that a room by default will have no lighting what-so-ever present. The bones that replaced the Blender objects will have been included in the exported file but they will be listed as simple bones. This means lighting needs to be added manually by editing the approprate file in NotePad or similar text editor.

    Design note : Light is expressed with numerical RGB values based using a sort of 'hue', 'saturation' and 'intensity' setting rather than 'brightness', so, the closer a colour value (as express by the numerical values) is to '1.000000' the 'whiter' and hense 'brighter' it will appear overall in IMVU.

    AMBIENT LIGHT : Background lighting, everything is lit with the following colour and brightness values. Open the *.xsf skeletal file into notepad and find the following line of code (usually the 3rd line of text);

    <SKELETON NUMBONES="[value]">

    Append the following after the number between the double quotes;

    SCENEAMBIENTCOLOR="0.525176 0.555059 0.545235"

    For example, you should go from this;

    <SKELETON NUMBONES="92">

    to this;

    <SKELETON NUMBONES="92" SCENEAMBIENTCOLOR="0.525176 0.555059 0.545235">

    DIRECTIONAL LIGHT : Lighting based on a light source lighting the scene and objects within 'directionally' (e.g.. a light at one end of a room will highlight avatars when they face it). Open the skeletal *.xsf file into notepad and find the following line;

    <BONE ID="2" NAME="omni1" NUMCHILD="0">

    Append the following text after the '0' between the double quotes;

    LIGHTTYPE="1" LIGHTCOLOR="0.881726 0.869392 0.858118"

    For example you should then go from this;

    <BONE ID="2" NAME="omni1" NUMCHILD="0">

    to this;

    <BONE ID="2" NAME="omni1" NUMCHILD="0" LIGHTTYPE="1" LIGHTCOLOR="0.881726 0.869392 0.858118">

    CHANGING COLOURS/LIGHTING : The easiest thing to do is to simply change the 'intensity' of the lighting. To do this simply edit the first digit after the decimal point 'up' or 'down'; "9" is 'light', "0" is 'dark'.

    Save the xsf file and load it into the Previewer, on pressing 'Apply' you should find the room lit using the values added to the xsf in NotePad. Save the cfl and upload for final testing and release.

© 2008 KatsBits - All Rights reserved.
No part of this web site may be reproduced (unless for personal use) without prior written consent from KatsBits.com
Privacy Policy | Advertise