Accessories 2



Download 81.13 Kb.
Page1/4
Date29.01.2017
Size81.13 Kb.
#12192
  1   2   3   4

Accessories v1.2

Accessories are products that can attach themselves to a bone in an avatar’s skeleton. This means that you now have the power to make watches, halos, wings, PETS. Anything! The power is in your hands.


NOTE: It is very important that you work from and save all of your files to IMVUtools/Previewer/Examples. This is because certain products (like Avatar Body Patterns and all derivations of any product) rely on the existence of other products to run in the previewer. So, please avoid the headache of dealing with this bug by simply working out of the Examples folder we provide. That said, it is also VERY, VERY important that you save all of your finished products and source files anywhere but IMVUtools/Previewer/Examples as uninstalling the previewer or installing a new version of the previewer will cause this folder to be deleted.
Now on to the How To.

1. Building the Skeleton, Mesh and Material

1.a Download the base Avatar Mesh


For the purposes of this document, we will be using 3DS MAX 7 as the default 3D editing program. Start MAX and open the base avatar mesh that you wish to add an attachment to. The base avatar meshes that IMVU, inc. has created can be found in the various Weighting.ZIP files found on our Developer site. These files are called:

FemaleWeighting.ZIP



MaleWeighting.ZIP
You will NOT actually use or export any piece of the original base avatar mesh or embedded avatar skeleton. You are building an Accessory and accessories contain their own skeletons and meshes. You need the avatar mesh and embedded avatar skeleton for placement/alignment only. Although it is highly recommended that you use the embedded Accessory skeleton, you COULD create your own from scratch if you like. The Accessory meshes found in the example files, typically a pair of glasses, are there as an example of how an Accessory can be weighted (using the Skin modifier) and to give you a functioning example of an Accessory Multi-Sub Material.
NOTE: Save this file with a new name, as you may need to merge facets of the original example 3D file into your new file if a mistake is made.

1.b Build your Accessory Skeleton


You may always use the embedded AttachmentRoot bone/node for your Accessory. All you need do is align it to the avatar bone with which you want your attachment to move. For example, if you want to build a bracelet, you would not align your AttachmentRoot bone/node to the avatar’s Head bone. Rather you would align it to one of the wrist bones.
1.b.1 Pets
If you want to make a pet that moves on its own (without the influence of the avatar’s idle animations), you will want to align the master root of your Accessory skeleton (usually the AttachmentRoot bone) to the avatar’s master root bone (called Female03MasterRoot).
1.b.2 Building your own skeleton
If you would like to build your own Accessory skeleton, you may do so. The accessory skeleton can be VERY simple. Whether you are using the Skin or Physique modifiers, you must build two bones/nodes. These bones/nodes can be called anything you like. One will be your master bone (or, the top of the hierarchy) and one will be the bone you actually weight the mesh to. I prefer to have the master bone called AttachmentRoot. I prefer to call the second bone AttachmentNode. Link the AttachmentNode bone to the AttachmentRoot bone. Now align AttachmentRoot to the avatar bone you wish your accessory to attach to. THEN, either align AttachmentNode to the same bone in the avatar skeleton OR align it to AttachmentRoot. Either way, AttachmentNode will end up in the same spot. Now you can weight the mesh to your heart’s content.
NOTE: If you are building something that is meant to move with one bone only (Glasses, Earrings, etc.), weight all of your vertices to that bone in the ACCESSORY SKELETON.
EXTRA SPECIAL NOTE: Your Accessory mesh should never be weighted to any bones in the avatar skeleton. Your Accessory has its own skeleton (which you just created). If you weight your accessory to anything but the accessory skeleton, it will not work.

1.c Build your Accessory Mesh



1.c.1 Accessory skeleton location
The first thing to realize about building an Accessory mesh is that the location of the Accessory skeleton master root matters a lot. If you want your glasses to show up on the avatar’s head in the Previewer, you need to have your Accessory skeleton master root bone aligned to the avatar’s head bone before you weight your glasses. So, to recap:

  1. Align your Accessory master root bone to the bone in the avatar skeleton that you want to influence the Accessory.

  2. THEN weight your mesh to the Accessory skeleton.


1.c.2 Accessories for Avatar heads
If you are building an Accessory for an avatar head (glasses, earrings, horns, etc.), there are a few things to keep in mind. First is that the current IMVU head products are all built around the same basic head shape for Male or Female products. The difference in all of the heads built by IMVU is only found in the size of the head and the shape of the face. Specifically, the cranium, bridge of nose and ears do not move from head to head. This allows each head to use all of the pre-existing Accessories without glaring aesthetic bugs. However, this means that things like facial jewelry, beards, mustaches, fangs, etc. will not look right from head to head.
1.c.3 The sky is the limit
Your Accessory can be anything you like. Check out the IMVU catalog to see some of the ingenious Accessories our other Developers have created. All of these have been built in the IMVU Previewer. EXCITING!
NOTE: The mesh for your Accessory can be very close to the mesh for the avatar. However, if they are too close you may get Z fighting (or shimmering) in IMVU. It is worth testing in the previewer. If you see Z fighting in the previewer, you will see it in IMVU.
1.b.1 Vertex Colors

fig1.2 – Vertex Color editor in the Surface Properties Menu

Vertex colors allow you to tint or darken the appearance of a portion of your mesh at runtime without having to manually paint in shadows on your texture. A vertex color blends evenly from the colored vertex A to the color of the next vertex B. If the color of B is white, the blend from A to B will go from 100% colored to 0% colored. This is especially handy if you want to keep your overall CFL file size down but want shaded and lit parts of a tiled texture.

To add vertex colors, go to edit Vertex mode in either the Edit Mesh or Edit Poly modifiers. Then, select one or a group of verts. Go to the surface properties menu and click on the white bar next to the word Colors. This will bring up a color picker. Pick your color, Close the picker and voila. Colored vertex. Vertex colors are not visible in MAX so you just have to have faith in the color, export the .xmf mesh file and load it all up in the Previewer. The vertex colors are activated per material vs. per mesh so please refer to the Previewer section of this doc for more info.

NOTE: There is a runtime cost of having one vertex color blend into another vertex color (as opposed to blending from color to no color) so beware and use vertex color blending sparingly.

1.b.2 Animation in Accessories?

YES! For more on animation, go to section 1.g.



1.b.3 Building and Hierarchy

Your mesh should not be parented or linked to any bones in the scene. However, they should be weighted to bones in the scene.

Once again: No to parented or linked. Yes to weighted.

If you want portions of your Accessory to animate and you want to see the mesh animate, you should weight the mesh to the appropriate bone in the Accessory skeleton. You will have to do this anyway for proper exporting of the mesh.


1.c Mapping Your Mesh


Texture mapping in any 3D program is an art all its own. However, there are a few IMVU specific things that you ought to know before you can export.

1.c.1 One Multi-Sub Material

If you are using MAX, you may only have one material on your model. This material can contain as many sub-materials as you like and can therefore be a “Multi-Sub” material. If you are using another 3D program, it is likely that you will have to have separate top level materials. This may result in your needing to have more meshes than described in this document.



1.c.2 Multi-Sub Material naming convention

What follows is from the IMVU Developers forum:

“When creating your materials for IMVU products, you must follow a simple numerical naming convention in order for your textures to show up in the previewer. Each material name must contain a bracketed number at the end of the name.

For example, FrogTexture [2]

The number contained in the brackets is always one number less than the material index in MAX. Therefore, every time you have a material in index 1 in MAX, that material's name must contain [0] at the end of its name. If the index is 6, the convention is [5]. If the material is 10, the convention is [9] and so on. It is actually pretty easy once you know what to do. It is also easy to forget if you've never done it before. Very easy.” (see fig 1.3)

Another thing to consider when naming your sub-materials is that they need to be consecutively numbered. You cannot have four sub-materials number [0], [2], [7], [22]. If you have four sub-materials, those materials must be numbered [0], [1], [2], [3]. Otherwise, you will end up with a product that will eventually not load. (see fig 1.3)



Fig 1.3 – Example of Material Editor and Sub-Material layout from MAX

1.c.3 Alpha

You can use both Cutout and Alpha blending in IMVU. Just add an opacity map to your material in MAX then, in the Previewer, you can choose the alpha setting you want.



1.c.4 HIGHLY Recommended Texture Guidelines

IMVU imposes only a limited budget on your texture usage: Any texture sized larger than 512 pixels on a side gets automatically reduced to 512 pixels on that side or lower. We do recommend the following guidelines to providing your customers with a decent IMVU experience.



  • All textures are required to be powers of 2 along a given side.

  • No texture should be greater than 512x512 pixels (this is actually a very helpful guideline as the larger your texture, the worse it looks in the IMVU window. This is due to IMVU having to cram all of your texture information into just a few pixels. Better to play it safe and keep your texture small and, surprisingly, more legible)

  • In the IMVU rendering engine, it is far better to have many small textures rather than one big texture. This runs contrary to many other engines wherein puzzle-like texture collages are used to save rendering budget.

  • Although we haven't hit a tiling limit yet, it is recommended that you keep your tiling down to 40 or so times.

  • .jpg is the file type of choice. There are a plethora of file types that we support but we have found .jpg to be both the best tasting and most filling.

1.c.5 Ambient Color

It is possible to dilute the color of your sub-material using its embedded ambient color setting. To be clear, this is the ambient color setting that is actually part of the sub-material and NOT the Scene ambient.

IMVU exports the ambient color that you can't see in your 3D program so, when you load your sub-material file in the previewer, you may be startled to see that your once bright and happy colors are now grey and sullen. The fix is simple: every time you create a new sub-material, make sure all of the sub-material's light settings are set to pure white. Pure white = no ambient interference. (see fig 1.4)

Fig 1.4 – Change the material colors to WHITE in order to avoid dull textures in IMVU.


1.d Animate your Accessory


Accessories with animations make IMVU come alive. However, this is not the time or place for an in depth discussion on how to animate in your 3D program. Rather, let's just say that if you know or can learn how to animate, you can make some really killer Accessories. By “animate” I am referring to both skeletal and morph animation. Skeletal animation refers to translating or rotating a bone that has vertices weighted to it over a linear timeline. Morph animation refers to playing one or a series of morph targets over a linear timeline. For example, if I wanted to animate an avatar flexing his bicep, I would use skeletal animation to actually move the bones (and thereby the mesh) to the right spot and then use a morph target to scale the bicep portion of the mesh.

1.d.1 Action Files

An Action file is what is played when anything in IMVU is animated. There are two levels of Accessory Action file, an Idle (or constant) Action and a Triggerable Action. When building a Accessory animation meant for a triggerable Action file, it is important to remember that you can use the Loop Frame functionality in the previewer to add length and life to your animation. For example, it may not be necessary to export an animation that includes, say, a slow, bobbing motion over and over. Rather, you may be able to simply loop one bob over and over again in the Previewer. This will help keep your Accessory animation file size way down but still get the desired effect. For more on Action files, please refer to section 3.g of this doc.

In regards to skeletal animation, the longer your animation, the larger your exported animation file will be and therefore the overall size of your Accessory will be higher. The same holds true for morph animation with the additional concern of the more morph targets you have in your exported file, the larger your file will be. But don't sweat it – have fun and create your vision. The Greeny Baby Dragon by IMVU is only @83k and it contains several skeletal animations.

1.e Smoothing Groups

NOTE: In order to avoid geometrical looking meshes in IMVU, it is important to make sure that all of the smoothing groups for a given mesh are the same across all polygons. To set the smoothing groups, select your geometry in a sub-object mode (faces, polygons, etc.) and go to the smoothing groups section of the Polygon Parameters panel. Note the rows of consecutive numbers. If you cannot see a number on a given square, then it is active and not the only number active. Click on all of the unseen numbers until you can see them all. Then, choose the number that you wish your smoothing group to be (any number is fine as long as all of your geometry is the same number).


Fig 1.5 – Incorrect looking Smoothing Groups Correct looking Smoothing Groups


1.f Weight your Mesh


The term “weighting” a mesh refers to the act of attaching a bone's influence to a particular vertex. Weighting a mesh can be as much of an art as painting a texture, mapping that texture or building the mesh itself. Though in some cases it is quite simple, it often requires patience and skill, as sloppy jobs are immediately evident. The two major weighting modifiers in MAX are called Skin and Physique. Both modifiers now ship with MAX 7 while Physique requires a license for versions 6 and below. Each modifier has their strengths and weaknesses. Namely, Skin is the best for weighting any non-organic mesh. Skin's envelope system is super fast and not as error prone as Physique. Physique, on the other hand, works much better for organic meshes like avatars or puppies. I love puppies.

For the most part, Accessory weighting will be done in Skin so I will briefly describe how it’s done here.



1.f.1 Weighting using Skin

First up, select your mesh and apply a Skin modifier to the top of the stack. Within the Skin modifier, click the “add” button and add AttachmentNode to the bone list. Now click the big button labeled “Edit Envelopes”. Check the Vertices box and uncheck the envelopes and Cross Sections boxes. In the veiwport, click and drag over all of the vertices in your mesh to select them. Back in the Skin Parameters menu, scroll down to Weight Properties and uncheck the Normalize and Rigid Handles boxes. Then check the Rigid box and drag the Abs. Effect arrows to the numeric value to 1.0. Unclick the big Edit Envelopes button and, voila, your mesh is now weighted. (see fig 1.4)



Fig 1.6 The Skin Modifier Menu



1.f.2 Weighting using Physique

The Physiquing process is too complex to cover here. Try looking online for how to use Physique if you are interested. One big tip, though, will save you hours of wasted time. When you apply Physique, it offsets your mesh ever so slightly. So, when you are ready to export your mesh, remember to turn the Physique modifier off. To be clear, do NOT delete Physique – just turn it off by clicking the little light bulb next to the modifier. The IMVU exporter will still export the vertex weighting values.



2.a Export the Skeleton, Mesh,Material and Animation files


Once you have a fully weighted, fully mapped mesh, you are ready to export. At the end of the export process you will need a skeleton file, a mesh file, and a material file. Optionally, you will have animation files. Remember, when exporting, you must manually type in the file extension or you will end up exporting the binary version of the file – which is unusable in the previewer.
NOTE: Sometimes, your weighting modifier will actually move the vertices of your mesh!! In order to avoid this, simply turn off your weighting modifier. Do not delete it but turn it off using the light bulb icon in the stack.
Here are the steps to export:

  1. Select AttachmentRoot (ALWAYS select the root node of a skeleton when exporting a .xsf file). Choose Export in the file menu. Scroll down to the .xsf file format, name your skeleton, click save and just hit next/finish until there are no more Cal3D windows visible.

  2. Now select your mesh (it should turn white in wireframe mode), choose Export, scroll to the .xmf file format, name your mesh file, click save, choose the skeleton file you just exported and click next/finish until there are no Cal3D windows visible.

  3. Drum roll please…. NOW select nothing, choose Export, scroll to the .xrf file format, name your material file, choose the material you named earlier (example: Glasses [0]) and click next/finish until there are no Cal3D windows visible. You need to repeat step 3 for every material in your Multi-Sub. This means that for every material you want to actually have show up in IMVU, you need a corresponding .xrf, or material, file.

Woohoo!! You’re all exported and what not!!!
2.a.1 Export the skeleton
Select AttachmentRoot (ALWAYS select the root node of a skeleton when exporting a .xsf file). Choose Export in the file menu. Scroll down to the .xsf file format, name your skeleton and remember to manually type the .xsf at the end of the name, and click next. The Cal3D skeleton export window appears. Within this window, you will see every asset in your scene that lives within the hierarchy of the master skeleton node sitting beside a checkbox and an icon. The icons are more or less meaningless to this process but the checkboxes are relevant. Anything that has an actual checked box beside it is exported within the skeleton file. Click Finish to complete the export process. Woohoo! You have just exported a skeleton file for your Accessory.
VERY IMPORTANT NOTE: Every time bones are added to or deleted from the skeleton and the skeleton file is re-exported and reloaded into the previewer, all of the assets that referred to the old skeleton need to be re-exported and reloaded. This is because your skeleton file is the base on which everything else hinges. Once the skeleton is changed, all of the other assets are now referencing a skeleton that no longer exists and your product will no longer work. Your material files do not refer to the skeleton file and therefore do not need to be re-exported. WHEW!
2.a.2 Export the Mesh

The Mesh file needs to be exported AFTER the skeleton file as the skeleton is referenced in the Mesh export process. It is possible to have multiple Mesh files in one Accessory. If your Accessory uses multiple skeletal animations, you will no doubt be exporting multiple .xmf files. Just how many you can use has not been tested so play away.

NOTE: Sometimes, your weighting modifier will actually move the vertices of your mesh!! In order to avoid this, simply turn off your weighting modifier. Do not delete it but turn it off using the light bulb icon.

In order to export your Mesh file, select the mesh in question and choose Export in the file menu. Scroll to the .xmf file format, name your file (remembering to manually type in the .xmf at the end of the name), and click save. In the Cal3D window that appears, you will be prompted to supply a skeleton/.xsf file with which this mesh is weighted. Browse to the skeleton file you just created and then click next/finish until there are no Cal3D windows visible. You just exported a Mesh file. Look what you did!


NOTE: If your Accessory has a morph animation, you must have the morph targets named properly and parented to the mesh file that is going to morph. Also, the morpher modifier needs to be underneath the weighting modifier. See section 2.d on proper morph target naming and export.
2.a.3 Export the Skeletal Animation file

Your Accessory does not need an animation file to work in IMVU. It only needs an animation file if you want it to....well...animate. Heh. The animation file needs to be exported AFTER the skeleton file as the skeleton is referenced in the Animation export process.

NOTE: In order to have multiple skeletal and/or morph animations in your Accessory, you can optionally export only those bones that will animate the desired mesh.

In order to export your Animation file, select AttachmentRoot and choose Export in the file menu. Scroll to the .xaf file format, name your file (remembering to manually type in the .xaf at the end of the name) and click Save. In the Cal3D window that appears, you will be prompted to supply a skeleton/.xsf file. Browse to the skeleton file you just created and then click next. The Cal3D window will then show you a list of all of the bones/nodes in the scene with check boxes next to them. You only need to export the bones/nodes that actually animate so uncheck those that are unnecessary.

Step 3 of the Cal3D animation exporter is where you verify the actual time values of the animation. Check that the start and end frame numbers match what you intended to export (they usually do), and make sure the frames per second is set to 30 (it usually is). Click finish. You just exported an animation file! We're so proud of you.
2.a.4 Export the Morph Animation file

Your Accessory does not need a morph file to work in IMVU. It needs a morph file if you want it to play a morph animation. The morph file can be exported at any time. The morph file simply contains the morph names and value change percentages over time.

To get your file ready for Morph export, the file needs to be set up a certain way. The actual morph set up is the same as usual (with copies of your mesh acting as your morph targets), but the actual morpher modifier needs to be just under the weighting modifier. Also, your morph targets need to be parented to your mesh (the mesh that is actually going to morph at runtime).

The morph targets have a naming convention that dictates what kind of morph they are. This naming convention must be used or your morphs will not play back in IMVU. An example of a properly named morph target is leftBlink.Clamped where the .Clamped suffix is the morph type. The prefix of the name can be anything you like. Here is a breakdown of what the four morph types are and what they mean:

.Clamped – allows multiple morph animations to affect the channel but clamps the sum of their effects to 100%

.Averaged – allows mutlipe morph animations to affect the channel, averages the result.

.Exclusive – allows only one morph animations (the most recent one applied) to affect the channel, no cap on value (ie allows values greater than 100%)

.Additive – allows multiple animations to affect the channel, values are added together.

In order to export your Morph file, select the mesh file that has the morpher modifier at the top of the stack, choose Export from the file menu, browse to the .xpf file format, name your file (remembering to manually type in the .xpf at the end of the name) and click Save. A Cal3D window appears with information regarding the actual time values of the morph animation. Check that the start and end frame numbers match what you intended to export, and make sure the frames per second is set to 30. Click finish. You just exported a morph animation file! You're doing ever so nicely!!

2.a.5 Export the Material files

The Material files in the IMVU process are not textures themselves. They are the link between the texture and the mesh that live in your final CFL product. Basically, the Material file tells the mesh that a specific texture (or textures) is meant to be applied to the material ID number embedded in the mesh. This material ID number should be included in the sub-material name in MAX.

The Material files can be exported at any time.

In order to export the Material files, make sure you have nothing selected, choose export from the file menu, name the file (remembering to manually type in the .xrf at the end of the name) and click Save. The Cal3D window that appears shoes you a list of the materials and sub-materials in the scene – including the sub-materials you had named back when you were building. Choose your sub-material name from this list and then click next. The following Cal3D window is your opportunity to verify that this Material does indeed contain the texture(s) you wish to export. Once verified, click Finish.

You need to repeat this process for every multi-sub in your MAX material. This means that for every material you want to actually have show up in IMVU, you need a corresponding .xrf, or Material, file. Ok...are you ready? You done been exported!!!

3.a Catalog Shot


While you still have MAX open, this is a good time to take your catalog snapshots. I usually take them in Perspective mode with a completely white background and all of the environmental lighting turned off/set to white – this makes the images nice and crisp when they are small. Taking your catalog shots in MAX also allows you to quickly swap textures while keeping the mesh in the exact same place. This is handy when you want to run an action in Photoshop to reduce all of the snaps of a given mesh to the same proportion.
Once you have your source, it needs to be reduced to 100x80 in order to fit in the IMVU catalog. The submission process automatically reduces any catalog image to 100x80 but the result is never as nice as what you can do yourself. The final catalog shot should be saved as a .gif file with no more than 64 characters in its name.



Download 81.13 Kb.

Share with your friends:
  1   2   3   4




The database is protected by copyright ©ininet.org 2024
send message

    Main page