Sie sind nicht angemeldet.

1

Freitag, 1. April 2011, 19:17

Scene prev next buttons with multiple xmls

Hi,

I`m building a tour using the scene tags. For several reasons i had to store the scenes in multiple xml files. Each xml represents a level in a building, so I've got
different thumbs and different maps for each xml file. So far so good - but now I would like to use Klaus' prev next buttons example.

So the problem with this example is that as soon as i go to another level in the building, meaning opening another xml, the scenes in this xml are also used for the prev/next action when i go back to the start-scene.

It looks like krpano stores all the scenes in the ram, independent from the xml which contain them.
Is there any solution for this, so that the prev/next actions include only the scenes from the current xml?

Thank in advance & regards
Michael

Code of Klaus' example:


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<action name="prevscene">
	if(%1 != findnext, sub(i,scene.count,1));
	txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
	if(scenexml == xml.content,
   	dec(i);
   	if(i LT 0, sub(i,scene.count,1));
   	loadscene(get(scene[%i].name), null, MERGE, BLEND(1));
  	,
   	dec(i);
   	if(i GE 0, prevscene(findnext));
  	);
</action>

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

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Samstag, 2. April 2011, 00:35

You see that it's checking the scene array each and everytime to count the scenes and check if it's got to loop around and whether it goes up or down in the load index.

you need to store the xml and scene of where you came from and what your next xml is, and if you are leaving your index negatively or positivity you know you need to change xmls.
Your next scene in a new xml will always be 0 but you don't know how many scenes were in your previous xml unless you saved it.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Samstag, 2. April 2011, 08:59

Hi,

thanks for your answer. Yeah - I understand the problem and what the solution should be. But I don't see any way how the code has to look like and how it could be done with the xml reference to save the number of scenes of the previous xml?

Best regards,
Michael

4

Dienstag, 5. April 2011, 15:08

Hi,

either remove all <scene> elements by doing:

Quellcode

1
set(scene.count,0);

before loading the new xml,

or just use the latest 1.0.8.14 from here:
http://krpano.com/download/beta/

there this will be done automatically,

best regards,
Klaus

5

Dienstag, 5. April 2011, 15:18

Hi,

thanks, works perfectly *thumbsup*

Best regards
Michael

Ähnliche Themen