From 33e1a9457a356c339170d79d66253fac2dd1f825 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Sun, 26 Dec 2010 18:34:00 +0100 Subject: [PATCH] set data variance to DYNAMIC for animated effect attributes --- simgear/scene/material/EffectBuilder.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/simgear/scene/material/EffectBuilder.hxx b/simgear/scene/material/EffectBuilder.hxx index c1d48405..a30efa5e 100644 --- a/simgear/scene/material/EffectBuilder.hxx +++ b/simgear/scene/material/EffectBuilder.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -578,6 +579,19 @@ new_EEPropListener(const Func& func, const std::string* propName, (func, 0, namesBegin, namesEnd); } +/** + * Set DYNAMIC data variance on an osg::Object. + */ + +inline void setDynamicVariance(void* obj) +{ +} + +inline void setDynamicVariance(osg::Object* obj) +{ + obj->setDataVariance(osg::Object::DYNAMIC); +} + /** * Initialize the value and the possible updating of an effect * attribute. If the value is specified directly, set it. Otherwise, @@ -598,6 +612,7 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj, const SGPropertyNode* valProp = getEffectPropertyNode(effect, prop); if (!valProp) return; + setDynamicVariance(obj); if (valProp->nChildren() == 0) { setter(obj, valProp->getValue()); } else { @@ -650,6 +665,7 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj, const SGPropertyNode* valProp = getEffectPropertyNode(effect, prop); if (!valProp) return; + setDynamicVariance(obj); if (valProp->nChildren() == 0) { // Has ? setter(obj, Bridge::get(valProp->getValue())); } else { -- 2.39.5