New-Media-Arts-New-Viewer-Avatar / OpenSim-Avatar

Research Results for the current default SL/OS viewer avatar.
Other
7 stars 1 forks source link

Rigged mesh Blender export, viewer import #2

Closed AdaRadius closed 1 year ago

AdaRadius commented 1 year ago

Export rigged mesh

Using the most recent Blender LTS version, at this date 3.6.0.

Some of these instructions are overkill. Much will be outdated within a year. I'll try to keep it updated.

I've found that it can be difficult to teach this to people who are not detail-oriented. Some of this doesn't make logical sense, because the viewer code is a mess and Blender does not have a great dae exporter.

Rigged Mesh import limitations: ~10K triangles per rigged mesh piece. Avoid intersecting faces. 8 materials, 21,844 triangles per material Avoid polygons < 0.1 cm edge length No more than 109-110 vertex weight bone groups per mesh piece. Textures do not upload with rigged mesh attachments.

Workflow Recommendations: 1) Make a new blend file labeled Export. Delete unused mesh, armatures, materials, images, shape keys, custom settings, lighting, UV maps. We don't always know what data is interfering with the data we're trying to export. Delete orphans.

2) All remaining data - mesh and one armature - should be visible in the scene. Armature with all bones visible, or at least all the bones used. There is no harm in having all the 159 bones visible. Only the vertex bone groups are counted in the 110 bone upload limitation. All mesh pieces you are uploading.

3) Set cursor to 0,0,0 (hotkey shift c). For armature and any separate mesh pieces, set origin to cursor..

4) Select all. If armature is facing front, looking down the Y axis, rotate 90 degrees on the Z axis. The armature should end up facing to your right (Blender front view), looking toward +X.

5) Select all: Object, Apply all transforms. Check each part to make sure rotation was applied.

6) With armature visible but not selected, select all the mesh

7} Export to dae. Settings (gear icon): Check boxes and settings: Main tab: Selection Only, Include Armatures, Global Orientation Apply. Forward Axis Y, Up Axis Z Geom tab: Triangulate, unless you've already triangulated in the 3D viewport. For clothing and mesh bodies it can be better to triangulate some quads manually and the rest via Face, Triangulate. The viewer will also triangulate on import but you may not like what it does.
Apply Modifiers: Viewport Transform: Matrix Arm tab: Deform Bones Only, Export to SL/OpenSim Extra tab: Use Blender Profile, Sort by Object Name. If we are using volume bone ("fitted") weighting or have edited the armature from its default, then Keep Bind Info is be a good idea - test to see what's currently working.

8) Inworld: Build, Upload Mesh Model For rigged mesh attachments, if I have not built LOD's in Blender, then Medium should be around half of high, Low, half of Medium, Lowest, 0. LODs will be in a separate article. No need for Physics settings, unless we are planning to rez this out instead of wearing it. Rigging: Check "Include Skin Weights" and leave "Include joint positions" blank unless: If the armature in blender was edited from the default, for weefolk or creatures, or animated machinery, for example, then check "Include joint positions". These features change from time to time, so you may need to test whether or not to check "Include joint positions". Right now, we need "Include Skin Weights" checked so the viewer knows to import the weights. The "Include joint positions" tells the viewer whether or not the Appearance sliders should work. Except for the skeleton morphs (height, thickness, bone length), which seem to work either way. Check the upload log for errors - LODs often need adjusting.

Last edited Ada Radius 2023-08-09

zadium commented 1 year ago

"2. Select all, rotate z 90 degrees" To rotate face to Y?

AdaRadius commented 1 year ago

"2. Select all, rotate z 90 degrees" To rotate face to Y?

Thank you! fixing.