diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 281 |
1 files changed, 139 insertions, 142 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 998f5c020e..d22ffc784a 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" @@ -270,16 +271,11 @@ 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*); void handle_object_asset_ids(void*); void force_take_copy(void*); -#ifdef _CORY_TESTING -void force_export_copy(void*); -void force_import_geometry(void*); -#endif void handle_force_parcel_owner_to_me(void*); void handle_force_parcel_to_content(void*); @@ -768,10 +764,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; @@ -1096,6 +1088,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; @@ -1185,33 +1181,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 // +// /////////////////////////// @@ -1233,24 +1205,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; } @@ -1260,8 +1214,7 @@ class LLAdvancedCheckWireframe : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gUseWireframe; - return new_value; + return gUseWireframe; } }; @@ -2339,47 +2292,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 // ////////////////// @@ -2581,14 +2493,6 @@ class LLDevelopSetLoggingLevel : public view_listener_t } }; -class LLDevelopTextureFetchDebugger : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - return gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); - } -}; - ////////////////// // ADMIN MENU // ////////////////// @@ -2876,6 +2780,51 @@ void handle_object_open() LLFloaterReg::showInstance("openobject"); } +struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor +{ + LLSelectedTEGetmatIdAndPermissions() : mCanCopy(true), mCanModify(true), mCanTransfer(true) {} + 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; + } + return true; + } + bool mCanCopy; + bool mCanModify; + bool mCanTransfer; + LLUUID mMaterialId; +}; + +bool enable_object_edit_gltf_material() +{ + if (!LLMaterialEditor::capabilitiesAvailable()) + { + return false; + } + + LLSelectedTEGetmatIdAndPermissions func; + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); + return func.mCanModify && func.mMaterialId.notNull(); +} + +bool enable_object_save_gltf_material() +{ + if (!LLMaterialEditor::capabilitiesAvailable()) + { + return false; + } + + LLSelectedTEGetmatIdAndPermissions func; + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); + return func.mCanCopy && func.mMaterialId.notNull(); +} + bool enable_object_open() { // Look for contents in root object, which is all the LLFloaterOpenObject @@ -2941,37 +2890,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); @@ -2985,6 +2939,28 @@ 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_object_save_gltf_material() +{ + LLMaterialEditor::savePickedMaterialAs(); +} + void handle_attachment_edit(const LLUUID& inv_item_id) { if (isAgentAvatarValid()) @@ -8133,6 +8109,18 @@ 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 LLToolsSelectBySurrounding : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8548,7 +8536,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) @@ -8567,13 +8554,11 @@ 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(); return true; } }; @@ -8915,6 +8900,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); @@ -8929,6 +8920,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(); @@ -8983,6 +8977,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); @@ -9356,6 +9354,7 @@ 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 LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding"); view_listener_t::addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection"); view_listener_t::addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius"); @@ -9424,15 +9423,10 @@ 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"); @@ -9563,11 +9557,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"); @@ -9646,10 +9638,15 @@ 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.SaveGLTFMaterial", boost::bind(&handle_object_save_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.EnableEditGLTFMaterial", boost::bind(&enable_object_edit_gltf_material)); + enable.add("Object.EnableSaveGLTFMaterial", boost::bind(&enable_object_save_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)); |