Killer.Penguin Posted January 21, 2014 Share Posted January 21, 2014 Ok so I have characters setup and all that from the editor. What function do I use to spawn them into my world via script? Link to comment
Killer.Penguin Posted January 21, 2014 Author Share Posted January 21, 2014 engine.world.loadNode? After that how do I add the loaded node into the world? Link to comment
sebastianbah Posted January 22, 2014 Share Posted January 22, 2014 Hello,The following line add your node to world but not to editor: Node node = engine.world.loadNode("<node_path>/node.node",0); If you want to get access to the node from editor use engine.editor.addNode() function. 1 Link to comment
Killer.Penguin Posted January 27, 2014 Author Share Posted January 27, 2014 https://developer.unigine.com/en/docs/1.0/scripting/library/engine/engine.world#engine.world.loadNodes_string_int Nodeengine.world.loadNode (string filename,int cache)"Loads a node from a file. If the node is loaded successfully, it does not belong to any node hierarchy or list, so be careful and make sure to handle it properly, when it is no longer needed." Huh??? I'm very confused with Unigine along these loading and setting up character stuff. How do I add animations into it? Is there a good tutorial for this? Link to comment
ulf.schroeter Posted January 27, 2014 Share Posted January 27, 2014 No tutorial, but numerous samples. Please have a look into the script code snippets. Link to comment
sebastianbah Posted January 27, 2014 Share Posted January 27, 2014 Killer.Penguin, You can use setAnimation() to set animation from script. Please, check Animation samples: <SDK folder>/data/samples/animation Link to comment
Killer.Penguin Posted January 27, 2014 Author Share Posted January 27, 2014 Yeah, I looked at the character sample scriptss, but those seem really too complicated for my usage (as it uses animation tree, combiner and such.) ObjectMeshSkin has setAnimation() and all that but it cannot saved nor do any animation blending on its own. Wish we have something simpler that handle those simple tasks.. Link to comment
Killer.Penguin Posted January 27, 2014 Author Share Posted January 27, 2014 ps. I notice these's this "node_load" function in character.h (mesh = node_load(mesh_file_name).) However I couldn't locate the root of such function... can you help guide me to its root class? Link to comment
sebastianbah Posted January 27, 2014 Share Posted January 27, 2014 Killer.Penguin, Animation samples shows how to combine animations using different layers. To open animation samples enter "world_load samples" in console and choose animation/animation_00. You can find source files for animation samples in <SDK folder>/data/samples/animationYou can find definition of node_load() function in unigine.h Link to comment
Killer.Penguin Posted January 27, 2014 Author Share Posted January 27, 2014 Is there any doc on unigine.h? I couldn't find it on your web... Link to comment
sebastianbah Posted January 27, 2014 Share Posted January 27, 2014 You can find some information here. upd. Full list of functions from unigine.h script you can find here Link to comment
Killer.Penguin Posted January 28, 2014 Author Share Posted January 28, 2014 ps. I understand how the animation layer work, but I would very much like Unigine to have a simpler animation blending management built in. (For example, just call blend and such. No worrying about layers..) Just a nip-picking thought. Link to comment
sebastianbah Posted January 28, 2014 Share Posted January 28, 2014 You can try to use Skinner for your needs. Link to comment
Killer.Penguin Posted January 29, 2014 Author Share Posted January 29, 2014 Skinner and schemer is way too complicated for my need.. I just need simple animation system for blending and such, Guess I have to come up with something simpler on my own. Thx though. :_) Link to comment
Recommended Posts