diff options
author | prep linden <prep@lindenlab.com> | 2011-03-17 17:25:52 -0400 |
---|---|---|
committer | prep linden <prep@lindenlab.com> | 2011-03-17 17:25:52 -0400 |
commit | 359d0494308451ce1318f0291ebbf0ba58e42f44 (patch) | |
tree | b9fce9d0ed9a2dd5dcf2c850ae914ff295ea2f29 /indra/newview/llfloatermodelpreview.cpp | |
parent | 4b54ec7965cd874af4d0eef381d0bc9fe06cff04 (diff) |
Added support for handling an asset that contains a skeletal node which has no root node for the scene (yuck). Fix for an upload issue w/simplebot
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6bf9fdfb9b..190af6deef 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1070,7 +1070,6 @@ LLModelLoader::LLModelLoader(std::string filename, S32 lod, LLModelPreview* prev mMasterJointList.push_front("mChest"); mMasterJointList.push_front("mNeck"); mMasterJointList.push_front("mHead"); - mMasterJointList.push_front("mSkull"); mMasterJointList.push_front("mCollarLeft"); mMasterJointList.push_front("mShoulderLeft"); mMasterJointList.push_front("mElbowLeft"); @@ -1298,7 +1297,25 @@ void LLModelLoader::run() bool missingSkeletonOrScene = false; //If no skeleton, do a breadth-first search to get at specific joints - if ( !pSkeleton ) + bool rootNode = false; + bool skeletonWithNoRootNode = false; + + //Need to test for a skeleton that does not have a root node + //This occurs when your instance controller does not have an associated scene + if ( pSkeleton ) + { + daeElement* pSkeletonRootNode = pSkeleton->getValue().getElement(); + if ( pSkeletonRootNode ) + { + rootNode = true; + } + else + { + skeletonWithNoRootNode = true; + } + + } + if ( !pSkeleton || !rootNode ) { daeElement* pScene = root->getDescendant("visual_scene"); if ( !pScene ) @@ -1482,7 +1499,7 @@ void LLModelLoader::run() //a skinned asset attached to a node in a file that contains an entire skeleton, //but does not use the skeleton). mPreview->setRigValid( doesJointArrayContainACompleteRig( model->mJointList ) ); - if ( !model->mJointList.empty() && mPreview->isRigValid() ) + if ( !skeletonWithNoRootNode && !model->mJointList.empty() && mPreview->isRigValid() ) { mResetJoints = true; } |