Use META_Object, ignore for serialize

pull/3236/head
Sam Hellawell 8 months ago
parent 13e1df3bf0
commit 42406ed0af

@ -36,6 +36,17 @@ namespace MWRender
AnimBlendControllerBase(osg::ref_ptr<SceneUtil::KeyframeController> keyframeTrack, AnimBlendStateData animState, AnimBlendControllerBase(osg::ref_ptr<SceneUtil::KeyframeController> keyframeTrack, AnimBlendStateData animState,
osg::ref_ptr<const SceneUtil::AnimBlendRules> blendRules); osg::ref_ptr<const SceneUtil::AnimBlendRules> blendRules);
AnimBlendControllerBase() {}
AnimBlendControllerBase(const AnimBlendControllerBase<NodeClass>& copy, const osg::CopyOp&)
: mTimeFactor(0.0f)
, mInterpFactor(0.0f)
{
setKeyframeTrack(copy.getKeyframeTrack(), copy.getAnimState(), copy.getBlendRules());
}
META_Object(MWRender, AnimBlendControllerBase<NodeClass>)
void operator()(NifOsg::MatrixTransform* node, osg::NodeVisitor* nv); void operator()(NifOsg::MatrixTransform* node, osg::NodeVisitor* nv);
void operator()(osgAnimation::Bone* node, osg::NodeVisitor* nv); void operator()(osgAnimation::Bone* node, osg::NodeVisitor* nv);
@ -49,13 +60,9 @@ namespace MWRender
void gatherRecursiveBoneTransforms(osgAnimation::Bone* parent, bool isRoot = true); void gatherRecursiveBoneTransforms(osgAnimation::Bone* parent, bool isRoot = true);
void applyBoneBlend(osgAnimation::Bone* parent); void applyBoneBlend(osgAnimation::Bone* parent);
const char* libraryName() const override { return "MWRender"; } osg::ref_ptr<SceneUtil::KeyframeController> getKeyframeTrack() const { return mKeyframeTrack; }
const char* className() const override { return "AnimBlendController"; } osg::ref_ptr<const SceneUtil::AnimBlendRules> getBlendRules() const { return mAnimBlendRules; }
AnimBlendStateData getAnimState() const { return mAnimState; }
protected:
osg::ref_ptr<SceneUtil::KeyframeController> mKeyframeTrack;
inline void calculateInterpFactor(float time);
private: private:
Easings::EasingFn mEasingFn; Easings::EasingFn mEasingFn;
@ -73,8 +80,11 @@ namespace MWRender
AnimBlendStateData mAnimState; AnimBlendStateData mAnimState;
osg::ref_ptr<const SceneUtil::AnimBlendRules> mAnimBlendRules; osg::ref_ptr<const SceneUtil::AnimBlendRules> mAnimBlendRules;
osg::ref_ptr<SceneUtil::KeyframeController> mKeyframeTrack;
std::unordered_map<osg::Node*, osg::Matrixf> mBlendBoneTransforms; std::unordered_map<osg::Node*, osg::Matrixf> mBlendBoneTransforms;
inline void calculateInterpFactor(float time);
}; };
using AnimBlendController = AnimBlendControllerBase<NifOsg::MatrixTransform>; using AnimBlendController = AnimBlendControllerBase<NifOsg::MatrixTransform>;

@ -187,19 +187,20 @@ namespace SceneUtil
mgr->addWrapper(new GeometrySerializer); mgr->addWrapper(new GeometrySerializer);
// ignore the below for now to avoid warning spam // ignore the below for now to avoid warning spam
const char* ignore[] const char* ignore[] = { "Debug::DebugDrawer", "AnimBlendControllerBase<NifOsg::MatrixTransform>",
= { "Debug::DebugDrawer", "MWRender::PtrHolder", "Resource::TemplateRef", "Resource::TemplateMultiRef", "AnimBlendControllerBase<osgAnimation::Bone>", "MWRender::PtrHolder", "Resource::TemplateRef",
"SceneUtil::CompositeStateSetUpdater", "SceneUtil::UBOManager", "SceneUtil::LightListCallback", "Resource::TemplateMultiRef", "SceneUtil::CompositeStateSetUpdater", "SceneUtil::UBOManager",
"SceneUtil::LightManagerUpdateCallback", "SceneUtil::FFPLightStateAttribute", "SceneUtil::LightListCallback", "SceneUtil::LightManagerUpdateCallback",
"SceneUtil::UpdateRigBounds", "SceneUtil::UpdateRigGeometry", "SceneUtil::LightSource", "SceneUtil::FFPLightStateAttribute", "SceneUtil::UpdateRigBounds", "SceneUtil::UpdateRigGeometry",
"SceneUtil::DisableLight", "SceneUtil::MWShadowTechnique", "SceneUtil::TextKeyMapHolder", "SceneUtil::LightSource", "SceneUtil::DisableLight", "SceneUtil::MWShadowTechnique",
"Shader::AddedState", "Shader::RemovedAlphaFunc", "NifOsg::FlipController", "SceneUtil::TextKeyMapHolder", "Shader::AddedState", "Shader::RemovedAlphaFunc",
"NifOsg::KeyframeController", "NifOsg::Emitter", "NifOsg::ParticleColorAffector", "NifOsg::FlipController", "NifOsg::KeyframeController", "NifOsg::Emitter",
"NifOsg::ParticleSystem", "NifOsg::GravityAffector", "NifOsg::ParticleBomb", "NifOsg::ParticleColorAffector", "NifOsg::ParticleSystem", "NifOsg::GravityAffector",
"NifOsg::GrowFadeAffector", "NifOsg::InverseWorldMatrix", "NifOsg::StaticBoundingBoxCallback", "NifOsg::ParticleBomb", "NifOsg::GrowFadeAffector", "NifOsg::InverseWorldMatrix",
"NifOsg::GeomMorpherController", "NifOsg::UpdateMorphGeometry", "NifOsg::UVController", "NifOsg::StaticBoundingBoxCallback", "NifOsg::GeomMorpherController", "NifOsg::UpdateMorphGeometry",
"NifOsg::VisController", "osgMyGUI::Drawable", "osg::DrawCallback", "osg::UniformBufferObject", "NifOsg::UVController", "NifOsg::VisController", "osgMyGUI::Drawable", "osg::DrawCallback",
"osgOQ::ClearQueriesCallback", "osgOQ::RetrieveQueriesCallback", "osg::DummyObject" }; "osg::UniformBufferObject", "osgOQ::ClearQueriesCallback", "osgOQ::RetrieveQueriesCallback",
"osg::DummyObject" };
for (size_t i = 0; i < sizeof(ignore) / sizeof(ignore[0]); ++i) for (size_t i = 0; i < sizeof(ignore) / sizeof(ignore[0]); ++i)
{ {
mgr->addWrapper(makeDummySerializer(ignore[i])); mgr->addWrapper(makeDummySerializer(ignore[i]));

Loading…
Cancel
Save