Difference between revisions of "Mesh/Exporting a mesh from Blender"

From Second Life Wiki
Jump to: navigation, search
(Tutorial links)
m (LOD meshes (with Blender 2.49): Typo, added a line feed.)
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Multi-lang}}
 
{{Multi-lang}}
 
{{Navbox/Mesh|tools}}
 
{{Navbox/Mesh|tools}}
== Video tutorial ==
+
== Basic workflow ==
 +
=== Create your model===
  
Check out this '''[http://blog.machinimatrix.org/3d-creation/blender-meshes-trail/ 3-part Blender tutorial for static meshes.]'''
+
====Some hints:====
 
+
There's also a detailed Blender rigging tutorial here: '''BlanderMan rigging tutorial [http://vimeo.com/5067809 part 1-1], [http://vimeo.com/5068722 part 1-2], [http://vimeo.com/5070359 part 2]'''.
+
 
+
=== Simple tube avatar ===
+
{{KBvideo|3JHWDdrIeD0|640|505|type=youtube}}
+
 
+
=== Mancandy avatar ===
+
{{KBvideo|8w88B7F7v_k|640|505|type=youtube}}
+
 
+
== Basic workflow ==
+
=== Create a box (or monkey or teapot or hippo) ===
+
=== Reduce polygons ===
+
  
The easiest way to reduce the polygon count of your mesh is via the "Poly Reducer" script, accessible via the Mesh -> Scripts -> Poly Reducer. This script reduces the number of polygons in the model without affecting its shape, much like the "Decimate" tool, but also maintains the mesh's UV mapping.
+
# Take care to create low polygon meshes (as few verts as possible)
 +
# Use no more than 8 face textures (8 materials assignments)
 +
# Avoid intersecting faces (unless intersections are intended)
 +
# Avoid duplicate vertices (unless you want to use the split modifier)
 +
# Avoid creating more than 21844 tris per texture face
 +
# Avoid creating extremely small polygons (< 0.1 cm edge length)
 +
# Did i mention you should create low poly models only ? an avatar with > 10000 faces starts getting too heavy ...
 +
# shoes with 30000 polygons per shoe have 20 times too much faces. really!!! Avoid that!
 +
# The same is true for hair.
 +
# Make low polygon meshes !!!
  
To quickly and easily produce a set of LOD meshes:
+
====LOD meshes (with Blender 2.49)====
 
# Make sure your blender file is saved
 
# Make sure your blender file is saved
 
# Export your full-detail mesh to COLLADA
 
# Export your full-detail mesh to COLLADA
Line 33: Line 31:
  
 
Unfortunately the Poly Reducer script is currently only available for version 2.4x of Blender. The "Decimate" modifier is a serviceable substitute but the downside is that you'll need to redo the UV map for each LOD level.
 
Unfortunately the Poly Reducer script is currently only available for version 2.4x of Blender. The "Decimate" modifier is a serviceable substitute but the downside is that you'll need to redo the UV map for each LOD level.
 +
 +
According to:[http://blender.stackexchange.com/questions/14501/poly-reducer-issues-in-blender-2-71 "Poly Reducer issues in Blender 2.71" in blender stackexchange], The UV mapping issues have been solved in recent versions.
 +
[https://wiki.blender.org/index.php/Doc:2.4/Manual/Modifiers/Generate/Decimate Decimate Modifier on blender wiki page].
  
 
=== Apply textures ===
 
=== Apply textures ===
=== Scale to meters ===
 
Scaling is somewhat arbitrary in Blender 2.49. In principle you just have to know how the mapping is between your 3D program (Blender) and the target environment (Second Life). Then all you need to do is to work in the correct scale. You even can later rescale your model in your target system.
 
  
So, what is the issue with Blender 2.49 ? It is all so simple that the Collada Exporter for Blender assumes that one Measurement Unit is mapped to one real life centimeter. But the common expectation in Second Life is that one Measurement Unit is mapped to 1 Second Life Meter. Unfortunately this missmatch very often leads to the import of "tiny objects". The common fix is to scale up the models in Blender 2.49 by a factor of 100.
+
=== Export to COLLADA ===
 +
You find the Blender Collada exporter here:
  
But there is a nicer fix, which adjust the Collada Exporter to behave according to our expectations.
+
File -> Export -> Collada (Default)
See this video to find out, how you can fix the Measurement missmatch between Blender-2.49b and Second Life once and for ever:
+
  
{{KBvideo|18354783|640|370|type=vimeo}}
+
=== Import to SL ===
 +
This is a tutorial that was originally made for Avastar (a blender addon) but most of the tutorial also fits to arbitrary mesh imports to second Life. So here it is:
 +
{{KBvideo|u575wa3knUM|640|505|type=youtube}}
  
If you don't want to watch the entire video:
+
== Best Practices ==
 +
[http://blogs.secondlife.com/message/460796#41935 Forum thread on optimizing your mesh in Blender for Second Life]
  
find the file <blender script dir>\bpymodules\colladaImEx\translator.py and change these two lines:
+
[http://blogs.secondlife.com/message/552002#552002 Forum thread on installing Blender]
 +
=== Bones and rigging ===
 +
* '''BVH Animations:'''  It's possible to import one of the default BVH animations that can be found linked in the header of the [[Internal_Animations#User-playable_animations]]. This will get you a slightly inaccurate skeleton to work from. Please note that the bones are all the wrong names for mesh import, as mentioned in [[Mesh/Troubleshooting#Rigging]].
  
daeAsset.unit.name = 'centimeter'
+
* '''Joints positions:''' [http://blogs.secondlife.com/message/534554#52305 Forum tip for exporting joint positions with Blender]
daeAsset.unit.meter = '0.01'
+
  
to
+
* '''Tool tip''': For rigged mesh creation and animation check out [http://blog.machinimatrix.org/Avastar Avastar] this addon might be of help for you (commercial tool).
  
daeAsset.unit.name = 'meter'
+
=== Gotchas and workarounds ===
daeAsset.unit.meter = '1.00'
+
  
To find the scripts directory, do Help > System Information in blender, and look in the text file for "Default dir for scripts:". The path for me is:
+
=== Optimization techniques ===
C:\Documents and Settings\tapple\Application Data\Blender Foundation\Blender\.blender\scripts
+
and thus the file is:
+
C:\Documents and Settings\tapple\Application Data\Blender Foundation\Blender\.blender\scripts\bpymodules\colladaImEx\translator.py
+
  
 +
== Tutorial links ==
 +
  ==  Blender 2.5x/2.6x specific ==
  
Note that this fix is not needed in Blender 2.5x.
+
=== Tutorials available in HD ===
  
=== Export to COLLADA ===
+
[http://blog.machinimatrix.org/category/mesh/quests/coffee-cups/ Coffee Cup Tutorials (basics)]
=== Import to SL ===
+
  
== Best Practices ==
+
[https://www.youtube.com/playlist?list=PLDF8295B062C9BB2F Shoe Quest (making a shoe with Blender)]
[http://blogs.secondlife.com/message/460796#41935 Forum thread on optimizing your mesh in Blender for Second Life]
+
  
[http://blogs.secondlife.com/message/552002#552002 Forum thread on installing Blender]
+
[http://blog.machinimatrix.org/optimizing-meshes/ Mesh for sculpted prim creators]
=== Bones and rigging ===
+
It's possible to import one of the default BVH animations that can be found linked in the header of the [[Internal_Animations#User-playable_animations]]. This will get you a slightly inaccurate skeleton to work from.
+
  
Please note that the bones are all the wrong names for mesh import, as mentioned in [[Mesh/Troubleshooting#Rigging]].
+
[https://www.youtube.com/playlist?list=PL7541C8D8005D6E53 Avacademy (basic insights to mesh)]
  
[http://blogs.secondlife.com/message/534554#52305 Forum tip for exporting joint positions with Blender]
+
[https://www.youtube.com/playlist?list=PL0A0B36DC6D404D95 Tip Top Tool tips (medium level tips for blender)]
  
=== Gotchas and workarounds ===
 
  
=== Optimization techniques ===
+
[http://www.youtube.com/watch?v=6LTWzw9ipyQ Blender 2.49/2.59 Workflow]
  
== Tutorial links ==
+
[http://www.youtube.com/playlist?list=PL11D6E99BB51A2BB2 Second Life Rigged Clothing Series]
  ==  Blender 2.5x specefic ==
+
  
http://blog.machinimatrix.org/3d-creation/blender-meshes-trail/
+
[http://www.youtube.com/user/ashasekayi#grid/user/2A3AF00B41F652ED SL Mesh Video Tutorial Playlist]
  
[http://www.youtube.com/playlist?list=PL11D6E99BB51A2BB2 Second Life Rigged Clothing Series] (available on HD)
+
[http://www.youtube.com/watch?v=yow60SivXtw How to Use an Offset Pivot Point With SL Mesh]
  
[http://www.youtube.com/watch?v=FF8D52BjBw8 How to Patch a Blender Python Add-on] (available on HD)
+
[http://www.youtube.com/watch?v=8FBCxIigIWw How to Install Blender and Blender Addon Scripts]
  
[http://www.youtube.com/watch?v=8FBCxIigIWw How to Install Blender and Blender Addon Scripts] (available on HD)
+
[http://www.youtube.com/watch?v=Kh6RBvoGo-E How to Use the New Bone Weight Copy 2.5x Script]
  
[http://www.youtube.com/watch?v=Kh6RBvoGo-E How to Use the New Bone Weight Copy 2.5x Script] (available on HD)
+
=== More tutorials ===
  
 
http://blendernewbies.blogspot.com/search/label/Blender%202.5
 
http://blendernewbies.blogspot.com/search/label/Blender%202.5
Line 117: Line 112:
  
 
http://www.3dbuzz.com/vbforum/showthread.php?188849-Blender-Fundamentals-First-drop-of-videos-now-available-to-the-public
 
http://www.3dbuzz.com/vbforum/showthread.php?188849-Blender-Fundamentals-First-drop-of-videos-now-available-to-the-public
 +
 +
http://orionstaff.blog84.fc2.com/blog-entry-1566.html
  
 
  ==  Blender 2.5x SL Mesh Classes ==
 
  ==  Blender 2.5x SL Mesh Classes ==
Line 124: Line 121:
 
*Location: Builder's Brewery Pavilion
 
*Location: Builder's Brewery Pavilion
 
*Time: Saturdays at 10 AM SLT
 
*Time: Saturdays at 10 AM SLT
 +
 +
==  Blender 2.4x specific (legacy) ==
 +
== Video tutorial ==
 +
 +
http://blog.machinimatrix.org/3d-creation/blender-meshes-trail/
 +
'''BlanderMan rigging tutorial [http://vimeo.com/5067809 part 1-1], [http://vimeo.com/5068722 part 1-2], [http://vimeo.com/5070359 part 2]'''.
 +
 +
=== Simple tube avatar ===
 +
{{KBvideo|3JHWDdrIeD0|640|505|type=youtube}}
 +
 +
=== Mancandy avatar ===
 +
{{KBvideo|8w88B7F7v_k|640|505|type=youtube}}
 +
 +
=== Scale to meters ===
 +
Scaling is somewhat arbitrary in Blender 2.49. In principle you just have to know how the mapping is between your 3D program (Blender) and the target environment (Second Life). Then all you need to do is to work in the correct scale. You even can later rescale your model in your target system.
 +
 +
So, what is the issue with Blender 2.49 ? It is all so simple that the Collada Exporter for Blender assumes that one Measurement Unit is mapped to one real life centimeter. But the common expectation in Second Life is that one Measurement Unit is mapped to 1 Second Life Meter. Unfortunately this missmatch very often leads to the import of "tiny objects". The common fix is to scale up the models in Blender 2.49 by a factor of 100.
 +
 +
But there is a nicer fix, which adjust the Collada Exporter to behave according to our expectations.
 +
See this video to find out, how you can fix the Measurement missmatch between Blender-2.49b and Second Life once and for ever:
 +
 +
{{KBvideo|18354783|640|370|type=vimeo}}
 +
 +
If you don't want to watch the entire video:
 +
 +
find the file <blender script dir>\bpymodules\colladaImEx\translator.py and change these two lines:
 +
 +
daeAsset.unit.name = 'centimeter'
 +
daeAsset.unit.meter = '0.01'
 +
 +
to
 +
 +
daeAsset.unit.name = 'meter'
 +
daeAsset.unit.meter = '1.00'
 +
 +
To find the scripts directory, do Help > System Information in blender, and look in the text file for "Default dir for scripts:". The path for me is:
 +
C:\Documents and Settings\tapple\Application Data\Blender Foundation\Blender\.blender\scripts
 +
and thus the file is:
 +
C:\Documents and Settings\tapple\Application Data\Blender Foundation\Blender\.blender\scripts\bpymodules\colladaImEx\translator.py
 +
 +
 +
Note that this fix is not needed in Blender 2.5x.

Latest revision as of 11:06, 17 March 2016

Basic workflow

Create your model

Some hints:

  1. Take care to create low polygon meshes (as few verts as possible)
  2. Use no more than 8 face textures (8 materials assignments)
  3. Avoid intersecting faces (unless intersections are intended)
  4. Avoid duplicate vertices (unless you want to use the split modifier)
  5. Avoid creating more than 21844 tris per texture face
  6. Avoid creating extremely small polygons (< 0.1 cm edge length)
  7. Did i mention you should create low poly models only ? an avatar with > 10000 faces starts getting too heavy ...
  8. shoes with 30000 polygons per shoe have 20 times too much faces. really!!! Avoid that!
  9. The same is true for hair.
  10. Make low polygon meshes !!!

LOD meshes (with Blender 2.49)

  1. Make sure your blender file is saved
  2. Export your full-detail mesh to COLLADA
  3. Run Poly Reducer with a poly reduce setting of 0.5 (to reduce your polygon count by half).
    • If you make any manual changes to tweak the resulting mesh, remember to update the UV map to match.
  4. Export your mesh to COLLADA; this will be the "medium" level of detail.
  5. Reload your original full-detail mesh. It's good to start from the full-detail mesh each time to prevent errors from accumulating, though this may not be a significant concern for simple meshes such as attachments.
  6. Run Poly Reducer with a poly reduce setting of 0.25 (to reduce your polygon count by three quarters).
  7. Export your mesh to COLLADA; this will be your "low" level of detail.
  8. Reload your original full-detail mesh.
  9. Run Poly Reducer with a poly reduce setting of 0.125 (to reduce your polygon count by seven eighths).
  10. Export your mesh to COLLADA; this will be your "lowest" level of detail. You may also want to use this mesh when defining your model's physics.

Unfortunately the Poly Reducer script is currently only available for version 2.4x of Blender. The "Decimate" modifier is a serviceable substitute but the downside is that you'll need to redo the UV map for each LOD level.

According to:"Poly Reducer issues in Blender 2.71" in blender stackexchange, The UV mapping issues have been solved in recent versions. Decimate Modifier on blender wiki page.

Apply textures

Export to COLLADA

You find the Blender Collada exporter here:

File -> Export -> Collada (Default)

Import to SL

This is a tutorial that was originally made for Avastar (a blender addon) but most of the tutorial also fits to arbitrary mesh imports to second Life. So here it is:

Best Practices

Forum thread on optimizing your mesh in Blender for Second Life

Forum thread on installing Blender

Bones and rigging

  • Tool tip: For rigged mesh creation and animation check out Avastar this addon might be of help for you (commercial tool).

Gotchas and workarounds

Optimization techniques

Tutorial links

 ==  Blender 2.5x/2.6x specific ==

Tutorials available in HD

Coffee Cup Tutorials (basics)

Shoe Quest (making a shoe with Blender)

Mesh for sculpted prim creators

Avacademy (basic insights to mesh)

Tip Top Tool tips (medium level tips for blender)


Blender 2.49/2.59 Workflow

Second Life Rigged Clothing Series

SL Mesh Video Tutorial Playlist

How to Use an Offset Pivot Point With SL Mesh

How to Install Blender and Blender Addon Scripts

How to Use the New Bone Weight Copy 2.5x Script

More tutorials

http://blendernewbies.blogspot.com/search/label/Blender%202.5

http://www.blendercookie.com/tag/2-5/

http://www.blenderguru.com/whered-that-button-go/

http://totallyblended.com/New/?page_id=705

http://blendernerd.com/?cat=5

https://sites.google.com/site/satishgoda/blender

http://3d-synthesis.com/tutorialsenglish.html

http://www.youtube.com/user/super3boy (has been updating his tutorials for 2.5)

http://www.katsbits.com/tutorials/index.php

http://cogfilms.com/index.html

http://www.3dbuzz.com/vbforum/showthread.php?188849-Blender-Fundamentals-First-drop-of-videos-now-available-to-the-public

http://orionstaff.blog84.fc2.com/blog-entry-1566.html

==  Blender 2.5x SL Mesh Classes ==

Beginner SL Mesh Modeling Series

  • Class Level | Building: Beginner(2) | Blender: Beginner
  • Instructor: Ashasekayi Ra
  • Location: Builder's Brewery Pavilion
  • Time: Saturdays at 10 AM SLT

Blender 2.4x specific (legacy)

Video tutorial

http://blog.machinimatrix.org/3d-creation/blender-meshes-trail/ BlanderMan rigging tutorial part 1-1, part 1-2, part 2.

Simple tube avatar

Mancandy avatar

Scale to meters

Scaling is somewhat arbitrary in Blender 2.49. In principle you just have to know how the mapping is between your 3D program (Blender) and the target environment (Second Life). Then all you need to do is to work in the correct scale. You even can later rescale your model in your target system.

So, what is the issue with Blender 2.49 ? It is all so simple that the Collada Exporter for Blender assumes that one Measurement Unit is mapped to one real life centimeter. But the common expectation in Second Life is that one Measurement Unit is mapped to 1 Second Life Meter. Unfortunately this missmatch very often leads to the import of "tiny objects". The common fix is to scale up the models in Blender 2.49 by a factor of 100.

But there is a nicer fix, which adjust the Collada Exporter to behave according to our expectations. See this video to find out, how you can fix the Measurement missmatch between Blender-2.49b and Second Life once and for ever:

If you don't want to watch the entire video:

find the file <blender script dir>\bpymodules\colladaImEx\translator.py and change these two lines:

daeAsset.unit.name = 'centimeter'
daeAsset.unit.meter = '0.01'

to

daeAsset.unit.name = 'meter'
daeAsset.unit.meter = '1.00'

To find the scripts directory, do Help > System Information in blender, and look in the text file for "Default dir for scripts:". The path for me is:

C:\Documents and Settings\tapple\Application Data\Blender Foundation\Blender\.blender\scripts

and thus the file is:

C:\Documents and Settings\tapple\Application Data\Blender Foundation\Blender\.blender\scripts\bpymodules\colladaImEx\translator.py


Note that this fix is not needed in Blender 2.5x.