From c58ff9b656758ea24f7482ce1866925cfce40b9a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 11 Mar 2009 11:00:24 +0000 Subject: [PATCH] From Lionel Lagarde, "The copy constructor of the nodes and the drawables do : Node::Node(Node &node, copyop) : _stateSet(copyop(node.getStateSet()), It doesn't call the setStateSet method of osg::Node (or osg::Drawable). So the parent list of the state set is not updated with the new node (drawable)." --- src/osg/Drawable.cpp | 2 +- src/osg/Node.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index 8bb2b40e8..18d64730f 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -223,7 +223,6 @@ Drawable::Drawable() Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop): Object(drawable,copyop), _parents(), // leave empty as parentList is managed by Geode - _stateset(copyop(drawable._stateset.get())), _initialBound(drawable._initialBound), _computeBoundCallback(drawable._computeBoundCallback), _boundingBox(drawable._boundingBox), @@ -240,6 +239,7 @@ Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop): _cullCallback(drawable._cullCallback), _drawCallback(drawable._drawCallback) { + setStateSet(copyop(drawable._stateset.get())); } Drawable::~Drawable() diff --git a/src/osg/Node.cpp b/src/osg/Node.cpp index 098a49f65..45b5555dc 100644 --- a/src/osg/Node.cpp +++ b/src/osg/Node.cpp @@ -82,9 +82,9 @@ Node::Node(const Node& node,const CopyOp& copyop): _numChildrenWithCullingDisabled(0), // assume no children yet. _numChildrenWithOccluderNodes(0), _nodeMask(node._nodeMask), - _descriptions(node._descriptions), - _stateset(copyop(node._stateset.get())) + _descriptions(node._descriptions) { + setStateSet(copyop(node._stateset.get())); } Node::~Node()