[solved] Problem using calc with loadpano

  • Hi, this works ok:
    loadpano(html/hosp_hlibre/tour.xml,null,MERGE|REMOVESCENES,null);
    but it doesn't:

    Code
    loadpano(calc('html/'+get(data[1].content)+'hosp_hlibre/tour.xml,null,MERGE|REMOVESCENES,null'));



    I even tried this just to be sure, but it doesn't work either:
    loadpano(calc('html'+'/hosp_hlibre/tour.xml,null,MERGE|REMOVESCENES,null'));

    What is wrong in my code?

    Thank for your help,

    Fernando

    edit:
    the code real was: loadpano(calc('html'+'/hosp_hlibre/tour.xml,null,MERGE|REMOVESCENES,null'));

    3 Mal editiert, zuletzt von Fernando (24. Mai 2018 um 15:56)

  • Hi,

    calc() or get() could be only used for ONE parameter, but not for ALL parameters at once.

    And right - get() is not necessary there.

    Here correct:

    Code
    loadpano(calc('html/'+data[1].content+'hosp_hlibre/tour.xml'),null,MERGE|REMOVESCENES);

    But also note because trying to load a tour.xml - the default vtourskin.xml is NOT designed for loading other tours.

    Best regards,
    Klaus

  • Thanks very much Piotr and Klaus, i see my error with "(get..." but it no works yet:

    If this works fine:


    loadpano(html/hosp_hlibre/tour.xml,null,MERGE|REMOVESCENES,null);

    loadscene(get(scene[0].name));

    Why this not?

    loadpano(calc('html/'+data[1].content+'/tour.xml'),null,MERGE|REMOVESCENES,null);


    data[1].content was created from:

    Code
    <action name="crealistalugares">for(set(i,0), i LT hotspot.count, inc(i), if(hotspot[get(i)].grupo == lugares,set(data[get(hotspot[get(i)].name)].content,get(hotspot[get(i)].name));  trace(data[get(hotspot[get(i)].name)].content););); </action>


    The trace was ok:
    INFO: hosp_hlibre


    The error is:
    FATAL ERROR:
    html/undefined/tour.xml loading failed! (404)

    *confused* What is wrong now?

    Best regards,
    Fernando

    Einmal editiert, zuletzt von Fernando (24. Mai 2018 um 13:19)

  • Code
    txtadd(myfolder, 'html/', get(data[0].content), '/tour.xml');loadpano(get(myfolder),null,MERGE|REMOVESCENES,null);loadscene(get(scene[0].name));

    The solution is to use txtadd instead calc, inspired in this klaus answer: https://krpano.com/forum/wbb/inde…58337#post58337

    txtadd(myfolder, 'html/', get(data[0].content), '/tour.xml');
    loadpano(get(myfolder),null,MERGE|REMOVESCENES,null);
    loadscene(get(scene[0].name));


    Best regards,
    Fernando

    Einmal editiert, zuletzt von Fernando (24. Mai 2018 um 15:55)

Jetzt mitmachen!

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