You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, November 8th 2013, 4:19pm

dynamic include xml or another solution

hi,

i'm currently re-building a portfolio with several hundred panos,
before i was using 1 scene for 1 pano, and the code was growing exponentially,
then i changed the way by using one single scene code to get lightweight xml code,

so basically :
-i setup variables of my pano
-i use "loadscene" to load scene xml code (using populated variables)

everything works fine,

but few scenes need additional hotspots/plugins/lensflares...

i think to several solutions :

A/
in my main scene code, i can add an include pointing to an extra.xml

Source code

1
<include url="%FIRSTXML%/panos/%$set_id%/%$pano_id%/extra.xml"/>

as you see i use some variables here too to load the extra.xml in each pano folder,
most of them will be empty xml file (because unnecessary) and fews will contains the additional stuff needed.
this solution works but we are loading empty files for nothing.

B/
i can put the include

Source code

1
<include url="%FIRSTXML%/panos/%$set_id%/%$pano_id%/extra.xml"/>

and with conditional setup the include url to null,

Source code

1
if(have_include_xml == false, set(include.url, null));

a solution avoiding loading unnecessary xml files,
but that's doesn't works *confused*

C/
i could use "loadxml",
but have to find a way to keep everything and add my additional stuff in he scene,
i don't know for now *huh*

so, smart advices appreciated and welcome

thanks

z

2

Saturday, November 16th 2013, 7:46pm

Never mind,
Found a creative work-around...

Z