Forum

User posts SergeyN
30 August 2016 18:58
Просто функцией m_animation.apply(new_obj, name)? Все равно пустой список
30 August 2016 18:10
Здравствуйте! У меня не сохраняется анимация на новом объекте при глубоком копировании. Так и должно быть или я что-то неправильно делаю? На клоне m_anim.get_anim_names(new_obj) выдает уже пустой список.
11 August 2016 12:23
В основной сцене действительно присутствуют все объекты, но у меня происходит динамическая подгрузка сцен и там уже список неполный. Вот пример:


"use strict"

// register the application module
b4w.register("test_get_obj", function(exports, require) {

// import modules used by the app
    var m_app       = require("app");
    var m_data      = require("data");
    var m_scn       = require("scenes");
    /**
     * export the method to initialize the app (called at the bottom of this file)
     */
    exports.init = function() {
        m_app.init({
            canvas_container_id: "main_canvas_container",
            callback: init_cb,
            show_fps: true,
            console_verbose: false,
            autoresize: true
        });
    }

    /**
     * callback executed when the app is initialized
     */
    function init_cb(canvas_elem, success) {

        if (!success) {
            console.log("b4w init failure");
            return;
        }
        load();
    }

    /**
     * load the scene data
     */
    function load() {
        m_data.load("/assets/components/light_test.json", load_cb);
    }

    /**
     * callback executed when the scene is loaded
     */
    function load_cb(data_id) {
        m_app.enable_camera_controls();

        // place your code here
        var objs = m_scn.get_all_objects("ALL",data_id);
        console.log("Основная сцена", objs);
        m_data.load("/assets/components/light_test.json", function(data_id2) {
            console.log("Та же сцена, загруженная после", m_scn.get_all_objects("ALL",data_id2));

        });

    }


});

// import the app module and start the app by calling the init method
b4w.require("test_get_obj").init();
10 August 2016 18:08
Добрый день! Вопрос такой: у меня простая сцена - объект типа Plane и источник света Point. При экспорте в списке объектов, получаемый функцией m_scn.get_all_objects("ALL",data_id), отсутствует источник света. Галочки Do Not Export на Point не стоит. В чем может быть дело?