• I was trying to replace the following standard action because some of my scene content explodes this action into a shower of sparks.
    So I was trying to use xml.scene instead.. should be a lot less material in the variable.
    However, on the initial load, xml.scene does NOT contain the scene name but only the index. Any ideas? After loading a second scene, the name is there.

    <action name="nextscene">
    if(%1 != findnext, set(i,0));
    set(scenename,get(scene[get(i)].name));
    trace(scenename,' ',get(xml.scene));
    if(scenename == get(xml.scene),
    trace('scene checked is next');
    inc(i);
    if(i == scene.count, set(i,0));
    loadscene(get(scene[get(i)].name), null, MERGE, BLEND(1));
    ,
    inc(i);
    if(i LT scene.count, nextscene(findnext));
    );
    </action>

  • Hi Sacha,

    I try your code and I am not able to understand your request....
    But I note an error in your second if call... get(xml.scene) should be xml.scene

    reference about if

    SAlut.

  • Sacha... I think you are making a mistake here.
    Try this code:

    Code
    <action name="incorrect">
    	if(xml.scene == get(xml.scene),
    	trace(the condition is true);
    	,
    	trace(the condition is false);
    	); 
    </action>


    it return the condition is false

    Code
    <action name="correct">
    	if(xml.scene == xml.scene,
    	trace(the condition is true);
    	,
    	trace(the condition is false);
    	);
    </action>


    it return the condition is true

    2. Comparing two variables or values:
    if(var1 OPERATOR var2, ...);
    The var1 or var2 can be a variables or values. When var1 or var2 is a variable then the content of the variable will be used for comparison. Only when using a 'strict' comparison operator (=== or !==) then var1 and var2 must be variables (or null).

    SAlut.

  • That's not really the issue, its just vaguely what I was working on..
    trace(xml.scene); was returning an INDEX instead of the scene name.
    Now, I have to figure out why and how. I thought maybe it was happening to everyone else as well. But it looks like there's something more complex since it works fine in my CMS.

  • Found it by breaking it down until no code remained!

    loadscene(get(startscene),null,MERGE);

    in my html I use using an index.. which explains my my cms worked "it has more complicated scene names here".
    viewer.addVariable("startscene", "<?php print $id-1?>);
    should have been
    viewer.addVariable("startscene", "scene<?php print $id-1?>");

    and my scenes where scene1 scene2 etc..
    So the mystery becomes why it worked in the first place instead of black screening..

    Thanks all!

  • Turns out, there wasn't much wrong with the next action except that it didn't support that many panoramas on iDevices. My broken panorama was on the edge of the rope (30/60).
    It appears the actions overflow limit is MUCh lower on iDevices.
    Using a delayedcall broke up the tremendous amount of code I was calling at once.. and perhaps scenename saves a stitch in memory.

    <action name="nextscene">
    if(%1 != findnext, set(i,0));
    set(scenename,get(scene[get(i)].name));
    if(scenename == xml.scene,
    inc(i);
    if(i == scene.count, set(i,0));
    loadscene(get(scene[get(i)].name), null, MERGE, BLEND(1));
    ,
    inc(i);
    if(i LT scene.count, delayedcall(0.02,nextscene(findnext)));
    );
    </action>

Participate now!

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