How do I access current scene attributes and nodes?

  • I see that I can access a specific scene's nodes and attributes with "scene[scenename].xxx", but I can't figure out how to access attributes (such as name) or nodes (such as data) for the current scene. Is there any way to do this?

  • Hi guys! Sorry if I understand you wrong about "get/access" for a scene's atributes, but the following stuff seems to work:

    the modified "startup action:

    Code
    <action name="startup">
    		if(startscene === null, copy(startscene,scene[0].name));
    		loadscene(get(startscene), null, MERGE);
    		set(panonumber,1);
    	</action>

    an event to trigger a check on every new pano:

    Code
    <events name="check_pano_data" keep="true" onnewpano="check_pano();" />

    and the action itself:

    The idea is that after you went through four panoramas, the title, thumburl, latitude, longitude and heading are set to "null". And I see in the log that traces return corresponding values and "nulls" after fourth loaded pano.

  • Hi,

    attributes AT the <scene> elements can be accessed!

    It's only not possible to access elements or attributes INSIDE the <scene> elements.

    The reason therefore is that the content inside the <scene> elements will be not parsed during the xml loading. Instead of parsing the whole <scene> content will be stored as text inside the 'scene[name].content' variable, and only parsed when calling loadscene() for that scene. That means a scene is like an 'inline-xml'.

    Best regards,
    Klaus

  • So if I put a layer inside the <scene> and set keep="false", it will appear only when this scene is loaded? I remember I tried this way some time ago to make different photos appear in various scenes, but I rejected this way, - honestly, don't remember why exactly((

    Or, I guess, this layer won't need keep="false"...

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!