diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-07-13 10:58:40 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-07-13 10:58:40 -0400 |
commit | c681cff64c907bccc307ef9ae7e0b5b10a2cf24f (patch) | |
tree | 7d39d54802d26596cf0d10bbf18ff3000508fa86 /indra | |
parent | 6221162ab786a7bf03b55278d41731aec06b8150 (diff) | |
parent | 40a489a9cc1b23db35c7b12f34e35cd2b191a307 (diff) |
merge
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-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 | 128 | ||||
-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 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory_add.xml | 12 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 12 |
11 files changed, 172 insertions, 64 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b57657540c..6ddcec6232 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1968,6 +1968,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DebugShowUploadCost</key> + <map> + <key>Comment</key> + <string>Show mesh upload cost</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>DebugShowXUINames</key> <map> <key>Comment</key> 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 a1f8f64627..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" @@ -48,6 +49,7 @@ #include "llthread.h" #include "llvfile.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewermenufile.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -355,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)); @@ -364,7 +365,6 @@ public: if (isGoodStatus(status) && cc["state"].asString() == "upload") { - llinfos << "fee request succeeded" << llendl; mThread->mWholeModelUploadURL = cc["uploader"].asString(); if (observer) @@ -414,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 @@ -423,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 @@ -440,7 +438,7 @@ public: if (observer) { - observer->onModelUploadFailure(); + doOnIdleOneTime(boost::bind(&LLWholeModelUploadObserver::onModelUploadFailure, observer)); } } } @@ -1304,6 +1302,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) LLSD res; result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); + result["texture_folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE); result["asset_type"] = "mesh"; result["inventory_type"] = "object"; result["description"] = "(No Description)"; @@ -2223,6 +2222,38 @@ void LLMeshRepository::notifyLoadedMeshes() LLAssetType::EType asset_type = LLAssetType::lookup(data.mPostData["asset_type"].asString()); LLInventoryType::EType inventory_type = LLInventoryType::lookup(data.mPostData["inventory_type"].asString()); + // Handle addition of texture, if any. + if ( data.mResponse.has("new_texture_folder_id") ) + { + const LLUUID& folder_id = data.mResponse["new_texture_folder_id"].asUUID(); + + if ( folder_id.notNull() ) + { + LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE); + + std::string name; + // Check if the server built a different name for the texture folder + if ( data.mResponse.has("new_texture_folder_name") ) + { + name = data.mResponse["new_texture_folder_name"].asString(); + } + else + { + name = data.mPostData["name"].asString(); + } + + // Add the category to the internal representation + LLPointer<LLViewerInventoryCategory> cat = + new LLViewerInventoryCategory(folder_id, parent_id, + LLFolderType::FT_NONE, name, gAgent.getID()); + cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN); + + LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1); + gInventory.accountForUpdate(update); + gInventory.updateCategory(cat); + } + } + on_new_single_inventory_upload_complete( asset_type, inventory_type, @@ -2232,6 +2263,7 @@ void LLMeshRepository::notifyLoadedMeshes() data.mPostData["description"], data.mResponse, data.mResponse["upload_price"]); + //} mInventoryQ.pop(); } @@ -2861,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) @@ -2902,7 +2937,7 @@ void LLPhysicsDecomp::doDecomposition() //load data intoLLCD if (stage == 0) { - setMeshData(mesh); + setMeshData(mesh, false); } //build parameter map @@ -3076,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; @@ -3089,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; @@ -3167,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> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 2169b5ccc3..8901583799 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -267,7 +267,7 @@ layout="topleft" left_pad="2" name="unlink_btn" - width="105"> + width="90"> <button.commit_callback function="BuildTool.UnlinkObjects"/> </button> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index e0ccb18c08..0f42000ae7 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -54,18 +54,6 @@ <menu_item_call.on_visible function="File.VisibleUploadModel"/> </menu_item_call> - <menu_item_call - label="Model Wizard..." - layout="topleft" - name="Upload Model Wizard"> - <menu_item_call.on_click - function="Floater.Show" - parameter="upload_model_wizard" /> - <menu_item_call.on_enable - function="File.EnableUploadModel" /> - <menu_item_call.on_visible - function="File.VisibleUploadModel"/> - </menu_item_call> <menu_item_call label="Bulk (L$[COST] per file)..." layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 499cf47b6c..0fe6c09684 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2076,12 +2076,14 @@ </menu_item_check> <menu_item_check label="Show Upload Cost" - layout="topleft" name="Show Upload Cost"> - <menu_item_check.on_click - function="ToggleControl" + <menu_item_check.on_check + function="CheckControl" parameter="DebugShowUploadCost" /> - </menu_item_check> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowUploadCost" /> + </menu_item_check> <menu_item_check label="Show Render Info" name="Show Render Info"> @@ -2092,7 +2094,7 @@ function="ToggleControl" parameter="DebugShowRenderInfo" /> </menu_item_check> - <menu_item_check + <menu_item_check label="Show Texture Info" name="Show Texture Info"> <menu_item_check.on_check |