Export data

12 February 2018 13:34
Hey there,

we are not able to export the data via the webplayer.

Isnt there any kind of documentation/example on the get request api? I mean it should be simple. We just need a possibility to export the scene with a button click. I don’t think this is the first time, that somebody is asking for that, or am i wrong? :D

For me as a web developer i would love to have something like a unique scene id which i can look up via an api.

Something like this:
exampleurl.com/example_scene.html?exportscenedata=123sceneid456&format=json

Is that possible?

Thanks for your time!
Patrick
12 February 2018 14:46
I'm not sure I got you. What should happen after clicking on exampleurl.com/example_scene.html?exportscenedata=123sceneid456&format=json ? The original Json should be downloaded? In this case this is not exporting, because there is no data convertion.

If you just want to save parameters, you can encode them in url like how it was implemented here

And just some info regarding data loading and its identification: you can load your data dynamically with load method. ID will be returned.
Alexander (Blend4Web Team)
twitter
13 February 2018 13:43
No, i do not want to export the original json. As you can see you are able to customize the scene with several buttons (colors).

I want to export those chosen colors after clicking an export button. Isnt that simply possible? Even in the example you have posted (the bag configurator) it is not able to export/share the configuration.
13 February 2018 14:02
(the bag configurator) it is not able to export/share the configuration.
It's able, just click "Customize" then change anything and click "save/share". This is how I shared my configuration with you.

Since your app is implemented with "Logic Nodes" you can interact with javascript using "JS Callback" node, just pass the configured params to this node every time when you changing some parameter. Then you can use this data in any way you want including sending this data with pure Javascript with native html button, or generating the link (like in bag configurator). In case of link you should add some code which will parse the url and initialize the configuration.
Alexander (Blend4Web Team)
twitter
28 March 2018 21:41
Hi Alexander,

That bag configurator example looks great, could i ask you how would you go about the generating the link ? Or as you mentioned previously just saving the color configuration ?

Generating the link would be great is there any sample files for that ?

I guess we need to add the Variable Store node and Jscallback node to each inherit material change branch but how do you get the data (variables) out of that ? Console print & send request nodes ?



Sorry i am struggling with this as i am just a 3d modeler and never touched any code properly.

cube_test.blend
 
Please register or log in to leave a reply.