get variable don't work

  • I took the old xml (krpano version 1.16) and try to make it work with krpano version 1.19-pr8. All works, except that the variable (viewdir), which I use to determine the view direction is not taken from the hotspot.
    What could be the problem ?

    Code
    <style name="skin_hotspotstyle" url="img/hotspot.png" scale="0.3" edge="center" oy="0"
    	       distorted="true"
    	      onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); lookto(get(ath),0);
    		   			loadscene(get(linkedscene),null, MERGE ,ZOOMBLEND(1,2)););
    					lookat(get(viewdir),0);"
    		  onhover="tween(scale,0.35,0.1);"
    		  onout="tween(scale,0.3,0.1)"
    	       />
  • Hi,

    this doesn't work (anymore) because after 'loadscene' the hotspot from the previous scene would be already removed (unless it was defined with keep=true) and so that hotspot and its 'viewdir' attribute aren't available anymore.

    In older versions this was working because of a bug (a memory leak), there the hotspot wasn't fully removed.

    A way to get this working would be getting the 'viewdir' before the loadscene call, e.g. into some temporary variable and then using that variable later instead.

    E.g. here an example:

    Code
    copy(hs_viewdir, viewdir);
    loadscene(...);
    lookat(get(hs_viewdir),0);"

    Btw - have also a look into the vtourskin.xml from the latest version, it has a similar functionality already implemented - there each hotspot could contain a 'linkedscene_lookat' attribute which would define the looking direction for the linked scene.

    Best regards,
    Klaus

Participate now!

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