diff options
author | Don Kjer <don@lindenlab.com> | 2011-07-12 18:10:44 -0700 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2011-07-12 18:10:44 -0700 |
commit | 40a489a9cc1b23db35c7b12f34e35cd2b191a307 (patch) | |
tree | 316e420be0ea12d6094772a337da50c19d4b6142 | |
parent | 4e16dc26ab3fd0506ba800f124649259aec46136 (diff) | |
parent | c45c603eeefb3b5692213e7840dda6a55f6e4b68 (diff) |
Merge
-rw-r--r-- | autobuild.xml | 12 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 26 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 4 | ||||
-rw-r--r-- | indra/newview/llfloatertools.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 93 | ||||
-rwxr-xr-x | indra/newview/llmeshrepository.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 16 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/floater_model_preview.xml | 20 |
8 files changed, 124 insertions, 52 deletions
diff --git a/autobuild.xml b/autobuild.xml index dfae7c6262..6872af0661 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1110,9 +1110,9 @@ <key>archive</key> <map> <key>hash</key> - <string>6e45ad68506cd1ba49fd35a3201f0478</string> + <string>0db10480362168f075c2af0ae302cb74</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/228821/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110504.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110707.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1122,9 +1122,9 @@ <key>archive</key> <map> <key>hash</key> - <string>00ff5144612c2e261a0811a4503ce3ba</string> + <string>f3c667dc159c0537a9122ce6e72e16db</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/228821/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110504.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110707.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1134,9 +1134,9 @@ <key>archive</key> <map> <key>hash</key> - <string>a4635dcbbe0915ce023dd41d3b848d4c</string> + <string>46cac4d667446bbbc9b5023f2848a5ac</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/228821/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110504.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110707.tar.bz2</string> </map> <key>name</key> <string>windows</string> diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 80a9b8f781..0748ed8039 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -101,7 +101,9 @@ #include "llcallbacklist.h" #include "llviewerobjectlist.h" #include "llanimationstates.h" +#include "llviewernetwork.h" #include "glod/glod.h" +#include <boost/algorithm/string.hpp> const S32 SLM_SUPPORTED_VERSION = 2; @@ -476,6 +478,18 @@ BOOL LLFloaterModelPreview::postBuild() text->setMouseDownCallback(boost::bind(&LLModelPreview::setPreviewLOD, mModelPreview, i)); } } + std::string current_grid = LLGridManager::getInstance()->getGridLabel(); + std::transform(current_grid.begin(),current_grid.end(),current_grid.begin(),::tolower); + std::string validate_url; + if (current_grid == "agni") + { + validate_url = "http://secondlife.com/my/account/mesh.php"; + } + else + { + validate_url = llformat("http://secondlife.%s.lindenlab.com/my/account/mesh.php",current_grid.c_str()); + } + getChild<LLTextBox>("warning_message")->setTextArg("[VURL]", validate_url); mUploadBtn = getChild<LLButton>("ok_btn"); mCalculateBtn = getChild<LLButton>("calculate_btn"); @@ -5482,7 +5496,17 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) { - mUploadModelUrl = upload_url; + mModelPhysicsFee = result; + mModelPhysicsFee["url"] = upload_url; + + doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::handleModelPhysicsFeeReceived,this)); +} + +void LLFloaterModelPreview::handleModelPhysicsFeeReceived() +{ + const LLSD& result = mModelPhysicsFee; + mUploadModelUrl = result["url"].asString(); + childSetTextArg("weights", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal())); childSetTextArg("weights", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal())); childSetTextArg("weights", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal())); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 29a61d6ed3..3a5f7602fe 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -201,7 +201,7 @@ public: /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason); /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); - + void handleModelPhysicsFeeReceived(); /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); /*virtual*/ void onModelUploadSuccess(); @@ -273,6 +273,8 @@ protected: LLToggleableMenu* mViewOptionMenu; LLMutex* mStatusLock; + LLSD mModelPhysicsFee; + private: void onClickCalculateBtn(); void toggleCalculateButton(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index dc71ade621..84fb8bd9e7 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -422,7 +422,7 @@ void LLFloaterTools::refresh() // Refresh object and prim count labels LLLocale locale(LLLocale::USER_LOCALE); - +#if 0 if (!gMeshRepo.meshRezEnabled()) { std::string obj_count_string; @@ -447,6 +447,7 @@ void LLFloaterTools::refresh() getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); } else +#endif { F32 link_phys_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost(); F32 link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost(); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4d9c324936..78e2716be2 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -34,6 +34,7 @@ #include "llagent.h" #include "llappviewer.h" #include "llbufferstream.h" +#include "llcallbacklist.h" #include "llcurl.h" #include "lldatapacker.h" #include "llfloatermodelpreview.h" @@ -356,7 +357,6 @@ public: cc = llsd_from_file("fake_upload_error.xml"); } - llinfos << "completed" << llendl; mThread->mPendingUploads--; dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num)); @@ -365,7 +365,6 @@ public: if (isGoodStatus(status) && cc["state"].asString() == "upload") { - llinfos << "fee request succeeded" << llendl; mThread->mWholeModelUploadURL = cc["uploader"].asString(); if (observer) @@ -415,8 +414,7 @@ public: //assert_main_thread(); mThread->mPendingUploads--; dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num)); - llinfos << "LLWholeModelUploadResponder content: " << cc << llendl; - + LLWholeModelUploadObserver* observer = mObserverHandle.get(); // requested "mesh" asset type isn't actually the type @@ -424,13 +422,12 @@ public: if (isGoodStatus(status) && cc["state"].asString() == "complete") { - llinfos << "upload succeeded" << llendl; mModelData["asset_type"] = "object"; gMeshRepo.updateInventory(LLMeshRepository::inventory_data(mModelData,cc)); if (observer) { - observer->onModelUploadSuccess(); + doOnIdleOneTime(boost::bind(&LLWholeModelUploadObserver::onModelUploadSuccess, observer)); } } else @@ -441,7 +438,7 @@ public: if (observer) { - observer->onModelUploadFailure(); + doOnIdleOneTime(boost::bind(&LLWholeModelUploadObserver::onModelUploadFailure, observer)); } } } @@ -2896,24 +2893,27 @@ S32 LLPhysicsDecomp::llcdCallback(const char* status, S32 p1, S32 p2) return 1; } -void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh) +void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based) { mesh.mVertexBase = mCurRequest->mPositions[0].mV; mesh.mVertexStrideBytes = 12; mesh.mNumVertices = mCurRequest->mPositions.size(); - mesh.mIndexType = LLCDMeshData::INT_16; - mesh.mIndexBase = &(mCurRequest->mIndices[0]); - mesh.mIndexStrideBytes = 6; + if(!vertex_based) + { + mesh.mIndexType = LLCDMeshData::INT_16; + mesh.mIndexBase = &(mCurRequest->mIndices[0]); + mesh.mIndexStrideBytes = 6; - mesh.mNumTriangles = mCurRequest->mIndices.size()/3; + mesh.mNumTriangles = mCurRequest->mIndices.size()/3; + } - if (mesh.mNumTriangles > 0 && mesh.mNumVertices > 2) + if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2) { LLCDResult ret = LLCD_OK; if (LLConvexDecomposition::getInstance() != NULL) { - ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh); + ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based); } if (ret) @@ -2937,7 +2937,7 @@ void LLPhysicsDecomp::doDecomposition() //load data intoLLCD if (stage == 0) { - setMeshData(mesh); + setMeshData(mesh, false); } //build parameter map @@ -3111,11 +3111,54 @@ void make_box(LLPhysicsDecomp::Request * request) void LLPhysicsDecomp::doDecompositionSingleHull() { - LLCDMeshData mesh; + LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); + + if (decomp == NULL) + { + //stub. do nothing. + return; + } - setMeshData(mesh); + LLCDMeshData mesh; + +#if 1 + setMeshData(mesh, true); + + LLCDResult ret = decomp->buildSingleHull() ; + if(ret) + { + llwarns << "Could not execute decomposition stage when attempting to create single hull." << llendl; + make_box(mCurRequest); + } + + mMutex->lock(); + mCurRequest->mHull.clear(); + mCurRequest->mHull.resize(1); + mCurRequest->mHullMesh.clear(); + mMutex->unlock(); + + std::vector<LLVector3> p; + LLCDHull hull; + + // if LLConvexDecomposition is a stub, num_hulls should have been set to 0 above, and we should not reach this code + decomp->getSingleHull(&hull); + + const F32* v = hull.mVertexBase; + + for (S32 j = 0; j < hull.mNumVertices; ++j) + { + LLVector3 vert(v[0], v[1], v[2]); + p.push_back(vert); + v = (F32*) (((U8*) v) + hull.mVertexStrideBytes); + } + + mMutex->lock(); + mCurRequest->mHull[0] = p; + mMutex->unlock(); - +#else + setMeshData(mesh, false); + //set all parameters to default std::map<std::string, const LLCDParam*> param_map; @@ -3124,23 +3167,15 @@ void LLPhysicsDecomp::doDecompositionSingleHull() if (!params) { - param_count = LLConvexDecomposition::getInstance()->getParameters(¶ms); + param_count = decomp->getParameters(¶ms); } - LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); - - if (decomp == NULL) - { - //stub. do nothing. - return; - } - for (S32 i = 0; i < param_count; ++i) { decomp->setParam(params[i].mName, params[i].mDefault.mIntOrEnumValue); } - const S32 STAGE_DECOMPOSE = mStageID["Decompose"]; + const S32 STAGE_DECOMPOSE = mStageID["Decompose"]; const S32 STAGE_SIMPLIFY = mStageID["Simplify"]; const S32 DECOMP_PREVIEW = 0; const S32 SIMPLIFY_RETAIN = 0; @@ -3202,7 +3237,7 @@ void LLPhysicsDecomp::doDecompositionSingleHull() } } } - +#endif { completeCurrent(); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index a15650463e..35a7314cd5 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -191,7 +191,7 @@ public: static S32 llcdCallback(const char*, S32, S32); void cancel(); - void setMeshData(LLCDMeshData& mesh); + void setMeshData(LLCDMeshData& mesh, bool vertex_based); void doDecomposition(); void doDecompositionSingleHull(); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index f418a6137a..9d38954d8b 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1071,10 +1071,12 @@ void LLViewerObjectList::fetchObjectCosts() LLSD id_list; U32 object_index = 0; + U32 count = 0; + for ( std::set<LLUUID>::iterator iter = mStaleObjectCost.begin(); iter != mStaleObjectCost.end(); - ++iter) + ) { // Check to see if a request for this object // has already been made. @@ -1084,13 +1086,15 @@ void LLViewerObjectList::fetchObjectCosts() mPendingObjectCost.insert(*iter); id_list[object_index++] = *iter; } - } - // id_list should now contain all - // requests in mStaleObjectCost before, so clear - // it now - mStaleObjectCost.clear(); + mStaleObjectCost.erase(iter++); + if (count++ >= 450) + { + break; + } + } + if ( id_list.size() > 0 ) { LLSD post_data = LLSD::emptyMap(); diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 060ddec1f4..1d4a1d4827 100644..100755 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -92,7 +92,7 @@ parse_urls="true" wrap="true" visible="false"> - You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.</text> + You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text> <text height="65" @@ -102,9 +102,9 @@ width="80" word_wrap="true" > -Streaming: +Download: Physics: -Simulation: +Server: Prim equivs: </text> @@ -123,7 +123,8 @@ Prim equivs: [EQ] </text> - + +<!-- <text height="65" top_delta="0" @@ -153,6 +154,7 @@ L$ [INSTANCES] L$ [TEXTURES] L$ [MODEL] </text> + --> <tab_container follows="right|top|bottom" @@ -168,7 +170,8 @@ L$ [MODEL] <panel border="true" label="Level of Detail" - name="lod_panel"> + name="lod_panel" + help_topic="upload_model_lod"> <text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header"> Select Level of Detail: @@ -291,7 +294,8 @@ L$ [MODEL] <panel border="true" label="Physics" - name="physics_panel"> + name="physics_panel" + help_topic="upload_model_physics"> <!-- PHYSICS GEOMETRY--> <panel @@ -432,7 +436,9 @@ L$ [MODEL] <panel border="true" label="Modifiers" - name="modifiers_panel"> + name="modifiers_panel" + help_topic="upload_model_modifiers"> + <text left="10" width="90" bottom="30" follows="top|left" height="15"> Scale: </text> |