Jump to content

[SOLVED] [2,0] error when load track file


photo

Recommended Posts

Hi,

 

i try load track file in script and get this error:

22:45:38 Unigine::Tracker::TrackerParameterFloat::Track(track).cache = CACHE;
22:45:38 memory:17: Interpreter::parse(): unknown token "Unigine::Tracker::TrackerParameterFloat::Track"
22:45:38 Unigine::Tracker::Tracker::compileParameters(): can't compile parameters

 

Code is:

#include <unigine.h>
#include <core/systems/tracker/tracker.h>

using Unigine::Tracker;

void loadTrack() {
	// Create a Tracker that will play track animations.
	Tracker tracker = new Tracker();
	// Load the created Tracker tracks from file.
	data.track = tracker.loadTrack("data/esq/tracks/env/lightning.track");
}

I can open this track in editor without error.

 

What is wrong?

 

Thanks

Honya

Link to comment

Honya,

 

Looks like you can't use Tracker inside WorldExpression that way, because of its internal design (it has its own interpreter instance). What you can do instead is to move that tracker creation code to world script as function and call that function from WorldExpression node.

Link to comment

Honya,

 

You can read about inter-script communication between WorldExpression and world/system/editor script here: https://developer.unigine.com/en/docs/1.0/scripting/library/worlds/class.worldexpression

 

So you need to move your code from expression to some world/system/editor script function and use engine.world.call/engine.system.call or engine.editor.call in WorldExpression. Note that you can't pass UserClasses (like Tracker or TrackerTrack) between world/system/editor script and WorldExpression.

Link to comment
×
×
  • Create New...