Sie sind nicht angemeldet.

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

1

Donnerstag, 13. September 2018, 04:26

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

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

2

Donnerstag, 13. September 2018, 06:08

Ah ha!

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

3

Montag, 17. September 2018, 22:01

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

Pavel

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

4

Dienstag, 18. September 2018, 06:04

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

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

5

Mittwoch, 19. September 2018, 22:47

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....

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Scott Witte« (25. September 2018, 01:48) aus folgendem Grund: Updated URL


6

Donnerstag, 20. September 2018, 09:16

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

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »indexofrefraction« (20. September 2018, 09:30)


7

Donnerstag, 20. September 2018, 22:07

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

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

8

Freitag, 21. September 2018, 03:49

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

Montag, 24. September 2018, 18:20

Hi,

Zitat

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

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

10

Dienstag, 25. September 2018, 01:44

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

Dienstag, 25. September 2018, 11:03

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

12

Dienstag, 25. September 2018, 16:22

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.:

Quellcode

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


Best regards,
Klaus

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

13

Mittwoch, 26. September 2018, 06:25

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

Freitag, 28. September 2018, 10:49

Hi,

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

Best regards,
Klaus

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

15

Freitag, 28. September 2018, 18:54

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

This is why we love you.