Added supported for setting animation path on MatrixTransform's.
This commit is contained in:
@@ -68,6 +68,22 @@ bool MatrixTransform_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("AnimationPath"))
|
||||
{
|
||||
static osg::ref_ptr<osg::AnimationPath> prototype = new osg::AnimationPath;
|
||||
osg::ref_ptr<osg::Object> object = fr.readObjectOfType(*prototype);
|
||||
osg::AnimationPath* path = dynamic_cast<osg::AnimationPath*>(object.get());
|
||||
if (path)
|
||||
{
|
||||
transform.setAnimationPath(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::Node* node = dynamic_cast<osg::Node*>(object.get());
|
||||
if (node) transform.addChild(node);
|
||||
}
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
@@ -78,5 +94,10 @@ bool MatrixTransform_writeLocalData(const Object& obj, Output& fw)
|
||||
|
||||
fw.writeObject(transform.getMatrix());
|
||||
|
||||
if (transform.getAnimationPath())
|
||||
{
|
||||
fw.writeObject(*transform.getAnimationPath());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user