diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelface.cpp | 63 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 7 | ||||
-rw-r--r-- | indra/newview/llpanelobject.cpp | 479 | ||||
-rw-r--r-- | indra/newview/llpanelobject.h | 34 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Paste.png | bin | 530 -> 0 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 176 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_build_paste.xml | 38 |
8 files changed, 87 insertions, 711 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 13d0e377d7..369861fa25 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -2929,7 +2929,7 @@ void LLPanelFace::onCopyFaces() { LLUUID item_id; LLUUID id = te_data["te"]["imageid"].asUUID(); - bool full_perm = LLPanelObject::isLibraryTexture(id) || (objectp->permCopy() && objectp->permTransfer() && objectp->permModify()); + bool full_perm = LLPanelFace::isLibraryTexture(id) || (objectp->permCopy() && objectp->permTransfer() && objectp->permModify()); if (id.notNull() && !full_perm) { @@ -2944,7 +2944,7 @@ void LLPanelFace::onCopyFaces() // as result it is Hightly unreliable, leaves little control to user, borderline hack // but there are little options to preserve permissions - multiple inventory // items might reference same asset and inventory search is expensive. - item_id = LLPanelObject::getCopyPermInventoryTextureId(id); + item_id = LLPanelFace::getCopyPermInventoryTextureId(id); // record value to avoid repeating inventory search when possible asset_item_map[id] = item_id; } @@ -3022,7 +3022,7 @@ void LLPanelFace::onCopyFaces() if (mat_data.has("NormMap")) { LLUUID id = mat_data["NormMap"].asUUID(); - if (id.notNull() && !LLPanelObject::canCopyTexture(id)) + if (id.notNull() && !LLPanelFace::canCopyTexture(id)) { mat_data["NormMap"] = LLUUID(gSavedSettings.getString( "DefaultObjectTexture" )); mat_data["NormMapNoCopy"] = true; @@ -3032,7 +3032,7 @@ void LLPanelFace::onCopyFaces() if (mat_data.has("SpecMap")) { LLUUID id = mat_data["SpecMap"].asUUID(); - if (id.notNull() && !LLPanelObject::canCopyTexture(id)) + if (id.notNull() && !LLPanelFace::canCopyTexture(id)) { mat_data["SpecMap"] = LLUUID(gSavedSettings.getString( "DefaultObjectTexture" )); mat_data["SpecMapNoCopy"] = true; @@ -3504,3 +3504,58 @@ bool LLPanelFace::pasteEnabletMenuItem(const LLSD& userdata) return true; } + +//static +bool LLPanelFace::isLibraryTexture(LLUUID image_id) +{ + if (gInventory.isObjectDescendentOf(image_id, gInventory.getLibraryRootFolderID()) + || image_id == LLUUID(gSavedSettings.getString("DefaultObjectTexture")) + || image_id == LLUUID(gSavedSettings.getString("UIImgWhiteUUID")) + || image_id == LLUUID(gSavedSettings.getString("UIImgInvisibleUUID")) + || image_id == LLUUID(SCULPT_DEFAULT_TEXTURE)) + { + return true; + } + return false; +} + +//static +LLUUID LLPanelFace::getCopyPermInventoryTextureId(LLUUID image_id) +{ + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(image_id); + gInventory.collectDescendentsIf(LLUUID::null, + cats, + items, + LLInventoryModel::INCLUDE_TRASH, + asset_id_matches); + if (items.size()) + { + for (S32 i = 0; i < items.size(); i++) + { + LLViewerInventoryItem* itemp = items[i]; + if (itemp) + { + LLPermissions item_permissions = itemp->getPermissions(); + if (item_permissions.allowOperationBy(PERM_COPY, + gAgent.getID(), + gAgent.getGroupID())) + { + return itemp->getUUID(); + } + } + } + } + return LLUUID::null; +} + +// Static +bool LLPanelFace::canCopyTexture(LLUUID image_id) +{ + // User is allowed to copy a texture if: + // library asset or default texture, + // or copy perm asset exists in user's inventory + + return isLibraryTexture(image_id) || getCopyPermInventoryTextureId(image_id).notNull(); +} diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 770f10e2ee..dbf3531332 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -115,6 +115,13 @@ public: LLRender::eTexIndex getTextureChannelToEdit(); void pasteFace(LLViewerObject* object, S32 te); + static bool isLibraryTexture(LLUUID image_id); + + // Finds copy-enabled texture with specified asset from inventory + // This can be performance unfriendly and doesn't warranty that + // the texture is original source of asset + static LLUUID getCopyPermInventoryTextureId(LLUUID image_id); + static bool canCopyTexture(LLUUID image_id); protected: void getState(); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index ac0122237f..5fd9655201 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -32,7 +32,6 @@ // linden library includes #include "llerror.h" #include "llfontgl.h" -#include "material_codes.h" // LL_MCODE_MASK #include "llpermissionsflags.h" #include "llstring.h" #include "llvolume.h" @@ -46,8 +45,6 @@ #include "llcolorswatch.h" #include "llcombobox.h" #include "llfocusmgr.h" -#include "llinventoryfunctions.h" -#include "llinventorymodel.h" #include "llmanipscale.h" #include "llmenubutton.h" #include "llpreviewscript.h" @@ -153,31 +150,6 @@ BOOL LLPanelObject::postBuild() mCtrlRotZ = getChild<LLSpinCtrl>("Rot Z"); childSetCommitCallback("Rot Z",onCommitRotation,this); - // Copy/paste pos - mBtnCopyPos = getChild<LLButton>("copy_pos_btn"); - mBtnCopyPos->setCommitCallback(boost::bind(&LLPanelObject::onCopyPos, this)); - mBtnPastePos = getChild<LLButton>("paste_pos_btn"); - mBtnPastePos->setCommitCallback(boost::bind(&LLPanelObject::onPastePos, this)); - - // Copy/paste size - mBtnCopySize = getChild<LLButton>("copy_size_btn"); - mBtnCopySize->setCommitCallback(boost::bind(&LLPanelObject::onCopySize, this)); - mBtnPasteSize = getChild<LLButton>("paste_size_btn"); - mBtnPasteSize->setCommitCallback(boost::bind(&LLPanelObject::onPasteSize, this)); - - // Copy/paste rot - mBtnCopyRot = getChild<LLButton>("copy_rot_btn"); - mBtnCopyRot->setCommitCallback(boost::bind(&LLPanelObject::onCopyRot, this)); - mBtnPasteRot = getChild<LLButton>("paste_rot_btn"); - mBtnPasteRot->setCommitCallback(boost::bind(&LLPanelObject::onPasteRot, this));; - - // Copy/paste obj prams - mBtnCopyParams = getChild<LLButton>("copy_params_btn"); - mBtnCopyParams->setCommitCallback(boost::bind(&LLPanelObject::onCopyParams, this)); - mBtnPasteParams = getChild<LLButton>("paste_params_btn"); - mBtnPasteParams->setCommitCallback(boost::bind(&LLPanelObject::onPasteParams, this)); - mBtnPasteMenu = getChild<LLMenuButton>("paste_gear_btn"); - //-------------------------------------------------------- // Base Type @@ -314,19 +286,11 @@ LLPanelObject::LLPanelObject() mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), mSculptTypeRevert(0), - mSizeChanged(FALSE), - mHasParamsClipboard(FALSE), mHasPosClipboard(FALSE), mHasSizeClipboard(FALSE), mHasRotClipboard(FALSE), - mPasteParametric(TRUE), - mPasteFlexible(TRUE), - mPastePhysics(TRUE), - mPasteLight(TRUE) + mSizeChanged(FALSE) { - mEnableCallbackRegistrar.add("BuildObject.PasteCheckItem", boost::bind(&LLPanelObject::pasteCheckMenuItem, this, _2)); - mCommitCallbackRegistrar.add("BuildObject.PasteDoToSelected", boost::bind(&LLPanelObject::pasteDoMenuItem, this, _2)); - mEnableCallbackRegistrar.add("BuildObject.PasteEnable", boost::bind(&LLPanelObject::pasteEnabletMenuItem, this, _2)); } @@ -418,8 +382,6 @@ void LLPanelObject::getState( ) mCtrlPosX->setEnabled(enable_move); mCtrlPosY->setEnabled(enable_move); mCtrlPosZ->setEnabled(enable_move); - mBtnCopyPos->setEnabled(enable_move); - mBtnPastePos->setEnabled(enable_move && mHasPosClipboard); if (enable_scale) { @@ -445,8 +407,6 @@ void LLPanelObject::getState( ) mCtrlScaleX->setEnabled( enable_scale ); mCtrlScaleY->setEnabled( enable_scale ); mCtrlScaleZ->setEnabled( enable_scale ); - mBtnCopySize->setEnabled( enable_scale ); - mBtnPasteSize->setEnabled( enable_scale && mHasSizeClipboard ); LLQuaternion object_rot = objectp->getRotationEdit(); object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ])); @@ -478,12 +438,6 @@ void LLPanelObject::getState( ) mCtrlRotX->setEnabled( enable_rotate ); mCtrlRotY->setEnabled( enable_rotate ); mCtrlRotZ->setEnabled( enable_rotate ); - mBtnCopyRot->setEnabled( enable_rotate ); - mBtnPasteRot->setEnabled( enable_rotate && mHasRotClipboard ); - - mBtnCopyParams->setEnabled( single_volume && enable_modify ); - mBtnPasteParams->setEnabled( single_volume && enable_modify && mHasParamsClipboard ); - mBtnPasteMenu->setEnabled( single_volume && enable_modify ); LLUUID owner_id; std::string owner_name; @@ -2058,12 +2012,6 @@ void LLPanelObject::onCopyPos() std::string stringVec = llformat("<%g, %g, %g>", mClipboardPos.mV[VX], mClipboardPos.mV[VY], mClipboardPos.mV[VZ]); LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); - LLStringUtil::format_map_t args; - args["VALUE"] = stringVec; - mBtnPastePos->setToolTip(getString("paste_position", args)); - - mBtnPastePos->setEnabled(TRUE); - mHasPosClipboard = TRUE; } @@ -2074,12 +2022,6 @@ void LLPanelObject::onCopySize() std::string stringVec = llformat("<%g, %g, %g>", mClipboardSize.mV[VX], mClipboardSize.mV[VY], mClipboardSize.mV[VZ]); LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); - LLStringUtil::format_map_t args; - args["VALUE"] = stringVec; - mBtnPasteSize->setToolTip(getString("paste_size", args)); - - mBtnPasteSize->setEnabled(TRUE); - mHasSizeClipboard = TRUE; } @@ -2090,12 +2032,6 @@ void LLPanelObject::onCopyRot() std::string stringVec = llformat("<%g, %g, %g>", mClipboardRot.mV[VX], mClipboardRot.mV[VY], mClipboardRot.mV[VZ]); LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); - LLStringUtil::format_map_t args; - args["VALUE"] = stringVec; - mBtnPasteRot->setToolTip(getString("paste_rotation", args)); - - mBtnPasteRot->setEnabled(TRUE); - mHasRotClipboard = TRUE; } @@ -2143,416 +2079,3 @@ void LLPanelObject::onPasteRot() sendRotation(FALSE); } - -void LLPanelObject::onCopyParams() -{ - LLViewerObject* objectp = mObject; - if (!objectp) - { - return; - } - - mParamsClipboard.clear(); - - mParamsClipboard["is_phantom"] = objectp->flagPhantom(); - mParamsClipboard["is_physical"] = objectp->flagUsePhysics(); - - // Parametrics - if (!objectp->isMesh()) - { - getVolumeParams(mClipboardVolumeParams); - } - - LLVOVolume *volobjp = NULL; - if (objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) - { - volobjp = (LLVOVolume *)objectp; - } - - // Flexi Prim - if (volobjp && volobjp->isFlexible()) - { - LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - if (attributes) - { - mParamsClipboard["flex"]["lod"] = attributes->getSimulateLOD(); - mParamsClipboard["flex"]["gav"] = attributes->getGravity(); - mParamsClipboard["flex"]["ten"] = attributes->getTension(); - mParamsClipboard["flex"]["fri"] = attributes->getAirFriction(); - mParamsClipboard["flex"]["sen"] = attributes->getWindSensitivity(); - LLVector3 force = attributes->getUserForce(); - mParamsClipboard["flex"]["forx"] = force.mV[0]; - mParamsClipboard["flex"]["fory"] = force.mV[1]; - mParamsClipboard["flex"]["forz"] = force.mV[2]; - } - } - - // Sculpted Prim - if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) - { - LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - - if (!objectp->isMesh()) - { - LLUUID texture_id = sculpt_params->getSculptTexture(); - if (canCopyTexture(texture_id)) - { - LL_INFOS() << "copy texture " << LL_ENDL; - mParamsClipboard["sculpt"]["id"] = texture_id; - } - else - { - mParamsClipboard["sculpt"]["id"] = LLUUID(SCULPT_DEFAULT_TEXTURE); - } - - mParamsClipboard["sculpt"]["type"] = sculpt_params->getSculptType(); - } - } - - // Light Source - if (volobjp && volobjp->getIsLight()) - { - mParamsClipboard["light"]["intensity"] = volobjp->getLightIntensity(); - mParamsClipboard["light"]["radius"] = volobjp->getLightRadius(); - mParamsClipboard["light"]["falloff"] = volobjp->getLightFalloff(); - LLColor3 color = volobjp->getLightSRGBColor(); - mParamsClipboard["light"]["r"] = color.mV[0]; - mParamsClipboard["light"]["g"] = color.mV[1]; - mParamsClipboard["light"]["b"] = color.mV[2]; - - // Spotlight - if (volobjp->isLightSpotlight()) - { - LLUUID id = volobjp->getLightTextureID(); - if (id.notNull() && canCopyTexture(id)) - { - mParamsClipboard["spot"]["id"] = id; - LLVector3 spot_params = volobjp->getSpotLightParams(); - mParamsClipboard["spot"]["fov"] = spot_params.mV[0]; - mParamsClipboard["spot"]["focus"] = spot_params.mV[1]; - mParamsClipboard["spot"]["ambiance"] = spot_params.mV[2]; - } - } - } - - // Physics - { - mParamsClipboard["physics"]["shape"] = objectp->getPhysicsShapeType(); - mParamsClipboard["physics"]["gravity"] = objectp->getPhysicsGravity(); - mParamsClipboard["physics"]["friction"] = objectp->getPhysicsFriction(); - mParamsClipboard["physics"]["density"] = objectp->getPhysicsDensity(); - mParamsClipboard["physics"]["restitution"] = objectp->getPhysicsRestitution(); - - U8 material_code = 0; - struct f : public LLSelectedTEGetFunctor<U8> - { - U8 get(LLViewerObject* object, S32 te) - { - return object->getMaterial(); - } - } func; - bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); - // This should always be true since material should be per object. - if (material_same) - { - mParamsClipboard["physics"]["material"] = material_code; - } - } - - mHasParamsClipboard = TRUE; -} - -void LLPanelObject::onPasteParams() -{ - LLViewerObject* objectp = mObject; - if (!objectp || !mHasParamsClipboard) - { - return; - } - - LLVOVolume *volobjp = NULL; - if (objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) - { - volobjp = (LLVOVolume *)objectp; - } - - // Light Source - if (mPasteLight && volobjp) - { - if (mParamsClipboard.has("light")) - { - volobjp->setIsLight(TRUE); - volobjp->setLightIntensity((F32)mParamsClipboard["light"]["intensity"].asReal()); - volobjp->setLightRadius((F32)mParamsClipboard["light"]["radius"].asReal()); - volobjp->setLightFalloff((F32)mParamsClipboard["light"]["falloff"].asReal()); - F32 r = (F32)mParamsClipboard["light"]["r"].asReal(); - F32 g = (F32)mParamsClipboard["light"]["g"].asReal(); - F32 b = (F32)mParamsClipboard["light"]["b"].asReal(); - volobjp->setLightSRGBColor(LLColor3(r, g, b)); - } - else - { - volobjp->setIsLight(FALSE); - } - - if (mParamsClipboard.has("spot")) - { - volobjp->setLightTextureID(mParamsClipboard["spot"]["id"].asUUID()); - LLVector3 spot_params; - spot_params.mV[0] = (F32)mParamsClipboard["spot"]["fov"].asReal(); - spot_params.mV[1] = (F32)mParamsClipboard["spot"]["focus"].asReal(); - spot_params.mV[2] = (F32)mParamsClipboard["spot"]["ambiance"].asReal(); - volobjp->setSpotLightParams(spot_params); - } - } - - // Physics - if (mPastePhysics) - { - bool is_root = objectp->isRoot(); - - // Not sure if phantom should go under physics, but doesn't fit elsewhere - BOOL is_phantom = mParamsClipboard["is_phantom"].asBoolean() && is_root; - LLSelectMgr::getInstance()->selectionUpdatePhantom(is_phantom); - - BOOL is_physical = mParamsClipboard["is_physical"].asBoolean() && is_root; - LLSelectMgr::getInstance()->selectionUpdatePhysics(is_physical); - - if (mParamsClipboard.has("physics")) - { - objectp->setPhysicsShapeType((U8)mParamsClipboard["physics"]["shape"].asInteger()); - U8 cur_material = objectp->getMaterial(); - U8 material = (U8)mParamsClipboard["physics"]["material"].asInteger() | (cur_material & ~LL_MCODE_MASK); - - objectp->setMaterial(material); - objectp->sendMaterialUpdate(); - objectp->setPhysicsGravity(mParamsClipboard["physics"]["gravity"].asReal()); - objectp->setPhysicsFriction(mParamsClipboard["physics"]["friction"].asReal()); - objectp->setPhysicsDensity(mParamsClipboard["physics"]["density"].asReal()); - objectp->setPhysicsRestitution(mParamsClipboard["physics"]["restitution"].asReal()); - objectp->updateFlags(TRUE); - } - } - - if (mPasteFlexible) - { - bool is_flexible = mParamsClipboard.has("flex"); - if (is_flexible) - { - LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL update_shape = FALSE; - if (!mPasteParametric) - { - // do before setParameterEntry or it will think that it is already flexi - update_shape = volobjp->setIsFlexible(is_flexible); - } - - if (objectp->getClickAction() == CLICK_ACTION_SIT) - { - objectp->setClickAction(CLICK_ACTION_NONE); - } - - LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - if (attributes) - { - LLFlexibleObjectData new_attributes; - new_attributes = *attributes; - new_attributes.setSimulateLOD(mParamsClipboard["flex"]["lod"].asInteger()); - new_attributes.setGravity(mParamsClipboard["flex"]["gav"].asReal()); - new_attributes.setTension(mParamsClipboard["flex"]["ten"].asReal()); - new_attributes.setAirFriction(mParamsClipboard["flex"]["fri"].asReal()); - new_attributes.setWindSensitivity(mParamsClipboard["flex"]["sen"].asReal()); - F32 fx = (F32)mParamsClipboard["flex"]["forx"].asReal(); - F32 fy = (F32)mParamsClipboard["flex"]["fory"].asReal(); - F32 fz = (F32)mParamsClipboard["flex"]["forz"].asReal(); - LLVector3 force(fx, fy, fz); - new_attributes.setUserForce(force); - objectp->setParameterEntry(LLNetworkData::PARAMS_FLEXIBLE, new_attributes, true); - } - - if (!mPasteParametric && update_shape) - { - mObject->sendShapeUpdate(); - LLSelectMgr::getInstance()->selectionUpdatePhantom(volobjp->flagPhantom()); - } - } - else if (!mPasteParametric) - { - LLVOVolume *volobjp = (LLVOVolume *)objectp; - if (volobjp->setIsFlexible(is_flexible)) - { - mObject->sendShapeUpdate(); - LLSelectMgr::getInstance()->selectionUpdatePhantom(volobjp->flagPhantom()); - } - } - } - // Parametric does updateVolume(), make sure we won't affect flexible - else if (mPasteParametric) - { - LLVOVolume *volobjp = (LLVOVolume *)objectp; - if (volobjp->isFlexible()) - { - if (mClipboardVolumeParams.getPathParams().getCurveType() == LL_PCODE_PATH_LINE) - { - mClipboardVolumeParams.getPathParams().setCurveType(LL_PCODE_PATH_FLEXIBLE); - } - } - else if (mClipboardVolumeParams.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE) - { - mClipboardVolumeParams.getPathParams().setCurveType(LL_PCODE_PATH_LINE); - } - } - - // Parametrics - if(mPasteParametric) - { - // Sculpted Prim - if (mParamsClipboard.has("sculpt")) - { - LLSculptParams sculpt_params; - LLUUID sculpt_id = mParamsClipboard["sculpt"]["id"].asUUID(); - U8 sculpt_type = (U8)mParamsClipboard["sculpt"]["type"].asInteger(); - sculpt_params.setSculptTexture(sculpt_id, sculpt_type); - objectp->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE); - } - else - { - LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - if (sculpt_params) - { - objectp->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, FALSE, TRUE); - } - } - - objectp->updateVolume(mClipboardVolumeParams); - } -} - -bool LLPanelObject::pasteCheckMenuItem(const LLSD& userdata) -{ - std::string command = userdata.asString(); - - if ("Parametric" == command) - { - return mPasteParametric; - } - if ("Flexible" == command) - { - return mPasteFlexible; - } - if ("Physics" == command) - { - return mPastePhysics; - } - if ("Light" == command) - { - return mPasteLight; - } - - return false; -} - -void LLPanelObject::pasteDoMenuItem(const LLSD& userdata) -{ - std::string command = userdata.asString(); - - if ("Parametric" == command) - { - mPasteParametric = !mPasteParametric; - } - if ("Flexible" == command) - { - mPasteFlexible = !mPasteFlexible; - } - if ("Physics" == command) - { - mPastePhysics = !mPastePhysics; - } - if ("Light" == command) - { - mPasteLight = !mPasteLight; - } -} - -bool LLPanelObject::pasteEnabletMenuItem(const LLSD& userdata) -{ - std::string command = userdata.asString(); - - // Keep at least one option enabled - if (mPasteParametric + mPasteFlexible + mPastePhysics + mPasteLight == 1) - { - if ("Parametric" == command && mPasteParametric) - { - return false; - } - if ("Flexible" == command && mPasteFlexible) - { - return false; - } - if ("Physics" == command && mPastePhysics) - { - return false; - } - if ("Light" == command && mPasteLight) - { - return false; - } - } - - return true; -} - -//static -bool LLPanelObject::isLibraryTexture(LLUUID image_id) -{ - if (gInventory.isObjectDescendentOf(image_id, gInventory.getLibraryRootFolderID()) - || image_id == LLUUID(gSavedSettings.getString("DefaultObjectTexture")) - || image_id == LLUUID(gSavedSettings.getString("UIImgWhiteUUID")) - || image_id == LLUUID(gSavedSettings.getString("UIImgInvisibleUUID")) - || image_id == LLUUID(SCULPT_DEFAULT_TEXTURE)) - { - return true; - } - return false; -} - -//static -LLUUID LLPanelObject::getCopyPermInventoryTextureId(LLUUID image_id) -{ - LLViewerInventoryCategory::cat_array_t cats; - LLViewerInventoryItem::item_array_t items; - LLAssetIDMatches asset_id_matches(image_id); - gInventory.collectDescendentsIf(LLUUID::null, - cats, - items, - LLInventoryModel::INCLUDE_TRASH, - asset_id_matches); - if (items.size()) - { - for (S32 i = 0; i < items.size(); i++) - { - LLViewerInventoryItem* itemp = items[i]; - if (itemp) - { - LLPermissions item_permissions = itemp->getPermissions(); - if (item_permissions.allowOperationBy(PERM_COPY, - gAgent.getID(), - gAgent.getGroupID())) - { - return itemp->getUUID(); - } - } - } - } - return LLUUID::null; -} - -// Static -bool LLPanelObject::canCopyTexture(LLUUID image_id) -{ - // User is allowed to copy a texture if: - // library asset or default texture, - // or copy perm asset exists in user's inventory - - return isLibraryTexture(image_id) || getCopyPermInventoryTextureId(image_id).notNull(); -} diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 65f46a8ed3..e9b9254a78 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -37,7 +37,6 @@ class LLCheckBoxCtrl; class LLTextBox; class LLUICtrl; class LLButton; -class LLMenuButton; class LLViewerObject; class LLComboBox; class LLColorSwatchCtrl; @@ -73,9 +72,6 @@ public: void onPasteSize(); void onCopyRot(); void onPasteRot(); - void onCopyParams(); - void onPasteParams(); - static void onCommitParametric(LLUICtrl* ctrl, void* userdata); @@ -85,17 +81,6 @@ public: BOOL onDropSculpt(LLInventoryItem* item); static void onCommitSculptType( LLUICtrl *ctrl, void* userdata); - bool pasteCheckMenuItem(const LLSD& userdata); - void pasteDoMenuItem(const LLSD& userdata); - bool pasteEnabletMenuItem(const LLSD& userdata); - static bool isLibraryTexture(LLUUID image_id); - - // Finds copy-enabled texture with specified asset from inventory - // This can be performance unfriendly and doesn't warranty that - // the texture is original source of asset - static LLUUID getCopyPermInventoryTextureId(LLUUID image_id); - static bool canCopyTexture(LLUUID image_id); - protected: void getState(); @@ -168,16 +153,6 @@ protected: LLSpinCtrl* mCtrlRotY; LLSpinCtrl* mCtrlRotZ; - LLButton *mBtnCopyPos; - LLButton *mBtnPastePos; - LLButton *mBtnCopySize; - LLButton *mBtnPasteSize; - LLButton *mBtnCopyRot; - LLButton *mBtnPasteRot; - LLButton *mBtnCopyParams; - LLButton *mBtnPasteParams; - LLMenuButton *mBtnPasteMenu; - LLCheckBoxCtrl *mCheckLock; LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; @@ -206,15 +181,6 @@ protected: BOOL mHasSizeClipboard; BOOL mHasRotClipboard; - LLSD mParamsClipboard; - LLVolumeParams mClipboardVolumeParams; - BOOL mHasParamsClipboard; - - BOOL mPasteParametric; - BOOL mPasteFlexible; - BOOL mPastePhysics; - BOOL mPasteLight; - LLPointer<LLViewerObject> mObject; LLPointer<LLViewerObject> mRootObject; }; diff --git a/indra/newview/skins/default/textures/icons/Paste.png b/indra/newview/skins/default/textures/icons/Paste.png Binary files differdeleted file mode 100644 index 10211df427..0000000000 --- a/indra/newview/skins/default/textures/icons/Paste.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index dd70354dd9..b041e6197c 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -186,7 +186,6 @@ with the same filename but different name <texture name="Conv_log_inbox" file_name="icons/Conv_log_inbox.png" preload="false" /> <texture name="Copy" file_name="icons/Copy.png" preload="false" /> - <texture name="Paste" file_name="icons/Paste.png" preload="false" /> <texture name="DisclosureArrow_Opened_Off" file_name="widgets/DisclosureArrow_Opened_Off.png" preload="true" /> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 425af16261..0abee2ff80 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1397,18 +1397,6 @@ even though the user gets a free copy. name="Object" top="16" width="295"> - <panel.string name="paste_position"> -Paste Position -[VALUE] - </panel.string> - <panel.string name="paste_size"> -Paste Size -[VALUE] - </panel.string> - <panel.string name="paste_rotation"> -Paste Rotation -[VALUE] - </panel.string> <check_box height="19" label="Locked" @@ -1468,21 +1456,6 @@ Paste Rotation text_enabled_color="1 0 0.3 .7" top_pad="5" width="87" /> - <button - top_delta="0" - left_pad="5" - height="19" - width="20" - follows="top|right" - layout="topleft" - tab_stop="false" - image_bottom_pad="1" - image_overlay="Copy" - image_hover_unselected="Toolbar_Middle_Over" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - name="copy_pos_btn" - tool_tip="Copy Position" /> <spinner follows="left|top" height="19" @@ -1491,28 +1464,13 @@ Paste Rotation label="Y" label_width="10" layout="topleft" - left="10" + left_delta="0" max_val="512" min_val="-256" name="Pos Y" text_enabled_color="EmphasisColor" top_pad="3" width="87" /> - <button - top_delta="0" - left_pad="5" - height="19" - width="20" - follows="top|right" - layout="topleft" - tab_stop="false" - image_bottom_pad="1" - image_overlay="Paste" - image_hover_unselected="Toolbar_Middle_Over" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - name="paste_pos_btn" - tool_tip="Paste Position" /> <spinner follows="left|top" height="19" @@ -1521,7 +1479,7 @@ Paste Rotation label="Z" label_width="10" layout="topleft" - left="10" + left_delta="0" max_val="4096" name="Pos Z" text_enabled_color="0 0.8 1 .65" @@ -1554,21 +1512,6 @@ Paste Rotation text_enabled_color="1 1 1 1" top_pad="5" width="87" /> - <button - top_delta="0" - left_pad="5" - height="19" - width="20" - follows="top|right" - layout="topleft" - tab_stop="false" - image_bottom_pad="1" - image_overlay="Copy" - image_hover_unselected="Toolbar_Middle_Over" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - name="copy_size_btn" - tool_tip="Copy Size" /> <spinner follows="left|top" height="19" @@ -1577,28 +1520,13 @@ Paste Rotation label="Y" label_width="10" layout="topleft" - left="10" + left_delta="0" max_val="64" min_val="0.01" name="Scale Y" text_enabled_color="1 1 1 1" top_pad="3" width="87" /> - <button - top_delta="0" - left_pad="5" - height="19" - width="20" - follows="top|right" - layout="topleft" - tab_stop="false" - image_bottom_pad="1" - image_overlay="Paste" - image_hover_unselected="Toolbar_Middle_Over" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - name="paste_size_btn" - tool_tip="Paste Size" /> <spinner follows="left|top" height="19" @@ -1607,7 +1535,7 @@ Paste Rotation label="Z" label_width="10" layout="topleft" - left="10" + left_delta="0" max_val="64" min_val="0.01" name="Scale Z" @@ -1642,21 +1570,6 @@ Paste Rotation text_enabled_color="1 1 1 1" top_pad="5" width="87" /> - <button - top_delta="0" - left_pad="5" - height="19" - width="20" - follows="top|right" - layout="topleft" - tab_stop="false" - image_bottom_pad="1" - image_overlay="Copy" - image_hover_unselected="Toolbar_Middle_Over" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - name="copy_rot_btn" - tool_tip="Copy Rotation" /> <spinner decimal_digits="2" follows="left|top" @@ -1666,28 +1579,13 @@ Paste Rotation label="Y" label_width="10" layout="topleft" - left="10" + left_delta="0" max_val="9999" min_val="-9999" name="Rot Y" text_enabled_color="1 1 1 1" top_pad="3" width="87" /> - <button - top_delta="0" - left_pad="5" - height="19" - width="20" - follows="top|right" - layout="topleft" - tab_stop="false" - image_bottom_pad="1" - image_overlay="Paste" - image_hover_unselected="Toolbar_Middle_Over" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - name="paste_rot_btn" - tool_tip="Paste Rotation" /> <spinner decimal_digits="2" follows="left|top" @@ -1697,7 +1595,7 @@ Paste Rotation label="Z" label_width="10" layout="topleft" - left="10" + left_delta="0" max_val="9999" min_val="-9999" name="Rot Z" @@ -1710,52 +1608,18 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="label basetype" top="5" width="150"> Prim Type </text>--> - <button - follows="top|right" - height="23" - label="Copy" - layout="topleft" - left="135" - name="copy_params_btn" - tool_tip="Copy Parameters to Clipboard" - top="6" - width="53"> - </button> - <button - follows="top|right" - height="23" - label="Paste" - layout="topleft" - left_pad="5" - name="paste_params_btn" - tool_tip="Paste Parameters from Clipboard" - width="53"> - </button> - <menu_button - menu_filename="menu_build_paste.xml" - follows="top|left" - height="23" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="OptionsMenu_Off" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - layout="topleft" - left_pad="5" - name="paste_gear_btn" - tool_tip="Paste options" - width="31"/> <combo_box height="19" layout="topleft" name="comboBaseType" - top_pad="5" - left="135" + top="6" + left="125" width="150"> <combo_box.item label="Box" @@ -1834,7 +1698,7 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="text hollow" top_pad="6" width="68"> @@ -1858,7 +1722,7 @@ Paste Rotation increment="5" initial_value="0" layout="topleft" - left="135" + left="125" max_val="95" name="Scale 1" top_pad="4" @@ -1882,7 +1746,7 @@ Paste Rotation follows="left|top" height="15" layout="topleft" - left="135" + left="125" name="Hollow Shape" top_pad="4" width="150"> @@ -1960,7 +1824,7 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="scale_taper" top_pad="3" width="150"> @@ -2013,7 +1877,7 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="text topshear" top_pad="3" width="141"> @@ -2056,7 +1920,7 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="advanced_cut" top_pad="3" width="150"> @@ -2120,7 +1984,7 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="text taper2" top_pad="3" width="150"> @@ -2163,7 +2027,7 @@ Paste Rotation follows="left|top" height="10" layout="topleft" - left="135" + left="125" name="text radius delta" top_pad="2" width="78"> @@ -2188,7 +2052,7 @@ Paste Rotation increment="0.05" initial_value="0" layout="topleft" - left="135" + left="125" min_val="-1" name="Radius Offset" top_pad="4" @@ -2213,7 +2077,7 @@ Paste Rotation height="141" label="Sculpt Texture" layout="topleft" - left="135" + left="125" name="sculpt texture control" tool_tip="Click to choose a picture" top="70" @@ -2671,7 +2535,7 @@ Paste Rotation top_pad="8" width="132" /> </panel> - <panel + <panel label="Texture" help_topic="toolbox_texture_tab" name="Texture" diff --git a/indra/newview/skins/default/xui/en/menu_build_paste.xml b/indra/newview/skins/default/xui/en/menu_build_paste.xml deleted file mode 100644 index acbef528b8..0000000000 --- a/indra/newview/skins/default/xui/en/menu_build_paste.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<toggleable_menu - layout="topleft" - name="Conversation Gear Menu"> - <menu_item_check - label="Prim Parameters" - layout="topleft" - name="Parametric"> - <on_check function="BuildObject.PasteCheckItem" parameter="Parametric" /> - <on_click function="BuildObject.PasteDoToSelected" parameter="Parametric" /> - <on_enable function="BuildObject.PasteEnable" parameter="Parametric" /> - </menu_item_check> - <menu_item_check - label="Flexible" - layout="topleft" - name="Flexible"> - <on_check function="BuildObject.PasteCheckItem" parameter="Flexible" /> - <on_click function="BuildObject.PasteDoToSelected" parameter="Flexible" /> - <on_enable function="BuildObject.PasteEnable" parameter="Flexible" /> - </menu_item_check> - <menu_item_check - label="Physics" - layout="topleft" - name="Physics"> - <on_check function="BuildObject.PasteCheckItem" parameter="Physics" /> - <on_click function="BuildObject.PasteDoToSelected" parameter="Physics" /> - <on_enable function="BuildObject.PasteEnable" parameter="Physics" /> - </menu_item_check> - <menu_item_check - label="Light" - layout="topleft" - name="Light"> - <on_check function="BuildObject.PasteCheckItem" parameter="Light" /> - <on_click function="BuildObject.PasteDoToSelected" parameter="Light" /> - <on_enable function="BuildObject.PasteEnable" parameter="Light" /> - </menu_item_check> -</toggleable_menu> - |