Wednesday, January 8, 2014

Step by step tutorial for making a decorative object - Step 5. Scaling mesh and bone assignment in Milkshape

I read somewhere that TSRWS covers bone assignment.  But I always use Milkshape for bone assignment and export the file in wso format.

If you have not used Milkshape, you'd better set preference as follows for convenience.

File > Preferences....   then preference window opens.




I set Grid Size = 0.5 and Joint Size = 0.01.

And in Groups tab, uncheck "Auto Smooth".


Before getting started, make sure the Milkshape plugin of TSRWS has been installed in Milkshape folder.

Open Milkshape and import the wso file of the base object.   File > Import > TSRW Object
Save the file with a file name you like.

Next, import your mesh in obj format.   File > Import > Wavefront OBJ


In this case, cup&saucer mesh is too big.  So its size has to be reduced.
Select the groups 'cup', 'handle' and 'saucer' under Groups tab, and scale down it using Scale under Model tab. And move it to center on the ground using Move under Model tab.

I'd like to omit (again) the explanation about basic usage of Milkshape.


I scaled down this mesh like this.



There are two groups in the base object (utencil decor), Group 0 and 1.  Group 0 is its dropshadow, and Group 1 is the object itself.  You have to replace Group 1 with your own mesh.  Leave Group 0 as is for now.

I merged three groups of my cup&saucer.  To merge groups, select all groups you want to merge, and click Regroup button.



Select Group 1, and click Joint tab.  You can see '0xCD68F001' there.  This is a bone name.  All vertices in Group 1 are assigned to this bone.  The number, order and names of groups, and bone assignment in your object must be same as base object.  We are assigning the vertices in your mesh to this bone.

While selecting Group 1, click show button.  


You can see '0xCD68F001' and 100.  Then delete Group 1 and select your mesh (Regroup00) in Groups tab, and back to Joint tab.


Click Assign button to assign vertices to this bone.

When bone name and weight (100, in this case) is not shown and you already delete Group 1,


select 0xCD68F001 from the pulldown menu, and 


input '100' in the box for bone weight.


Most of the object in ts3 has this bone assignment pattern, i.e. 0xCD68F001 to all vertices of object part with 100% weight.   Some objects attached to wall or ceiling, such as wall lamps and ceiling lamps have no bone assigned, and other objects have two or more bones with various weight, such as teddy bear toy.




Now bone assignment is done.  Back to Groups tab, and select your mesh (Regroup00).  Input 'Group 1' in the box next to 'Rename' button, and click Rename.


This file is almost ready to export.  Before exporting, edit the dropshadow.


First, the dropshadow plane was too high for this cup&saucser.  So lowered it a bit.


To adjust the shape of dropshadow, we need its texture.  You can extract it with TSRWS.


In High level of detail under Mesh tab, click the line below Goup 0, and click "..." button.


Material Editor window will open.  Click 'Drop shadow atlas' and click Edit button.



In Image Editor, click 'Export' and save the image in dds format with a name you like such as "dropshadow".
This dropshadow image is common to all objects having dropshadow.   



Back to Milkshape.  Select Group0, and go to Materials tab, 


Click New button, and


click <none> button, and select the dropshadow image.


Click Assign button.  Now the dropshadow image is assigned to group 0.


Open Texture Coordinate Editor window.   (Window > Texture Coordinate Editor )


Select Group 0 from pulldown menu, and adjust scale (I used scale 0.6 for this image).

You can see the plane of group 0 being mapped over the top-left circle shadow.  



I moved the plane to one of light circles and scaled it up a bit.
You can edit it later.



All edit is done.  Save the file and export it in wso format.  File > Export >TSR Object

Next will be the last step of this tutorial.  (I hope)






1 comment:

  1. Let me say that I had no Idea I needed to assign Heigh and Weigh :o
    That's Awesome OMG!

    ReplyDelete