Questions about managing krpano files and updates

  • Hi, this is my first post and I wasn't entirely sure what sub-forum would be best, so I am posting this here and maybe it can be moved if needed?

    Last night it came to my attention that VR for my virtual tours was broken. I searched the forum and found the solution, which was that an update to some math in Chrome (degrees vs radians) had caused it, and that I just needed to update my plugin, js, and swf files (I was on pr12, so updated to pr16). In doing so, I found it very cumbersome to replace the contents of the "plugins" folder inside every vtour individually. The number of vtours I manage will only increase over time, so it would be very helpful to be able to make a single edit (per vtour, at the time of creation) that causes it to look for plugins in a central location. This way I would only ever need to update the contents of one folder. I looked through the xml and html files, but could not find any reference to "plugins" path anywhere. Is this centralization possible? What do I need to modify?

    On the same theme, I would like to centralize the customizations I've made to my vtour skin. This one is more obvious HOW to do, but I can't seem to make it work... in the tour.xml file, you can "include" extra files that will modify the skin. The default path which works fine is the "skin" folder, which is inside the root vtour folder for a given vtour. So including my custom file looks like this:

    Code
    <include url="skin/vtourskin_tntweaks_rev01.xml" />


    This is fine, but same as with the plugins, I need a copy of this file inside every "skin" folder for every vtour. If I want to make a tweak in the future, I will need to replace every instance of it. It would be much better to have one instance of it that every tour can reference. Since, in my file-structure, it would be two directories higher than the vtour root, I have tried variations of this:

    Code
    <include url="../../SKIN-CUSTOMIZATIONS/vtourskin_tntweaks_rev01.xml" />


    But it fails to load... I've even tried an absolute path with my full website URL. Is this a permissions issue? or do I have the wrong syntax? Is this possible to achieve?

    Lastly, a bit different kind of question, but I noticed that there is a vtour editor built right into "krpano Tools.exe" in the new pr16, but it when I tried to use it, it told me that my tour had not been created by one of the droplets. My workflow is to use a droplet first, then make some manual edits, which include the "include" lines mentioned in the previous paragraph, as well as the duplication of some scenes (and renamed, so that I can make you face the right way depending on what direction you are travelling through the vtour)... so my question about this is: what are the criteria that the tool looks for to determine if the tour is valid for editing by inside the program? My edits are pretty minor, so it seems pretty strict...

    Hope I can find some solutions, and streamline my work!

  • Hi,

    about file structure and managing files:
    Basically you can ANY file structure, krpano doesn't have any predefined paths, all paths are defined in the html and xml files and they can be also relative in any way.

    Maybe see here for more information about the paths and urls:
    https://krpano.com/docu/html/#top
    https://krpano.com/docu/xml/#url

    And to make updating easier it's a good practice of course to store the core krpano viewer and plugin files (and optionally also skin files) that are the same for all tours at one global place. Than they could be reused for all other panos and tours on the server.

    You could see one possibility of such in the examples included in the download package - there even only one global html file is used - and everything else just a redirection to that html file with the path to the individual example xml.

    About the VTour Editor:
    the criteria for the editing functions currently is simply the occurrence of a 'vtourskin.xml' (could be even in a comment).

    Best regards,
    Klaus

  • Thanks for the reply :) I finally got it working the way I want.
    But even with your feedback, I struggled to get this working, so I thought I'd share a few things that I learned along the way:
    My syntax for the path to my custom skin xmls was correct from the start. I was getting errors because I had made modifications to the base vtourskin.xml file (to hide some UI elements), and since that file references all the image files (pngs for the buttons etc.) it was looking for them in the same directory as itself... I had only placed 2 xml files in my central location, without the images... so once I added the rest of the skin folder contents to my central directory (alongside my custom files), it loaded fine.
    The other thing that was tripping me up was that I could not find any reference to the "plugins" folder, and no information in the links you provided... I did find ONE occurrence of the word "plugins" in the main .js file and figured that it was the same situation as the skin xml: it looks for a plugin folder in the same directory as itself... so my central directory now contains krpano.js, krpano.swf, plugins folder, and skin folder... then I point to the new .js and .swf location via tour.html, and point to the new skin xml location via tour.xml... the plugins folder is found by the fact that it is in the same directory as the .js (as far as I can tell).
    Does this sound right? It seems to be working fine.

  • First, skins and plugins locations are usually %SWFPATH%/plugins and %SWFPATH%/skin, most of the time hardcoded in vtourskin or plugins themselves.
    If you want to change locations:
    - either you change %SWFPATH% globally (through the embedpano line in js)
    - either you ctrl+f the whole code, and override all attributes where you can see %SWFPATH% and change it to your needs, but it will be a lot of work, and it may break on future krpano updates. If you still want to do it, you can take as an example the "skin_base" style in vtourskin, nicely done with a calculated path rather than a hardcoded %SWFPATH%.

    Second, for your code structure, modifying vtourskin.xml is a bad habit because when you have a lot of code there, it can become a pain on each krpano upgrade.

    You could for instance split your code in 3 parts :
    - vtourskin_mod.xml : all that is vtourskin.xml direct modifications (fixes, changing order of layers in the bottom bar, etc...), all that is directly linked to vtourskin and could break on a krpano upgrade. Also, in vtourskin_mod add the "include vtourskin" line;
    - default.xml : all skinsettings or plugin settings, and all that is shared or could be needed by all your tours (events, actions, etc...), but that is not in vtourskin_mod.xml. In there add an "include vtourskin_mod.xml" line.
    - tour.xml : all that is specific to your tour and not shared with other tours. In your tour.xml, include default.xml and you'll have all your default actions, events, settings, etc ... + it will cascade automatically and include vtourskin.xml and vtourskin_mod.xml.


    On a krpano update, you'll (ideally) only have to check vtourskin_mod.xml if it is still aligned. If you split things correctly, default.xml and tour.xml (the biggest parts of your code) should keep working through updates. Maintain vtourskin_mod.xml the smallest possible, but if you note actions in default.xml often break on updates, you can send parts back to vtourskin_mod.xml not to forget to check them on next update. This way you have a simple file to check on updates.

  • Thanks for all this info. I will definitely reference this the next time there is an update.
    The last time I did a krpano update, I went through a process of comparing the new xml to the existing one I had modified, and manually copied over my alterations... it was a bit of a pain, but it meant that I was starting with a fresh updated file (from the new version) and making my modifications again from scratch.
    There hasn't been an update to krpano since then, so I haven't had to struggle through this process a second time so far... it's actually nice to have software that is reliable without needing constant updates :)

  • sorry that i revive this old thread, but since i want to do exactly the same i thought to ask my question here.
    i want to link the plugins folder to a specific path on our webserver. I tried to change every "%SWFPATH%/plugins/swffile.swf" to "https://www.website.com/code/plugins/swffile.swf" whitout luck. Now i want to change the %SWFPATH% path globally, but i don`t know how to do that with the embedpano line.

    Here is an example from one of my tour.html files. Note that my folder-structure always has a tour-specific-folder inside a company-named-folder, and my global folder is at the same level as the company-named-folders. This is why you see ../../ because the global folder is always found two levels above the tour.html file. I have a template file from which I copy this chunk and paste it over any new tours that I make. It's a single added step during tour-creation.

    Code
    <script src="../../KRPANO-GLOBAL/krpano.js"></script>
    <div id="pano" style="width:100%;height:100%;">	<noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>	<script>		embedpano({swf:"../../KRPANO-GLOBAL/krpano.swf", xml:"tour.xml", target:"pano", html5:"auto", mobilescale:1.0, passQueryParameters:true});	</script></div>

Jetzt mitmachen!

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