Forum

Edit code while still working in Blender?

04 January 2016 21:21
Assuming all of the JS coding is done in a separate application, I am puzzled how it is possible to go back into Blender to make additional 3D modifications and still keep any code modifications made through the separate application. Once the changes are made in Blender and a new JSON file is exported, all previously added code through a third application is lost (i.e. replaces previous one).
Does all of the modeling etc have to be completed in Blender prior to any coding. Perhaps there a way to edit the code within Blender?
I have tried to follow the documentation; however, it is still not clear.
Thanks
05 January 2016 13:16
Hi!

The .json file constains only the scene models/cameras/lamps etc and does not include any code. This is what JavaScript (.js) files for. This approach allows artists and coders work independently from each other. If you need more info about this approach see the following topic in the documenation.
05 January 2016 13:32
Hello.

You can change a scene anytime you want. It is completely independent from JS-scripts. Code is not included in JSON-files.
The project structure is described here: link
It is as follows:
blend4web/
    apps_dev/
        myproject/
            project.py
            .b4w_project
            myproject.js
            myproject.css
            myproject_dev.html
    blender/
        myproject/
            myproject.blend
    deploy/
        apps/
            my_project/
                myproject.js
                myproject.css
                myproject.html
        assets/
            myproject/
                myproject.json
                myproject.bin

Thus, when you reexport myproject.json, myproject.js remains untouched.
05 January 2016 15:26
Excellent. Thanks for clarifying.
 
Please register or log in to leave a reply.