Problem with Anchor nodes

There seems to be an issue with anchor nodes when being created within a custom node's InitSelf() method:

mAnchor = dynamic_cast<Graph::IAnchor*>(root->CreateNode("Anchor"));

which generates the following output while failing initialization:

2014-04-09 15:43:11.239 Sky[20963:1d703] Load package 'menu'.
2014-04-09 15:43:11.244 Sky[20963:1d803] (null)
2014-04-09 15:43:11.244 Sky[20963:1d803] Murl::Graph::Node::Init(), line 893: ID=, InitSelf() failed
2014-04-09 15:43:11.244 Sky[20963:1d803] Murl::Graph::Node::InitChildren(), line 1275: ID=particles, Failed for child 3
2014-04-09 15:43:11.245 Sky[20963:1d803] Murl::Graph::Node::Init(), line 911: ID=particles, InitChildren() failed
2014-04-09 15:43:11.245 Sky[20963:1d803] Murl::Graph::Node::InitChildren(), line 1275: ID=, Failed for child 4
2014-04-09 15:43:11.245 Sky[20963:1d803] Murl::Graph::Node::Init(), line 911: ID=, InitChildren() failed
Oops, that's a bug.

Currently, the Graph::Anchor node expects an ID to be set, otherwise initialization fails. Unfortunately, the debug error output for this case is broken as well, that's why you get the "(null)" error message.

Will be fixed in the next release; we removed the ID check so that it's possible to create an unnamed anchor node (which is probably what you want when generating nodes from code).

In the meantime, you can work around that problem by setting a unique ID for the newly created anchor nodes:
mAnchor = dynamic_cast<Graph::IAnchor*>(root->CreateNode("Anchor", newAnchorId));

Hope that helps!

Forum Jump:

Copyright © 2011-2017 Spraylight GmbH.