You are not logged in.

1

Friday, June 11th 2010, 10:29am

Setting scene image properties using an action

Hello,

I'm trying to define the image for a new scene without having to write a list of every cube image. I've tried to use an action with a parameter for the path but it doesn't work.

Quoted


<action name="setimage">
<image type="CUBE">
<left url="%1.tiles/pano_l_0101.jpg" />
<front url="%1.tiles/pano_f_0101.jpg" />
<right url="%1.tiles/pano_r_0101.jpg" />
<back url="%1.tiles/pano_b_0101.jpg" />
<up url="%1.tiles/pano_u_0101.jpg" />
<down url="%1.tiles/pano_d_0101.jpg" />
</image>
</action>




<!-- -----------------------------------scene 1----------------------------------- -->

<scene name="scene1"

onstart="action(setimage, Assets/Images/Pano/View_1);">

<!-- -----------------------------------scene 2----------------------------------- -->

<scene name="scene2"

onstart="action(setimage, Assets/Images/Pano/View_2);">






Can anyone give me an idea how to acheive the desired result?

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Friday, June 11th 2010, 1:01pm

Try this at the end of a scene </scene>

Will that help?

Tuur *thumbsup*

mindlessboss

Professional

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

3

Friday, June 11th 2010, 5:14pm

Try this. its working in my test ;-)

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<action name="setimage">
	set(image.front.url, %1.tiles/pano_f_0101.jpg);
	set(image.right.url, %1.tiles/pano_r_0101.jpg);
	set(image.back.url, %1.tiles/pano_b_0101.jpg);
	set(image.left.url, %1.tiles/pano_l_0101.jpg);
	set(image.up.url, %1.tiles/pano_u_0101.jpg);
	set(image.down.url, %1.tiles/pano_d_0101.jpg);
</action>


 <scene name="scene2" onstart="setimage(Assets/Images/Pano/View_2);">
	<image type="CUBE"></image>
</scene>
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

4

Saturday, June 12th 2010, 9:16am

setting the preview URL


That's solved my problem very well. Thanks v much Boss-Man.

There's one last issue which would be really useful to work out.

IIs it possible to set the preview image at the same time?

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
<krpano version="1.0.8" onstart="loadscene(scene1,null,null);" >


	<action name="setimage">
		set(preview.url, %1.tiles/preview.jpg);
		set(image.front.url, %1.tiles/pano_f_0101.jpg);
		set(image.right.url, %1.tiles/pano_r_0101.jpg);
		set(image.back.url, %1.tiles/pano_b_0101.jpg);
		set(image.left.url, %1.tiles/pano_l_0101.jpg);
		set(image.up.url, %1.tiles/pano_u_0101.jpg);
		set(image.down.url, %1.tiles/pano_d_0101.jpg);
	</action>

	

	<!-- -----------------------------------scene 1----------------------------------- -->

	<scene name="scene1" onstart=" setimage(Assets/Images/Pano/View_1);">
		
		<preview type="CUBESTRIP"/>

		<image type="CUBE"> </image>

	</scene>

</krpano>




Perhaps it needs to be set at the loadscene stage. Not sure of the syntax for doing that. any ideas anybody??




mindlessboss

Professional

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

5

Saturday, June 12th 2010, 3:14pm

I'm afraid can not do.
but maybe I am mistaken.
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

6

Monday, June 14th 2010, 1:29pm

Hi nicoclark,

You could try another approach...
I think adding the preview to the scene content using a txtadd() action... 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
26
27
28
<krpano version="1.0.8" onstart="do_loadscene(scene1,null,null);" >

	
	<action name="do_loadscene">
		txtadd(scene[%1].content, get(scene[%1].content), '<preview type="CUBESTRIP" url="path_to_preview/preview.jpg" />');
		loadscene(%1, %2, %3);
	</action>
	

	<action name="setimage">
		set(image.front.url, %1.tiles/pano_f_0101.jpg);
		set(image.right.url, %1.tiles/pano_r_0101.jpg);
		set(image.back.url, %1.tiles/pano_b_0101.jpg);
		set(image.left.url, %1.tiles/pano_l_0101.jpg);
		set(image.up.url, %1.tiles/pano_u_0101.jpg);
		set(image.down.url, %1.tiles/pano_d_0101.jpg);
	</action>


	<!-- -----------------------------------scene 1----------------------------------- -->

	<scene name="scene1" onstart=" setimage(Assets/Images/Pano/View_1);">

		<image type="CUBE"> </image>

	</scene>

</krpano>


Hope this help.

SAlut.

This post has been edited 2 times, last edit by "michel" (Jun 14th 2010, 1:56pm)


7

Tuesday, June 15th 2010, 11:55am

Hi,

setting the preview image as parameter for the loadscene() call should also work,
e.g.

Source code

1
loadscene(scene, preview.url=preview.jpg, ...);


best regards,
Klaus

nidrig

Beginner

Posts: 26

Location: Switzerland

  • Send private message

8

Saturday, August 3rd 2013, 3:25pm

Hi,

setting the preview image as parameter for the loadscene() call should also work,
e.g.

Source code

1
loadscene(scene, preview.url=preview.jpg, ...);


best regards,
Klaus

Hi,

I'm also trying to set the preview.url variable, but by passing it another variable and I struggle with the syntax.

What works:

Source code

1
loadscene(scene, preview.url=preview.jpg, ...);


What doesn't:

Source code

1
loadscene(scene, preview.url=get(var_name), ...);

Source code

1
loadscene(scene, set(preview.url,get(var_name)), ...);


What is the correct syntax, please?

Thanks.

Edit: I found the solution by passing loadscene a string built before the call.

This post has been edited 1 times, last edit by "nidrig" (Aug 3rd 2013, 3:45pm)