From 2aab28149fbbdc65cceeb516fe8f8aab47a25b7b Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Mon, 28 Aug 2017 15:59:13 +0200 Subject: [PATCH] reroot to rigtransform::prepareData old path to rig::buildvertexinfluence --- include/osgAnimation/RigGeometry | 9 +++++++-- src/osgAnimation/RigGeometry.cpp | 5 ----- src/osgAnimation/RigTransformHardware.cpp | 2 +- src/osgAnimation/RigTransformSoftware.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/osgAnimation/RigGeometry b/include/osgAnimation/RigGeometry index 31cda0179..a636f7717 100644 --- a/include/osgAnimation/RigGeometry +++ b/include/osgAnimation/RigGeometry @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -151,8 +151,13 @@ namespace osgAnimation osg::notify(osg::WARN) << "A RigGeometry did not find a parent skeleton for RigGeometry ( " << geom->getName() << " )" << std::endl; return; } - geom->buildVertexInfluenceSet(); geom->setSkeleton(finder._root.get()); + + if(!geom->getRigTransformImplementation()) + { + geom->setRigTransformImplementation(new RigTransformSoftware); + } + geom->getRigTransformImplementation()->prepareData(*geom); } if(!geom->getSkeleton()) diff --git a/src/osgAnimation/RigGeometry.cpp b/src/osgAnimation/RigGeometry.cpp index b09c61966..bb5a9c8ee 100644 --- a/src/osgAnimation/RigGeometry.cpp +++ b/src/osgAnimation/RigGeometry.cpp @@ -118,11 +118,6 @@ void RigGeometry::computeMatrixFromRootSkeleton() void RigGeometry::update() { - if (!getRigTransformImplementation()) - { - _rigTransformImplementation = new RigTransformSoftware; - } - RigTransform& implementation = *getRigTransformImplementation(); (implementation)(*this); } diff --git a/src/osgAnimation/RigTransformHardware.cpp b/src/osgAnimation/RigTransformHardware.cpp index dc67533ae..90c684669 100644 --- a/src/osgAnimation/RigTransformHardware.cpp +++ b/src/osgAnimation/RigTransformHardware.cpp @@ -600,7 +600,7 @@ bool RigTransformHardware::init(RigGeometry& geom) void RigTransformHardware::operator()(RigGeometry& geom) { if (_needInit) - if (!init(geom)) + if (!prepareData(geom)) return; computeMatrixPaletteUniform(geom.getMatrixFromSkeletonToGeometry(), geom.getInvMatrixFromSkeletonToGeometry()); } diff --git a/src/osgAnimation/RigTransformSoftware.cpp b/src/osgAnimation/RigTransformSoftware.cpp index c1bc46560..69920cd71 100644 --- a/src/osgAnimation/RigTransformSoftware.cpp +++ b/src/osgAnimation/RigTransformSoftware.cpp @@ -256,7 +256,7 @@ bool RigTransformSoftware::prepareData(RigGeometry&rig) { void RigTransformSoftware::operator()(RigGeometry& geom) { if (_needInit) - if (!init(geom)) + if (!prepareData(geom)) return; if (!geom.getSourceGeometry()) {