You are not logged in.

1

Sunday, December 9th 2018, 7:56pm

Not always resolving krpano variables.

When I enter vr mode, I have the following block to turn on the VR only hotspots in the tour:

Source code

1
<action name="showVRHotspots">    for(set(i,0), i LT hotspot.count, inc(i),  set(hotspot[get(i)].visible, false);  if(hotspot[get(i)].tag == vr,        set(hotspot[get(i)].visible, true);      );  error("-----");  error(hotspot[get(i)].tag);  error(hotspot[get(i)].tooltip);  error(hotspot[get(i)].name);  error(hotspot[get(i)].visible);  error("-----");  if(hotspot[get(i)].tag == vr_menu,        set(hotspot[get(i)].visible, true);      );         );  </action>

Grr, the code block keeps dismissing newlines....

The problem is some of the hotspots with a "vr" tag don't get their visible set to true. The error output show "ERROR: hotspot[get(i)].tag" instead of the tag name. The hotspots that work correctly actually resolve that to the correct tag.

What can I do to make sure the krpano variable always gets resolved?

Thanks

2

Sunday, December 9th 2018, 10:32pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<action name="showVRHotspots"> 
	for(set(i,0), i LT hotspot.count, inc(i),  
		if(hotspot[get(i)].tag == vr,
			set(hotspot[get(i)].visible, true);
		,
			set(hotspot[get(i)].visible, false);
		); 
		trace("-----");  
		trace(hotspot[get(i)].tag);  
		trace(hotspot[get(i)].tooltip); 
		trace(hotspot[get(i)].name); 
		trace(hotspot[get(i)].visible);
		trace("-----");  
		if(hotspot[get(i)].tag == vr_menu,
			set(hotspot[get(i)].visible, true);
		);
	);
</action>


i think the problem are your conditions
you should check for "vr" and "vr_menu" in quotes
if you use vr and vr_menu without quotes
then the condition interprets them as variables
and as they are unsed the condition is for both
the same as if(hotspot[get(i)].tag == null, ...

also maybe better use trace() or debug()
for such output, not error()

3

Sunday, December 16th 2018, 7:12pm

Thanks for the help!

They should be strings, sure. So I have fixed that, but that doesn't change the original problem:


The error output from `error(hotspot[get(i)].tag);` shows
"ERROR: hotspot[get(i)].tag" instead of:


"ERROR: <actual tag name>".


And to be clear, it is inconsistent. There are 10 + hotspots and some show the correct name, and some show "hotspot[get(i)].tag" instead.


Tags such as "photo" and "text" print correctly. Tags "vr" do not. I even tried changing the tag to a nonsense string in case "vr" has some special meaning. I still get inconsistent output from the error debug statements.

4

Sunday, December 16th 2018, 9:05pm

if you get "hotspot[get(i)].tag" this simply means the tag property is unset / null
we dont see how you set the tags and there could be hotspots in your scene, which you are not aware of
(set by the webvr plugin for example)

its hard to say if you dont post the full tour