Forum

Static object outline via API

22 January 2016 13:54
Hi,
We got a scene with several outline-able objects. It's a first-person walk kind of project, so there is no mouse pointer, and objects are interacted with via collisions and so on.
We use the outlining feature to hint interactivity to the user; as there is no mouse pointer, we enable the outline with the API call apply_outline_anim(). Problem is, this function seems to always make an intensity animation cycle effect. We'd rather make this static in intensity (maybe fade in and out on activation and deactivation, but no looping animation), just like the mouse hover outline effect does.
We tried various parameter values for the apply_outline_anim() with no success, and looked for a similar function without the _anim component but found none.

Any help would be much appreciated.
Thanks a lot.
22 January 2016 14:48
Hello.

m_scenes.apply_outline_anim(cube, 0.5, 1) // cycle effect
m_scenes.apply_outline_anim(cube, 0.5, 1, 0) // cycle effect
m_scenes.apply_outline_anim(cube, 0.5, 1, 1) // not cycle effect
m_scenes.apply_outline_anim(cube, 0.5, 1, 2) // not cycle effect

end etc

The fourth param determines number of the anim iteration.
22 January 2016 15:43
Hi Roman,
Thanks for the swift response.

Not there yet, I'm afraid I didn't properly explain what we are trying to achieve.
With your code, the outline does not loop, but it does the complete off-on-off cycle on its own. What we need is for the effect to not have a specific duration, but rather to apply the outline with a static intensity and keep it static indefinitely (till we disable it via another function, we are currently using clear_outline_anim for that).

Hope this makes the issue clearer.
Thanks again.
22 January 2016 17:16
Sorry, try to use the following code lines for enabling outline animation
m_scenes.set_outline_intensity(cube, 1);

and for disabling it:
m_scenes.set_outline_intensity(cube, 0);
22 January 2016 17:20
Also you can animate the fade-out outline animation with using a timeline sensor
25 January 2016 12:59
Spot on, Roman, set_outline_intensity() is the function we were looking for.
We ended up animating up the intensity with the animate() function (we're using jQuery in the project).

Thanks once again.
Best.
 
Please register or log in to leave a reply.