Hi, as you know I wanted to try to add the possibility to read vertex animation data from point cache files, so I started looking at existing code in order to figure out where the integrations should be done. I have really basic experience with animations in OSG, so I'd like to share my ideas with you before doing anything.
First of all, looking at the FBX SDK doc it looks like that there are 3 ways "*geometries can be deformed: using skinning, shapes, or vertex caches. A vertex cache is a way to store directly the vertex animations inside a cache file"*. Looking at the existing code in osgfbx, I see that what is managed so far are 'static', 'rigged' and 'morph' geomerty types that I guess correspond to no animations or skinning and shapes deformers respectively. I thought to add also another type (GEOMETRY_CACHE) corrensponding to KFbxDeformer::eVERTEX_CACHE. In the examples provided with the SDK there is the "ViewScene" example that shows how to load point cache files (there are just 2 functions to use almost in a straightforwar way: PreparePointCacheData() and ReadVertexCacheData()). Well, this is the easy part I guess. But then I don't know how to handle that animation data...of course there are no bones for this kind of animation, also there is just one shape (unlike morphing where I guess at least 2 shapes are required) so I can just think about creating an UpdateCallback that keeps reading animation data (of course loaded once forever outside the application loop) and keeps updating vertex positions. What do you think about this? Can you give me suggestions or point me to other examples that do almost the same thing? Thanks. Alessandro PS: along the ViewScene example there is a sample FBX file (Humanoid.FBX) that I'll suggest you to check, it should contain at least skinning animation, but is not played correctly. On Mon, Jun 7, 2010 at 6:56 PM, Michael Platings <[email protected]>wrote: > I just tried opening the files you posted again in the FBX Quicktime Viewer > and this time they work! It seems that having the files in the root of C: > magically fixes it. > Ideally osgfbx will be able to any file that the official viewer can, so if > you can submit PC2/XML support then that would be very welcome :) > > On 7 June 2010 16:25, Alessandro Terenzi <[email protected]> wrote: > >> >> On Mon, Jun 7, 2010 at 4:57 PM, Michael Platings <[email protected]>wrote: >> >>> Anyway, given that I'm not an expert Max user, I think that pc2/xml >>>> files are the only means used by FBX files (created by Max) to refer to >>>> cached animations data coming from the widely used "Point Cache" modifier. >>>> In other words I think that if we export a FBX from Max it is not possible >>>> to "embed" cached animation data into the FBX file, but we must refer to >>>> one >>>> of those external files. >>>> >>> >>> There's no reason why that should be the case as FBX has full support for >>> vertex animation. You're attacking this problem at the wrong point - get on >>> the Max forums and ask "how can I export this model so it animates in the >>> official viewer?" >>> >> >> I agree, but there is also no reason to not support it :) because >> referring to external pc2/xml files is a feature that is available in the >> FBX format and so, for completeness' sake, it would be nice to support it in >> OSG even if there is another way to 'embed' the same cached animations data >> in the FBX file itself. >> >> Alessandro >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

