by duststorm » Mon Apr 30, 2012 8:03 pm
To clarify things, you are experiencing those issues in your 3D renderer, right (so in openscenegraph).
In Blender everything works as it should, correct?
Probably something is configured wrong in Blender, making the exporter you are using do things you don't want.
The best thing to do is trying to understand what settings the blender OSG exporter needs for things to work. Best to look for manuals or help files, or ask help in the community forums of OSG.
I'm not familiar with OSG or its exporter (only the Ogre mesh exporter)
What I can tell you that it is pretty reasonable that you have to solve a few problems before being able to export complex models properly using any blender exporter. The main problem is that firstly these exporters sometimes don't have all features blender has, often because the formats or engines they export to have these limitations (this could be things like: not having multiple texture coordinates, having strict rules on skeleton formats, or maximum bone counts, not allowing certain texture formats, ...) These are the things you need to know about the engine or exporter you are using in order to make good decisions.
Some general things I would consider (these are general remarks for realtime use):
- Try merging everything as one mesh, both clothes and body, remove all geometry that is not needed. Maybe OSG only supports animating of one mesh.
- Try limiting the number of different materials used (for example by remapping uv coordinates to one texture). The more materials in one model the higher the batchcount will be the slower your framerate. (and some engines might even not support multiple materials)
- Be careful with transparency. Don't assume it will just work, figure out how to make it work on your specific engine.
- Mind the poly count. If you are going to be using the MH model in a complex scene or together with a lot of characters, don't just use the base mesh. It's too high poly. Try using one of the proxies instead. Try to stick at least below 10.000 polygons (that is tris, a quad consists of two tris. Since MH meshes only use quads you need to multiply the count by two to know the polycount in the engine)
I suggest to read up on the exporter you're using and what OSG supports, and what blender features the exporter translates into OSG features. If you're new to using that particular exporter it's not such a good idea to start with a MH mesh. Since MH uses a lot of blender features it makes it hard to figure out how to make it work with the exporter. First experiment with a very simple model, animate it, and move on from there.
For example, the old Ogre exporter used vertex groups as submeshes (which can have a different material) for a mesh. But MH uses vertex groups in blender just to group vertexes that belong to a part on the body (this is twhat it was intended for in blender). Just exporting a MH mesh without reducing the vertex groups would lead to a bad export because the mesh had way too many submeshes, above the maximum allowed in Ogre. Same for the skeleton: you cannot use the MH or rigify rigs because they have too many bones. In Ogre, bone count is limited I believe to 256.
These are things you need to be mindful of.
Next to trying to understand the exporter better, try following my general advice and see if it solves your problems.
Without knowing the details, a possibility why exporting the clothes doesn't work with animation could be: you export separate meshes which are rigged to the same armature (this is how the MH setup is in blender) Maybe OSG expects one mesh to be coupled with one armature. And by exporting them separately you actually have two meshes in OSG with separate skeletons, which you need to animate separately.
So, just try merging the body and clothes into one mesh, apply one single armature modifier to the whole, then export it to OSG.
Just remember that blender has some very specific features that only work in blender internally, and which can differ a lot from any other engine. Any blender script can only export a specific subset of these blender settings, and sometimes does this in different ways than you would initially expect. One thing is for sure: there exists no blender exporter that makes an exact 1:1 export of blender data to another program. The blender format is just too specific for that. That's why it's important to read up on what features are available in the tool you're exporting to, and how your exporter maps these features from blender features to the exported format.
Like I said, I cannot be very specific since I don't know OSG. I can only give you general pointers. Try the OSG community if you need more specific help.
MakeHuman™ developer