diff --git a/src/osg/CopyOp.cpp b/src/osg/CopyOp.cpp index 50e801d57..9c28c0f29 100644 --- a/src/osg/CopyOp.cpp +++ b/src/osg/CopyOp.cpp @@ -33,7 +33,6 @@ TYPE* CopyOp::operator() (const TYPE* obj) const \ } COPY_OP( Object, DEEP_COPY_OBJECTS ) -COPY_OP( Node, DEEP_COPY_NODES ) COPY_OP( StateSet, DEEP_COPY_STATESETS ) COPY_OP( Image, DEEP_COPY_IMAGES ) COPY_OP( Uniform, DEEP_COPY_UNIFORMS ) @@ -49,6 +48,16 @@ Referenced* CopyOp::operator() (const Referenced* ref) const return const_cast(ref); } +Node* CopyOp::operator() (const Node* node) const +{ + if (!node) return 0; + + const Drawable* drawable = node->asDrawable(); + if (drawable) return operator()(drawable); + else if (_flags&DEEP_COPY_NODES) return osg::clone(node, *this); + else return const_cast(node); +} + StateAttribute* CopyOp::operator() (const StateAttribute* attr) const { if (attr && _flags&DEEP_COPY_STATEATTRIBUTES)