Forum

hide_object(), children and lamp

04 December 2015 01:33
Hello,

i try to hide an empty with all his children :

m_scenes.hide_object(m_scenes.get_object_by_name("my_empty"), false);


it dosen't work, it seems it hides only the empty, not the children.

The same when i try to hide a lamp :

m_scenes.hide_object(m_scenes.get_object_by_name("my_lamp"));


it gives this error :
B4W ERROR: show/hide is only supported for dynamic meshes/empties

The API doc says it is possible :
Check if object is hidden. Supported only for dynamic meshes/empties and lamps.

is it? how do i do?

Thank u


04 December 2015 09:51
Hello and welcome to the forum.

Could you tell me, please, what version of b4w engine (b4w.min.js) you use? The hide/show methods for lamp objects and children was supported in 15.11 b4w version. I see the old version of console message. In the latest version it is "B4W ERROR: show/hide is only supported for dynamic meshes/empties and lamps".

If you use the latest b4w engine version, please, let me know.
04 December 2015 09:54
Also, don't forget to enable "Force dynamic object" property on your empty object.
04 December 2015 10:17
I've just downloaded and tested the latest SDK version. It's works fine. My scene:

Hide/show empty with child:


Lamp:


04 December 2015 12:11
OK,
thanx Roman, you're right :
I started this project on the 15_10 SDK, and it keeps the old b4w.min.js
I replace by the new one and it 's ok!

Thx
05 April 2017 20:25
There seems to be a problem with hiding lamps with Cycles Nodes, though. Try your example (fresh scene, cube), put a plane under the cube, make a Glossy Shader (GGX) material for the Plane. My result:

Lamp on:



Lamp off:



The cube goes fully dark, but the glossy Cycles material on the plane remains visible. Do you get this too?

As a temporary workaround, instead of show/hide, I simply move the lamp back/forth by a thousand Blender units to simulate the "lamp on/off" state. Works fine.
06 April 2017 10:14
The cube goes fully dark, but the glossy Cycles material on the plane remains visible. Do you get this too?

As a temporary workaround, instead of show/hide, I simply move the lamp back/forth by a thousand Blender units to simulate the "lamp on/off" state. Works fine.
Hello,

thank you for the report! We'll take a look at the issue
Blend4Web Team - developer
Twitter
LinkedIn
 
Please register or log in to leave a reply.