diff --git a/include/osgPresentation/PropertyManager b/include/osgPresentation/PropertyManager index d345a8c2f..fa8a2aaea 100644 --- a/include/osgPresentation/PropertyManager +++ b/include/osgPresentation/PropertyManager @@ -158,7 +158,7 @@ public: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); - virtual void update(osg::Node* node); + virtual void update(osg::Node& node); protected: diff --git a/src/osgPresentation/PropertyManager.cpp b/src/osgPresentation/PropertyManager.cpp index deabebd04..965973472 100644 --- a/src/osgPresentation/PropertyManager.cpp +++ b/src/osgPresentation/PropertyManager.cpp @@ -39,10 +39,14 @@ void PropertyAnimation::reset() { _firstTime = DBL_MAX; _pauseTime = DBL_MAX; + + OSG_NOTICE<<"PropertyAnimation::reset()"<getOrCreateUserDataContainer(), itr->second.get()); + assign(node.getOrCreateUserDataContainer(), itr->second.get()); } else if (itr!=_keyFrameMap.end()) { @@ -218,7 +222,7 @@ void PropertyAnimation::update(osg::Node* node) // clone all the properties from p1; - osg::ref_ptr destination = node->getOrCreateUserDataContainer(); + osg::ref_ptr destination = node.getOrCreateUserDataContainer(); assign(destination.get(), p1); @@ -259,7 +263,7 @@ void PropertyAnimation::update(osg::Node* node) else // (itr==_keyFrameMap.end()) { OSG_NOTICE<<"PropertyAnimation::update() : copy last UserDataContainer"<getOrCreateUserDataContainer(), _keyFrameMap.rbegin()->second.get()); + assign(node.getOrCreateUserDataContainer(), _keyFrameMap.rbegin()->second.get()); } } diff --git a/src/osgPresentation/SlideEventHandler.cpp b/src/osgPresentation/SlideEventHandler.cpp index e75d47649..dd8aeddb4 100644 --- a/src/osgPresentation/SlideEventHandler.cpp +++ b/src/osgPresentation/SlideEventHandler.cpp @@ -249,6 +249,7 @@ struct CallbackOperator : public ObjectOperator osg::AnimationPathCallback* apc = dynamic_cast(_callback.get()); osgUtil::TransformCallback* tc = dynamic_cast(_callback.get()); AnimationMaterialCallback* amc = dynamic_cast(_callback.get()); + PropertyAnimation* pa = dynamic_cast(_callback.get()); if (apc) { OSG_INFO<<"apc->setPause("<setPause("<setPause(pause); } + else if (pa) + { + pa->setPause(pause); + } else if (nc) { OSG_NOTICE<<"Need to pause callback : "<className()<(_callback.get()); osgUtil::TransformCallback* tc = dynamic_cast(_callback.get()); AnimationMaterialCallback* amc = dynamic_cast(_callback.get()); + PropertyAnimation* pa = dynamic_cast(_callback.get()); if (apc) { apc->reset(); @@ -290,6 +296,11 @@ struct CallbackOperator : public ObjectOperator amc->reset(); amc->update(*_node); } + else if (pa) + { + pa->reset(); + pa->update(*_node); + } else { OSG_NOTICE<<"Need to reset callback : "<className()<