getProperty and inheritance
Submitted by ebeuque on January 23, 2007 - 12:12.
I would like a way to get the total inherited value of a property of the current node. For instance, I have made panogroup for managing hotspots with a an animated zoom to the hotspot area before going to the other scene. If I adjust the pan and tilt globally in the panogroup attributes, the panoelement will inherit this, but getProperty("_this", "pan") will return 0 because it's the default value of panoelement.
I understand fixing this could break some existing xml so I suggest that Aldo could introduce either a third parameter to getProperty or another specific property name to get the total pan and tilt as inherited from all the ancestor panogroup that the panoelement is part of.
fieldOfView | SPi-V dev
Re: getProperty and inheritance
Couldn't you do '=getProperty("_this", "pan")+getProperty("yourPanoGroup", "pan")' instead?
Re: getProperty and inheritance
Yes I could, but I tried to minimize the number of modifications I had to do for numerous hotspots I have in numerous scenes of a tour. That's where _this is interesting and what it is intended to. So one good option could also be to have "_parent" keyword so that I could write :
'=getProperty("_this", "pan")+getProperty("_parent", "pan")'
But this would also break as soon as I would decide to include the parent into another panogroup. That's why I was suggesting a way to get the total pan that is used to render the panoelement node, whatever the number of parent or ancestors is.
Re: getProperty and inheritance
In SPi-V 1.4, I will likely implement the following functionality for getProperty:
Likewise, the setProperty call will gain the ability to set a value persistently into the XML as it were. This means the property will remain set to that value when you exit and reenter the scene.
Re: getProperty and inheritance
Well, I assume the persistence will occur only if you navigate among scenes contained in the same XML file, but not if you organise your tour with one XML file per scene and use getUrl to switch scene ?
Re: getProperty and inheritance
Your assumption is correct