SGMaterialAnimation::SGMaterialAnimation(const SGPropertyNode* configNode,
- SGPropertyNode* modelRoot) :
- SGAnimation(configNode, modelRoot)
+ SGPropertyNode* modelRoot,
+ const osgDB::ReaderWriter::Options*
+ options) :
+ SGAnimation(configNode, modelRoot),
+ texturePathList(options->getDatabasePathList())
{
if (configNode->hasChild("global"))
SG_LOG(SG_IO, SG_ALERT, "Use of <global> in material animation is "
if (node)
inputRoot = getModelRoot()->getRootNode()->getNode(node->getStringValue(),
true);
-
- osgDB::FilePathList texturePathList = osgDB::getDataFilePathList();
-
if (getConfig()->hasChild("texture-prop"))
osg::StateSet* stateSet = group->getOrCreateStateSet();
if (getConfig()->hasChild("texture")) {
#endif
#include <osg/Material>
+#include <osgDB/ReaderWriter>
#include "animation.hxx"
//////////////////////////////////////////////////////////////////////
class SGMaterialAnimation : public SGAnimation {
public:
SGMaterialAnimation(const SGPropertyNode* configNode,
- SGPropertyNode* modelRoot);
+ SGPropertyNode* modelRoot,
+ const osgDB::ReaderWriter::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node);
private:
osg::ref_ptr<osg::Material> defaultMaterial;
osg::Vec4 defaultAmbientDiffuse;
+ osgDB::FilePathList texturePathList;
};
#endif // _SG_MATERIALANIMATION_HXX
SGFlashAnimation animInst(configNode, modelRoot);
animInst.apply(node);
} else if (type == "material") {
- SGMaterialAnimation animInst(configNode, modelRoot);
+ SGMaterialAnimation animInst(configNode, modelRoot, options);
animInst.apply(node);
} else if (type == "noshadow") {
SGShadowAnimation animInst(configNode, modelRoot);