Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.


Donnerstag, 10. Januar 2019, 18:56

Overload attributes with GET:


I've been using GET: a bit and it seems like if you use a GET: in a given attribute, then one cannot overload this attribute.

<hotspot name="myhotspot" type="text" visible="true" distorted="true"
ath="0" atv="0"

<hotspot name="myhotspotcopy" type="text" visible="true" distorted="true"
ath="20" atv="0"

<!-- override of myhotspotcopy -->
<!-- override of ath works perfectly, override of html does not -->
<hotspot name="myhotspotcopy" type="text" visible="true" distorted="true"
ath="90" atv="0"
html="this text should be shown"

The last override should make the myhotspotcopy hotspot move (as ath changes) and the text change (as html changes).
But only the ath gets overloaded.

Actually anywhere I use GET: , afterwards I cannot overload this attributes. Seems likes using GET: blocks any overloading.

Normal? Bug?




Beiträge: 3 032

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden


Donnerstag, 10. Januar 2019, 21:57


Use like get(hotspot[bla...etc );

get: has other use.

Hope it helps.
Tuur *thumbsup*


Samstag, 12. Januar 2019, 15:57

- Using get() does not seem to be possible in attributes
- documentation says GET: is meant to be used that way, and Klaus himself uses it in vtourskin.xml, what am I doing wrong?


When the value of a xml attribute starts with get: or calc::
In this case the value for the xml attribute will get from an other variable or calculated using an expression

And in the doc about overwrite, it says :


All xml elements and attributes in the krpano xml are optionally and can be defined a several times and in any order. When the same element will be defined again two or more times, then the later/following declarations will overwrite the previous one.
Nothing says GET: attributes cannot be overriden.

I can of course use get() in actions, it's a way round I was using a lot, before GET: was introduced. But styles are so nice to use, and a bit more concise than actions (a simple loadstyle instead of multiple set(attribute, value) lines)


Sonntag, 13. Januar 2019, 22:18

Just from top of my head (without testing) seems that's all about timing. Although the source hotspot is written in the xml code above the hotspot with GET: statement it does not mean that the hotspot is already available when loaded for the particular scene.
I do my settings in onloaded="set(html, get(source.html))"
The "cleanest" way is apparently using onloaded"callwhen(source.loaded, set(html, source.html))"

Please correct me if I'm wrong.
Thank you,


Montag, 14. Januar 2019, 15:38

Yep, I also got to use that onloaded way-round *g*
But anyway, documentation says "the later/following declarations will overwrite the previous one", which in this case is not true


Montag, 14. Januar 2019, 18:11

i noticed that behaviour, too
it also happens when using multiple xml files

ie. you want to override your main xml in an included xml
overriding a get: statement does NOT work in this case, too
I just tested it now.

this strikes me as very odd and may be a bug.


Gestern, 10:17


right, once using get: or calc: it is currently not possible to overwrite that setting again with a normal value...

The reason is that attributes with get:/calc: are getting put to a special list during the xml parsing and evaluated after the main part of the xml parsing is done.

To allow overwriting these attributes again with normal values, it would be necessary to check each time for every other attribute if it is also on that list, and that could be inefficient and slow...

But I will check and measure that in detail and maybe by using a hash-table instead of a list it might be possible to keep the slow-down for supporting this as low as possible...

Best regards,


Gestern, 10:33

But I will check and measure that in detail and maybe by using a hash-table instead of a list it might be possible to keep the slow-down for supporting this as low as possible...

Update: I have checked and updated that now to internal hash-table usage and the performance is okay.
That means in the next version overwriting/redefining xml attributes that used get:/calc: will be possible.


Gestern, 11:45

happy new year klaus :)

fastest problem fixer ever :-D