You are not logged in.

1

Friday, April 7th 2017, 5:18pm

getting current scene/objects xml to save on disk

Hello,

I'm trying to create hotspot editor using krpano.

I want to save every new update on scene after adding.removing etc. hotspot to .xml file using server side script.
Is there a way to get xml as string or object for the current scene or for new objects or even whole project ?

If I'm going wrong way, how do you manage saving all updates on panos in .xml ?

thanks!

Marek

This post has been edited 1 times, last edit by "Marek_" (Apr 7th 2017, 6:32pm)


2

Friday, April 7th 2017, 8:35pm

Hi,

here a quote from the xml documentation here:
https://krpano.com/docu/xml/#xmlstructure

Quoted

The xml itself is just a transport-format - that means it will be only used to transport the data for the krpano viewer.
When the xml will parsed, then the xml elements will be transformed/mapped into the krpano internal data structures.
That means after parsing there is internally no xml anymore.

That means at runtime there is no xml anymore. If you want to edit the xml, then you would need to load and the edit the xml file itself. The krpano viewer itself will not output a xml file.

Best regards,
Klaus

3

Friday, May 12th 2017, 7:14pm

I'm currently working on moving hotspots after mousedown. I'm using code from the dragabl-hotspots example.

Once HS is moved I'd like to save new position in xml config file from "action" script level. Is it possible ?

I'm adding new line like this:

Source code

1
"set(hotspot[get(name)].atv, atv);"




Source code

1
2
3
4
5
6
7
8
9
10
11
12
<action name="draghotspot">
 spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
 sub(drag_adjustx, mouse.stagex, hotspotcenterx);
 sub(drag_adjusty, mouse.stagey, hotspotcentery);
 asyncloop(pressed,
 sub(dx, mouse.stagex, drag_adjustx);
 sub(dy, mouse.stagey, drag_adjusty);
 screentosphere(dx, dy, ath, atv);
 print_hotspot_pos();
 );
 set(hotspot[get(name)].atv, atv);
	</action>



but that doesn't change xml content and after reload HS is in old place.

If it's not posisble, what is the best way to save latest changes in xml ? From JS external calls level i'm using jquery call to php and then storing on server.
Is it doable in similar way in here ? How I could call php from there ?

thanks

This post has been edited 7 times, last edit by "Marek_" (May 12th 2017, 8:37pm)


4

Friday, May 19th 2017, 2:42am

jscall did the trick here.

Fernando

Intermediate

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

5

Friday, September 7th 2018, 2:31am

Your solution?

Hi, sorry peoples, this is a very old post, but... Which was the final solution?

Greets

Fdo.

Similar threads