Visible map layer in some scenes, hidden in others - Is This Possible?? {solved}

  • I'm just going around in circles at this point searching the forum for hours, and there's nothing I can find on this subject that I'm capable of understanding.

    I have some scenes in which I require my floorplan map layer to be visible, and other scenes where it needs to be hidden.

    I thought I had solved the issue myself with this in the scene name:

    Code
    onstart="updateradar(); updatemap();"

    and this action in the scene:

    Code
    <action name="updatemap"
    set(layer[map].visible,false);
    </action>

    (with false or true changing according to the scene)

    This worked, except now my map is showing up in webVR.


    At this point I have absolutely no idea how to proceed and am stuck. Any help would be much appreciated as this is the last hurdle in my project! Tnx.

    Edited once, last by landrvr1 (September 27, 2016 at 11:04 PM).

  • open plugins/webvr.xml and find:

    Code
    onentervr="webvr_onentervr();"
    onexitvr="webvr_onexitvr();"


    change to e.g.

    Code
    onentervr="set(vr_started,true); webvr_onentervr();"
    onexitvr="set(vr_started,false); webvr_onexitvr();"


    Adapt your action to:

    Code
    <action name="updatemap"
    ifnot(vr_started,
    set(layer[map].visible,false);
    );
    </action>

    It might be even simplier using if(webvr.isenabled.... without helper variable but I am not sure how this variable in internally handled. Check it....

  • Thanks Umalo, but I tried the first method below and it didn't work. The map still shows up in webvr:


    code from my webvr.xml:

    Code
    onentervr="set(vr_started,true); webvr_onentervr();"
    onexitvr="set(vr_started,false); webvr_onexitvr();"
    />


    code from my actions:

    Edited once, last by landrvr1 (September 25, 2016 at 7:57 PM).

  • In your case you use vtourskin.xml which is overwriting some webvr attirbutes like onentervr and onexitvr. That mean changed action to set vr_started variable is not working as it is overwritten in memory. State is always null and that's reason IF is not working as we wanted. Solution: Or you add this into vtourski.xml part

    Code
    onentervr="skin_showloading(false); webvr_onentervr(); webvr_setup(); skin_reloadscene_webvr();"
    onexitvr="webvr_onexitvr(); webvr_setup(); skin_reloadscene_webvr();"


    to

    Code
    onentervr="set(vr_started,true); skin_showloading(false); webvr_onentervr(); webvr_setup(); skin_reloadscene_webvr();"
    onexitvr="set(vr_started,false); webvr_onexitvr(); webvr_setup(); skin_reloadscene_webvr();"


    or add vr_started set to true or false directly into webvr_onentervr and webvr_onexitvr actions

  • Cool. There's been some improvement, but still some issues.

    When you first enter the site and go into webVR, no map appears (yay!). Then you go into the next scene while still in webVR and no map appears - which is how it's supposed to be.

    However, when in that scene you go back into pano mode, the map doesn't appear. When you click to the next scene, still in pano mode, the map will appear.


    Also, the very last scene isn't supposed to have a map. If you enter that last scene in webvr, then hit escape to go into pano, the map shows up (which, again, it's not supposed to...)

    Other scenes in the middle behave properly = no map in VR but map in pano.

    So close! Thanks so very much for taking the time to help me, Umalo.

    Edited once, last by landrvr1 (September 25, 2016 at 7:57 PM).

  • Your map visibility is handled on start of the scene. When you enter or go out of VR you need another handler to make your map visible.
    e.g. onexitvr=". . . . . updatemap();"
    As update map you have separately in every scene valid one is still valid.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!