You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

1

Wednesday, September 23rd 2009, 9:06am

action to set properties on all hotspots

I've created an action to add a duplicate hotspot with different values to get over the problem I found in this post . i.e. you need 2 hotspots if you want to have a graphic in a polygonal hotspot.

Ideally this would be called when each hotspot is loaded, but onloaded="" doesn't work on a hotspot.

Is there a way of creating an action that can be run when the scene is loaded that applies my action to all hotspots?

2

Thursday, September 24th 2009, 9:21am

Hi,

looping through all hotspots can be done with this actions for example (with beta 9 there will also be an easier method)

e.g.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<action name="loop_all_hotspots">
  set(i,0);
  loop_all_hotspots_next(get(i));
</action>

<action name="loop_all_hotspots_next">
   trace(hotspot[%1].name);
   set(hotspot[%1].onclick, ...);
   ...
    inc(i);
   if(i LT hotspot.count, loop_all_hotspots_next(get(i)) );
 </action>


best regards,
Klaus

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

3

Friday, September 25th 2009, 1:14am

Cheers Klaus,

That kind of works - only it replaces the hotspots I'm trying to duplicate with the new hotspots. This is how I'm using it -

Source code

1
<action name="loop_all_hotspots">set(i,0);loop_all_hotspots_next(get(i));</action><action name="loop_all_hotspots_next">trace(hotspot[%1].name);addhotspot(%1);set(hotspot[%1].atv,get(hotspot[%1].atv));set(hotspot[%1].ath,get(hotspot[%1].ath));set(hotspot[%1].url,%SWFPATH%/hs.png);set(hotspot[%1].scale,get(hotspot[%1].scale));set(hotspot[%1].enabled,false);set(hotspot[%1].keep,false);set(hotspot[%1].zorder,-100);set(hotspot[%1].edge,bottom);inc(i);if(i LT hotspot.count, loop_all_hotspots_next(get(i)));</action>



What I want to do is create new hotspots so tried things like this:

Source code

1
<action name="loop_all_hotspots">set(i,0);loop_all_hotspots_next(get(i));</action><action name="loop_all_hotspots_next">trace(hotspot[%1].name);addhotspot(%1_new);set(hotspot[%1_new].atv,get(hotspot[%1].atv));set(hotspot[%1_new].ath,get(hotspot[%1].ath));set(hotspot[%1_new].url,%SWFPATH%/hs.png);set(hotspot[%1_new].scale,get(hotspot[%1].scale));set(hotspot[%1_new].enabled,false);set(hotspot[%1_new].keep,false);set(hotspot[%1_new].zorder,-100);set(hotspot[%1_new].edge,bottom);inc(i);if(i LT hotspot.count, loop_all_hotspots_next(get(i)));</action>



And it only works on the first hotspot. Any ideas? *pinch*

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

4

Friday, September 25th 2009, 5:26am

Doing this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
		<action name="loop_all_hotspots">
		set(i,0);
		loop_all_hotspots_next(get(i));
		</action>
		
		<action name="loop_all_hotspots_next">
		trace(hotspot[%1].name);
		add_hotspot_graphic(%1);
		inc(i);
		if(i LT hotspot.count, loop_all_hotspots_next(get(i)));
		</action>
		
		<action name="add_hotspot_graphic">
		addhotspot(%1_%1);
		set(hotspot[%1_%1].atv,get(hotspot[%1].atv));
		set(hotspot[%1_%1].ath,get(hotspot[%1].ath));
		set(hotspot[%1_%1].url,%SWFPATH%/hs.png);
		set(hotspot[%1_%1].scale,get(hotspot[%1].scale));
		set(hotspot[%1_%1].enabled,false);
		set(hotspot[%1_%1].keep,false);	
		set(hotspot[%1_%1].zorder,-100);
		set(hotspot[%1_%1].edge,bottom);
		</action>


Just deletes the first hotspot, does the right thing on the second hotspot, and ignores the third one!

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

5

Saturday, September 26th 2009, 3:01am

Hi viewinz,

The bigger mistake in your code is how the z-order is set.... *sad*
  • There is a strange behaviour on setting the z-order attribute when it is call after setting the ath and atv attributes *attention* . I do not know why ( KLAUS please *smile* , some explanation here )... *wacko* It MUST be set before the ath and atv attributes.
  • You have put a value of -100 for z-order. Better will be positive value: 100.
The way the hotspot.count is used it is not optimal... because each addhotspot() increase the hotspot.count value *attention* You have to "freeze" the hotspot.count at the moment of the calling action.

Adding a new hospot with %1_%1 as argument, addhotspot(%1_%1);, seems to result on strange behaviour too.... I do not know why......

Finaly, no needs of the 3 actions... 2 actions are sufficient.

Here is a code to test the modified actions.. change the hotspot images with yours.

Source code

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<krpano version="1.0.8">

	<!-- use the editor for moving,rotating,scaling hotspots -->
	<plugin name="editor"  url="%SWFPATH%/plugins/editor.swf"  />
	<plugin name="options" url="%SWFPATH%/plugins/options.swf" />

	<!-- use only a grid preview pano to save download space ;-) -->
	<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16" />

	<view hlookat="0" vlookat="0"  fov="105"  />

	 <hotspot name="spot1"
	     	url="image.jpg"
	     	keep="false"
	     	ath="-50" atv="-10"
	     	zoom="false" distorted="true"
	     	width="340" height="233"
	     	scale="0.5" scale9grid="" scalechildren="false" rotate="0"
	     	edge="center" ox="" oy=""
	     	visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	     	zorder="1"
	     	alpha="1.00" blendmode="normal" smoothing="true"
 	     	refreshrate="auto"
	     	onclick="action(loop_all_hotspots);"
	     	/>

	<hotspot name="spot2"
	     	url="image2.jpg"
	     	keep="false"
	     	ath="0" atv="0"
	     	zoom="false" distorted="true"
	     	width="340" height="233"
	     	scale="0.5" scale9grid="" scalechildren="false" rotate="0"
	     	edge="center" ox="" oy=""
	     	visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	     	zorder="2"
	     	alpha="1.00" blendmode="normal" smoothing="true"
 	     	refreshrate="auto"
	     	onclick="action(loop_all_hotspots);"
	     	/>

	<hotspot name="spot3"
	     	url="image3.jpg"
	     	keep="false"
	     	ath="50" atv="10"
	     	zoom="false" distorted="true"
	     	width="340" height="233"
	     	scale="0.5" scale9grid="" scalechildren="false" rotate="0"
	     	edge="center" ox="" oy=""
	     	visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	     	zorder="3"
	     	alpha="1.00" blendmode="normal" smoothing="true"
 	     	refreshrate="auto"
	     	onclick="action(loop_all_hotspots);"
	     	/>
			 
		<action name="loop_all_hotspots">
		set(i,0);
		set(H_count,get(hotspot.count));
		loop_all_hotspots_next(get(i));
		</action>
		
		<action name="loop_all_hotspots_next">
		addhotspot(truc_%1);	
		set(hotspot[truc_%1].zorder,100);
		set(hotspot[truc_%1].url,%SWFPATH%/hs.png);
		set(hotspot[truc_%1].atv,get(hotspot[%1].atv));
		set(hotspot[truc_%1].ath,get(hotspot[%1].ath));
		set(hotspot[truc_%1].scale,get(hotspot[%1].scale));
		set(hotspot[truc_%1].distorted,true);
		set(hotspot[truc_%1].enabled,false);
		set(hotspot[truc_%1].keep,false);
		set(hotspot[truc_%1].edge,center);
		inc(i);
		if(i LT H_count, loop_all_hotspots_next(get(i)));
		</action>
		
</krpano>


I hope this can help. Tell me please. ;-)

Salut.

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

6

Saturday, September 26th 2009, 7:12am

***MICHEL YOU ARE A STAR!!!***

Michel,



Thanks so much for this it works nearly perfectly!



It's generating an extra 3 hotspots, see here -



Source code

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
          keep="false"
          visible="true" enabled="true" handcursor="true" capture="true" children="true"
           zorder="0"
          fillcolor     ="0xffffff" fillalpha     ="0.00" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
          fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00"
          fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
          onover="hs_text()"
          onhover=""
          onout=""
          ondown="hs(beach,beach2ferry)"
          onup=""
          onclick=""
          flying="0"
  >
  
  
  
  
  
  
  
  
 
 
          keep="false"
          visible="true" enabled="true" handcursor="true" capture="true" children="true"
           zorder="0"
          fillcolor     ="0xffffff" fillalpha     ="0.00" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
          fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00"
          fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
          onover="hs_text()"
          onhover=""
          onout=""
          ondown="hs_newxml(exterior,../pavillion_cafe/pavillion-cafe.xml,pavillion2street)"
          onup=""
          onclick=""
          flying="0"
  >
  
  
  
  
  
  
  
  
  
  
 
 
          keep="false"
          visible="true" enabled="true" handcursor="true" capture="true" children="true"
           zorder="0"
          fillcolor     ="0xffffff" fillalpha     ="0.00" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
          fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00"
          fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
          onover="hs_text()"
          onhover="showtext(get(data[en_pier2ferry].content),hs)"
          onout=""
          ondown="hs(ferry,ferry2pier)"
          onup=""
          onclick=""
          flying="0"
  >
  
  
  
  
  
  
  
  
 
 
 
          url="%SWFPATH%/hs.png"
          keep="false"
          ath="0" atv="0"
          zoom="false" distorted="true"
          width="400" height="400"
          scale="0.3" scale9grid="" scalechildren="false" rotate="0"
          rx="0" ry="0" rz="0"
          edge="bottom" ox="" oy=""
          crop="" ondowncrop="" onovercrop=""
          visible="true" enabled="false" handcursor="true" capture="true" children="true"
           zorder="100"
          alpha="0.00" blendmode="normal" smoothing="true"
           refreshrate="auto"
           onloaded=""
          onover=""
          onhover=""
          onout=""
          ondown=""
          onup=""
          onclick=""
          flying="0"
          />
 
          url="%SWFPATH%/hs.png"
          keep="false"
          ath="-10" atv="0"
          zoom="false" distorted="true"
          width="400" height="400"
          scale="0.3" scale9grid="" scalechildren="false" rotate="0"
          rx="0" ry="0" rz="0"
          edge="bottom" ox="" oy=""
          crop="" ondowncrop="" onovercrop=""
          visible="true" enabled="false" handcursor="true" capture="true" children="true"
           zorder="100"
          alpha="0.00" blendmode="normal" smoothing="true"
           refreshrate="auto"
           onloaded=""
          onover=""
          onhover=""
          onout=""
          ondown=""
          onup=""
          onclick=""
          flying="0"
          />
 
          url="%SWFPATH%/hs.png"
          keep="false"
          ath="0" atv="0"
          zoom="false" distorted="true"
          width="400" height="400"
          scale="0.3" scale9grid="" scalechildren="false" rotate="0"
          rx="0" ry="0" rz="0"
          edge="bottom" ox="" oy=""
          crop="" ondowncrop="" onovercrop=""
          visible="true" enabled="false" handcursor="true" capture="true" children="true"
           zorder="100"
          alpha="0.00" blendmode="normal" smoothing="true"
           refreshrate="auto"
           onloaded=""
          onover=""
          onhover=""
          onout=""
          ondown=""
          onup=""
          onclick=""
          flying="0"
          />
 
          url="%SWFPATH%/hs.png"
          keep="false"
          ath="-150" atv="0"
          zoom="false" distorted="true"
          width="400" height="400"
          scale="0.43302562749413004" scale9grid="" scalechildren="false" rotate="0"
          rx="0" ry="0" rz="0"
          edge="bottom" ox="" oy=""
          crop="" ondowncrop="" onovercrop=""
          visible="true" enabled="false" handcursor="true" capture="true" children="true"
           zorder="100"
          alpha="0.82" blendmode="normal" smoothing="true"
           refreshrate="auto"
           onloaded=""
          onover=""
          onhover=""
          onout=""
          ondown=""
          onup=""
          onclick=""
          flying="0"
          />
 
          url="%SWFPATH%/hs.png"
          keep="false"
          ath="100" atv="-1"
          zoom="false" distorted="true"
          width="400" height="400"
          scale="0.3" scale9grid="" scalechildren="false" rotate="0"
          rx="0" ry="0" rz="0"
          edge="bottom" ox="" oy=""
          crop="" ondowncrop="" onovercrop=""
          visible="true" enabled="false" handcursor="true" capture="true" children="true"
           zorder="100"
          alpha="0.00" blendmode="normal" smoothing="true"
           refreshrate="auto"
           onloaded=""
          onover=""
          onhover=""
          onout=""
          ondown=""
          onup=""
          onclick=""
          flying="0"
          />
 
          url="%SWFPATH%/hs.png"
          keep="false"
          ath="0" atv="0"
          zoom="false" distorted="true"
          width="400" height="400"
          scale="0.3" scale9grid="" scalechildren="false" rotate="0"
          rx="0" ry="0" rz="0"
          edge="bottom" ox="" oy=""
          crop="" ondowncrop="" onovercrop=""
          visible="true" enabled="false" handcursor="true" capture="true" children="true"
           zorder="100"
          alpha="0.00" blendmode="normal" smoothing="true"
           refreshrate="auto"
           onloaded=""
          onover=""
          onhover=""
          onout=""
          ondown=""
          onup=""
          onclick=""
          flying="0"
          />
 
          keep="false"
          visible="false" enabled="true" handcursor="true" capture="true" children="true"
           zorder="0"
          fillcolor     ="0xffffff" fillalpha     ="0.00" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
          fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
          fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
          onover=""
          onhover=""
          onout="set(hotspot[truc_pier2ferry].visible,true)"
          ondown=""
          onup=""
          onclick=""
          flying="0"
  >




And another small problem is that I want to make these disapear with an onover action from the original hotspots using the hotspot name. Before I was using something like this:

Source code

1
2
3
4
5
6
7
8
9
10
  trace(name);
  hs_text_set(get(name),get(lang));
  hs_text_graphic_off(get(name));
    
  
  set(hotspot[truc_%1].visible,false);
  set(hotspot[truc_%1].onout,set(hotspot[truc_%1].visible,true));
  
  
  set(hotspot[%1].onhover,showtext(get(data[%2_%1].content),hs));




I tried to get it to trace the name and use that instead of the hotspot count but it's not working? Any ideas?



Thank you so much for your help with this! *g*

EDIT: Fixed the extra hotspot problem by calling the action later after the intro.

Still would like to find a way of making the new names the same as other original name with the 'truc_'!?

This post has been edited 1 times, last edit by "viewinz" (Sep 26th 2009, 9:24am)


michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

7

Saturday, September 26th 2009, 9:12pm

Hi viewinz,

Quoted

Still would like to find a way of making the new names the same as other original name with the 'truc_'!?
I have made some changes into the code to retrieve the name of the original hotspot to use it as first part of the added hotspot. The code becomes like this:

Source code

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="loop_all_hotspots">
		set(i,0);
		set(H_count,get(hotspot.count));
		loop_all_hotspots_next(get(i));
	</action>
		
	<action name="loop_all_hotspots_next">
		txtadd(add_hotspot_name,get(hotspot[%1].name),_,%1);
		add_hotspots_next(get(i),get(add_hotspot_name));
	</action>
		
	<action name="add_hotspots_next">
		addhotspot(%2);	
		set(hotspot[%2].zorder,100);
		set(hotspot[%2].url,%SWFPATH%/hs.png);
		set(hotspot[%2].atv,get(hotspot[%1].atv));
		set(hotspot[%2].ath,get(hotspot[%1].ath));
		set(hotspot[%2].scale,get(hotspot[%1].scale));
		set(hotspot[%2].distorted,true);
		set(hotspot[%2].enabled,false);
		set(hotspot[%2].keep,false);
		set(hotspot[%2].edge,center);
		inc(i);
		if(i LT H_count, loop_all_hotspots_next(get(i)));
	</action>


Can you give a link to see what you are trying to do? It is really difficult to understand your goal.
For example, what element is the one that call the actions above? What is the goal? Perhaps to substitute the originals hotspot? If so, why to not change the attributes of those originals hotspot (the url value for example)?...

Quoted

It's generating an extra 3 hotspots, see here -
I do not really understand what you are talking about... Is it because the actions are called 2 times?
Anyway, I have noticed an other strange behaviour on the code above... The first call seems to work correctly... But if you make a second call, then there is one added hotspot with scale=1 instead of 0,5... I really do not understand why... *sad*

Salut.

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

8

Sunday, September 27th 2009, 3:34am

Michel,

Works perfectly.. I'll upload it all in a while and show you what it is doing! *thumbup*

Cheers

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

9

Sunday, September 27th 2009, 6:56am

Actually, I'm getting very strange behaviours also.

Sometimes it keeps the hotspot from the previous scene that called the loadscene. Even though that one is set keep=false!?

Very strange.. *cry*

They are always fine on the first call, maybe I should remove all created hotspots when a new scene is loaded, and re-call this action?

To answer your question:

Quoted

Can you give a link to see what you are trying to do? It is really difficult to understand your goal.
For example, what element is the one that call the actions above? What is the goal? Perhaps to substitute the originals hotspot? If so, why to not change the attributes of those originals hotspot (the url value for example)?...

All my hotspots are polygonal (this is for consistency). I want to have a graphic that shows when close to the point of view, as with the other thread. To keep the polygonal hotspot and make the whole area clickable, I need to have another hotspot with the graphic that is generated in the above action.

So they are duplicates of existing hotspots.


p.s. site is viewnz.net

This post has been edited 2 times, last edit by "viewinz" (Sep 27th 2009, 7:38am)


10

Monday, September 28th 2009, 7:57pm

Sometimes it keeps the hotspot from the previous scene that called the loadscene. Even though that one is set keep=false!?

Very strange.. *cry*

They are always fine on the first call, maybe I should remove all created hotspots when a new scene is loaded, and re-call this action?
Hi,

I think this is the problem:
you need to call the loadscene() with the MERGE flag,
e.g.

Source code

1
loadscene(scenename, null, MERGE);


best regards,
Klaus

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

11

Tuesday, September 29th 2009, 12:20am

Hi Klaus, thanks for your help - that doesn't seem to have made any difference.

Can you have a look at my example?

The problem appears when you click on the hotspot on the beach. Here are the original beach hotspots:



Source code

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<hotspot name="beach2ferry" 
ath="-120" 
atv="0" 
scale="0.4" 
style="hs_style" 
onover="hs_text()" 
ondown="hs(ferry,ferry2beach)" 
flying="0" 
> 
<point ath="-124.9477" atv=" -0.1557" /> 
<point ath="-107.5686" atv=" -0.8087" /> 
<point ath="-107.7542" atv=" 1.0302" /> 
<point ath="-124.8984" atv=" 1.0331" /> 
<point ath="-124.9406" atv=" 0.8490" /> 
</hotspot> 
<hotspot name="beach2pier" 
ath="-70" 
atv="0" 
scale="0.4" 
style="hs_style" 
onover="hs_text()" 
ondown="hs(pier,pier2beach)" 
flying="0" 
> 
<point ath="-86.8927" atv=" -3.8173" /> 
<point ath="-83.2684" atv=" 3.2758" /> 
<point ath="-52.4010" atv=" 2.0748" /> 
<point ath="-56.4183" atv=" -1.5674" /> 
</hotspot> 
<hotspot name="beach2marine_parade" 
ath="50" 
atv="-5" 
scale="0.6" 
style="hs_style" 
onover="hs_text()" 
ondown="hs(marine_parade,marine_parade2beach)" 
flying="0" 
> 
<point ath=" 16.0910" atv="-13.1556" /> 
<point ath=" 17.2020" atv=" 3.4047" /> 
<point ath=" 77.1409" atv=" 2.6158" /> 
<point ath=" 76.9145" atv=" -6.4260" /> 
<point ath=" 75.0812" atv=" -6.8958" /> 
<point ath=" 65.3348" atv=" -5.7343" /> 
<point ath=" 65.2003" atv=" -7.3209" /> 
<point ath=" 61.3626" atv="-10.8441" /> 
<point ath=" 49.8380" atv="-11.4295" /> 
<point ath=" 49.0091" atv="-10.8142" /> 
<point ath=" 45.8642" atv="-13.8180" /> 
<point ath=" 42.7641" atv="-13.7355" /> 
<point ath=" 41.9161" atv="-14.9053" /> 
<point ath=" 35.9359" atv="-13.4173" /> 
<point ath=" 35.5455" atv="-13.3935" /> 
</hotspot>



There are 3 hotspots:

  • beach2ferry
  • beach2pier
  • beach2marineparade

So when I run the action to create the new hotspots that Klaus and Michel helped me with I should get 6 hotspots:



original(polygonal)

original_(graphical)

  • beach2ferry
  • beach2pier
  • beach2marineparade
  • beach2ferry_
  • beach2pier_
  • beach2marineparade_



Here is what gets generated by Michel' action -

Source code

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<hotspot name="pier2beach_" 
keep="false" 
visible="true" enabled="true" handcursor="true" capture="true" children="true" 
zorder="0" 
fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00" 
fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80" 
fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700" 
onover="" 
onhover="" 
onout="" 
ondown="" 
onup="" 
onclick="" 
flying="0" 
> 
</hotspot> 
<hotspot name="beach2pier" 
keep="false" 
visible="true" enabled="true" handcursor="true" capture="true" children="true" 
zorder="1" 
fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00" 
fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00" 
fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700" 
onover="hs_text()" 
onhover="" 
onout="" 
ondown="hs(pier,pier2beach)" 
onup="" 
onclick="" 
flying="0" 
> 
<point ath="-86.8927" atv=" -3.8173" /> 
<point ath="-83.2684" atv=" 3.2758" /> 
<point ath="-52.4010" atv=" 2.0748" /> 
<point ath="-56.4183" atv=" -1.5674" /> 
</hotspot> 
<hotspot name="beach2ferry" 
keep="false" 
visible="true" enabled="true" handcursor="true" capture="true" children="true" 
zorder="1" 
fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00" 
fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00" 
fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700" 
onover="hs_text()" 
onhover="" 
onout="" 
ondown="hs(ferry,ferry2beach)" 
onup="" 
onclick="" 
flying="0" 
> 
<point ath="-124.9477" atv=" -0.1557" /> 
<point ath="-107.5686" atv=" -0.8087" /> 
<point ath="-107.7542" atv=" 1.0302" /> 
<point ath="-124.8984" atv=" 1.0331" /> 
<point ath="-124.9406" atv=" 0.8490" /> 
</hotspot> 
<hotspot name="beach2marine_parade" 
keep="false" 
visible="true" enabled="true" handcursor="true" capture="true" children="true" 
zorder="1" 
fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00" 
fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00" 
fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700" 
onover="hs_text()" 
onhover="" 
onout="" 
ondown="hs(marine_parade,marine_parade2beach)" 
onup="" 
onclick="" 
flying="0" 
> 
<point ath=" 16.0910" atv="-13.1556" /> 
<point ath=" 17.2020" atv=" 3.4047" /> 
<point ath=" 77.1409" atv=" 2.6158" /> 
<point ath=" 76.9145" atv=" -6.4260" /> 
<point ath=" 75.0812" atv=" -6.8958" /> 
<point ath=" 65.3348" atv=" -5.7343" /> 
<point ath=" 65.2003" atv=" -7.3209" /> 
<point ath=" 61.3626" atv="-10.8441" /> 
<point ath=" 49.8380" atv="-11.4295" /> 
<point ath=" 49.0091" atv="-10.8142" /> 
<point ath=" 45.8642" atv="-13.8180" /> 
<point ath=" 42.7641" atv="-13.7355" /> 
<point ath=" 41.9161" atv="-14.9053" /> 
<point ath=" 35.9359" atv="-13.4173" /> 
<point ath=" 35.5455" atv="-13.3935" /> 
</hotspot> 
<hotspot name="beach2ferry_" 
url="%SWFPATH%/hs.png" 
keep="false" 
ath="0" atv="0" 
zoom="false" distorted="true" 
width="400" height="400" 
scale="0.3" scale9grid="" scalechildren="false" rotate="0" 
rx="0" ry="0" rz="0" 
edge="bottom" ox="" oy="" 
crop="" ondowncrop="" onovercrop="" 
visible="true" enabled="false" handcursor="true" capture="true" children="true" 
zorder="100" 
alpha="0.60" blendmode="normal" smoothing="true" 
refreshrate="auto" 
onloaded="" 
onover="" 
onhover="" 
onout="" 
ondown="" 
onup="" 
onclick="" 
flying="0" 
/> 
<hotspot name="beach2marine_parade_" 
url="%SWFPATH%/hs.png" 
keep="false" 
ath="50" atv="-5" 
zoom="false" distorted="true" 
width="400" height="400" 
scale="0.3" scale9grid="" scalechildren="false" rotate="0" 
rx="0" ry="0" rz="0" 
edge="bottom" ox="" oy="" 
crop="" ondowncrop="" onovercrop="" 
visible="true" enabled="false" handcursor="true" capture="true" children="true" 
zorder="100" 
alpha="0.00" blendmode="normal" smoothing="true" 
refreshrate="auto" 
onloaded="" 
onover="" 
onhover="" 
onout="" 
ondown="" 
onup="" 
onclick="" 
flying="0" 
/> 
<hotspot name="beach2pier_" 
url="%SWFPATH%/hs.png" 
keep="false" 
ath="-70" atv="0" 
zoom="false" distorted="true" 
width="400" height="400" 
scale="0.3" scale9grid="" scalechildren="false" rotate="0" 
rx="0" ry="0" rz="0" 
edge="bottom" ox="" oy="" 
crop="" ondowncrop="" onovercrop="" 
visible="true" enabled="false" handcursor="true" capture="true" children="true" 
zorder="100" 
alpha="0.21" blendmode="normal" smoothing="true" 
refreshrate="auto" 
onloaded="" 
onover="" 
onhover="" 
onout="" 
ondown="" 
onup="" 
onclick="" 
flying="0" 
/>





  • pier2beach_
  • beach2ferry
  • beach2pier
  • beach2marineparade
  • beach2ferry_
  • beach2pier_
  • beach2marineparade_




The top hotspot, "pier2beach_" is a relic from the previous scene. And is the hotspot that called the next scene. This hotspot name is stored in the trace(name) from the hotspot action I use to look at the hotspot when you call it (see below).

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<action name="hs">
 trace(name); 
txtadd(hs_name,get(name),_); 
looktohotspot(get(hs_name)); 
wait(load); 
loadscene(%1,null,MERGE); 
copy(backup_hlookat,view.hlookat); 
copy(backup_vlookat,view.vlookat); 
copy(backup_fov,view.fov); 
set(view.hlookat,get(hotspot[%2].ath)); 
set(view.vlookat,get(hotspot[%2].atv)); 
set(view.fov,50); 
set(lockmultireslevel,0); 
wait(load); 
set(lockmultireslevel,-1); 
wait(blend); 
wait(0.5); 
set(lockmultireslevel,0); 
lookto(get(backup_hlookat),get(backup_vlookat),get(backup_fov)); 
set(lockmultireslevel,-1); 
</action>


As you can see, I am using MERGE in the loadpano and all hotspots are keep=false.

This post has been edited 4 times, last edit by "viewinz" (Sep 29th 2009, 5:02am)


michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

12

Tuesday, September 29th 2009, 11:22pm

Hi viewinz,

I think the action code that add the hotspots is not the cause of the problem....
Try using this:

Source code

1
2
3
<action name="loop_all_hotspots">
		trace('hotspot.count = ',hotspot.count);
	</action>


The hotspot.count has 1 more hotspot... the relic one...

I am sure the problem comes from your <action name="hs_text"> and the others actions called from him *attention*

Try using this code:

Source code

1
2
3
		<action name="hs_text">
		trace(name);
		</action>


You will notice that the hotspot.count is correct now....

At this moment I do not know where is the problem on the hs_text() action... maybe later... *rolleyes*

Salut.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

13

Tuesday, September 29th 2009, 11:44pm

Hi

The problem seems to come from the hs_text_graphic_off() action.... I do not understand why at this moment...
Try to simply make this action empty to see if all the others things work well:

Source code

1
2
		<action name="hs_text_graphic_off">
		</action>


Salut.

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

14

Wednesday, September 30th 2009, 12:03am

Michel - that's fixed it! Thank you very much.

Am I not going to be able to switch off the hotspot on rollover?

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

15

Wednesday, September 30th 2009, 12:34am

Hi viewinz,

Must have a way to do... But first we have to know what is wrong on the hs_text_graphic_off() action code... *whistling* *smile*

Salut.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

16

Wednesday, September 30th 2009, 10:10pm

Hi viewinz,

The line of code that makes the mistake into hs_text_graphic_off() action code is:

Source code

1
set(hotspot[%1].onout,set(hotspot[%1_].visible,true);

I do not know why... *sad*
In trying to understand what happens here, I imagine that perhaps the hotspot[%1].onout attribute can not be changed because it is currently in use (onover)..... and then krpano create an new hotspot[%1] to be able to set the onout attribute... JUST IMAGINATION *rolleyes* .... but.... *whistling*

Perhaps KLAUS can explain us what is happening here. *smile* Please *thumbsup*

Salut.

17

Wednesday, September 30th 2009, 11:48pm

Hi,

wow, I got it now, it's a very complex problem

the main problem is the usage of the "onviewchange" event in combination the "lookto/wait" actions,

the lookto/wait actions are "blocking" actions (for historical reasons, but I'm planing to change that in some way...)
all other actions that were called while a lookto action is running will be queued,

now here is the problem:
- the onviewchange event is set to an action with a lot of commands
- a lookto action happens
- the onviewchange event will be called every frame during the lookto movement
- but the actions from the onviewchange event are NOT executed (because of the "blocking")
- instead these actions were queued for later execution
- and finally the number of actions to execute became just TOO MUCH

as quick solution would be to disable the calling of the onviewchange event, during an "blocking" action
(I have done this for testing direct in krpano and it would work (test version via mail if interested), I think I will integrate it in the next release,
but I will also try to improve the actions execution to allow more commands at once),

btw - the usage of the onviewchange here is no very efficient - do you have some as3 (or programming) knowledge?
doing the same in as3 code (as plugin) should work much better...

best regards,
Klaus

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

18

Thursday, October 1st 2009, 12:05am

Klaus - Thank you for looking at this.

Basically I think what your saying is that I asked it to do too much and broke it! Standard procedure for me..

My AS3 isn't good, I've tried a few things and run into a load of errors and don't know how to fix them.. Might have to hire someone to help!
How would you suggest making it into a plugin?

Does the test you've done stop the problem happening? i.e. fix it? Please email it to me when you get the chance!

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

19

Thursday, October 1st 2009, 12:43am

Hi viewinz,

the main problem is the usage of the "onviewchange" event in combination the "lookto/wait" actions,
After reading the post from Klaus, I was thinking in erasing the onviewchange event to see if the Relic hotspot problem become solved... then I do... into the <action name="normalview" i have erased the line set(events.onviewchange,show_hotspots_in_range()); . But the Relic Hotpot is always here... *wacko*

Then I do not understand... *sad*

Salut.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

20

Thursday, October 1st 2009, 2:06am

Hi viewinz,

Ok, Another way I found to get the hotspot.count correct is only making changes in the hs() action... I have commented the looktohotspot() and the wait(load) , like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<action name="hs">
		trace(name);
		txtadd(hs_name,get(name),_);
		<!--looktohotspot(get(hs_name));
		wait(load);-->
		loadscene(%1,null,MERGE,ZOOMBLEND(3,3));
		copy(backup_hlookat,view.hlookat);
		copy(backup_vlookat,view.vlookat);
		copy(backup_fov,view.fov);
		set(view.hlookat,get(hotspot[%2].ath));
		set(view.vlookat,get(hotspot[%2].atv));
		set(view.fov,50);
		set(lockmultireslevel,0);
		wait(load);
		set(lockmultireslevel,-1);
		wait(blend);
		wait(0.5);
		set(lockmultireslevel,0);
		lookto(get(backup_hlookat),get(backup_vlookat),get(backup_fov));
		set(lockmultireslevel,-1);
		</action>


Doing this way, you do not loose the hs_text_graphic_off() action but you loose the looktohotspot.
At least the relic hotspot disappear...

Salut. *sleeping*