Saturday, October 9, 2010

How to create animated sculpties for OpenSim in Blender part 1



Prerequisites: This tutorial assumes you know how to use Blender 2.49b with the Primstar plugin and OpenSim.


I found very little information on how to create animated sculpties in Blender in the Internet. What we need are sculpty maps for every frame of animation and an lsl script to change those maps in a loop.  In this part of this tutorial we will create the sculpty maps in Blender with the Primstar plugin.

I will not teach you how to model or rig meshes. I assume you already have a fully rigged sculpty mesh.



Create the sculpty in Blender/Primstar



     1. Select the object you wish to animate and copy (shift-d) in Blender Object mode.
     2. Move the copy to another layer
     3. Go to Blender pose mode and pose the copy
     4. Apply the armature modifier. The armature modifier is in the editing buttons group, modifier panel.



     5. Clear your transformations to reset the original. Blender pose mode Menu-Pose-Clear-Clear User Transform.



Notice that we did not use frames. The animated frames are separate object copies of the original sculptie mesh.





Warning: Do not move/transform the copy in Blender Object mode or the center will change. Change it only in Blender Pose Mode or Edit mode.

The copy will have the original UV image assigned to it. We will need to create new UV images for each copy.

     6. Select each new object
     7. Go to Blender Edit mode
     8. Select all vertices of the copy
     9. In the Blender UV/Image editor click Image-New. Create a 64x64 image and save.




Unfortunately this will be a labor intensive endevour if you use a lot of frames. It will also be prone to error. I hope someone could come up with an automatic way to do this.

Check your sculpty




Make sure the following requirements for baking multi-prim sculpties are followed:

     10. Go to Blender Object mode
     11. Select all objects
     12. Menu-Clear/Apply-Apply Scale/Rotation to ObData
     13. Check if you parented the original and copies to the root mesh. You can check this in the Blender Outliner window. There should only be the root mesh listed at the highest node of the tree.
     14. If you mirrored any of the parts then mirror the UV as well in the Blender UV/Image. Otherwise your sculpty will be inside out in OpenSim.
          a. Select the object mesh
          b. Select all vertices so that the UVs menu item will appear in the UV/Image editor
          c. Go to the UV/Image editor and select all the UV vertices. Your UV grid should be colored yellow.
          d. Click UV/Image editor-UVs-Mirror-X Axis (or Y Axis depending on how you mirrored the object mesh)

Bake the Sculpt Meshes

     1. Go to Blender Object mode
     2. Select all objects (including static parts)
     3. Blender top menu-Render-Bake Sculpt Meshes



     4. Check "Keep Center"




     5. Bake

Save the sculpty as an SL LSL file

     1. Click on Blender top menu-File-Export-Second Life LSL (to dir)

You should have an lsl file and the sculpt maps.

Note that I did not included the textures of the sculpty. For information on texturing sculpty meshes in Primstar see  http://blog.machinimatrix.org/2010/03/10/sculpted-prims-ii-blenderjass2/.

Part two will deal with rezzing the animated sculpty in OpenSim.

Downloads:

The example here uses the Alex horse rig by Wayne Dixon which is licensed under the Creative Commons Attribution 2.5 Australia
http://creativecommons.org/licenses/by/2.5/au/ and can be downloaded at http://www.blendswap.com/3D-models/animals/alex-2-5-2/.


Horse mesh by Roel Cantada copyright 2010.
Creative Commons Attribution-ShareAlike 3.0 Philippines 



http://www.mediafire.com/file/2jdvjrtwlczjtvq/animsculptkabayo.blend.zip (1.1 MB)

2 comments:

Anonymous said...

Hi,
your horse is walking pace but really impressive nonetheless :)

Erasme said...

Thank you for sharing.
I'll spread the news. Many of us are much interested in animated sculpts!

 
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.