Re: [Maya2osg-users] Blend Shapes and Geometry Export
Status: Alpha
Brought to you by:
jtaibo
From: Javier T. <jav...@gm...> - 2011-05-24 15:01:32
|
Hi Peter, Thank you very much for this information. It is very valuable to me as I am just beginning to work on exporting blend shapes. I'm just taking a look at osgAnimation (never used it before) to see what it supports and how. Then I'll try to integrate the blend shape export in your code into Maya2OSG. I'll let you know how it's going. I appreciate very much all the effort you have done here. Cheers! On Tue, May 24, 2011 at 1:41 AM, Peter Wrobel <pp...@cg...> wrote: > Hi all, > > wanna give some information about the current geometry export and the > required steps to implement deformers like skinClusters and blendShapes. > We should also implement normal Maya Clusters, as they are a fast and > usefull Character utility. > > The current mesh exporter converts maya poly mesh into a VBO. Only > osg::DrawElementsUByte( osg::PrimitiveSet::TRIANGLES ) are supported > right now, all non triangle meshes get triangulated internally. > In this proces, Vertices with multiple Normals ( Hard Edges ) or > multiple UVs are duplicated, so the osg vertex count and IDs and don't > correspond to the Maya vertex count and IDs in most of the cases. All > Vertex Attributes are stored inside a Vertex Structure, and it has a > field for the original Maya Vertex ID, which I will use for skinning. > One Issue here is, that the Shape Orig of a Maya deformation chain does > not have a shader attached, and does not necessarily need to have the > same UVs or Normals as the resulting Mesh. The same is true for all the > BlendShape Targets. The only attributes that are considered are > VertexPositions and Normals ( there is a flag in > osgAnimatin::MorphGeometry whether to morph Normals as well ). > > This means, that when exporting a deforming Mesh, the ShapeOrig, the > resulting Shape and in the case of BlendShapes the Blend Targets should > be exported simultaneously. > Now the Vertex Atributes Structure is handy, as when all the > osg::VertexArrays of the resulting mesh are generated, the required ones > ( Position and Normals ) can be duplicated, and the corresponding Values > can be accessed through the originla VertexID Attribute in the Vertex > Structure, or even more confortable in the mVertexToVBOIndices variable, > which is a std::Vector ( corresponding to Maya IDs ) of std::Vectors ( > the VBO IDs that refer Maya ID ). > > One more Issue. Now, it is possible to have shaders per Face attached, > the exporter will capture all faces attached to one shader into one > osg::Geometry, as to my understanding this is the lowest possible option > to attach a osg::StateSet. This means one Maya Mesh can get Split up > into multiple osg::Geometries. If this Mesh is a BlendShape, then we > need to export as many MorphGeometries as Shaders are attached, and this > leads to a new overhead of managing and connecting ( or duplicating ? ) > animations. > > That's it for now I guess. > > Cheers, PP > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Maya2osg-users mailing list > May...@li... > https://lists.sourceforge.net/lists/listinfo/maya2osg-users > -- Javier Taibo |