Forum

Using .bin file from a different location and name than .json

11 May 2016 23:06
I have a file upload system, where the files are renamed to a md5 hash to avoid naming conflicts. My problem is that the .bin file has to be the same name as the .json file (also same location). Is there some way to specify the .bin file location? I am loading the .json using this code:

    let m_app    = b4w.require("app");
    let m_data   = b4w.require("data");

    m_app.init({
        canvas_container_id: "canvas_cont",
        callback: init_cb,
        physics_enabled: false,
        media_auto_activation: false
    });

    function init_cb(canvas_elem, success) {
        m_data.load("../"+jsonFile, load_cb);
    }

    function load_cb(root) {
        m_app.enable_camera_controls();
    }
13 May 2016 16:06
Is there some way to specify the .bin file location? I am loading the .json using this code
The location is written automatically into the .json file during the export. So, the only way is to change it manually. It's stored at the following path: JSON_FILE["binaries"]["binfile"]


13 May 2016 18:55
Thanks, I should be able to use this
13 May 2016 19:28
sorry, I was wrong about the path, it should be: JSON_FILE["binaries"][0]["binfile"]
 
Please register or log in to leave a reply.