webvr.isenabled does not work?

  • Hi all,

    I need to deactivate some hotspots for the webvr tour. But

    Code
    <hotspot name="hs_1a" if="webvr.isenabled == false"

    does not work. Something wrong with this idea? Is there an alternative standard approach to this?

    Any help appreciated very much,

    Yours,
    Michael

  • Well, thank you.

    I tried something like that before. I added a parameter to a hotspot style ("tag1") and an action to the vtourskin.xml code for the webvr plugin:

    vtourskin.xml:

    Code
    <plugin name="WebVR" keep="true" devices="html5"
              	(...)
    	    	onentervr="skin_showloading(false); webvr_onentervr(); webvr_setup(); skin_reloadscene_webvr(); a_hiderichmediahs();"
    	    	onexitvr="webvr_onexitvr(); webvr_setup(); skin_reloadscene_webvr(); a_showrichmediahs();"
    	    	/>

    tour.xml:

    But that did not work as expected. The hotspots were hidden in vrmode only, but - in vr mode - when returning to the same scene the hotspots showed up again.

  • You need to check spots not only when entering or exiting VR, but also when you go from scene to scene (onnewpano).


    Ahhhh...

    Code
    <plugin name="WebVR" keep="true" devices="html5"
    (...)
    onentervr="... a_hiderichmediahs();"
    onexitvr="... a_showrichmediahs();"
    />


    Code
    <events name="webvr_events" keep="true" devices="html5"
                  	(...)
    	    	onnewpano="a_hiderichmediahs();"	    	
    	    	/>



    Thank you very much!

    Michael

  • Yep, I was doing the same task as you and the first thought was to use that 'if' check inside hotspots, but it was not simple. I made a test then and added two hotspots into first pano of the tour (one with webvr.isenabled == true and one with false) to see how it works and there were issues and Krpano works very logical here, the only thing is to understand its behaviour:

    1) First pano is loaded before the VR plugin (it seemed so to me), so inside first pano none of the two spots were visible initially. That is, "if" check works only when xml is being parsed, so for Krpano there were no hotspots in this case (I used normal panos).
    2) If I go from first scene to second and then return back, I see the spot with 'webvr.isenabled == false". If I enter VR then, the same spot stays visible. The reason here is that normal pano is not being reloaded when entering VR (Multires ones are reloaded to use webvr-ready images).
    3) This is all quite logical, because "if" check inside attributes is meant only for xml parsing check - Krpano goes thtough xml at startup and checks those 'ifs' to see which elements are needed and which are not.

    All this is based on my tests and experience, maybe Klaus and other guys here may add something about it. *wink*

    Regards,

    Alexey

Participate now!

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