From e02f35264fd2e8f78d258d73cb5f6c709b110e64 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 6 Feb 2016 15:08:12 +0100 Subject: [PATCH] Work around OSG 3.2 not respecting the DEEP_COPY_CALLBACK flag (Fixes #3183) --- components/sceneutil/clone.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/sceneutil/clone.cpp b/components/sceneutil/clone.cpp index 26f3f5c7c..784195e7e 100644 --- a/components/sceneutil/clone.cpp +++ b/components/sceneutil/clone.cpp @@ -81,6 +81,11 @@ namespace SceneUtil #endif osg::Drawable* cloned = osg::clone(drawable, copyop); +#if OSG_VERSION_LESS_THAN(3,3,3) + // work around OSG 3.2 not respecting the DEEP_COPY_CALLBACK flag + if (cloned->getUpdateCallback()) + cloned->setUpdateCallback(osg::clone(cloned->getUpdateCallback(), *this)); +#endif return cloned; } if (dynamic_cast(drawable))