Horde3D
http://www.horde3d.org/forums/

best way to check if node exists?
http://www.horde3d.org/forums/viewtopic.php?f=2&t=433
Page 1 of 1

Author:  jimbo [ 18.07.2008, 22:00 ]
Post subject:  best way to check if node exists?

Is there a way to know if a node exists without producing a log entry? Using
Code:
getNodeType( NodeHandle  node )
and test for an invalid handle produces an error in the log.

Author:  marciano [ 19.07.2008, 20:09 ]
Post subject:  Re: best way to check if node exists?

Currently I can only propose you a workaround. You could decrease the message level (EngineOptions::MaxLogLevel) and use the getNodeType function after that. Probably it would make sense to add a special function for validating a node/resource handle.

Author:  stuckie [ 19.07.2008, 23:32 ]
Post subject:  Re: best way to check if node exists?

Wouldn't using findNode work as well? As it would return a 0 if it can't find the node you're looking for.. granted you'd need to know it's string and resource type, but it's better than nothing :)

Author:  swiftcoder [ 19.07.2008, 23:55 ]
Post subject:  Re: best way to check if node exists?

jimbo wrote:
Is there a way to know if a node exists without producing a log entry?
I am really having a hard time coming up with a reason to do this - any chance you could explain yours?

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/