Please note in the example below I have added an "architectural" section to my xml scene. I'm having difficulty understanding the syntax of accessing child node information from the tour.xml files. Let's say I'm storing scene data in the following format so I have some additional scene information to use:
<scene name="name" title="title" active="true" thumburl="panos/blahblah/thumb.jpg" datahere="blahblah">
<view hlookat="190" vlookat="-20" fovtype="MFOV" fov="90" maxpixelzoom="1.5" fovmin="80" fovmax="100" limitview="auto"/>
<preview url="panos/blahblah.tiles/preview.jpg"/>
<image>
<cube url="panos/blahblah/pano_%s.jpg"/>
<cube url="panos/blahblah/mobile/pano_%s.jpg" devices="mobile"/>
</image>
<architectural type="residential" status="active" price="240,000" sf="1400" bedrooms="2" bathrooms="2.5"/>
</scene>
I can have an action that loops through the data like this...
for(set(i,0), i LT scene.count, inc(i),
copy(name, scene[get(i)].name);
copy(datahere, scene[get(i)].datahere);
trace(name);
trace(datahere);
);
That works fine. I can access any attribute of "scene", name, title, datahere, etc.
What I can not do however is access the architectural "type", "price", etc.
I've tried:
scene[get(i)].architectural.price);
architectural[get(i)].price);
etc.
What am I missing here? KRpano is clearly accessing view, hotspot data, etc. that is stored as children of "scene". What syntax does KRpano use to access attributes of scene children?
Thanks.
EDIT: This works to access the price of the CURRENT scene
architectural[get(xml.scene)].price
and i realize that xml.scene returns the name of the current scene but something like this does NOT work.
copy(name, scene[get(i)].name);
trace(architectural[get(name)].price );
It seems like it may not be possible to access xml child nodes without having the scene loaded. Is this correct? If so, they could be stores directly as scene attributes rather than in an child node I suppose but I'm trying to keep the data structure cleaner.