Forum

Sync camera with blend file

17 September 2015 11:43 #3889
Hi all,
I am new to blend4web and trying to understand all the features.
I was asking myself if there was the feature to sync blend4web camera with the ".blend" file because I would like to use Blend4web as front end viewer and render online with cycles.

Thank you.
Filippo
18 September 2015 10:35 #3908
Xsippo, it is my understanding that all the rendering occurs through the Blend4Web renderer rather than Blender Render or Cycles. The effects that you can achieve in Cycles won't render to WebGL using Blend4Web. If you have a scene in Blender, you can certainly render that into an HTML or JSON file that is viewable online. You will just need to take advantage of the Blend4Web render effects rather than Cycles effects.

If you haven't seen this video, it might be worth a look.
https://www.youtube.com/watch?v=nsQPI7YM-LE

I am still new to this myself so please elaborate on your question if I missed your point.
~Will
Blend4Web Videos
https://www.youtube.com/channel/UCp6x8JP7oCiiTjbJorPPMsQ/videos
18 September 2015 11:02 #3911
Hi Will, thank you for your reply.
I know that blend4web use WebGl to render and I need to bake to textures to archive a realistic effect.
What I am looking for is the possibility to use Blend4Web as the front-end interface to enable a user to "manipulate" a simple 3D scene without teaching blender interface to everyone.
Inside the Bled4web 3d scene there will be a button to render the scene on the renderfarm online with command line and scripting.

Hope I better explain my question.
Thank you
Filippo
18 September 2015 12:06 #3913
Hello and welcome to the forum!

This task is more about server interaction rather than Blend4web API. You can easily extract camera position from Blend4Web scene and send it with POST message to the server. What is going to happen on the server side is a completely independent story, but I think it's not a very complex challenge to write a script for setting camera position in Blender with something like this:

scene.camera.rotation_mode = 'QUATERNION'
scene.camera.rotation_quaternion[0] = rx
scene.camera.rotation_quaternion[0] = ry
scene.camera.rotation_quaternion[0] = rz
scene.camera.rotation_quaternion[0] = rw

scene.camera.location.x = tx
scene.camera.location.y = ty
scene.camera.location.z = tz
Blend4Web developer
18 September 2015 12:27 #3914

This task is more about server interaction rather than Blend4web API. You can easily extract camera position from Blend4Web scene and send it with POST message to the server. What is going to happen on the server side is a completely independent story, but I think it's not a very complex challenge to write a script for setting camera position in Blender

Thank you very much!
This is a very good info to start with.
I will dig into API to understand how to interact with POST variables and search for Blender server-side scripting.

Thank you.
 
Please register or log in to leave a reply.