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?

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

  • 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

  • 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

  • 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?

  • 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

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

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

    Code
    ...
    copy(xml_scene_backup, xml.scene);
    loadxml(...);
    copy(xml.scene, xml_scene_backup);
    ...

    Best regards,
    Klaus

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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!