diff options
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 7a2ab37a0d..268c646719 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -685,6 +685,11 @@ void LLFloaterModelPreview::draw() childSetTextArg("status", "[STATUS]", getString("status_parse_error")); toggleCalculateButton(false); } + else + if (mModelPreview->getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) + { + childSetTextArg("status", "[STATUS]", getString("status_bind_shape_orientation")); + } else { childSetTextArg("status", "[STATUS]", getString("status_idle")); @@ -1368,7 +1373,11 @@ U32 LLModelPreview::calcResourceCost() F32 radius = scale.length()*0.5f*debug_scale; - streaming_cost += LLMeshRepository::getStreamingCost(ret, radius); + LLMeshCostData costs; + if (gMeshRepo.getCostData(ret, costs)) + { + streaming_cost += costs.getRadiusBasedStreamingCost(radius); + } } } @@ -1618,6 +1627,19 @@ void LLModelPreview::rebuildUploadData() mFMP->childDisable( "calculate_btn" ); } } + LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) mFMP; + bool upload_skinweights = fmp && fmp->childGetValue("upload_skin").asBoolean(); + if (upload_skinweights && high_lod_model->mSkinInfo.mJointNames.size() > 0) + { + LLQuaternion bind_rot = LLSkinningUtil::getUnscaledQuaternion(high_lod_model->mSkinInfo.mBindShapeMatrix); + LLQuaternion identity; + if (!bind_rot.isEqualEps(identity,0.01)) + { + LL_WARNS() << "non-identity bind shape rot. mat is " << high_lod_model->mSkinInfo.mBindShapeMatrix + << " bind_rot " << bind_rot << LL_ENDL; + setLoadState( LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION ); + } + } } instance.mTransform = mat; mUploadData.push_back(instance); @@ -1763,9 +1785,17 @@ void LLModelPreview::getJointAliases( JointMap& joint_map) //Joint names and aliases come from avatar_skeleton.xml joint_map = av->getJointAliases(); - for (S32 i = 0; i < av->mNumCollisionVolumes; i++) + + std::vector<std::string> cv_names, attach_names; + av->getSortedJointNames(1, cv_names); + av->getSortedJointNames(2, attach_names); + for (std::vector<std::string>::iterator it = cv_names.begin(); it != cv_names.end(); ++it) + { + joint_map[*it] = *it; + } + for (std::vector<std::string>::iterator it = attach_names.begin(); it != attach_names.end(); ++it) { - joint_map[av->mCollisionVolumes[i].getName()] = av->mCollisionVolumes[i].getName(); + joint_map[*it] = *it; } } @@ -3451,16 +3481,11 @@ void LLModelPreview::update() //----------------------------------------------------------------------------- void LLModelPreview::createPreviewAvatar( void ) { - mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion() ); + mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR ); if ( mPreviewAvatar ) { mPreviewAvatar->createDrawable( &gPipeline ); - mPreviewAvatar->mIsDummy = TRUE; mPreviewAvatar->mSpecialRenderMode = 1; - mPreviewAvatar->setPositionAgent( LLVector3::zero ); - mPreviewAvatar->slamPosition(); - mPreviewAvatar->updateJointLODs(); - mPreviewAvatar->updateGeometry( mPreviewAvatar->mDrawable ); mPreviewAvatar->startMotion( ANIM_AGENT_STAND ); mPreviewAvatar->hideSkirt(); } |