honya Posted March 10, 2015 Share Posted March 10, 2015 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
necris Posted March 11, 2015 Share Posted March 11, 2015 Hi, Unfortunately, we can't reproduce such behaviour. Could you provide a sample with a problem track and script? Link to comment
honya Posted March 11, 2015 Author Share Posted March 11, 2015 Hi Necris, i attach test scene track_load.rar that throw this error. It throw code called from expression, in script is it ok. Thanks Honya Link to comment
unclebob Posted March 12, 2015 Share Posted March 12, 2015 Thanks, Honya! Will look at the sample and report back soon. Link to comment
unclebob Posted March 12, 2015 Share Posted March 12, 2015 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 Posted March 12, 2015 Author Share Posted March 12, 2015 Unclebob: ok. Which way must call that function? Because i always get NULL in expresion, but in script i get right object. Thanks Honya Link to comment
unclebob Posted March 15, 2015 Share Posted March 15, 2015 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
Recommended Posts