Forum

Selectable outline occlusion?

12 June 2018 11:39
Hi all,
I need to hide the selectable outline in fast preview if it's behind another object.
As you can see in the attached picture, the outline is shown through the boxes.
Is there a way to avoid this behaviour?
Thanks.

13 June 2018 21:33
I don't think you can do this with the original outlining effect, but you can use a workaround:

1) Make a copy of the object material.
2) To the copied material, add a glow effect to your liking; for example, a B4W_GLOW_OUTPUT node or a semi-transparent yellow color.
3) Whenever the object is clicked (or mouse-overed, depending on what you need), swap between the two materials.

Result:

14 June 2018 11:17
Thanks a lot for your reply.
Would you mind attaching the project file here to see how you setup this?
Sorry, I never did this kind of interactions before.

Thanks again.
14 June 2018 11:23
Would you mind attaching the project file here to see how you setup this?
Sorry, I never did this kind of interactions before.
Sure! Can you tell me which interaction you need? When does your object need to be outlined? Upon clicking, upon mouseover…..?
14 June 2018 11:27
Whenever I click on it. And it should deactivate if I click on another object as well.
14 June 2018 12:06
Good, that's especially simple. You can do it with logic nodes. Here's your setup. It toggles on/off/on/off… with each click:



Make the two materials as described. Call them "M_outline" and "M_no_outline". You need two objects:

- "your_target_object", the object that will be outlined. Give it one material slot with "M_no_outline".
- "your_source_object", a dummy object (can be set to hidden) that holds both materials. Make two slots, one for each material.

Important: You must set the objects to "dynamic geometry and materials" for the inherit node to work!

I have to say it looks a bit stupid in the fast previewer because the previewer does its own outline if you click on objects, LOL.
14 June 2018 12:09
And it should deactivate if I click on another object as well.
Oh, sorry, I didn't see that edit. I'll post a revised version later.
14 June 2018 15:14
ok, I'll wait
14 June 2018 21:24

This setup will additionally deactivate the outline if any other selectable object in the scene is clicked. To make this work, for each of those "other objects", do this:

- Make sure the object is set to "Selectable" (object panel).
- Click "Add a Socket" in the Switch Node. A new empty "Hit" socket will appear and a respective empty object box further down. Set it to the object's name. Then connect the Hit socket to the "Connect all other objects to me!" node.

(The example shows two "other objects" having been added this way.)

P.S.: I forgot to mention this logic tree was made with the older B4W 17.08, so if you were wondering about node names, some may have changed, like I think "Conditional Jump" is now called "Branch" etc.
18 June 2018 11:31
First of all, thanks for the answer…

But honestly, I want to know if there is the possibility to keep just one object and not duplicate.
 
Please register or log in to leave a reply.