diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 308 |
1 files changed, 162 insertions, 146 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 8686fad3e6..3708ad82e8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -93,6 +93,7 @@ #include "llpanelblockedlist.h" #include "llpanelmaininventory.h" #include "llmarketplacefunctions.h" +#include "llmaterialeditor.h" #include "llmenuoptionpathfindingrebakenavmesh.h" #include "llmoveview.h" #include "llnavigationbar.h" @@ -272,7 +273,6 @@ void handle_reset_view(); void handle_duplicate_in_place(void*); - void handle_object_owner_self(void*); void handle_object_owner_permissive(void*); void handle_object_lock(void*); @@ -767,10 +767,6 @@ U32 render_type_from_string(std::string render_type) { return LLPipeline::RENDER_TYPE_WATER; } - else if ("ground" == render_type) - { - return LLPipeline::RENDER_TYPE_GROUND; - } else if ("volume" == render_type) { return LLPipeline::RENDER_TYPE_VOLUME; @@ -1035,10 +1031,6 @@ U64 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_LOD_INFO; } - else if ("build queue" == info_display) - { - return LLPipeline::RENDER_DEBUG_BUILD_QUEUE; - } else if ("lights" == info_display) { return LLPipeline::RENDER_DEBUG_LIGHTS; @@ -1095,6 +1087,10 @@ U64 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_IMPOSTORS; } + else if ("reflection probes" == info_display) + { + return LLPipeline::RENDER_DEBUG_REFLECTION_PROBES; + } else { LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL; @@ -1184,33 +1180,9 @@ class LLAdvancedCheckPeriodicSlowFrame : public view_listener_t }; - -//////////////// -// FRAME TEST // -//////////////// - - -class LLAdvancedToggleFrameTest : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLPipeline::sRenderFrameTest = !(LLPipeline::sRenderFrameTest); - return true; - } -}; - -class LLAdvancedCheckFrameTest : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - bool new_value = LLPipeline::sRenderFrameTest; - return new_value; - } -}; - - /////////////////////////// // SELECTED TEXTURE INFO // +// /////////////////////////// @@ -1232,24 +1204,6 @@ class LLAdvancedToggleWireframe : public view_listener_t bool handleEvent(const LLSD& userdata) { gUseWireframe = !(gUseWireframe); - gWindowResized = TRUE; - - LLPipeline::updateRenderDeferred(); - - if (gUseWireframe) - { - gInitialDeferredModeForWireframe = LLPipeline::sRenderDeferred; - } - - gPipeline.resetVertexBuffers(); - - if (!gUseWireframe && !gInitialDeferredModeForWireframe && LLPipeline::sRenderDeferred != bool(gInitialDeferredModeForWireframe) && gPipeline.isInit()) - { - LLPipeline::refreshCachedSettings(); - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - LLViewerShaderMgr::instance()->setShaders(); - } return true; } @@ -1259,8 +1213,7 @@ class LLAdvancedCheckWireframe : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gUseWireframe; - return new_value; + return gUseWireframe; } }; @@ -2146,6 +2099,21 @@ class LLAdvancedPurgeDiskCache : public view_listener_t }; +//////////////////////// +// PURGE SHADER CACHE // +//////////////////////// + + +class LLAdvancedPurgeShaderCache : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerShaderMgr::instance()->clearShaderCache(); + LLViewerShaderMgr::instance()->setShaders(); + return true; + } +}; + //////////////////// // EVENT Recorder // /////////////////// @@ -2355,47 +2323,6 @@ class LLAdvancedCheckViewAdminOptions : public view_listener_t } }; -///////////////////////////////////// -// Enable Object Object Occlusion /// -///////////////////////////////////// -class LLAdvancedEnableObjectObjectOcclusion: public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - - bool new_value = gGLManager.mHasOcclusionQuery; // && LLFeatureManager::getInstance()->isFeatureAvailable(userdata.asString()); - return new_value; -} -}; - -///////////////////////////////////// -// Enable Deferred Rendering /// -///////////////////////////////////// -class LLAdvancedEnableRenderDeferred: public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - bool new_value = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1 && - LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0; - return new_value; - } -}; - -///////////////////////////////////// -// Enable Deferred Rendering sub-options -///////////////////////////////////// -class LLAdvancedEnableRenderDeferredOptions: public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - bool new_value = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1 && - LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 && gSavedSettings.getBOOL("RenderDeferred"); - return new_value; - } -}; - - - ////////////////// // ADMIN STATUS // ////////////////// @@ -2597,14 +2524,6 @@ class LLDevelopSetLoggingLevel : public view_listener_t } }; -class LLDevelopTextureFetchDebugger : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - return gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); - } -}; - ////////////////// // ADMIN MENU // ////////////////// @@ -2899,6 +2818,49 @@ bool enable_object_inspect() return selected_objectp != NULL; } +struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor +{ + LLSelectedTEGetmatIdAndPermissions() + : mCanCopy(true) + , mCanModify(true) + , mCanTransfer(true) + , mHasNonPbrFaces(false) + {} + bool apply(LLViewerObject* objectp, S32 te_index) + { + mCanCopy &= (bool)objectp->permCopy(); + mCanTransfer &= (bool)objectp->permTransfer(); + mCanModify &= (bool)objectp->permModify(); + LLUUID mat_id = objectp->getRenderMaterialID(te_index); + if (mat_id.notNull()) + { + mMaterialId = mat_id; + } + else + { + mHasNonPbrFaces = true; + } + return true; + } + bool mCanCopy; + bool mCanModify; + bool mCanTransfer; + bool mHasNonPbrFaces; + LLUUID mMaterialId; +}; + +bool enable_object_edit_gltf_material() +{ + if (!LLMaterialEditor::capabilitiesAvailable()) + { + return false; + } + + LLSelectedTEGetmatIdAndPermissions func; + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); + return func.mCanModify && !func.mHasNonPbrFaces; +} + bool enable_object_open() { // Look for contents in root object, which is all the LLFloaterOpenObject @@ -2964,37 +2926,42 @@ class LLObjectBuild : public view_listener_t } }; -void handle_object_edit() +void update_camera() { - LLViewerParcelMgr::getInstance()->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); - if (gAgentCamera.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) - { - LLFloaterTools::sPreviousFocusOnAvatar = true; - LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + if (gAgentCamera.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) + { + LLFloaterTools::sPreviousFocusOnAvatar = true; + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + + if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) + { + // always freeze camera in space, even if camera doesn't move + // so, for example, follow cam scripts can't affect you when in build mode + gAgentCamera.setFocusGlobal(gAgentCamera.calcFocusPositionTargetGlobal(), LLUUID::null); + gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); + } + else + { + gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); + LLViewerObject* selected_objectp = selection->getFirstRootObject(); + if (selected_objectp) + { + // zoom in on object center instead of where we clicked, as we need to see the manipulator handles + gAgentCamera.setFocusGlobal(selected_objectp->getPositionGlobal(), selected_objectp->getID()); + gAgentCamera.cameraZoomIn(0.666f); + gAgentCamera.cameraOrbitOver(30.f * DEG_TO_RAD); + gViewerWindow->moveCursorToCenter(); + } + } + } +} + +void handle_object_edit() +{ + update_camera(); - if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) - { - // always freeze camera in space, even if camera doesn't move - // so, for example, follow cam scripts can't affect you when in build mode - gAgentCamera.setFocusGlobal(gAgentCamera.calcFocusPositionTargetGlobal(), LLUUID::null); - gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); - } - else - { - gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); - LLViewerObject* selected_objectp = selection->getFirstRootObject(); - if (selected_objectp) - { - // zoom in on object center instead of where we clicked, as we need to see the manipulator handles - gAgentCamera.setFocusGlobal(selected_objectp->getPositionGlobal(), selected_objectp->getID()); - gAgentCamera.cameraZoomIn(0.666f); - gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD ); - gViewerWindow->moveCursorToCenter(); - } - } - } - LLFloaterReg::showInstance("build"); LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); @@ -3008,6 +2975,23 @@ void handle_object_edit() return; } +void handle_object_edit_gltf_material() +{ + if (!LLFloaterReg::instanceVisible("build")) + { + handle_object_edit(); // does update_camera(); + } + else + { + update_camera(); + + LLViewerJoystick::getInstance()->moveObjects(true); + LLViewerJoystick::getInstance()->setNeedsReset(true); + } + + LLMaterialEditor::loadLive(); +} + void handle_attachment_edit(const LLUUID& inv_item_id) { if (isAgentAvatarValid()) @@ -7859,10 +7843,6 @@ class LLToggleShaderControl : public view_listener_t BOOL checked = gSavedSettings.getBOOL( control_name ); gSavedSettings.setBOOL( control_name, !checked ); LLPipeline::refreshCachedSettings(); - //gPipeline.updateRenderDeferred(); - //gPipeline.releaseGLBuffers(); - //gPipeline.createGLBuffers(); - //gPipeline.resetVertexBuffers(); LLViewerShaderMgr::instance()->setShaders(); return !checked; } @@ -8143,6 +8123,30 @@ class LLToolsSelectOnlyMovableObjects : public view_listener_t } }; +class LLToolsSelectInvisibleObjects : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + BOOL cur_val = gSavedSettings.getBOOL("SelectInvisibleObjects"); + + gSavedSettings.setBOOL("SelectInvisibleObjects", !cur_val); + + return true; + } +}; + +class LLToolsSelectReflectionProbes: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + BOOL cur_val = gSavedSettings.getBOOL("SelectReflectionProbes"); + + gSavedSettings.setBOOL("SelectReflectionProbes", !cur_val); + + return true; + } +}; + class LLToolsSelectBySurrounding : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8558,7 +8562,6 @@ BOOL get_visibility(void* user_data) return viewp->getVisible(); } -// TomY TODO: Get rid of these? class LLViewShowHoverTips : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8577,13 +8580,14 @@ class LLViewCheckShowHoverTips : public view_listener_t } }; -// TomY TODO: Get rid of these? class LLViewHighlightTransparent : public view_listener_t { bool handleEvent(const LLSD& userdata) { LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; - gPipeline.resetVertexBuffers(); + + // invisible objects skip building their render batches unless sShowDebugAlpha is true, so rebuild batches whenever toggling this flag + gPipeline.rebuildDrawInfo(); return true; } }; @@ -8925,6 +8929,12 @@ class LLWorldEnvSettings : public view_listener_t LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } + else if (event_name == "legacy noon") + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_LEGACY_MIDDAY, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); + defocusEnvFloaters(); + } else if (event_name == "sunset") { LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_INSTANT); @@ -8939,6 +8949,9 @@ class LLWorldEnvSettings : public view_listener_t } else if (event_name == "region") { + // reset probe data when reverting back to region sky setting + gPipeline.mReflectionMapManager.reset(); + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); @@ -8993,6 +9006,10 @@ class LLWorldEnableEnvSettings : public view_listener_t { result = (skyid == LLEnvironment::KNOWN_SKY_MIDDAY); } + else if (event_name == "legacy noon") + { + result = (skyid == LLEnvironment::KNOWN_SKY_LEGACY_MIDDAY); + } else if (event_name == "sunset") { result = (skyid == LLEnvironment::KNOWN_SKY_SUNSET); @@ -9387,6 +9404,8 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); view_listener_t::addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects"); view_listener_t::addMenu(new LLToolsSelectOnlyMovableObjects(), "Tools.SelectOnlyMovableObjects"); + view_listener_t::addMenu(new LLToolsSelectInvisibleObjects(), "Tools.SelectInvisibleObjects"); + view_listener_t::addMenu(new LLToolsSelectReflectionProbes(), "Tools.SelectReflectionProbes"); view_listener_t::addMenu(new LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding"); view_listener_t::addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection"); view_listener_t::addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius"); @@ -9455,20 +9474,16 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleWireframe(), "Advanced.ToggleWireframe"); view_listener_t::addMenu(new LLAdvancedCheckWireframe(), "Advanced.CheckWireframe"); // Develop > Render - view_listener_t::addMenu(new LLAdvancedEnableObjectObjectOcclusion(), "Advanced.EnableObjectObjectOcclusion"); - view_listener_t::addMenu(new LLAdvancedEnableRenderDeferred(), "Advanced.EnableRenderDeferred"); - view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredOptions(), "Advanced.EnableRenderDeferredOptions"); view_listener_t::addMenu(new LLAdvancedToggleRandomizeFramerate(), "Advanced.ToggleRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame"); view_listener_t::addMenu(new LLAdvancedCheckPeriodicSlowFrame(), "Advanced.CheckPeriodicSlowFrame"); - view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest"); - view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest"); view_listener_t::addMenu(new LLAdvancedHandleAttachedLightParticles(), "Advanced.HandleAttachedLightParticles"); view_listener_t::addMenu(new LLAdvancedCheckRenderShadowOption(), "Advanced.CheckRenderShadowOption"); view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption"); view_listener_t::addMenu(new LLAdvancedClickRenderProfile(), "Advanced.ClickRenderProfile"); view_listener_t::addMenu(new LLAdvancedClickRenderBenchmark(), "Advanced.ClickRenderBenchmark"); + view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache"); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER view_listener_t::addMenu(new LLAdvancedHandleToggleHackedGodmode(), "Advanced.HandleToggleHackedGodmode"); @@ -9598,11 +9613,9 @@ void initialize_menus() view_listener_t::addMenu(new LLDevelopCheckLoggingLevel(), "Develop.CheckLoggingLevel"); view_listener_t::addMenu(new LLDevelopSetLoggingLevel(), "Develop.SetLoggingLevel"); - //Develop (Texture Fetch Debug Console) - view_listener_t::addMenu(new LLDevelopTextureFetchDebugger(), "Develop.SetTexFetchDebugger"); //Develop (clear cache immediately) commit.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately) ); - + // Admin >Object view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy"); view_listener_t::addMenu(new LLAdminHandleObjectOwnerSelf(), "Admin.HandleObjectOwnerSelf"); @@ -9681,11 +9694,14 @@ void initialize_menus() commit.add("Object.Buy", boost::bind(&handle_buy)); commit.add("Object.Edit", boost::bind(&handle_object_edit)); + commit.add("Object.Edit", boost::bind(&handle_object_edit)); + commit.add("Object.EditGLTFMaterial", boost::bind(&handle_object_edit_gltf_material)); commit.add("Object.Inspect", boost::bind(&handle_object_inspect)); commit.add("Object.Open", boost::bind(&handle_object_open)); commit.add("Object.Take", boost::bind(&handle_take)); commit.add("Object.ShowInspector", boost::bind(&handle_object_show_inspector)); enable.add("Object.EnableInspect", boost::bind(&enable_object_inspect)); + enable.add("Object.EnableEditGLTFMaterial", boost::bind(&enable_object_edit_gltf_material)); enable.add("Object.EnableOpen", boost::bind(&enable_object_open)); enable.add("Object.EnableTouch", boost::bind(&enable_object_touch, _1)); enable.add("Object.EnableDelete", boost::bind(&enable_object_delete)); |