IF and Multiple Values

  • When changing scene I would like to have a special action only for selected scenes (for example resetting the architectural view) so I have this type of action:

    Code
    <action name="reset_arch"> 
    if(linkedscene == var2, reset_arch_off, reset_arch_on )
    </action>

    it works if I have only one value for var2 but var2 has obviusly multiple values:

    scene_03, scene_24, scene_71, etc.

    how can I make this working? How can I assign to var2 multiple values?

    thanks

    Toni

    BTW, I use defined architectural view setting in each <scene> property, but my loading actions to connect the scenes through hotspots have the KEEPVIEW setting so it does not work.
    If your curious why I have this KEEPVIEW setting see here

  • Hi!

    Introduce the "view_tag" inside each "scene" node. Like this:

    Code
    <scene name="DSC_0619_Panorama_cube_equi" title="Gallery" view_tag="pattern_1"  >

    Let's say you have 3 view patterns. Then create an action which will check the "view_tag" of each scene:

    Code
    if(scene[get(xml.scene)].view_tag == pattern_1. set(view... blah-blah-blah);  );if(scene[get(xml.scene)].view_tag == pattern_2. set(view... another blah-blah-blah);  );  if(scene[get(xml.scene)].view_tag == pattern_3. set(view... third blah-blah-blah);  );

    This should work *smile*

    Regards,

    Alexey

  • Or


    <myarray>
    <item name="i0" value="blabla1"/>
    <item name="i1" value="blabla2"/>
    <item name="i2" value="blabla3"/>
    <item name="i3" value="blabla4"/>
    <item name="i4" value="blabla5"/>
    <item name="i5" value="blabla6"/>
    </myarray>


    ....
    set(checkvar,false);

    for(set(i,0), i LT myarray.item.count, inc(i),
    if(a == myarray.item[get(i)].value, set(checkvar,true); );
    );
    if(checkvar, do_something() );
    ....


    Or


    set(var_with_many_values,one two three four five);

    set(my_var,three);
    indexoftxt(searched_index,get(var_with_many_values),get(my_var));
    searched_index - wil have "8" value, means value in list


    set(my_var,ten);
    indexoftxt(searched_index,get(var_with_many_values),get(my_var));
    searched_index - wil have "-1" value, means value not in list


    If(searched_index GT -1, do_something() );

    Andrey

  • thank you Andrey Sudarchikov for the lesson *smile* !

    I use the second example in the three you suggested, using an array.

    Now I have for each scene the viewing defined settings for architectural, for example this:

    Code
    <scene name="scene_070" title="070"   thumburl="panos/070.tiles/thumb.jpg"  >
    <view hlookat=" " vlookat=" " architectural="1.0" architecturalonlymiddle="false"  />
    
    
    .................
    
    
    <scene name="scene_090" title="090" thumburl="panos/090.tiles/thumb.jpg"  >
    <view hlookat=" " vlookat=" " architectural="1.0" architecturalonlymiddle="false"  />

    or this:

    When I click on thumbs or on next/prev buttons or on a button on a map that uses the "MERGE" to load a new scene, I get the defined (for each scene) architectural view setting.

    But if I load a scene with hotspots that uses "KEEPVIEW" (I'm doing this to have a same orientation as said here) like this:

    Code
    <style name="skin_hotspotstyle" url="vtourskin_hotspot.png" scale="0.2" edge="top" oy="0"
    	       distorted="true"
    	       onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); loadscene(get(linkedscene),null,KEEPVIEW,BLEND(1)); reset_arch(); skin_updatescroll(); );"
    	       onhover="if(skin_settings.tooltips_hotspots, if(linkedscene, showtext(get(scene[get(linkedscene)].title),SKIN_TOOLTIPS)) );"
    	       />


    With the code below, I get correct architectural view settings:

    Thank you again. *thumbup*
    toni

Participate now!

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