Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi Michael, I'll do my best to help in finding the problem and if you agree I will send you a simplified version of the humanoid model with just 2 or 3 joints. Cheers. Alessandro On Tue, Jan 18, 2011 at 7:08 PM, Michael Platings mplati...@gmail.comwrote: Great, I've bumped my submission so hopefully it'll be in osg trunk soon. Re: poses, they have been a complete nightmare to get working so far, and yet there are still a few cases that don't work. If you can find what's going on with humanoid.fbx then you'll be my hero! I may be able to help more if you can get a much simpler example that demonstrates the problem e.g. only one or two joints. On 18 January 2011 15:27, Alessandro Terenzi a.tere...@gmail.com wrote: Thank you very much Michael, your fix solved the timing issue. Any idea/suggestion about the wrong initial-pose problem? (it happen with the humanoid.fbx model available with the FBX SDK). Regards. Alessandro On Tue, Jan 18, 2011 at 11:12 AM, Michael Platings mplati...@gmail.comwrote: Hi Alessandro, I posted a fix a while back that may solve the issue you're referring to. If it works for you then maybe with more prodding Cedric might accept it ;) Here it is again, attached On 17 January 2011 15:43, Alessandro Terenzi a.tere...@gmail.comwrote: Hi, no one else is experiencing the same problems with osgAnimation and the FBX plugin? I mean the 'initial-pose' issue (described in this thread) and the timing issue described in another post of mine. Cheers, Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35708#35708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
I'm sending a simplified version of humanoid.fbx. I could remove animations for all the bones but I kept just two: LeftArmRoll and LeftForeArm (I'm sending the file just to Michael because it is quite huge). I could just delete animation keys but not the bones themselves because without them the model would be messed up also in 3dsMax. One last note, when you open the model (also the original one) in 3dsMax or QuickTime everything works fine, but in 3dsMax you get the following warnings: *1) The following parent and/or ancestor node(s) is/are not part of the BindPose definition.* *-Humanoid:LeftHips_Dummy* *-Humanoid:LeftArm_Dummy* *-Humanoid:LeftShoulder_Dummy* *-Humanoid:Spine_Dummy* *-Humanoid:RightShoulder_Dummy* *-Humanoid:RightHips_Dummy* *-Humanoid:RightArm_Dummy* * * *2) The following object(s) use a rotation limit mode that is not supported by * *3ds Max (UseLimitsForRotationSpaceOnly). The rotation limits for the following * *node(s) will be ignored : * * -Humanoid:Spine_Dummy* * -Humanoid:LeftShoulder_Dummy* * -Humanoid:LeftArm_Dummy* * -Humanoid:RightShoulder_Dummy* * -Humanoid:RightArm_Dummy* * -Humanoid:LeftHips_Dummy* * -Humanoid:RightHips_Dummy* * * *3) The Initial position (or Initial Pose) of the skinned objects is missing. The plug-in will create a pose automatically but running the 'Assume Skin Pose' command may create unexpected results.* I guess that they can help you to better understand where the problem could be. Cheers. Alessandro On Wed, Jan 19, 2011 at 9:28 AM, Alessandro Terenzi a.tere...@gmail.comwrote: Hi Michael, I'll do my best to help in finding the problem and if you agree I will send you a simplified version of the humanoid model with just 2 or 3 joints. Cheers. Alessandro On Tue, Jan 18, 2011 at 7:08 PM, Michael Platings mplati...@gmail.comwrote: Great, I've bumped my submission so hopefully it'll be in osg trunk soon. Re: poses, they have been a complete nightmare to get working so far, and yet there are still a few cases that don't work. If you can find what's going on with humanoid.fbx then you'll be my hero! I may be able to help more if you can get a much simpler example that demonstrates the problem e.g. only one or two joints. On 18 January 2011 15:27, Alessandro Terenzi a.tere...@gmail.com wrote: Thank you very much Michael, your fix solved the timing issue. Any idea/suggestion about the wrong initial-pose problem? (it happen with the humanoid.fbx model available with the FBX SDK). Regards. Alessandro On Tue, Jan 18, 2011 at 11:12 AM, Michael Platings mplati...@gmail.comwrote: Hi Alessandro, I posted a fix a while back that may solve the issue you're referring to. If it works for you then maybe with more prodding Cedric might accept it ;) Here it is again, attached On 17 January 2011 15:43, Alessandro Terenzi a.tere...@gmail.comwrote: Hi, no one else is experiencing the same problems with osgAnimation and the FBX plugin? I mean the 'initial-pose' issue (described in this thread) and the timing issue described in another post of mine. Cheers, Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35708#35708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi Alessandro, I posted a fix a while back that may solve the issue you're referring to. If it works for you then maybe with more prodding Cedric might accept it ;) Here it is again, attached On 17 January 2011 15:43, Alessandro Terenzi a.tere...@gmail.com wrote: Hi, no one else is experiencing the same problems with osgAnimation and the FBX plugin? I mean the 'initial-pose' issue (described in this thread) and the timing issue described in another post of mine. Cheers, Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35708#35708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org /* -*-c++-*- * Copyright (C) 2008 Cedric Pinson cedric.pin...@plopbyte.net * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include osgAnimation/Animation using namespace osgAnimation; Animation::Animation(const osgAnimation::Animation anim, const osg::CopyOp copyop): osg::Object(anim, copyop), _duration(anim._duration), _originalDuration(anim._originalDuration), _weight(anim._weight), _startTime(anim._startTime), _playmode(anim._playmode) { const ChannelList cl = anim.getChannels(); for (ChannelList::const_iterator it = cl.begin(); it != cl.end(); ++it) { addChannel(it-get()-clone()); } } void Animation::addChannel(Channel* pChannel) { _channels.push_back(pChannel); if (_duration == _originalDuration) computeDuration(); else _originalDuration = computeDurationFromChannels(); } double Animation::computeDurationFromChannels() const { double tmin = 1e5; double tmax = -1e5; ChannelList::const_iterator chan; for( chan=_channels.begin(); chan!=_channels.end(); chan++ ) { float min = (*chan)-getStartTime(); if (min tmin) tmin = min; float max = (*chan)-getEndTime(); if (max tmax) tmax = max; } return tmax-tmin; } void Animation::computeDuration() { _duration = computeDurationFromChannels(); _originalDuration = _duration; } osgAnimation::ChannelList Animation::getChannels() { return _channels; } const osgAnimation::ChannelList Animation::getChannels() const { return _channels; } void Animation::setDuration(double duration) { _originalDuration = computeDurationFromChannels(); _duration = duration; } double Animation::getDuration() const { return _duration; } float Animation::getWeight () const { return _weight; } void Animation::setWeight (float weight) { _weight = weight; } bool Animation::update (double time, int priority) { if (!_duration) // if not initialized then do it computeDuration(); double ratio = _originalDuration / _duration; double t = (time - _startTime) * ratio; switch (_playmode) { case ONCE: if (t _originalDuration) return false; break; case STAY: if (t _originalDuration) t = _originalDuration; break; case LOOP: if (!_originalDuration) t = _startTime; else if (t _originalDuration) t = fmod(t, _originalDuration); // std::cout t t duration _duration std::endl; break; case PPONG: if (!_originalDuration) t = _startTime; else { int tt = (int) (t / _originalDuration); t = fmod(t, _originalDuration); if (tt%2) t = _originalDuration - t; } break; } ChannelList::const_iterator chan; for( chan=_channels.begin(); chan!=_channels.end(); ++chan) { (*chan)-update(t, _weight, priority); } return true; } void Animation::resetTargets() { ChannelList::const_iterator chan; for( chan=_channels.begin(); chan!=_channels.end(); ++chan) (*chan)-reset(); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Thank you very much Michael, your fix solved the timing issue. Any idea/suggestion about the wrong initial-pose problem? (it happen with the humanoid.fbx model available with the FBX SDK). Regards. Alessandro On Tue, Jan 18, 2011 at 11:12 AM, Michael Platings mplati...@gmail.comwrote: Hi Alessandro, I posted a fix a while back that may solve the issue you're referring to. If it works for you then maybe with more prodding Cedric might accept it ;) Here it is again, attached On 17 January 2011 15:43, Alessandro Terenzi a.tere...@gmail.com wrote: Hi, no one else is experiencing the same problems with osgAnimation and the FBX plugin? I mean the 'initial-pose' issue (described in this thread) and the timing issue described in another post of mine. Cheers, Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35708#35708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Great, I've bumped my submission so hopefully it'll be in osg trunk soon. Re: poses, they have been a complete nightmare to get working so far, and yet there are still a few cases that don't work. If you can find what's going on with humanoid.fbx then you'll be my hero! I may be able to help more if you can get a much simpler example that demonstrates the problem e.g. only one or two joints. On 18 January 2011 15:27, Alessandro Terenzi a.tere...@gmail.com wrote: Thank you very much Michael, your fix solved the timing issue. Any idea/suggestion about the wrong initial-pose problem? (it happen with the humanoid.fbx model available with the FBX SDK). Regards. Alessandro On Tue, Jan 18, 2011 at 11:12 AM, Michael Platings mplati...@gmail.comwrote: Hi Alessandro, I posted a fix a while back that may solve the issue you're referring to. If it works for you then maybe with more prodding Cedric might accept it ;) Here it is again, attached On 17 January 2011 15:43, Alessandro Terenzi a.tere...@gmail.com wrote: Hi, no one else is experiencing the same problems with osgAnimation and the FBX plugin? I mean the 'initial-pose' issue (described in this thread) and the timing issue described in another post of mine. Cheers, Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35708#35708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi, no one else is experiencing the same problems with osgAnimation and the FBX plugin? I mean the 'initial-pose' issue (described in this thread) and the timing issue described in another post of mine. Cheers, Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35708#35708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi everybody, I'm still testing the FBX plugin but I'm still experiencing problems with animations. The humanoid.fbx test model that comes with the FBX SDK 2011.3 is displayed incorrectly by osgviewer and by osganimationviewer too (OSG 2.9.10). In order to try to understand where the problem is, I tried to simplify the animation (I removed everything but the left arm animation) but, since I'm not confortable with osgAnimation yet, I still cannot figure out the cause of this issue. The only thing I can think of, is that the model seems to miss an 'initial pose' (at least this is the warning that I get if I try to import the model in 3dsMax) but anyway 3dsMax, Motion Builder and QuickTime display it correctly. 3dsMax warns me that it will try to 'guess' the initial pose and actually it manage to set the correct one. Could the problem be related to a missing 'initial pose'? Maybe if such an 'initial pose' is missing then the model's starting position is messed up and so, when we play the animation, everything is messed up too. Any ideas? One more thing I've found out is that if I comment the following line: vi.push_back(osgAnimation::VertexIndexWeight(gi.second, weight)); in fbxRMesh.cpp then the humanoid mesh is displayed correctly (of course without animations) and the mesh rests in the 'arms spread' pose. Maybe there is somthing happening when setting the initial pose weights? Still guessing... Cheers. Alessandro ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi Alessandro and Michael, I have similar timing-related playback errors on a multi-take FBX exported from MotionBuilder. Playback in: OSG 2.9.8 OSG FBX plugin built with: FBX Sdk 2011.2: fbxsdk_md2005.lib / fbxsdk_md2005d.lib FBX exported from: MotionBuilder 2011 QuickTime can move between all twenty(ish) animation takes and play them with proper timing. The only oddity is that after each animation plays, there is a variable length dead space on the playback timeline in which the model does not move. For example, the first 40% of playback is animated normally, then it stays in a static pose for the remaining 60% of the timeline. Playback is different using the osgViewer modified for FBX playbacks and changing takes/animations when a key is pressed. Calling playAnimation() moves the character to the correct initial pose but he does not move. In the debugger, the animation durations appear correct (e.g., 12 seconds) but for most takes the model is motionless the whole time. For a few takes, after a long pause the model eventually runs part of the animation at very high-speed, in the way that Alessandro's 3-bouncing-balls model played at high speed. Then even these return to a static pose for the remainder of their play time. My best guess is the timing is thrown off and this is somehow compounded across takes. The plugin has FPS hard-coded to 25 fps so we tried exporting at both 25 fps and 30 fps with only slightly varying results. I can email a sample file to demonstrate this (~15 MB). Thanks, Brian From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Alessandro Terenzi Sent: Friday, July 09, 2010 6:56 AM To: OpenSceneGraph Users Subject: EXTERNAL: Re: [osg-users] FBX Plugin: animation speed not as expected... I've downloaded the latest source code of the FBX plugin and osgAnimation from svn but, I'm still experiencing different playback speed with respect to QuickTime moreover I have also problems with the animations themselves. As I said I'm using the latest code for FBX plugin and osgAnimation, on the other hand I'm using OSG 2.9.6 for all other plugins and libraries, so my question is: beyond the FBX plugin itself and osgAnimation what else could cause the problems with animations I'm experiencing? (ie not only speed, but also wrong/bad animation playback in general) By the way, I tried with both QuickTime and the ViewScene example that comes with the FBX SDK, they both play every model correctly. Talking about test models, I tryed: humanoid.fbx: model messed up during animation the 3-bouncing-balls model (sent to Michael some days ago): animation played at exagerated speed and now I have two more humanoid models one of which has the same problems of humanoid.fbx and the other seems to be missing some starting and ending frames. I'm going to send them to Michael. Regards. Alessandro On Thu, Jul 8, 2010 at 9:35 AM, Alessandro Terenzi a.tere...@gmail.commailto:a.tere...@gmail.com wrote: Ok, thanks Michael, I will double check that I'm really using the latest source code for both the FBX plugin and osgAnimation. Regards. Alessandro On Wed, Jul 7, 2010 at 6:54 PM, Michael Platings mplati...@gmail.commailto:mplati...@gmail.com wrote: Hi Alessandro, I can't reproduce the problem so I don't know why you're seeing that, sorry. ___ osg-users mailing list osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
I've downloaded the latest source code of the FBX plugin and osgAnimation from svn but, I'm still experiencing different playback speed with respect to QuickTime moreover I have also problems with the animations themselves. As I said I'm using the latest code for FBX plugin and osgAnimation, on the other hand I'm using OSG 2.9.6 for all other plugins and libraries, so my question is: beyond the FBX plugin itself and osgAnimation what else could cause the problems with animations I'm experiencing? (ie not only speed, but also wrong/bad animation playback in general) By the way, I tried with both QuickTime and the ViewScene example that comes with the FBX SDK, they both play every model correctly. Talking about test models, I tryed: humanoid.fbx: model messed up during animation the 3-bouncing-balls model (sent to Michael some days ago): animation played at exagerated speed and now I have two more humanoid models one of which has the same problems of humanoid.fbx and the other seems to be missing some starting and ending frames. I'm going to send them to Michael. Regards. Alessandro On Thu, Jul 8, 2010 at 9:35 AM, Alessandro Terenzi a.tere...@gmail.comwrote: Ok, thanks Michael, I will double check that I'm really using the latest source code for both the FBX plugin and osgAnimation. Regards. Alessandro On Wed, Jul 7, 2010 at 6:54 PM, Michael Platings mplati...@gmail.comwrote: Hi Alessandro, I can't reproduce the problem so I don't know why you're seeing that, sorry. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Ok, thanks Michael, I will double check that I'm really using the latest source code for both the FBX plugin and osgAnimation. Regards. Alessandro On Wed, Jul 7, 2010 at 6:54 PM, Michael Platings mplati...@gmail.comwrote: Hi Alessandro, I can't reproduce the problem so I don't know why you're seeing that, sorry. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi Alessandro, I can't reproduce the problem so I don't know why you're seeing that, sorry. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi Alessandro, playback should work at normal speed without any special configuration. If you're still having issues please send me a sample file and I'll have a look. Thanks On 2 July 2010 17:24, Alessandro Terenzi a.tere...@gmail.com wrote: I'm having a problem about a simple model whose animation is played differently in Quicktime and OSG (both my OSG build (2.9.7) and Quicktime are using FBX SDK 2011.2). I'm attacching the model: 3 balls bouncing with different timing each, but while in Quicktime the animation is played at the expected speed, in OSG it seems that the animation speed is very very fast (the model has been exported from Maya). Is there something I'm supposed to do in order to have the same expected playback speed? Or is there an issue with the FBX plugin? Thanks. Alessandro ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi Michael, Hi Alessandro, playback should work at normal speed without any special configuration. If you're still having issues please send me a sample file and I'll have a look. Thanks Perhaps you didn't see it, but he did :-) See file balls_01.zip attached to the first post. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Oops missed that. Thanks, I'll be able to have a look in the next day or 2 On 5 July 2010 14:00, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.comwrote: Hi Michael, Hi Alessandro, playback should work at normal speed without any special configuration. If you're still having issues please send me a sample file and I'll have a look. Thanks Perhaps you didn't see it, but he did :-) See file balls_01.zip attached to the first post. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org