You are not logged in.

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

1

Thursday, September 13th 2018, 4:26am

Can you change image (pano) without changing scene?

I have some cases where I want to change just the image within a scene but not the scene itself. For instance, a sunrise animation consisting of a series of panos. Why? I only want one thumbnail to be generated for the set. If loading a new pano requires loading a new scene each of those images ends up getting its own thumbnail. I thought loadpano might accomplish this, including only the image element in the XML file specified by loadpano(). Unfortunately, loadpano seems to wipe out the scene element, though curiously not any hotspots, events, styles or actions contained within the scene. I tried including the scene element in the loadpano XML but that results in a black window and does not load the scene element.

And, I would like a nice crossfade when the image changes....

Is there a way to accomplish this?

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

2

Thursday, September 13th 2018, 6:08am

Ah ha!

The solution is loadxml. It's, ah, right in the documentation.

3

Monday, September 17th 2018, 10:01pm

Scott,
Do you have an example of your solution?
Thank you,

Pavel

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

4

Tuesday, September 18th 2018, 6:04am

Do you have an example of your solution?

In the next couple days. It hasn't proven as simple as I'd hoped.

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

5

Wednesday, September 19th 2018, 10:47pm

What worked for me

You can see the result here: Hauser Statue. This site is still under development.

All I wanted to do was replace the image element(s) of the scene. The loadxml action will do that, but.... it wipes out any hotspots defined in the scene and the scene tag itself (so you can't access the current scene name, for instance). Curiously, it didn't seem to affect the style, data or action elements. Adding the hotspot elements to the loaded XML returns them, but adding the scene element results in no image at all and, as I recall, wiped out style, events, data and action elements. To show the image I had to use the loadscene action and moved styles, actions, and data outside the scene.

Seems like way too much effort just to replace the image element. Just saying....

This post has been edited 1 times, last edit by "Scott Witte" (Sep 25th 2018, 1:48am) with the following reason: Updated URL


6

Thursday, September 20th 2018, 9:16am

i use a changed vtourskin being able to read a variable number of scenes as options of each other,
only showing the thumbnails, map spot for one (the active) option (scene)
while the next/prev buttons jump over the inactive options (scenes)
works perfect, but it is also a quite complex solution

This post has been edited 2 times, last edit by "indexofrefraction" (Sep 20th 2018, 9:30am)


7

Thursday, September 20th 2018, 10:07pm

Scott,

According my understanding you need to play with the *flags argument of the loadxml() action. Read the *flags options of the loadscene(), loadxml() ...
https://krpano.com/docu/actions/#loadpano
If you use the vtourskin.xml then the <skin_settings loadscene_flags="MERGE" of your tour.xml does it for you. Just write one or more flags, which will work for you.
Of course you can selectively set the hotspot param keep=true for some hotspots and they will be on all scenes.
Looking forward seeing your results.

Pavel

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

8

Friday, September 21st 2018, 3:49am

play with the *flags argument of the loadxml() action

Thanks for the suggestion. I had high hopes, especially for the IMAGEONLY flag. Indeed, if I only use the image and preview element in the loaded XML and use IMAGEONLY, then hotspots are maintained. However, the scene tag is still destroyed. This is also true if I include MERGE. It still seems the only way to keep a scene element is to include it in the XML loaded and that results in no image until I issue a loadscene command. So, really, right back where I was before.

Unless I am doing something wrong.

I've tried many flag variations that seemed plausible.

Klaus... If you are listening could you shed some wisdom?

9

Monday, September 24th 2018, 6:20pm

Hi,

Quoted

Klaus... If you are listening could you shed some wisdom?
Sorry, but for a detailed answer, I would need to study the example, but using loadxml() wouldn't change any scene related information...

If you want to keep everything and change only the pano image, try using loadxml with the KEEPALL|KEEPHOTSPOTS flags.

Best regards,
Klaus

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

10

Tuesday, September 25th 2018, 1:44am

If you want to keep everything and change only the pano image, try using loadxml with the KEEPALL|KEEPHOTSPOTS flags.

No joy. I just tested that and used the distro version to be sure nothing in my mods could be the issue.

loadxml with KEEPALL|KEEPHOTSPOTS flags changes the preview and image elements, keeps the view, hotspot, style, data and action elements but wipes out the scene and events elements.

See the example here: Image Replacement Test. You can download the XML.

In the log window you will see "XML Complete. Scene: hauser" trace from the xmlcomplete event when the scene first loads.
Click an arrow to fire the "next_view" action. Traces display the scene name before and after the loadxml action. The first time, before the first loadxml, the the scene name is found, but after that, the scene name is always null. Also, the events element is gone so the trace in the xmlcomplete event doesn't fire.

BTW, I tried putting the data elements outside the scene. Made no difference.

11

Tuesday, September 25th 2018, 11:03am

hm did you try to wrap your data with
<krpano><scene> ... </scene></krpano>
?

12

Tuesday, September 25th 2018, 4:22pm

Hi,

the scenes will not change, but the xml.scene variable will become null after the loadxml() call.

But this is intended as the current panos is actually not longer the current scene.
Only loadscene or loadpanoscenes are setting xml.scene to the value given by the calls, with loadpano or loadxml it will always become null.

As solution you could backup the xml.scene value before the loadxml call and restore it after it - e.g.:

Source code

1
2
3
4
5
...
copy(xml_scene_backup, xml.scene);
loadxml(...);
copy(xml.scene, xml_scene_backup);
...


Best regards,
Klaus

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

13

Wednesday, September 26th 2018, 6:25am

But this is intended as the current panos is actually not longer the current scene.

Ah. Might it make sense to think of the pano as the image part of the scene but not the scene itself? I want it to be the same, current "scene" but just change the image within it, keeping everything else as is. An extreme example might be a virtual object scene. It doesn't become a different scene with each change of image. In my example, the "scene" is the statue, essentially a virtual object but using panos instead of flat images as "frames." I believe this is a useful capability and I'm not alone.

Consider this: Have loadxml do just that and nothing more. It would replace the existing same elements or add new ones but not wipe out any existing elements that weren't in the loaded XML. It half way does that now in that it doesn't affect the style, data or action elements within a scene, only scene, hotspot, view, and events.

14

Friday, September 28th 2018, 10:49am

Hi,

yes, I will think about an API for directly loading an pano image.

Best regards,
Klaus

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 382

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

15

Friday, September 28th 2018, 6:54pm

I will think about an API for directly loading an pano image

This is why we love you.