Jump to content

[SOLVED] World Nodes


photo

Recommended Posts

Hi, I have an odd question that I think I know the answer to, but I'm a little puzzled about some specifics.

 

Here's our setup:

We have a simulation mode and a editing mode. During simulation mode we run the Unigine application without any editing facilities at all (we don't want things changing during this mode). So a large amount of what we create (node wise) is in world and not in the editor. During editing mode, we push some of our loaded elements into the editor but not always (for various reasons).

 

So, the question is, during simulation mode is it possible to use the tracker object - since it attempts to use the engine.editor.getNodeByName function in the file tracker_parameter.h. I was thinking there should be a fairly simple way to supplant this function with a look-up into the world nodes, but there doesn't appear to be any mechanism for this? (or is there?).

 

Is there any world node 'get loaded node list' or something similar?

Is there any getNodeByName equivalent for world nodes?

Is the tracker object usable without the editor? If no, do we need to use something else?

 

I have also been through the forums (trying to search) for discussions on how to search world nodes, and not found anything to help - if there is a thread, please point me to it.

Thanks in advance,

Dave.

Link to comment

Yes. Sorry, I forgot some important details :(

We are dynamically loading nodes into the scene at run-time and I noted in the help that the "getNodeByName" states that "Returns a node (loaded from the *.world file or belonging to the node list of UnigineEditor) by its name." These nodes being loaded are not in the world file and are not being pushed into the editor space, hence why they are not being found by the tracker, so the question still remains if we use dynamic nodes, the tracker will have problems.

 

It would seem that we need to move these nodes into the world some way. I'm thinking maybe we can get our dynamic nodes into a NodeLayer and use it this way? Does this sounds sensible?

But in any-case, the other two questions remain. It seems odd to have to move objects between world and editor and then back again just to search for a node? What is the intent if the world is procedurally generated? Do you need to push all of them to the editor for them to be useful.

 

Why have a world of objects at all, seems like everything should be pushed to the editor always? Is this what others are doing?

 

Cheers,

Dave.

Link to comment

`Successfully pushed the nodes into a NodeLayer and now the tracker is picking up the nodes without problem, however our nodes are now in the editor.

I assume game developers will be needing to keep nodes from being editable at run-time, so using the world space(I assume this is what the world vm is for). Are you doing this as a post process or something? Push the editor nodes to world space as part of a release? Again, I'm interested in hearing what others are doing. Or maybe people are not bothered and just put everything in the editor?

Cheers,

Dave

Link to comment

Hi Dave,

 

There is no 'getNodeByName' analog for world script, but you can get any node by its id via engine.world.getNode call. Also, you can use this id as tracker parameter to bind your node in world script to the tracker system.

 

For example, lets say we have this track:

 

<track version="1.00" min_time="0" max_time="1" unit_time="1">
<parameter type="node.object.particles.swanRate" id="1803495018" name="light_dust">
 <key time="0" type="1">0</key>
 <key time="1" type="1">60</key>
</parameter>
</track>

 

In this case we look for world script node at given id and if we haven't found any then we look for editor script node by given name.

Link to comment

You can also set any tracker parameter object by calling setParameterObject on your TrackerTrack instance. This could solve your problem with dynamic loading.

Link to comment

Thanks unclebob - that is very useful.

The engine.world.getNode requires an id, I assume this id is unique for an object across worlds (if its per world, it wont be overly useful).

We can keep a list of the id's we need for these specific nodes and use that function - sounds like a nice/quick solve.

Is there any likelihood the world will get search/lookup features in the future?

Thanks again.

 

Cheers,

Dave

Link to comment

Hi Dave,

 

Sorry for late reply. No, we don't plan to add world search/lookup features. In world script you can get any node by its id, in editor you can get node by its name and thats enough for most use cases.

Link to comment
×
×
  • Create New...