nodeAdded signal, properties are not set on imported node.

SMokeyDemonSMokeyDemon Posts: 0

Hi

Ive created a slot to listen to the DzScene::nodeAdded signal, this is working fine but I'm having issues when reading property values.

I have a node with a DzEnumProperty, I have saved this node with a non 0 value (ie not the first selection in the enum list), on import to the scene, it fires the nodeAdded function, when using both functions "getValue" or "getStringValue" to retrieve the value of the added node, I am getting the default value '0' (the first item in the list), on inspection of the loaded asset the property setting is set correctly and is not value '0'.

I seems that the nodeAdded function is being called when the node is created (while it still has its default values), but before the properties are loaded/set onto the node?

Is there any way to get a callback of the node when added to the scene and all the properties are loaded?

Cheers.

Comments

  • dtammdtamm Posts: 126
    edited December 1969

    You can delay processing the nodes by storing them in a list, then DzScene::sceneLoaded will tell you when a scene is loaded. Or you can hook up to your enumProperty and react when its value is changed.

  • SMokeyDemonSMokeyDemon Posts: 0
    edited December 1969

    thanks dtamm, that does the trick :)

Sign In or Register to comment.