summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp16
-rw-r--r--indra/newview/llfloatermodelpreview.h8
2 files changed, 13 insertions, 11 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ae0e1b7d46..afe57ebb70 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1560,14 +1560,14 @@ bool LLModelLoader::doLoadModel()
//(which means we have all the joints that are required for an avatar versus
//a skinned asset attached to a node in a file that contains an entire skeleton,
//but does not use the skeleton).
-
+ buildJointToNodeMappingFromScene( root );
mPreview->critiqueRigForUploadApplicability( model->mSkinInfo.mJointNames );
if ( !missingSkeletonOrScene )
{
//Set the joint translations on the avatar - if it's a full mapping
//The joints are reset in the dtor
- if ( mPreview->getResetJointFlag() )
+ if ( mPreview->getRigWithSceneParity() )
{
std::map<std::string, std::string> :: const_iterator masterJointIt = mJointMap.begin();
std::map<std::string, std::string> :: const_iterator masterJointItEnd = mJointMap.end();
@@ -1774,10 +1774,6 @@ bool LLModelLoader::doLoadModel()
handlePivotPoint( root );
- buildJointToNodeMappingFromScene( root );
-
- mPreview->critiqueJointToNodeMappingFromScene();
-
return true;
}
@@ -2016,6 +2012,8 @@ void LLModelLoader::handlePivotPoint( daeElement* pRoot )
//-----------------------------------------------------------------------------
void LLModelPreview::critiqueRigForUploadApplicability( const std::vector<std::string> &jointListFromAsset )
{
+ critiqueJointToNodeMappingFromScene();
+
//Determines the following use cases for a rig:
//1. It is suitable for upload with skin weights & joint positions, or
//2. It is suitable for upload as standard av with just skin weights
@@ -2034,7 +2032,7 @@ void LLModelPreview::critiqueRigForUploadApplicability( const std::vector<std::s
setLegacyRigValid( true );
}
- if ( isJointPositionUploadOK )
+ if ( getRigWithSceneParity() && isJointPositionUploadOK )
{
setResetJointFlag( true );
}
@@ -2078,12 +2076,11 @@ void LLModelPreview::critiqueJointToNodeMappingFromScene( void )
if ( result )
{
setResetJointFlag( true );
- //llinfos<<"Full"<<llendl;
+ setRigWithSceneParity( true );
}
else
{
setResetJointFlag( false );
- //llinfos<<"Partial"<<llendl;
}
}
//-----------------------------------------------------------------------------
@@ -2650,6 +2647,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
, mLegacyRigValid( false )
, mRigValidJointUpload( false )
, mResetJoints( false )
+, mRigParityWithScene( false )
, mLastJointUpdate( false )
{
mNeedsUpdate = TRUE;
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 7927edcd36..92104c01f4 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -339,8 +339,10 @@ public:
U32 getLoadState() { return mLoadState; }
//setRestJointFlag: If an asset comes through that changes the joints, we want the reset to persist
void setResetJointFlag( bool state ) { if ( !mResetJoints ) mResetJoints = state; }
- bool getResetJointFlag( void ) { return mResetJoints; }
-
+ const bool getResetJointFlag( void ) const { return mResetJoints; }
+ void setRigWithSceneParity( bool state ) { mRigParityWithScene = state; }
+ const bool getRigWithSceneParity( void ) const { return mRigParityWithScene; }
+
LLVector3 getTranslationForJointOffset( std::string joint );
protected:
@@ -370,6 +372,8 @@ public:
bool mLoading;
U32 mLoadState;
bool mResetJoints;
+ bool mRigParityWithScene;
+
std::map<std::string, bool> mViewOption;
//GLOD object parameters (must rebuild object if these change)