Hello Robert,
Thanks for the quick reply. It is, indeed a node. But if the node was
not intended to be used as-is, shouldn't it be abstract? Yet, it seems
that it is not treated like that at all within the code. In fact, the
visitors' apply(osg::Node&) method suggests that you can actually end up
visiting a Node...
I indeed fixed my problem by replacing:
new osg::Node(node, osg::CopyOp::DEEP_COPY_ALL);
by:
osg::ref_ptr<osg::Node> osgNode =
dynamic_cast<osg::Node*>(_node.clone(osg::CopyOp::DEEP_COPY_ALL));
Which probably would have caused another bug eventually... But I am
rather surprised that the visitors use references instead of pointers.
The latest would allow making osg::Node abstract (i.e. class Node
abstract {};) to prevent this kind of mistakes/problems. Should
osg::Node never be created, shouldn't its creation be prevented?
Thanks a lot Robert!
J-O
Robert Osfield wrote:
Hi Jean-Olivier,
Could you try outputting the data to a .osg and have a look at the results.
It sounds like somehow an osg::Node has got into the scene graph, and
osg::Node is really just meant as a base class from Node's so not
something you'd put in the scene graph.
Robert.
On Wed, Dec 23, 2009 at 8:46 PM, Jean-Olivier Racine
<[email protected]> wrote:
Hello all,
I think I just came across a bug in 2.9.6, revision 10691. I save a tree
(very simple one) which has been created from importing a tree using the 3ds
plugin (log below):
-- LOG BEGINS --
INFO: OSG: Opened DynamicLibrary osgPlugins-2.9.6/osgdb_3dsd.dll
INFO: OSG: texture->name=OAK1.TGA, _directory=C:/Users/Jean-Olivier
Racine/Desktop
WARNING: OSG: texture 'OAK1.TGA' not found
INFO: OSG: Final OSG node structure looks like this:
INFO: OSG: Group
INFO: OSG: Geode
-- LOG ENDS --
When I try to save this tree, I simply do a osgDB::writeNodeFile(node,
filename), where the node corresponds to the group in the LOG above.
If I save using the OSG (in filename), all works fine. If I save using the
IVE extension, it fails (log below):
-- LOG BEGINS --
INFO: OSG: Opened DynamicLibrary osgPlugins-2.9.6/osgdb_ived.dll
WARNING: OSG: Error writing IVE file: Unknown node in Group::write()
-- LOG ENDS --
Looking at the code where the exception is thrown, in
DataOuputStream.cpp:1381 (in writeNode()), it seems that there simply isn't
any treatment for... ...osg::node. Only sub types are handled.
I did not try to modify the code and recompile because I am not setup for
this, but in all likelihood, I believe that this is the problem.
Are you aware of this? Am I missing something?
Thanks all,
J-O
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org