From db05176138e6bf3e2011db1b5db4bc1b125d070f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 16 May 2011 12:56:18 -0400 Subject: sh-1491 WIP --- indra/newview/llfirstuse.cpp | 2 +- indra/newview/llmeshrepository.cpp | 43 +++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 2c4153688a..a9f52282a5 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -131,7 +131,7 @@ void LLFirstUse::notMoving(bool enable) // static void LLFirstUse::viewPopup(bool enable) { - firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right")); +// firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right")); } // static diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 2a68fbac8d..653fb46754 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -84,6 +84,8 @@ U32 LLMeshRepository::sPeakKbps = 0; const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5; +void dumpLLSDToFile(LLSD& content, std::string filename); + std::string header_lod[] = { "lowest_lod", @@ -492,11 +494,18 @@ public: const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - assert_main_thread(); + //assert_main_thread(); llinfos << "completed" << llendl; mThread->mPendingUploads--; + + LLSD content; + LLBufferStream istr(channels, buffer.get()); + if (!LLSDSerialize::fromXML(content, istr)) + { + llinfos << "Failed to deserialize LLSD. " << " [" << status << "]: " << reason << llendl; + } + dumpLLSDToFile(content,"whole_model_response.xml"); } - }; LLMeshRepoThread::LLMeshRepoThread() @@ -1362,8 +1371,8 @@ void LLMeshUploadThread::run() } } -#if 0 -void dumpLLSDToFile(LLSD& content, std::string& filename) +#if 1 +void dumpLLSDToFile(LLSD& content, std::string filename) { std::ofstream of(filename); LLSDSerialize::toPrettyXML(content,of); @@ -1373,9 +1382,10 @@ void dumpLLSDToFile(LLSD& content, std::string& filename) void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) { // TODO where do textures go? - + LLSD result; + LLSD res; result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); result["asset_type"] = "mesh"; result["inventory_type"] = "object"; @@ -1384,9 +1394,9 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) // TODO "optional" fields from the spec - LLSD res; res["mesh_list"] = LLSD::emptyArray(); - res["texture_list"] = LLSD::emptyArray(); +// TODO Textures + //res["texture_list"] = LLSD::emptyArray(); S32 mesh_num = 0; S32 texture_num = 0; @@ -1432,10 +1442,15 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) LLQuaternion rot; LLMatrix4 transformation = instance.mTransform; decomposeMeshMatrix(transformation,pos,rot,scale); - + +#if 0 mesh_entry["childpos"] = ll_sd_from_vector3(pos); mesh_entry["childrot"] = ll_sd_from_quaternion(rot); mesh_entry["scale"] = ll_sd_from_vector3(scale); +#endif + mesh_entry["position"] = ll_sd_from_vector3(LLVector3()); + mesh_entry["rotation"] = ll_sd_from_quaternion(rot); + mesh_entry["scale"] = ll_sd_from_vector3(scale); // TODO should be binary. std::string str = ostr.str(); @@ -1479,9 +1494,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } result["asset_resources"] = res; -#if 0 - std::string name("whole_model.xml"); - dumpLLSDToFile(result,name); +#if 1 + dumpLLSDToFile(result,"whole_model.xml"); #endif dest = result; @@ -1540,9 +1554,14 @@ void LLMeshUploadThread::doWholeModelUpload() mPendingUploads++; LLCurlRequest::headers_t headers; - mCurlRequest->post(mWholeModelUploadCapability, headers, model_data.asString(), + mCurlRequest->post(mWholeModelUploadCapability, headers, model_data, new LLWholeModelFeeResponder(this)); + do + { + mCurlRequest->process(); + } while (mCurlRequest->getQueued() > 0); + // Currently a no-op. mFinished = true; } -- cgit v1.2.3 From 92426cce0c412e2f7d6dbf8caca5647524968b3a Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 16 May 2011 14:57:15 -0400 Subject: remove new search in favor of moving to a project viewer --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llfloatersearch.cpp | 11 +---------- 2 files changed, 1 insertion(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e6c2dc4413..33c5e533be 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3910,17 +3910,6 @@ Value http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] - SearchURLBeta - - Comment - URL for Search website, displayed in the Find floater - Persist - 0 - Type - String - Value - http://beta.search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] - WebProfileURL Comment diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index c8fe380710..d5806e375c 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -38,7 +38,6 @@ #include "llui.h" #include "llviewercontrol.h" #include "llweb.h" -#include "llversioninfo.h" // support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps class LLSearchHandler : public LLCommandHandler @@ -204,15 +203,7 @@ void LLFloaterSearch::search(const LLSD &key) // get the search URL and expand all of the substitutions // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) - std::string url; - if (LLVersionInfo::getChannel().find("Beta") != std::string::npos) - { - url = gSavedSettings.getString("SearchURLBeta"); - } - else - { - url = gSavedSettings.getString("SearchURL"); - } + std::string url = gSavedSettings.getString("SearchURL"); url = LLWeb::expandURLSubstitutions(url, subs); // and load the URL in the web view -- cgit v1.2.3 From bde7cd91130ee91993f6b42863ac7ab6430bafd6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 16 May 2011 17:39:42 -0400 Subject: sh-1491 WIP --- indra/newview/llmeshrepository.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 653fb46754..7d48416292 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -84,7 +84,7 @@ U32 LLMeshRepository::sPeakKbps = 0; const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5; -void dumpLLSDToFile(LLSD& content, std::string filename); +void dumpLLSDToFile(const LLSD& content, std::string filename); std::string header_lod[] = { @@ -490,20 +490,13 @@ public: mThread(thread) { } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) + virtual void completed(U32 status, + const std::string& reason, + const LLSD& content) { //assert_main_thread(); llinfos << "completed" << llendl; mThread->mPendingUploads--; - - LLSD content; - LLBufferStream istr(channels, buffer.get()); - if (!LLSDSerialize::fromXML(content, istr)) - { - llinfos << "Failed to deserialize LLSD. " << " [" << status << "]: " << reason << llendl; - } dumpLLSDToFile(content,"whole_model_response.xml"); } }; @@ -1372,7 +1365,7 @@ void LLMeshUploadThread::run() } #if 1 -void dumpLLSDToFile(LLSD& content, std::string filename) +void dumpLLSDToFile(const LLSD& content, std::string filename) { std::ofstream of(filename); LLSDSerialize::toPrettyXML(content,of); @@ -1562,6 +1555,9 @@ void LLMeshUploadThread::doWholeModelUpload() mCurlRequest->process(); } while (mCurlRequest->getQueued() > 0); + delete mCurlRequest; + mCurlRequest = NULL; + // Currently a no-op. mFinished = true; } -- cgit v1.2.3 From f9ac182865ac31eb03668a628e100d94c35eab53 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 17 May 2011 23:47:29 -0500 Subject: SH-1555 Disable upload button if a hull exists that has more than 256 vertices. --- indra/newview/llfloatermodelpreview.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index b7e9865228..241e908d8c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3848,6 +3848,18 @@ void LLModelPreview::updateStatusMessages() } } + + //make sure no hulls have more than 256 points in them + for (U32 i = 0; upload_ok && i < mModel[LLModel::LOD_PHYSICS].size(); ++i) + { + LLModel* mdl = mModel[LLModel::LOD_PHYSICS][i]; + + for (U32 j = 0; upload_ok && j < mdl->mPhysics.mHull.size(); ++j) + { + upload_ok = upload_ok && mdl->mPhysics.mHull[i].size() <= 256; + } + } + bool errorStateFromLoader = getLoadState() >= LLModelLoader::ERROR_PARSING ? true : false; bool skinAndRigOk = true; @@ -3871,6 +3883,10 @@ void LLModelPreview::updateStatusMessages() { mFMP->childEnable("ok_btn"); } + else + { + mFMP->childDisable("ok_btn"); + } //add up physics triangles etc S32 start = 0; -- cgit v1.2.3 From e237f5733ca453fa51a16f9f88da265be201a607 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 May 2011 01:30:21 -0500 Subject: SH-914 Fix for normals getting screwed up by non-uniform model normalization. --- indra/llprimitive/llmodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 794cdb83d5..57ac7a143f 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -991,6 +991,9 @@ void LLModel::normalizeVolumeFaces() scale.splat(1.f); scale.div(size); + LLVector4a inv_scale(1.f); + inv_scale.div(scale); + for (U32 i = 0; i < mVolumeFaces.size(); ++i) { LLVolumeFace& face = mVolumeFaces[i]; @@ -1007,10 +1010,14 @@ void LLModel::normalizeVolumeFaces() // For all the positions, we scale // the positions to fit within the unit cube. LLVector4a* pos = (LLVector4a*) face.mPositions; + LLVector4a* norm = (LLVector4a*) face.mNormals; + for (U32 j = 0; j < face.mNumVertices; ++j) { pos[j].add(trans); pos[j].mul(scale); + norm[j].mul(inv_scale); + norm[j].normalize3(); } } -- cgit v1.2.3 From 4374f53e23c9d999206764b0b38473337720c1c3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 May 2011 02:02:52 -0500 Subject: SH-1586 Fix for bad camera behavior introduced by SH-1119 --- indra/newview/llagentcamera.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c6b5a0113f..80085dad9d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -394,7 +394,9 @@ LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 origi LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation LLVector3 object_extents; const LLVector4a* oe4 = object->mDrawable->getSpatialExtents(); - object_extents.set( oe4[1][0], oe4[1][1], oe4[1][2] ); + LLVector4a size; + size.setSub(oe4[1], oe4[0]); + object_extents.set( size[0], size[1], size[2] ); // make sure they object extents are non-zero object_extents.clamp(0.001f, F32_MAX); -- cgit v1.2.3 From 7a02501aae8a21f4bf552d47e0799c4abdcd4228 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 May 2011 09:47:58 -0400 Subject: SH-1492 WIP --- indra/newview/llmeshrepository.cpp | 32 ++++++++++++++++++++++++++++++-- indra/newview/llmeshrepository.h | 3 ++- 2 files changed, 32 insertions(+), 3 deletions(-) mode change 100644 => 100755 indra/newview/llmeshrepository.cpp mode change 100644 => 100755 indra/newview/llmeshrepository.h (limited to 'indra') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp old mode 100644 new mode 100755 index 922291c9e1..5305f3dbca --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -499,6 +499,27 @@ public: llinfos << "completed" << llendl; mThread->mPendingUploads--; dumpLLSDToFile(content,"whole_model_response.xml"); + + mThread->mWholeModelUploadURL = content["uploader"]; + } +}; + +class LLWholeModelUploadResponder: public LLCurl::Responder +{ + LLMeshUploadThread* mThread; +public: + LLWholeModelUploadResponder(LLMeshUploadThread* thread): + mThread(thread) + { + } + virtual void completed(U32 status, + const std::string& reason, + const LLSD& content) + { + //assert_main_thread(); + llinfos << "upload completed" << llendl; + mThread->mPendingUploads--; + dumpLLSDToFile(content,"whole_model_upload_response.xml"); } }; @@ -1263,7 +1284,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset"); mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice"); - mWholeModelUploadCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); + mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); mOrigin += gAgent.getAtAxis() * scale.magVec(); } @@ -1548,7 +1569,7 @@ void LLMeshUploadThread::doWholeModelUpload() mPendingUploads++; LLCurlRequest::headers_t headers; - mCurlRequest->post(mWholeModelUploadCapability, headers, model_data, + mCurlRequest->post(mWholeModelFeeCapability, headers, model_data, new LLWholeModelFeeResponder(this)); do @@ -1556,6 +1577,13 @@ void LLMeshUploadThread::doWholeModelUpload() mCurlRequest->process(); } while (mCurlRequest->getQueued() > 0); + mCurlRequest->post(mWholeModelUploadURL, headers, model_data["asset_resources"], new LLWholeModelUploadResponder(this)); + + do + { + mCurlRequest->process(); + } while (mCurlRequest->getQueued() > 0); + delete mCurlRequest; mCurlRequest = NULL; diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h old mode 100644 new mode 100755 index 802e3e1aba..f859e29c07 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -387,7 +387,8 @@ public: LLHost mHost; std::string mUploadObjectAssetCapability; std::string mNewInventoryCapability; - std::string mWholeModelUploadCapability; + std::string mWholeModelFeeCapability; + std::string mWholeModelUploadURL; std::queue mUploadQ; std::queue mConfirmedQ; -- cgit v1.2.3 From 3990324e8f8391aee335ad74b33b22e0b1c849af Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 May 2011 11:33:28 -0400 Subject: trying to fix mac build complaints --- indra/newview/llmeshrepository.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 5305f3dbca..d9a58d56fe 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -500,7 +500,7 @@ public: mThread->mPendingUploads--; dumpLLSDToFile(content,"whole_model_response.xml"); - mThread->mWholeModelUploadURL = content["uploader"]; + mThread->mWholeModelUploadURL = content["uploader"].asString(); } }; @@ -1389,7 +1389,7 @@ void LLMeshUploadThread::run() #if 1 void dumpLLSDToFile(const LLSD& content, std::string filename) { - std::ofstream of(filename); + std::ofstream of(filename.c_str()); LLSDSerialize::toPrettyXML(content,of); } #endif -- cgit v1.2.3 From c84e84cfbf101deb0a920bd95b3a8a7b16806d04 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 18 May 2011 15:56:24 -0400 Subject: Fix for sh-1227. Decoupled avatar in preview window from in world avatar. Code cleanup. --- indra/newview/llfloatermodelpreview.cpp | 103 +++++++++++--------------------- indra/newview/llfloatermodelpreview.h | 4 ++ 2 files changed, 38 insertions(+), 69 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 241e908d8c..9dd5269a6b 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -98,7 +98,8 @@ #include "llvfile.h" #include "llvfs.h" #include "llcallbacklist.h" - +#include "llviewerobjectlist.h" +#include "llanimationstates.h" #include "glod/glod.h" //static @@ -381,12 +382,6 @@ LLFloaterModelPreview::~LLFloaterModelPreview() { sInstance = NULL; - if ( mModelPreview && mModelPreview->getResetJointFlag() ) - { - gAgentAvatarp->resetJointPositions(); - } - - if ( mModelPreview ) { delete mModelPreview; @@ -1577,7 +1572,7 @@ bool LLModelLoader::doLoadModel() { //llinfos<<"joint "<getJoint( lookingForJoint ); + LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint ); if ( pJoint ) { pJoint->storeCurrentXform( jointTransform.getTranslation() ); @@ -2657,6 +2652,8 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) mMasterLegacyJointList.push_front("mHipLeft"); mMasterLegacyJointList.push_front("mKneeLeft"); mMasterLegacyJointList.push_front("mFootLeft"); + + createPreviewAvatar(); } LLModelPreview::~LLModelPreview() @@ -2710,7 +2707,7 @@ U32 LLModelPreview::calcResourceCost() if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() ) { - gAgentAvatarp->setPelvisOffset( mPelvisZOffset ); + getPreviewAvatar()->setPelvisOffset( mPelvisZOffset ); } F32 streaming_cost = 0.f; @@ -4293,42 +4290,6 @@ void LLModelPreview::update() } //----------------------------------------------------------------------------- -// changeAvatarsJointPositions() -//----------------------------------------------------------------------------- -void LLModelPreview::changeAvatarsJointPositions( LLModel* pModel ) -{ - if ( mMasterJointList.empty() ) - { - return; - } - - std::vector :: const_iterator jointListItBegin = pModel->mSkinInfo.mJointNames.begin(); - std::vector :: const_iterator jointListItEnd = pModel->mSkinInfo.mJointNames.end(); - - S32 index = 0; - for ( ; jointListItBegin!=jointListItEnd; ++jointListItBegin, ++index ) - { - std::string elem = *jointListItBegin; - //llinfos<<"joint "<mSkinInfo.mAlternateBindMatrix.size(); - if ( matrixCnt < 1 ) - { - llinfos<<"Total WTF moment :"<mSkinInfo.mAlternateBindMatrix[index]; - - LLJoint* pJoint = gAgentAvatarp->getJoint( elem ); - if ( pJoint ) - { - pJoint->storeCurrentXform( jointTransform.getTranslation() ); - } - } - } -} -//----------------------------------------------------------------------------- // getTranslationForJointOffset() //----------------------------------------------------------------------------- LLVector3 LLModelPreview::getTranslationForJointOffset( std::string joint ) @@ -4341,6 +4302,30 @@ LLVector3 LLModelPreview::getTranslationForJointOffset( std::string joint ) } return LLVector3(0.0f,0.0f,0.0f); } +//----------------------------------------------------------------------------- +// createPreviewAvatar +//----------------------------------------------------------------------------- +void LLModelPreview::createPreviewAvatar( void ) +{ + mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion() ); + 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(); + } + else + { + llinfos<<"Failed to create preview avatar for upload model window"<childSetEnabled("upload_joints", upload_skin); - //poke at avatar when we upload custom joints - /* - if ( upload_joints ) - { - for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) - { - for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter) - { - LLModelInstance& instance = *model_iter; - LLModel* model = instance.mModel; - if ( !model->mSkinWeights.empty() ) - { - changeAvatarsJointPositions( model ); - } - } - } - } - */ - F32 explode = mFMP->childGetValue("physics_explode").asReal(); glClear(GL_DEPTH_BUFFER_BIT); @@ -4493,7 +4459,7 @@ BOOL LLModelPreview::render() if (skin_weight) { - target_pos = gAgentAvatarp->getPositionAgent(); + target_pos = getPreviewAvatar()->getPositionAgent(); z_near = 0.01f; z_far = 1024.f; mCameraDistance = 16.f; @@ -4713,8 +4679,7 @@ BOOL LLModelPreview::render() } else { - LLVOAvatarSelf* avatar = gAgentAvatarp; - target_pos = avatar->getPositionAgent(); + target_pos = getPreviewAvatar()->getPositionAgent(); LLViewerCamera::getInstance()->setOriginAndLookAt( target_pos + ((LLVector3(mCameraDistance, 0.f, 0.f) + offset) * av_rot), // camera @@ -4723,7 +4688,7 @@ BOOL LLModelPreview::render() if (joint_positions) { - avatar->renderCollisionVolumes(); + getPreviewAvatar()->renderCollisionVolumes(); } for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) @@ -4754,7 +4719,7 @@ BOOL LLModelPreview::render() LLMatrix4 mat[64]; for (U32 j = 0; j < model->mSkinInfo.mJointNames.size(); ++j) { - LLJoint* joint = avatar->getJoint(model->mSkinInfo.mJointNames[j]); + LLJoint* joint = getPreviewAvatar()->getJoint(model->mSkinInfo.mJointNames[j]); if (joint) { mat[j] = model->mSkinInfo.mInvBindMatrix[j]; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index b54a72e555..f6d4a08d1f 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -341,6 +341,9 @@ public: LLVector3 getTranslationForJointOffset( std::string joint ); + void createPreviewAvatar( void ); + LLVOAvatar* getPreviewAvatar( void ) { return mPreviewAvatar; } + protected: friend class LLModelLoader; friend class LLFloaterModelPreview; @@ -422,6 +425,7 @@ public: std::deque mMasterLegacyJointList; std::deque mJointsFromNode; JointTransformMap mJointTransformMap; + LLPointer mPreviewAvatar; }; #endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3