Sie sind nicht angemeldet.

1

Dienstag, 13. Oktober 2015, 08:29

How to get image elements of other scene ?

Hi. Does anyone know the solution ?

<scene name="scene1">
<image type="CUBE" />
</scene>

<scene name="scene2">
<image type="CYLINDER" />
</scene>

Like this scene structure, when the current scene is "scene1", we can get the current image type as " copy( currenttype, image.type ) ".
But how can I get the image type of "scene2" ?

I tried to get the value as " copy( nexttype, scene[1].image.type ); ", it doesn't work.

Please help me!

2

Dienstag, 13. Oktober 2015, 10:43

I found a trick using JavaScript like follwing code. But it's not so elegant and scene.content is undocumented attribute.


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function getImageType( sceneName )
{
	var krpano = document.getElementById("krpanoSWFObject");
	var imagetype = "";

	for( index=0; index<krpano.get("scene.count"); index++ )
	{
		if( krpano.get("scene["+ index + "].name") == sceneName )
		{
			var xmlContent = "<scene>" +  krpano.get("scene["+ index + "].content") + "</scene>";
			xmlDoc = $.parseXML( xmlContent );
			imagetype = $(xmlDoc).find("image").attr("type");
			break;
		}
	}

	krpano.set( "imagetype", imagetype );
	return imagetype;
}

3

Freitag, 16. Oktober 2015, 09:52

and scene.content is undocumented attribute.

is not: ;-)
http://krpano.com/docu/xml/#scene.content

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

4

Freitag, 16. Oktober 2015, 12:07

heh, Klaus)

I remember while learning documentation I initiallly missed some info until discovered that magic button 'show / hide advanced settings" ;-) *tongue*
Regards,

Alexey

5

Dienstag, 20. Oktober 2015, 02:12


Quoted from "mata"
and scene.content is undocumented attribute.

is not:
http://krpano.com/docu/xml/#scene.content


Oh! I didn't noticed. Sorry...

6

Donnerstag, 4. August 2016, 23:23

so, there is no way to DYNAMICALLY READ AND SET OTHER SCENES view, images, hotspots, etc ?
na, i guess thats kind of a rethoric question, bc i already know its not possible.

but it would be kinda nice to have some kind of:
set(scene[name].view.fov, 50); etc...

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »indexofrefraction« (5. August 2016, 01:04)