Hello Gerrit, all,

the attached patch changes changedFunctors to receive the change origin as an additional argument - so this may break applications that register changed functors. It also makes sure that during a ChangeList::apply or a RemoteAspect::receiveSync the changed functions of containers are called with ChangedOrigin::Sync instead of the normal ChangedOrigin::Commit.

The motivation for this is that when using GPU skinned characters in a cluster where the client renders locally as well, the shader variables already have the correct values set, but GPUSkinningAlgorithm marks them invalid because it receives a changed notification from the Skeleton. Apart from unnecessarily recomputing the values, this produces lots of warnings from ShaderVariableAccess::updateSVariable, because the variable names are not in the map on the remote side (perhaps that's a bug too?).

Comments?

        Cheers,
                Carsten
diff --git a/Source/Base/Base/OSGContainerForwards.h 
b/Source/Base/Base/OSGContainerForwards.h
index 81d8666..b87838c 100644
--- a/Source/Base/Base/OSGContainerForwards.h
+++ b/Source/Base/Base/OSGContainerForwards.h
@@ -149,7 +149,7 @@ class FieldContainerFactoryBase;
 typedef SingletonHolder<FieldContainerFactoryBase> FieldContainerFactory;
 
 typedef boost::function<
-              void (FieldContainer *, ConstFieldMaskArg )> ChangedFunctor;
+    void (FieldContainer *, ConstFieldMaskArg, UInt32)> ChangedFunctor;
 
 typedef boost::function<void (DrawEnv *)> RenderFunctor;
 
diff --git a/Source/Base/FieldContainer/Base/OSGChangeList.cpp 
b/Source/Base/FieldContainer/Base/OSGChangeList.cpp
index a549ddf..0eb4ad0 100644
--- a/Source/Base/FieldContainer/Base/OSGChangeList.cpp
+++ b/Source/Base/FieldContainer/Base/OSGChangeList.cpp
@@ -66,7 +66,7 @@ OSG_BEGIN_NAMESPACE
 /* ContainerChangeEntry                                                    */
 
 
-void ContainerChangeEntry::commitChanges(void)
+void ContainerChangeEntry::commitChanges(UInt32 origin)
 {
 #ifdef OSG_ENABLE_VALGRIND_CHECKS
     VALGRIND_CHECK_VALUE_IS_DEFINED(uiContainerId);
@@ -93,7 +93,7 @@ void ContainerChangeEntry::commitChanges(void)
            whichField            |= *bvUncommittedChanges;
            *bvUncommittedChanges  = TypeTraits<BitVector>::BitsClear;
 
-           pTmp->changed(tmpChanges, ChangedOrigin::Commit, 0);
+           pTmp->changed(tmpChanges, origin, 0);
         }
     }
 }
@@ -385,9 +385,20 @@ void ChangeList::dump(      UInt32    uiIndent,
             fprintf(stderr, " ");
         }
 
-        fprintf(stderr, "CE : %u %u\n",
+        FieldContainer *pTmp =
+            FieldContainerFactory::the()->getContainer((*cIt)->uiContainerId);
+
+        std::string szTmp("Unknown");
+
+        if(pTmp != NULL)
+        {
+            szTmp.assign(pTmp->getType().getName());
+        }
+
+        fprintf(stderr, "CE : %u %u | %s\n",
                 (*cIt)->uiEntryDesc,
-                (*cIt)->uiContainerId);
+                (*cIt)->uiContainerId,
+                szTmp.c_str());
 
         ++cIt;
     }
@@ -411,7 +422,7 @@ void ChangeList::dump(      UInt32    uiIndent,
 
         if(pTmp != NULL)
         {
-            szTmp.assign(pTmp->getType().getCName());
+            szTmp.assign(pTmp->getType().getName());
         }
 
         BitVector tmpChanges = 0xDEADBEEF;
@@ -711,7 +722,7 @@ void ChangeList::clearPool(void)
 /*-------------------------------------------------------------------------*/
 /* Helper                                                                  */
 
-void ChangeList::doCommitChanges(void)
+void ChangeList::doCommitChanges(UInt32 origin)
 {
     if(_workStore.empty() == false)
     {
@@ -740,7 +751,7 @@ void ChangeList::doCommitChanges(void)
 
             if((*changesIt)->uiEntryDesc == ContainerChangeEntry::Change)
             {
-                (*changesIt)->commitChanges();
+                (*changesIt)->commitChanges(origin);
             }
 
             ++changesIt;
@@ -968,9 +979,9 @@ void ChangeList::doApply(bool bClear)
         ++cIt;
     }
 
-    commitDelayedSubRefs();
+    pDstCL->commitChangesAndClear(ChangedOrigin::Sync);
+    pDstCL->commitDelayedSubRefs ();
 
-    pDstCL->commitDelayedSubRefs();
 #endif
 }
 
diff --git a/Source/Base/FieldContainer/Base/OSGChangeList.h 
b/Source/Base/FieldContainer/Base/OSGChangeList.h
index 740b33f..18c7f8b 100644
--- a/Source/Base/FieldContainer/Base/OSGChangeList.h
+++ b/Source/Base/FieldContainer/Base/OSGChangeList.h
@@ -43,6 +43,7 @@
 #endif
 
 #include "OSGBaseTypes.h"
+#include "OSGContainerBase.h"
 #include "OSGLog.h"
 #include "OSGMemoryObject.h"
 #include "OSGThread.h"
@@ -91,7 +92,7 @@ struct OSG_BASE_DLLMAPPING ContainerChangeEntry
     ContainerChangeEntry(void);
 
     void clear        (ChangeList *pListParent);
-    void commitChanges(void                   );
+    void commitChanges(UInt32      origin     );
     void release      (void                   );
 };
 
@@ -136,8 +137,8 @@ class OSG_BASE_DLLMAPPING ChangeList : public MemoryObject
     /*! \name Commit                                                       */
     /*! \{                                                                 */
 
-    void commitChanges        (void);
-    void commitChangesAndClear(void);
+    void commitChanges        (UInt32 origin = ChangedOrigin::Commit);
+    void commitChangesAndClear(UInt32 origin = ChangedOrigin::Commit);
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
@@ -299,7 +300,7 @@ class OSG_BASE_DLLMAPPING ChangeList : public MemoryObject
     /*! \name Helper                                                       */
     /*! \{                                                                 */
 
-    void doCommitChanges(void           );
+    void doCommitChanges(UInt32 origin  );
     void doApply        (bool   bClear  );
     void doClear        (void           );
 
diff --git a/Source/Base/FieldContainer/Base/OSGChangeList.inl 
b/Source/Base/FieldContainer/Base/OSGChangeList.inl
index c56451a..3b06e0b 100644
--- a/Source/Base/FieldContainer/Base/OSGChangeList.inl
+++ b/Source/Base/FieldContainer/Base/OSGChangeList.inl
@@ -67,16 +67,16 @@ void ContainerChangeEntry::clear(ChangeList *pListParent)
 /* Commit                                                                  */
 
 inline
-void ChangeList::commitChanges(void)
+void ChangeList::commitChanges(UInt32 origin)
 {
-    doCommitChanges();
+    doCommitChanges(origin);
 }
 
 inline
-void ChangeList::commitChangesAndClear(void)
+void ChangeList::commitChangesAndClear(UInt32 origin)
 {
-    doCommitChanges();
-    clear          ();
+    doCommitChanges(origin);
+    clear          (      );
 }
 
 /*-------------------------------------------------------------------------*/
diff --git a/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp 
b/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp
index fa039ad..9fdb5bc 100644
--- a/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp
+++ b/Source/Base/FieldContainer/Base/OSGFieldContainer.cpp
@@ -318,7 +318,7 @@ bool FieldContainer::deregister(UInt32 uiContainerId)
 
 void FieldContainer::resolveLinks(void)
 {
-    callChangedFunctors(0);
+    callChangedFunctors(0, ChangedOrigin::External);
 }
 
 FieldContainer *FieldContainer::findNamedComponent(const Char8 *)
diff --git a/Source/Base/FieldContainer/Base/OSGFieldContainer.h 
b/Source/Base/FieldContainer/Base/OSGFieldContainer.h
index 9d5f279..5006eba 100644
--- a/Source/Base/FieldContainer/Base/OSGFieldContainer.h
+++ b/Source/Base/FieldContainer/Base/OSGFieldContainer.h
@@ -155,9 +155,10 @@ class FieldContainer : public ReflexiveContainer
 
     virtual void changed            (ConstFieldMaskArg whichField,
                                      UInt32            origin,
-                                     BitVector         details);
+                                     BitVector         details    );
 
-            void callChangedFunctors(ConstFieldMaskArg whichField );
+            void callChangedFunctors(ConstFieldMaskArg whichField,
+                                     UInt32            origin     );
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
diff --git a/Source/Base/FieldContainer/Base/OSGFieldContainer.inl 
b/Source/Base/FieldContainer/Base/OSGFieldContainer.inl
index 6195569..8e9bed8 100644
--- a/Source/Base/FieldContainer/Base/OSGFieldContainer.inl
+++ b/Source/Base/FieldContainer/Base/OSGFieldContainer.inl
@@ -63,14 +63,15 @@ UInt16 FieldContainer::getClassGroupId(void)
 
 inline
 void FieldContainer::changed(ConstFieldMaskArg whichField, 
-                             UInt32            ,
-                             BitVector         )
+                             UInt32            origin,
+                             BitVector         details)
 {
-    callChangedFunctors(whichField);
+    callChangedFunctors(whichField, origin);
 }
 
 inline
-void FieldContainer::callChangedFunctors(ConstFieldMaskArg whichField)
+void FieldContainer::callChangedFunctors(ConstFieldMaskArg whichField,
+                                         UInt32            origin     )
 {
     MFChangedFunctorCallback::iterator       cfIt = _mfChangedFunctors.begin();
     MFChangedFunctorCallback::const_iterator cfEnd= _mfChangedFunctors.end();
@@ -78,7 +79,7 @@ void FieldContainer::callChangedFunctors(ConstFieldMaskArg 
whichField)
     for(; cfIt != cfEnd; ++cfIt)
     {
         if(cfIt->_func)
-            (cfIt->_func)(this, whichField);
+            (cfIt->_func)(this, whichField, origin);
     }
 }
 
diff --git a/Source/Base/FieldContainer/Base/testChangedCallback.cpp 
b/Source/Base/FieldContainer/Base/testChangedCallback.cpp
index d6d7765..0c3668b 100644
--- a/Source/Base/FieldContainer/Base/testChangedCallback.cpp
+++ b/Source/Base/FieldContainer/Base/testChangedCallback.cpp
@@ -9,15 +9,15 @@ class Foo
 {
   public:
 
-    void testCB(OSG::FieldContainer *pObj, OSG::BitVector whichField)
+    void testCB(OSG::FieldContainer *pObj, OSG::BitVector whichField, 
OSG::UInt32 origin)
     {
-        fprintf(stderr, "Foo::testCB %"PRIx64"\n", whichField);
+        fprintf(stderr, "Foo::testCB %"PRIx64" origin %u\n", whichField, 
origin);
     }
 };
 
-void testCB(OSG::FieldContainer *pObj, OSG::BitVector whichField)
+void testCB(OSG::FieldContainer *pObj, OSG::BitVector whichField, OSG::UInt32 
origin)
 {
-    fprintf(stderr, "testCB %"PRIx64"\n", whichField);
+    fprintf(stderr, "testCB %"PRIx64" origin %u\n", whichField, origin);
 }
 
 int main (int argc, char **argv)
@@ -30,7 +30,7 @@ int main (int argc, char **argv)
 
     OSG::NodeRecPtr pNode = OSG::Node::create();
 
-    OSG::ChangedFunctor objCB = boost::bind(&Foo::testCB, &foo, _1, _2);
+    OSG::ChangedFunctor objCB = boost::bind(&Foo::testCB, &foo, _1, _2, _3);
 
     pNode->addChangedFunctor(testCB, "");
     pNode->addChangedFunctor(objCB, "");
diff --git a/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.cpp 
b/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.cpp
index 8fe1974..101081f 100644
--- a/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.cpp
+++ b/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.cpp
@@ -124,8 +124,9 @@ void ConnectorAttachment::addConnection 
(BasicFieldConnector *pConnector)
     }
 }
 
-void ConnectorAttachment::processChanged(FieldContainer      *pObj, 
-                                         BitVector            whichField)
+void ConnectorAttachment::processChanged(FieldContainer *pObj,
+                                         BitVector       whichField,
+                                         UInt32          origin     )
 {
     ConnectionStore::const_iterator cIt  = _vConnections.begin();
     ConnectionStore::const_iterator cEnd = _vConnections.end  ();
@@ -141,8 +142,9 @@ void ConnectorAttachment::processChanged(FieldContainer     
 *pObj,
     }
 }
 
-void ConnectorAttachment::targetDestroyed(FieldContainer      *pObj, 
-                                          BitVector            whichField)
+void ConnectorAttachment::targetDestroyed(FieldContainer *pObj,
+                                          BitVector       whichField,
+                                          UInt32          origin     )
 {
     if(whichField == 0x0000)
     {
@@ -233,7 +235,8 @@ void ConnectorAttachment::removeConnections(      BitVector 
      bSrcMask,
                 boost::bind(&ConnectorAttachment::targetDestroyed, 
                             this, 
                             _1, 
-                            _2));
+                            _2,
+                            _3));
         }
 
         ++ccIt;
@@ -272,7 +275,8 @@ bool ConnectorAttachment::unlinkParent(FieldContainer * 
const pParent,
         boost::bind(&ConnectorAttachment::processChanged, 
                     this, 
                     _1, 
-                    _2));
+                    _2,
+                    _3));
     
     return Inherited::unlinkParent(pParent, parentFieldId);
 }
@@ -287,7 +291,8 @@ void ConnectorAttachment::resolveLinks(void)
             boost::bind(&ConnectorAttachment::targetDestroyed, 
                         this, 
                         _1, 
-                        _2));
+                        _2,
+                        _3));
 
         delete _vConnections[i];
     }
@@ -332,7 +337,8 @@ void addConnector(OSG::AttachmentContainer *pContainer,
             boost::bind(&ConnectorAttachment::processChanged, 
                         pCA.get(), 
                         _1, 
-                        _2),
+                        _2,
+                        _3),
             "");
 
         pContainer->addAttachment(pCA);
@@ -356,7 +362,8 @@ void addConnector(OSG::AttachmentContainer *pContainer,
             boost::bind(&ConnectorAttachment::targetDestroyed, 
                         pCA.get(), 
                         _1, 
-                        _2),
+                        _2,
+                        _3),
             "");
     }
 
diff --git a/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.h 
b/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.h
index a888d1b..ff34d8c 100644
--- a/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.h
+++ b/Source/Base/FieldContainer/Connector/OSGConnectorAttachment.h
@@ -78,13 +78,15 @@ class OSG_BASE_DLLMAPPING ConnectorAttachment :
     /*! \name                     Output                                   */
     /*! \{                                                                 */
 
-    void addConnection  (BasicFieldConnector *pConnector);
+    void addConnection  (BasicFieldConnector *pConnector );
 
     void processChanged (FieldContainer      *pObj, 
-                         BitVector            whichField);
+                         BitVector            whichField,
+                         UInt32               origin     );
 
     void targetDestroyed(FieldContainer      *pObj, 
-                         BitVector            whichField);
+                         BitVector            whichField,
+                         UInt32               origin     );
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
diff --git a/Source/Contrib/Manipulators/testManipulatorsPivot.cpp 
b/Source/Contrib/Manipulators/testManipulatorsPivot.cpp
index 8a5e851..e6bea1c 100644
--- a/Source/Contrib/Manipulators/testManipulatorsPivot.cpp
+++ b/Source/Contrib/Manipulators/testManipulatorsPivot.cpp
@@ -333,13 +333,13 @@ namespace
         {
             if (!use_changed_functor_) {
                 xformTranslationN->getCore()->
-                    addChangedFunctor(boost::bind(&object_type::changed_cb, 
this, xformTranslationN, _1, _2),
+                    addChangedFunctor(boost::bind(&object_type::changed_cb, 
this, xformTranslationN, _1, _2, _3),
                                       "xform_translation_changed_cb");
                 xformRotationN->getCore()->
-                    addChangedFunctor(boost::bind(&object_type::changed_cb, 
this, xformRotationN,    _1, _2),
+                    addChangedFunctor(boost::bind(&object_type::changed_cb, 
this, xformRotationN,    _1, _2, _3),
                                       "xform_rotation_changed_cb");
                 xformScaleN->getCore()->
-                    addChangedFunctor(boost::bind(&object_type::changed_cb, 
this, xformScaleN,       _1, _2),
+                    addChangedFunctor(boost::bind(&object_type::changed_cb, 
this, xformScaleN,       _1, _2, _3),
                                       "xform_scale_changed_cb");
             } else {
                 xformTranslationN->getCore()->clearChangedFunctors();
@@ -397,7 +397,7 @@ namespace
         bool use_changed_functor_;
 
         void
-        changed_cb(OSG::NodeRefPtr a, OSG::FieldContainer* fc, OSG::BitVector 
fm)
+        changed_cb(OSG::NodeRefPtr a, OSG::FieldContainer* fc, OSG::BitVector 
fm, OSG::UInt32 origin)
         {
             std::cout << "object_type::changed_cb(" << OSG::getName(a) << ")" 
<< std::endl;
 
diff --git a/Source/System/Cluster/Base/OSGRemoteAspect.cpp 
b/Source/System/Cluster/Base/OSGRemoteAspect.cpp
index de953fc..b5ab3c1 100644
--- a/Source/System/Cluster/Base/OSGRemoteAspect.cpp
+++ b/Source/System/Cluster/Base/OSGRemoteAspect.cpp
@@ -257,11 +257,11 @@ void RemoteAspect::receiveSync(Connection &connection, 
bool applyToChangelist)
 
     if(applyToChangelist)
     {
-        commitChanges();
+        Thread::getCurrentChangeList()->commitChanges(ChangedOrigin::Sync);
     }
     else
     {
-        commitChangesAndClear();
+        
Thread::getCurrentChangeList()->commitChangesAndClear(ChangedOrigin::Sync);
     }
 
     // unregister mapper into factory
@@ -547,9 +547,8 @@ void RemoteAspect::receiveNewType(Connection                
&con,
 
 #ifndef OSG_REMOTE_ASPECT_SILENT
     SLOG << "Receive NEWTYPE: type name '" << typeName
-         << "' remote type '"              << remoteTypeId
-         << "' local type '"               << localTypeId
-         << "'\n";
+         << "' type id (r/l) '" << remoteTypeId
+         << "/" << localTypeId << "'\n";
 #endif
 }
 
@@ -590,10 +589,9 @@ void RemoteAspect::receiveCreated(Connection               
 &con,
             newContainers.push_back(fcPtr);
 
 #ifndef OSG_REMOTE_ASPECT_SILENT
-            SLOG << "Receive CREATED: remote type '" << remoteTypeId
-                 << "' local type '"                 << localTypeId
-                 << "' remote id '"                  << remoteId
-                 << "' local id '"
+            SLOG << "Receive CREATED: type (r/l) '" << remoteTypeId
+                 << "/" << localTypeId
+                 << "' id (r/l) '" << remoteId << "/"
                  << (fcPtr  != NULL ? fcPtr->getId()     : 0)
                  << "' type name '"
                  << (fcType != NULL ? fcType->getName() : "")
@@ -602,7 +600,8 @@ void RemoteAspect::receiveCreated(Connection                
&con,
         }
         else
         {
-            SWARNING << "Already created a local container for "
+            SWARNING << "Already created a local container ("
+                     << _localFC[fullRemoteId] << ") for "
                      << "remote container id '" << remoteId
                      << "'" << std::endl;
         }
@@ -633,11 +632,11 @@ void RemoteAspect::receiveChanged(Connection              
  &con,
         fcPtr = fcFactory->getContainer(localId);
 
 #ifndef OSG_REMOTE_ASPECT_SILENT
-        SLOG << "Receive CHANGED: remote id '" << remoteId
-             << "' local id '"                 << localId
+        SLOG << "Receive CHANGED: id (r/l) '" << remoteId
+             << "/" << localId
              << "' mask '0x"
              << std::hex << fieldMask << std::dec
-             << "' len '"                      << len
+             << "' len '" << len
              << "' type name '"
              << (fcPtr != NULL ? fcPtr->getType().getName() : "")
              << "'\n";
@@ -690,9 +689,8 @@ void RemoteAspect::receiveAddRefed(Connection               
 &con,
         fcPtr = fcFactory->getContainer(localId);
 
 #ifndef OSG_REMOTE_ASPECT_SILENT
-        SLOG << "Receive ADDREFED: remote id '" << remoteId
-             << "' local id '"                  << localId
-             << "' type name '"
+        SLOG << "Receive ADDREFED: id (r/l) '" << remoteId
+             << "/" << localId << "' type name '"
              << (fcPtr != NULL ? fcPtr->getType().getName() : "")
              << "'\n";
 #endif
@@ -728,9 +726,8 @@ void RemoteAspect::receiveSubRefed(Connection               
 &con,
         fcPtr = fcFactory->getContainer(localId);
 
 #ifndef OSG_REMOTE_ASPECT_SILENT
-        SLOG << "Receive SUBREFED: remote id '" << remoteId
-             << "' local id '"                  << localId
-             << "' type name '"
+        SLOG << "Receive SUBREFED: id (r/l) '" << remoteId
+             << "/" << localId << "' type name '"
              << (fcPtr != NULL ? fcPtr->getType().getName() : "")
              << "'\n";
 #endif
@@ -762,9 +759,9 @@ void RemoteAspect::receiveIdMapping(Connection &con)
     con.getValue(localId);
 
 #ifndef OSG_REMOTE_ASPECT_SILENT
-    SLOG << "Receive IDMAPPING: remote id '" << remoteId
-         << "' local id '"                   << localId
-         << "' local aspect '"               << localAspect
+    SLOG << "Receive IDMAPPING: id (r/l) '" << remoteId
+         << "/" << localId
+         << "' local aspect '"              << localAspect
          << "'\n";
 #endif
 
diff --git a/Source/System/Dynamics/Animation/OSGAnimation.cpp 
b/Source/System/Dynamics/Animation/OSGAnimation.cpp
index b7ca5cc..7122c47 100644
--- a/Source/System/Dynamics/Animation/OSGAnimation.cpp
+++ b/Source/System/Dynamics/Animation/OSGAnimation.cpp
@@ -132,7 +132,7 @@ void Animation::setTimeSensor(AnimTimeSensor *value)
     if(_sfTimeSensor.getValue() != NULL)
     {
         _sfTimeSensor.getValue()->subChangedFunctor(
-            boost::bind(&Animation::timeSensorChanged, this, _1, _2));
+            boost::bind(&Animation::timeSensorChanged, this, _1, _2, _3));
     }
 
     Inherited::setTimeSensor(value);
@@ -141,7 +141,7 @@ void Animation::setTimeSensor(AnimTimeSensor *value)
     {
         _sfTimeSensor.getValue()->setEnabled       (false               );
         _sfTimeSensor.getValue()->addChangedFunctor(
-            boost::bind(&Animation::timeSensorChanged, this, _1, _2), "");
+            boost::bind(&Animation::timeSensorChanged, this, _1, _2, _3), "");
     }
 }
 
@@ -218,7 +218,9 @@ void Animation::stop(void)
     ts->setEnabled(false);
 }
 
-void Animation::timeSensorChanged(FieldContainer *fc, BitVector whichField)
+void Animation::timeSensorChanged(FieldContainer *fc,
+                                  BitVector       whichField,
+                                  UInt32          origin     )
 {
     AnimTimeSensor *ts = _sfTimeSensor.getValue();
 
diff --git a/Source/System/Dynamics/Animation/OSGAnimation.h 
b/Source/System/Dynamics/Animation/OSGAnimation.h
index b9ec3f3..8ae0e3f 100644
--- a/Source/System/Dynamics/Animation/OSGAnimation.h
+++ b/Source/System/Dynamics/Animation/OSGAnimation.h
@@ -141,7 +141,8 @@ class OSG_DYNAMICS_DLLMAPPING Animation : public 
AnimationBase
     /*! \{                                                                 */
 
     void timeSensorChanged(FieldContainer *fc,
-                           BitVector       whichField);
+                           BitVector       whichField,
+                           UInt32          origin     );
 
     void calcLength(void) const;
 
diff --git a/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.cpp 
b/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.cpp
index f286a90..1601e61 100644
--- a/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.cpp
+++ b/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.cpp
@@ -305,12 +305,12 @@ void GPUSkinningAlgorithm::changed(ConstFieldMaskArg 
whichField,
     {
         if(_sfSkeleton.getValue()->hasChangedFunctor(boost::bind(
                &GPUSkinningAlgorithm::skeletonChanged,
-               this, _1, _2                                )) == false)
+               this, _1, _2, _3                            )) == false)
         {
             _sfSkeleton.getValue()->addChangedFunctor(boost::bind(
                 &GPUSkinningAlgorithm::skeletonChanged,
-                this, _1, _2                                ),
-                "GPUSkinningAlgorithm::skeletonChanged"  );
+                this, _1, _2, _3                           ),
+                "GPUSkinningAlgorithm::skeletonChanged");
         }
     }
 
@@ -325,9 +325,15 @@ void GPUSkinningAlgorithm::dump(      UInt32    ,
 
 void
 GPUSkinningAlgorithm::skeletonChanged(FieldContainer    *fc,
-                                      ConstFieldMaskArg  whichField)
+                                      ConstFieldMaskArg  whichField,
+                                      UInt32             origin     )
 {
-    if(((Skeleton::JointMatricesFieldMask      |
+    // if the skeleton was changed by a sync we don't invalidate
+    // the data - it either is updated by the same sync or
+    // the sync marks it as invalid.
+
+    if(origin != ChangedOrigin::Sync  &&
+       ((Skeleton::JointMatricesFieldMask      |
          Skeleton::JointNormalMatricesFieldMask) & whichField) != 0)
     {
         OSG_ASSERT(fc == _sfSkeleton.getValue());
@@ -347,7 +353,7 @@ GPUSkinningAlgorithm::resolveLinks(void)
     {
         _sfSkeleton.getValue()->subChangedFunctor(boost::bind(
             &GPUSkinningAlgorithm::skeletonChanged,
-            this, _1, _2                                ));
+            this, _1, _2, _3                       ));
     }
 
     Inherited::resolveLinks();
diff --git a/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.h 
b/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.h
index c9b9972..76954ee 100644
--- a/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.h
+++ b/Source/System/Dynamics/Skeleton/OSGGPUSkinningAlgorithm.h
@@ -134,7 +134,9 @@ class OSG_DYNAMICS_DLLMAPPING GPUSkinningAlgorithm : public 
GPUSkinningAlgorithm
     /*! \name                  Skeleton Change                             */
     /*! \{                                                                 */
 
-    void skeletonChanged(FieldContainer *fc, ConstFieldMaskArg whichField);
+    void skeletonChanged(FieldContainer    *fc,
+                         ConstFieldMaskArg  whichField,
+                         UInt32             origin     );
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
diff --git 
a/Source/System/FieldContainer/Mixins/OSGTraversalValidationHandlerMixin.inl 
b/Source/System/FieldContainer/Mixins/OSGTraversalValidationHandlerMixin.inl
index 0986427..7e00367 100644
--- a/Source/System/FieldContainer/Mixins/OSGTraversalValidationHandlerMixin.inl
+++ b/Source/System/FieldContainer/Mixins/OSGTraversalValidationHandlerMixin.inl
@@ -527,7 +527,7 @@ void 
TraversalValidationHandlerMixin<ParentT>::onDestroyAspect(
         for(; cfIt != cfEnd; ++cfIt)
         {
             if(cfIt->_func)
-                (cfIt->_func)(this, 0x0000);
+                (cfIt->_func)(this, 0x0000, ChangedOrigin::External);
         }
     }
 }
diff --git 
a/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.cpp 
b/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.cpp
index 52c5bfb..9c531af 100644
--- a/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.cpp
+++ b/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.cpp
@@ -283,7 +283,8 @@ void DrawableStatsAttachment::operator 
-=(DrawableStatsAttachment *arg)
 
 void DrawableStatsAttachment::invalidateFunctor(
     FieldContainer *obj,
-    BitVector       mask)
+    BitVector       whichField,
+    UInt32          origin     )
 {
     invalidate(obj);
 }
diff --git 
a/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.h 
b/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.h
index 3d39d9e..eeac8a2 100644
--- a/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.h
+++ b/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.h
@@ -152,9 +152,9 @@ class OSG_SYSTEM_DLLMAPPING DrawableStatsAttachment :
     /*! \{                                                                 */
     
     static void invalidateFunctor(FieldContainer *obj,
-                                  BitVector       mask);
-    
-    static void invalidate       (FieldContainer *obj );
+                                  BitVector       whichField,
+                                  UInt32          origin    );
+    static void invalidate       (FieldContainer *obj       );
 
     /*! \}                                                                 */
     /*==========================  PRIVATE  ================================*/
diff --git a/Source/System/NodeCores/Groups/Misc/OSGInline.cpp 
b/Source/System/NodeCores/Groups/Misc/OSGInline.cpp
index f5d2c5a..a1f70f4 100644
--- a/Source/System/NodeCores/Groups/Misc/OSGInline.cpp
+++ b/Source/System/NodeCores/Groups/Misc/OSGInline.cpp
@@ -168,7 +168,7 @@ void Inline::postOSGLoading(void)
         if(pFile != NULL)
         {
             pFile->addChangedFunctor(
-                boost::bind(&Inline::rootChanged, this, _1, _2),
+                boost::bind(&Inline::rootChanged, this, _1, _2, _3),
                 "");
 
             setRoot(pFile);
@@ -190,7 +190,7 @@ void Inline::postOSGLoading(void)
     if(i == _mfUrl.size() && _sfRoot.getValue() != NULL)
     {
         _sfRoot.getValue()->subChangedFunctor(
-            boost::bind(&Inline::rootChanged, this, _1, _2));
+            boost::bind(&Inline::rootChanged, this, _1, _2, _3));
 
         setRoot(NULL);
     }
@@ -218,7 +218,9 @@ void Inline::adjustVolume(Volume &volume)
     }
 }
 
-void Inline::rootChanged(FieldContainer *pFC, ConstFieldMaskArg whichField)
+void Inline::rootChanged(FieldContainer    *pFC,
+                         ConstFieldMaskArg  whichField,
+                         UInt32             origin     )
 {
     if(0x0000 != (whichField & Node::VolumeFieldMask))
     {
diff --git a/Source/System/NodeCores/Groups/Misc/OSGInline.h 
b/Source/System/NodeCores/Groups/Misc/OSGInline.h
index bd5c26b..e126b0d 100644
--- a/Source/System/NodeCores/Groups/Misc/OSGInline.h
+++ b/Source/System/NodeCores/Groups/Misc/OSGInline.h
@@ -118,7 +118,9 @@ class OSG_GROUP_DLLMAPPING Inline : public InlineBase
     /*! \name                     Init                                     */
     /*! \{                                                                 */
 
-    void rootChanged(FieldContainer *pFC, ConstFieldMaskArg whichField);
+    void rootChanged(FieldContainer    *pFC,
+                     ConstFieldMaskArg  whichField,
+                     UInt32             origin     );
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
diff --git a/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.cpp 
b/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.cpp
index 9e8a964..1d41297 100644
--- a/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.cpp
+++ b/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.cpp
@@ -80,13 +80,13 @@ void VisitSubTree::setSubTreeRoot(Node * const value)
     if(_sfSubTreeRoot.getValue() != NULL)
     {
         _sfSubTreeRoot.getValue()->subChangedFunctor(
-            boost::bind(&VisitSubTree::rootChanged, this, _1, _2));
+            boost::bind(&VisitSubTree::rootChanged, this, _1, _2, _3));
     }
 
     if(value != NULL)
     {
         value->addChangedFunctor(
-            boost::bind(&VisitSubTree::rootChanged, this, _1, _2),
+            boost::bind(&VisitSubTree::rootChanged, this, _1, _2, _3),
             "");
     }
 
@@ -94,7 +94,8 @@ void VisitSubTree::setSubTreeRoot(Node * const value)
 }
 
 void VisitSubTree::rootChanged(FieldContainer    *pFC, 
-                               ConstFieldMaskArg  whichField)
+                               ConstFieldMaskArg  whichField,
+                               UInt32             origin     )
 {
     if(0x0000 != (whichField & Node::VolumeFieldMask))
     {
diff --git a/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.h 
b/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.h
index e0a3c55..0db16f3 100644
--- a/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.h
+++ b/Source/System/NodeCores/Groups/Misc/OSGVisitSubTree.h
@@ -138,10 +138,11 @@ class OSG_GROUP_DLLMAPPING VisitSubTree : public 
VisitSubTreeBase
     /*! \name                      NodeCore Specific                       */
     /*! \{                                                                 */
 
-    void adjustVolume(Volume            &volume    );
+    void adjustVolume(Volume            &volume     );
 
     void rootChanged (FieldContainer    *pFC, 
-                      ConstFieldMaskArg  whichField);
+                      ConstFieldMaskArg  whichField,
+                      UInt32             origin     );
 
     /*! \}                                                                 */
     /*==========================  PRIVATE  ================================*/
diff --git a/Source/System/State/Shader/Base/OSGShaderProgram.cpp 
b/Source/System/State/Shader/Base/OSGShaderProgram.cpp
index 5c0a34c..4bb44b0 100644
--- a/Source/System/State/Shader/Base/OSGShaderProgram.cpp
+++ b/Source/System/State/Shader/Base/OSGShaderProgram.cpp
@@ -499,7 +499,7 @@ void ShaderProgram::resolveLinks(void)
     for(; dfIt != dfEnd; ++dfIt)
     {
         if(dfIt->_func.empty() == false)
-            (dfIt->_func)(this, 0x0000);
+            (dfIt->_func)(this, 0x0000, ChangedOrigin::External);
     }
 
     Inherited::resolveLinks();
diff --git 
a/Source/System/State/Shader/Chunks/OSGShaderProgramVariableChunk.cpp 
b/Source/System/State/Shader/Chunks/OSGShaderProgramVariableChunk.cpp
index 3f34501..34f60ca 100644
--- a/Source/System/State/Shader/Chunks/OSGShaderProgramVariableChunk.cpp
+++ b/Source/System/State/Shader/Chunks/OSGShaderProgramVariableChunk.cpp
@@ -289,7 +289,7 @@ void ShaderProgramVariableChunk::resolveLinks(void)
     for(; cfIt != cfEnd; ++cfIt)
     {
         if(cfIt->_func)
-            (cfIt->_func)(this, 0x0000);
+            (cfIt->_func)(this, 0x0000, ChangedOrigin::External);
     }
 
     Inherited::resolveLinks();
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to