From 48e0f098ff1c19816785d7718b972c79bd1cc144 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 24 Feb 2017 07:38:03 +0100 Subject: [PATCH] Add missing copy of callbacks when a Transform is replaced by Group (Fixes #3770) --- components/sceneutil/optimizer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/sceneutil/optimizer.cpp b/components/sceneutil/optimizer.cpp index b0686d524..1aadc19d6 100644 --- a/components/sceneutil/optimizer.cpp +++ b/components/sceneutil/optimizer.cpp @@ -537,7 +537,10 @@ bool CollectLowestTransformsVisitor::removeTransforms(osg::Node* nodeWeCannotRem group->setDataVariance(osg::Object::STATIC); group->setNodeMask(transform->getNodeMask()); group->setStateSet(transform->getStateSet()); - group->setUserData(transform->getUserData()); + group->setUpdateCallback(transform->getUpdateCallback()); + group->setEventCallback(transform->getEventCallback()); + group->setCullCallback(transform->getCullCallback()); + group->setUserDataContainer(transform->getUserDataContainer()); group->setDescriptions(transform->getDescriptions()); for(unsigned int i=0;igetNumChildren();++i) {