X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation%2Fkeyframe.cpp;h=6cb8ce6ad1b5d9d5260115bae32821f62961c426;hp=f610de2d42afbd08dd118cf97e7f54afa75da7de;hb=3ac3a51c623271da815c8ee60c484445871753bf;hpb=885b8ad08cfcefba4b95ec9028fa1e25df2fe171 diff --git a/source/animation/keyframe.cpp b/source/animation/keyframe.cpp index f610de2d..6cb8ce6a 100644 --- a/source/animation/keyframe.cpp +++ b/source/animation/keyframe.cpp @@ -1,4 +1,5 @@ #include +#include #include "keyframe.h" #include "pose.h" @@ -33,7 +34,6 @@ void KeyFrame::set_uniform(const string &n, const AnimatedUniform &u) void KeyFrame::set_pose(const Pose &p) { pose = &p; - pose.keep(); } @@ -73,17 +73,22 @@ void KeyFrame::Loader::init() add("scaling", &Loader::scaling); } +void KeyFrame::Loader::set_inline_base_name(const string &n) +{ + inline_base_name = n; +} + void KeyFrame::Loader::pose(const string &n) { obj.pose = &get_collection().get(n); - obj.pose.keep(); } void KeyFrame::Loader::pose_inline() { RefPtr p = new Pose; load_sub(*p, get_collection()); - obj.pose = p; + get_collection().add((inline_base_name.empty() ? FS::basename(get_source()) : inline_base_name)+".pose", p.get()); + obj.pose = p.release(); } void KeyFrame::Loader::position(float x, float y, float z)