Forum

Change scenes

21 October 2017 10:23
Good, I can not find a way to change the scene, I do not know if it can be done.
Thank you
23 October 2017 16:19
Did you try it on already with API?
var m_scenes = require("scenes");
m_scenes.set_active("Scene");
http://blender.hu Hungary Blender Community Site
23 October 2017 18:33
Thank you very much for answering.
Yes stewet, the method you propose and in this way

var m_scenes = require("scenes");
               var listScenes = m_scenes.get_scenes();
               m_scenes.set_active(listScenes[1]) 


I can not get it to work, just load the first scene.
24 October 2017 19:42
Test it possibly so:
var scenes = m_scenes.get_all_scenes();
    var scene_names = [];
    for (var i = 0; i < scenes.length; i++)
        scene_names.push(scenes[i]["name"]);

It may be m_scenes.set_active() a name may be his parameter only. (I am not a programmer)
http://blender.hu Hungary Blender Community Site
24 October 2017 21:36
I'm sorry, stewet, this code does not work, the method (get_all_scenes) does not exist, there is (get_scenes ()), this method is already a list, it could be accessed by name or by index, I tried it with a loop but it does not work.
Regards.


P.S. I'm not a programmer, I'm an amateur, it's my hobby.
25 October 2017 11:05
Which version do you use?
What does the console write onto your code?
http://blender.hu Hungary Blender Community Site
25 October 2017 20:48
Hi stewet, I use version 17.8, I leave a screenshot with the error that gives me the console.
Thank you
 
Please register or log in to leave a reply.