diff options
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 95 |
1 files changed, 1 insertions, 94 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 9b6a2c5503..e8da1aa42c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -112,8 +112,6 @@ const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16; const S32 PREVIEW_TEXTURE_HEIGHT = 300; -const F32 MAXIMUM_PIVOT_OFFSET = 64.0f; - void drawBoxOutline(const LLVector3& pos, const LLVector3& size); @@ -1772,8 +1770,6 @@ bool LLModelLoader::doLoadModel() processElement(scene); - handlePivotPoint( root ); - return true; } @@ -1963,49 +1959,6 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode ) } } } -//----------------------------------------------------------------------------- -// handlePivotPoint() -//----------------------------------------------------------------------------- -void LLModelLoader::handlePivotPoint( daeElement* pRoot ) -{ - //Import an optional pivot point - a pivot point is just a node in the visual scene named "AssetPivot" - //If no assetpivot is found then the asset will use the SL default - daeElement* pScene = pRoot->getDescendant("visual_scene"); - if ( pScene ) - { - daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren(); - S32 childCount = children.getCount(); - for (S32 i = 0; i < childCount; ++i) - { - domNode* pNode = daeSafeCast<domNode>(children[i]); - if ( pNode && isNodeAPivotPoint( pNode ) ) - { - LLMatrix4 workingTransform; - daeSIDResolver nodeResolver( pNode, "./translate" ); - domTranslate* pTranslate = daeSafeCast<domTranslate>( nodeResolver.getElement() ); - //Translation via SID was successful - //todo#extract via element as well - if ( pTranslate ) - { - extractTranslation( pTranslate, workingTransform ); - LLVector3 pivotTrans = workingTransform.getTranslation(); - if ( pivotTrans[VX] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VX] < -MAXIMUM_PIVOT_OFFSET || - pivotTrans[VY] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VY] < -MAXIMUM_PIVOT_OFFSET || - pivotTrans[VZ] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VZ] < -MAXIMUM_PIVOT_OFFSET ) - { - llwarns<<"Asset Pivot Node contains an offset that is too large - values should be within (-"<<MAXIMUM_PIVOT_OFFSET<<","<<MAXIMUM_PIVOT_OFFSET<<")."<<llendl; - mPreview->setHasPivot( false ); - } - else - { - mPreview->setModelPivot( pivotTrans ); - mPreview->setHasPivot( true ); - } - } - } - } - } -} //----------------------------------------------------------------------------- // critiqueRigForUploadApplicability() @@ -2205,27 +2158,7 @@ bool LLModelLoader::isNodeAJoint( domNode* pNode ) return false; } -//----------------------------------------------------------------------------- -// isNodeAPivotPoint() -//----------------------------------------------------------------------------- -bool LLModelLoader::isNodeAPivotPoint( domNode* pNode ) -{ - bool result = false; - - if ( pNode && pNode->getName() ) - { - std::string name = pNode->getName(); - if ( name == "AssetPivot" ) - { - result = true; - } - else - { - result = false; - } - } - return result; -} + //----------------------------------------------------------------------------- // extractTranslation() //----------------------------------------------------------------------------- @@ -2852,27 +2785,6 @@ void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost)); } -void LLModelPreview::alterModelsPivot( void ) -{ - for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter) - { - if ( *iter ) - { - (*iter)->offsetMesh( mModelPivot ); - } - } - - for ( int i=0;i<LLModel::NUM_LODS;++i ) - { - for (LLModelLoader::model_list::iterator iter = mModel[i].begin(); iter != mModel[i].end(); ++iter) - { - if ( *iter ) - { - (*iter)->offsetMesh( mModelPivot ); - } - } - } -} void LLModelPreview::rebuildUploadData() { @@ -4971,11 +4883,6 @@ void LLFloaterModelPreview::onUpload(void* user_data) LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data; - if ( mp && mp->mModelPreview->mHasPivot ) - { - mp->mModelPreview->alterModelsPivot(); - } - mp->mModelPreview->rebuildUploadData(); bool upload_skinweights = mp->childGetValue("upload_skin").asBoolean(); |