20 August 2016 13:26
Hi,
I'm trying to programmatically get an object so that I can outline it in the scene viewer. The object in question has been dynamically loaded making it necessary to get it like this:
Once, I have the object, I try to apply its outline animation:
Nonetheless, this doesn't work… the error I get given back is: B4W ERROR: apply_outline_anim(): wrong object
The select object's type is 'MESH'. Is that the reason? Either way, how can I programmatically get a dynamically loaded object/scene and display its outline (animation). That is, I am not interested in using something like the "pick_object" function (https://www.blend4web.com/api_doc/module-scenes.html#.pick_object) to get the object based on user interaction within the scene viewer.
Do I need to implement sensors (and the accompanying manifolds), not unlike what was done in the "Furnishing a Room" tutorial (https://www.blend4web.com/en/community/article/66/) to programmatically get an object and run its outline animation?
The whole point of what I am trying to do is to have a list of (dynamically loaded) objects in a host web application and to outline the object of the corresponding list item that is currently being hovered over (in the before-mentioned list).
Hope this makes sense. Thanks in advance,
Brett
I'm trying to programmatically get an object so that I can outline it in the scene viewer. The object in question has been dynamically loaded making it necessary to get it like this:
var selectedObject = m_scenes.get_object_by_name(name_of_object, m_scenes.DATA_ID_ALL);
Once, I have the object, I try to apply its outline animation:
m_scenes.apply_outline_anim(selectedObject, 1, 1, 0);
Nonetheless, this doesn't work… the error I get given back is: B4W ERROR: apply_outline_anim(): wrong object
The select object's type is 'MESH'. Is that the reason? Either way, how can I programmatically get a dynamically loaded object/scene and display its outline (animation). That is, I am not interested in using something like the "pick_object" function (https://www.blend4web.com/api_doc/module-scenes.html#.pick_object) to get the object based on user interaction within the scene viewer.
Do I need to implement sensors (and the accompanying manifolds), not unlike what was done in the "Furnishing a Room" tutorial (https://www.blend4web.com/en/community/article/66/) to programmatically get an object and run its outline animation?
The whole point of what I am trying to do is to have a list of (dynamically loaded) objects in a host web application and to outline the object of the corresponding list item that is currently being hovered over (in the before-mentioned list).
Hope this makes sense. Thanks in advance,
Brett