KatsBits Community

Game Editing => IMVU Creator Community => Topic started by: kat on December 10, 2017, 08:01:23 AM

Title: [IMVU] mesh only export to fbx (furniture orientation)
Post by: kat on December 10, 2017, 08:01:23 AM
Exporting furniture item meshes without an attached (parented) skeleton or 'root' node.

With the availability of FBX its now possible to export furniture meshes from Blender to IMVU (https://www.katsbits.com/tutorials/imvu/fbx-import.php) without the need to use an underlying skeleton or "Root" node because, on export from Blender, the process structures the data relative to the Scene itself being at the top of the hierarchy rather than an particular Object it might contain, i.e. an "Empty" or "Armature" used as a root or master 'node' (point of origin).

What this means in practice is that the 'Scene' itself (shown below as displayed in the "Outliner" editor) is subsequently set as the exported furniture items 'Root', to and under which everything else is then attached or associated (vertex grouped and/or parented (https://www.katsbits.com/tutorials/imvu/furniture-nodes.php#mesh)). When exporting just a mesh to FBX for use in IMVU this basically means mesh objects latch on to the Scene as Root. For simple items this essentially negates the need to set up or use Root nodes and skeleton structures (https://www.katsbits.com/tutorials/imvu/furniture-nodes.php).

"Scene" is the 'root' of exported fbx
When exporting simple furniture items for IMVU, if no 'root' node is present as an actual Object element, the "Scene" itself substitutes for the missing component to which everything is then linked

Typical furniture item set up for walls
Normally furniture items are set up so the items root is a skeletal object, typically either an "Empty" or "Armature", that forms the basis around which the item is then reassembled in IMVU. For wall furniture this 'node' would normally be orientated so the blue "Z" axis handle points inwards (in "Front" view) towards the screen

With that said care still needs to be taken to ensure the correct orientation of the object relative to the items eventual use; although the FBX file has a Root node, "Scene" as explained above, its orientation is determined by the global Scene or World orientation, or as though the node belongs to a standard floor-bound furniture item, for which in both instances "Z" points upwards (the blue widget handle in Blender). For walls "Z" points inwards, for ceilings "Z" points down, which means absent a rudamentary 'root' object, "Z" is the primary axis of orientation in IMVU to which meshes are relative.

This problem can be seen below where a typical wall-mounted picture frame stands upright as might be expected. Looking at the mesh orientation however, the blue handle of the widget points upwards as though for floor items. When the mesh is imported as a wall item this results in a 90° degree rotation forward to match wall-node orientations, pitching the mesh on its face (the mesh 'face-plants'). To compensate for this when performing mesh only exports the mesh will need to be rotated backwards 90° degrees to lie flat on its backs, thus when IMVU corrects for node placement the mesh is adjusted by being rotated upright -90° (negative 90°) relative to wall furniture nodes (the same correction/compensation is true for ceiling items except they would typically need to be flipped upside-down).

A picture frame as would be typically made standing uprightPicture frame faceplants in IMVU due to node orientationLaying mesh on its back to compensation for "Z" axis in IMVU
The way wall mounted furniture items are set up in Blender will results in a 'face plant' when imported into IMVU using the "Scene" as the root element. To avoid this the mesh will typically need to be rotated onto its back prior to export

Picture frames as appears in IMVU corrected and broken
When set up correctly imported meshes will align to walls without needing to do anything else

Additional Resources
- Make IMVU Furniture using nodes (https://www.katsbits.com/tutorials/imvu/furniture-nodes.php).
- Setting up furniture meshes using nodes (https://www.katsbits.com/tutorials/imvu/furniture-nodes.php#mesh).
- Furniture orientation (https://www.katsbits.com/tutorials/imvu/make-rooms-armatures.php#furnitureorientation).
- FBX tutorials for IMVU (https://www.katsbits.com/tutorials/#virtualdevelopers).
- FBX files and resources (https://www.katsbits.com/smforum/index.php?topic=960.0).