svn merge -r137024:137071 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/avatar-pipeline-14-seraph into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3

Bugs: EXT-1785 EXT-1818 EXT-1820 EXT-1845
master
Loren Shih 2009-10-23 15:21:49 +00:00
parent 9c3ae7a243
commit 584962d5c7
22 changed files with 276 additions and 204 deletions

View File

@ -65,10 +65,4 @@
icon_name="inv_folder_outfit_undershirt.tga"
allowed="undershirt"
/>
<ensemble
asset_num="47"
xui_name="outfit"
icon_name="inv_folder_outfit.tga"
allowed="outfit"
/>
</ensemble_defs>

View File

@ -794,22 +794,12 @@ const LLUUID LLAgentWearables::getWearableAssetID(EWearableType type, U32 index)
return LLUUID();
}
// Warning: include_linked_items = TRUE makes this operation expensive.
BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id, BOOL include_linked_items) const
BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const
{
if (getWearableFromItemID(item_id) != NULL) return TRUE;
if (include_linked_items)
const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id);
if (getWearableFromItemID(base_item_id) != NULL)
{
LLInventoryModel::item_array_t item_array;
gInventory.collectLinkedItems(item_id, item_array);
for (LLInventoryModel::item_array_t::iterator iter = item_array.begin();
iter != item_array.end();
iter++)
{
LLViewerInventoryItem *linked_item = (*iter);
const LLUUID &linked_item_id = linked_item->getUUID();
if (getWearableFromItemID(linked_item_id) != NULL) return TRUE;
}
return TRUE;
}
return FALSE;
}
@ -1395,8 +1385,9 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem
for (S32 i=max_entry; i>=0; i--)
{
LLWearable* old_wearable = getWearable(type,i);
gInventory.addChangedMask(LLInventoryObserver::LABEL, getWearableItemID(type,i));
const LLUUID &item_id = getWearableItemID(type,i);
popWearable(type,i);
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
//queryWearableCache(); // moved below
if (old_wearable)
@ -1410,8 +1401,9 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem
{
LLWearable* old_wearable = getWearable(type, index);
gInventory.addChangedMask(LLInventoryObserver::LABEL, getWearableItemID(type,index));
const LLUUID &item_id = getWearableItemID(type,index);
popWearable(type, index);
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
//queryWearableCache(); // moved below
@ -1479,7 +1471,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
}
gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
// Assumes existing wearables are not dirty.
if (old_wearable->isDirty())
{
@ -1501,7 +1492,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
{
// MULTI_WEARABLE: assuming 0th
LLWearable* wearable = getWearable((EWearableType)i, 0);
gInventory.addChangedMask(LLInventoryObserver::LABEL, getWearableItemID((EWearableType)i,0));
const LLUUID &item_id = getWearableItemID((EWearableType)i,0);
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
if (wearable)
{
wearables_being_removed.push_back(wearable);

View File

@ -70,7 +70,7 @@ protected:
// Queries
//--------------------------------------------------------------------
public:
BOOL isWearingItem(const LLUUID& item_id, const BOOL include_linked_items = FALSE) const;
BOOL isWearingItem(const LLUUID& item_id) const;
BOOL isWearableModifiable(EWearableType type, U32 index /*= 0*/) const;
BOOL isWearableCopyable(EWearableType type, U32 index /*= 0*/) const;
BOOL areWearablesLoaded() const;
@ -79,7 +79,6 @@ public:
// Note: False for shape, skin, eyes, and hair, unless you have MORE than 1.
bool canWearableBeRemoved(const LLWearable* wearable) const;
//--------------------------------------------------------------------
// Accessors

View File

@ -350,13 +350,15 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
}
/* static */ LLUUID LLAppearanceManager::getCOF()
/* static */
LLUUID LLAppearanceManager::getCOF()
{
return gInventory.findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT);
}
// Update appearance from outfit folder.
/* static */ void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, bool append)
/* static */
void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, bool append)
{
if (!proceed)
return;
@ -381,7 +383,8 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
}
// Append to current COF contents by recursively traversing a folder.
/* static */ void LLAppearanceManager::updateCOFFromCategory(const LLUUID& category, bool append)
/* static */
void LLAppearanceManager::updateCOFFromCategory(const LLUUID& category, bool append)
{
// BAP consolidate into one "get all 3 types of descendents" function, use both places.
LLInventoryModel::item_array_t wear_items;
@ -473,8 +476,9 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
}
}
/* static */ void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb)
/* static */
void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
@ -517,13 +521,15 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
}
}
/* static */ bool LLAppearanceManager::isMandatoryWearableType(EWearableType type)
/* static */
bool LLAppearanceManager::isMandatoryWearableType(EWearableType type)
{
return (type==WT_SHAPE) || (type==WT_SKIN) || (type== WT_HAIR) || (type==WT_EYES);
}
// For mandatory body parts.
/* static */ void LLAppearanceManager::checkMandatoryWearableTypes(const LLUUID& category, std::set<EWearableType>& types_found)
/* static */
void LLAppearanceManager::checkMandatoryWearableTypes(const LLUUID& category, std::set<EWearableType>& types_found)
{
LLInventoryModel::cat_array_t new_cats;
LLInventoryModel::item_array_t new_items;
@ -548,7 +554,8 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
// with contents of new category. This means preserving any mandatory
// body parts that aren't present in the new category, and getting rid
// of everything else.
/* static */ void LLAppearanceManager::purgeCOFBeforeRebuild(const LLUUID& category)
/* static */
void LLAppearanceManager::purgeCOFBeforeRebuild(const LLUUID& category)
{
// See which mandatory body types are present in the new category.
std::set<EWearableType> wt_types_found;
@ -580,7 +587,8 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
}
// Replace COF contents from a given outfit folder.
/* static */ void LLAppearanceManager::rebuildCOFFromOutfit(const LLUUID& category)
/* static */
void LLAppearanceManager::rebuildCOFFromOutfit(const LLUUID& category)
{
lldebugs << "rebuildCOFFromOutfit()" << llendl;
@ -688,7 +696,8 @@ void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder,
// dec_busy_count();
}
/* static */ void LLAppearanceManager::updateAppearanceFromCOF()
/* static */
void LLAppearanceManager::updateAppearanceFromCOF()
{
dumpCat(getCOF(),"COF, start");
@ -739,7 +748,7 @@ void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder,
LLDynamicArray<LLFoundData*> found_container;
for(S32 i = 0; i < wear_items.count(); ++i)
{
found = new LLFoundData(wear_items.get(i)->getUUID(),
found = new LLFoundData(wear_items.get(i)->getLinkedUUID(), // Wear the base item, not the link
wear_items.get(i)->getAssetUUID(),
wear_items.get(i)->getName(),
wear_items.get(i)->getType());
@ -770,7 +779,7 @@ void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder,
/* static */
void LLAppearanceManager::getCOFValidDescendents(const LLUUID& category,
LLInventoryModel::item_array_t& items)
LLInventoryModel::item_array_t& items)
{
LLInventoryModel::cat_array_t cats;
LLFindCOFValidItems is_cof_valid;
@ -783,11 +792,12 @@ void LLAppearanceManager::getCOFValidDescendents(const LLUUID& category,
follow_folder_links);
}
/* static */ void LLAppearanceManager::getUserDescendents(const LLUUID& category,
LLInventoryModel::item_array_t& wear_items,
LLInventoryModel::item_array_t& obj_items,
LLInventoryModel::item_array_t& gest_items,
bool follow_folder_links)
/* static */
void LLAppearanceManager::getUserDescendents(const LLUUID& category,
LLInventoryModel::item_array_t& wear_items,
LLInventoryModel::item_array_t& obj_items,
LLInventoryModel::item_array_t& gest_items,
bool follow_folder_links)
{
LLInventoryModel::cat_array_t wear_cats;
LLFindWearables is_wearable;

View File

@ -151,6 +151,13 @@ void LLAvatarPropertiesProcessor::sendAvatarGroupsRequest(const LLUUID& avatar_i
sendGenericRequest(avatar_id, APT_GROUPS, "avatargroupsrequest");
}
void LLAvatarPropertiesProcessor::sendAvatarTexturesRequest(const LLUUID& avatar_id)
{
sendGenericRequest(avatar_id, APT_TEXTURES, "avatartexturesrequest");
// No response expected.
removePendingRequest(avatar_id, APT_TEXTURES);
}
void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props)
{
llinfos << "Sending avatarinfo update" << llendl;

View File

@ -52,7 +52,8 @@ enum EAvatarProcessorType
APT_NOTES,
APT_GROUPS,
APT_PICKS,
APT_PICK_INFO
APT_PICK_INFO,
APT_TEXTURES
};
struct LLAvatarData
@ -160,6 +161,7 @@ public:
void sendAvatarPicksRequest(const LLUUID& avatar_id);
void sendAvatarNotesRequest(const LLUUID& avatar_id);
void sendAvatarGroupsRequest(const LLUUID& avatar_id);
void sendAvatarTexturesRequest(const LLUUID& avatar_id);
// Duplicate pick info requests are not suppressed.
void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id);

View File

@ -81,16 +81,24 @@ static void update_texture_ctrl(LLVOAvatar* avatarp,
ETextureIndex te)
{
LLUUID id = IMG_DEFAULT_AVATAR;
EWearableType wearable_type = LLVOAvatarDictionary::getInstance()->getTEWearableType(te);
LLWearable *wearable = gAgentWearables.getWearable(wearable_type, 0);
if (wearable)
const LLVOAvatarDictionary::TextureEntry* tex_entry = LLVOAvatarDictionary::getInstance()->getTexture(te);
if (tex_entry->mIsLocalTexture)
{
LLLocalTextureObject *lto = wearable->getLocalTextureObject(te);
if (lto)
const EWearableType wearable_type = tex_entry->mWearableType;
LLWearable *wearable = gAgentWearables.getWearable(wearable_type, 0);
if (wearable)
{
id = lto->getID();
LLLocalTextureObject *lto = wearable->getLocalTextureObject(te);
if (lto)
{
id = lto->getID();
}
}
}
else
{
id = avatarp->getTE(te)->getID();
}
//id = avatarp->getTE(te)->getID();
if (id == IMG_DEFAULT_AVATAR)
{

View File

@ -586,7 +586,6 @@ void LLFloaterProperties::onCommitName()
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.updateLinkedObjects(new_item->getUUID());
gInventory.notifyObservers();
}
else

View File

@ -238,8 +238,7 @@ void LLInvFVBridge::renameLinkedItems(const LLUUID &item_id, const std::string&
return;
}
LLInventoryModel::item_array_t item_array;
model->collectLinkedItems(item_id, item_array);
LLInventoryModel::item_array_t item_array = model->collectLinkedItems(item_id);
for (LLInventoryModel::item_array_t::iterator iter = item_array.begin();
iter != item_array.end();
iter++)
@ -1242,7 +1241,6 @@ BOOL LLItemBridge::renameItem(const std::string& new_name)
buildDisplayName(new_item, mDisplayName);
new_item->updateServer(FALSE);
model->updateItem(new_item);
model->updateLinkedObjects(item->getUUID());
model->notifyObservers();
}
@ -1292,7 +1290,7 @@ BOOL LLItemBridge::isItemCopyable() const
return FALSE;
}
if( avatarp->isWearingAttachment( mUUID, TRUE ) )
if(avatarp->isWearingAttachment(mUUID))
{
return FALSE;
}
@ -1416,7 +1414,7 @@ BOOL LLFolderBridge::isItemRemovable()
if( (item->getType() == LLAssetType::AT_CLOTHING) ||
(item->getType() == LLAssetType::AT_BODYPART) )
{
if( gAgentWearables.isWearingItem( item->getUUID(), TRUE ) )
if(gAgentWearables.isWearingItem(item->getUUID()))
{
return FALSE;
}
@ -1424,7 +1422,7 @@ BOOL LLFolderBridge::isItemRemovable()
else
if( item->getType() == LLAssetType::AT_OBJECT )
{
if( avatar->isWearingAttachment( item->getUUID(), TRUE ) )
if(avatar->isWearingAttachment(item->getUUID()))
{
return FALSE;
}
@ -2207,7 +2205,6 @@ BOOL LLFolderBridge::renameItem(const std::string& new_name)
new_cat->rename(new_name);
new_cat->updateServer(FALSE);
model->updateCategory(new_cat);
model->updateLinkedObjects(cat->getUUID());
model->notifyObservers();
}
@ -2855,11 +2852,11 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
case LLAssetType::AT_CLOTHING:
case LLAssetType::AT_BODYPART:
is_movable = !gAgentWearables.isWearingItem(inv_item->getUUID(), TRUE);
is_movable = !gAgentWearables.isWearingItem(inv_item->getUUID());
break;
case LLAssetType::AT_OBJECT:
is_movable = !avatar->isWearingAttachment(inv_item->getUUID(), TRUE);
is_movable = !avatar->isWearingAttachment(inv_item->getUUID());
break;
default:
break;
@ -3769,7 +3766,7 @@ BOOL LLObjectBridge::isItemRemovable()
{
LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
if(!avatar) return FALSE;
if(avatar->isWearingAttachment(mUUID, TRUE)) return FALSE;
if(avatar->isWearingAttachment(mUUID)) return FALSE;
return LLInvFVBridge::isItemRemovable();
}
@ -3818,16 +3815,13 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model
else if ("detach" == action)
{
LLInventoryItem* item = gInventory.getItem(mUUID);
// In case we clicked on a link, detach the base object instead of the link.
LLInventoryItem* base_item = gInventory.getItem(item->getLinkedUUID());
if(base_item)
if(item)
{
gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv);
gMessageSystem->nextBlockFast(_PREHASH_ObjectData );
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
gMessageSystem->addUUIDFast(_PREHASH_ItemID, base_item->getUUID() );
gMessageSystem->sendReliable( gAgent.getRegion()->getHost() );
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
gMessageSystem->sendReliable( gAgent.getRegion()->getHost());
}
// this object might have been selected, so let the selection manager know it's gone now
LLViewerObject *found_obj =
@ -4080,7 +4074,6 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name)
buildDisplayName(new_item, mDisplayName);
new_item->updateServer(FALSE);
model->updateItem(new_item);
model->updateLinkedObjects(item->getUUID());
model->notifyObservers();
@ -4180,10 +4173,8 @@ void remove_inventory_category_from_avatar( LLInventoryCategory* category )
struct OnRemoveStruct
{
LLUUID mUUID;
LLFolderView *mFolderToDeleteSelected;
OnRemoveStruct(const LLUUID& uuid, LLFolderView *fv = NULL):
mUUID(uuid),
mFolderToDeleteSelected(fv)
OnRemoveStruct(const LLUUID& uuid):
mUUID(uuid)
{
}
};
@ -4295,7 +4286,7 @@ BOOL LLWearableBridge::renameItem(const std::string& new_name)
BOOL LLWearableBridge::isItemRemovable()
{
if (gAgentWearables.isWearingItem(mUUID, TRUE)) return FALSE;
if (gAgentWearables.isWearingItem(mUUID)) return FALSE;
return LLInvFVBridge::isItemRemovable();
}
@ -4339,24 +4330,11 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
LLViewerInventoryItem* item = getItem();
if (item)
{
if (item->getIsLinkType() &&
model->isObjectDescendentOf(mUUID,LLAppearanceManager::getCOF()))
{
// Delete link after item has been taken off.
LLWearableList::instance().getAsset(item->getAssetUUID(),
item->getName(),
item->getType(),
LLWearableBridge::onRemoveFromAvatarArrived,
new OnRemoveStruct(mUUID, folder));
}
else
{
LLWearableList::instance().getAsset(item->getAssetUUID(),
item->getName(),
item->getType(),
LLWearableBridge::onRemoveFromAvatarArrived,
new OnRemoveStruct(mUUID));
}
LLWearableList::instance().getAsset(item->getAssetUUID(),
item->getName(),
item->getType(),
LLWearableBridge::onRemoveFromAvatarArrived,
new OnRemoveStruct(mUUID));
}
}
}
@ -4684,7 +4662,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
void* userdata)
{
OnRemoveStruct *on_remove_struct = (OnRemoveStruct*) userdata;
LLUUID item_id = on_remove_struct->mUUID;
const LLUUID &item_id = gInventory.getLinkedItemID(on_remove_struct->mUUID);
if(wearable)
{
if( gAgentWearables.isWearingItem( item_id ) )
@ -4700,10 +4678,20 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
}
}
}
if (on_remove_struct->mFolderToDeleteSelected)
// Find and remove this item from the COF.
LLInventoryModel::item_array_t items = gInventory.collectLinkedItems(item_id, LLAppearanceManager::getCOF());
llassert(items.size() == 1); // Should always have one and only one item linked to this in the COF.
for (LLInventoryModel::item_array_t::const_iterator iter = items.begin();
iter != items.end();
++iter)
{
on_remove_struct->mFolderToDeleteSelected->removeSelectedItems();
const LLViewerInventoryItem *linked_item = (*iter);
const LLUUID &item_id = linked_item->getUUID();
gInventory.purgeObject(item_id);
}
gInventory.notifyObservers();
delete on_remove_struct;
}

View File

@ -507,8 +507,12 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
}
}
void LLInventoryModel::updateLinkedObjects(const LLUUID& object_id)
void LLInventoryModel::updateLinkedItems(const LLUUID& object_id)
{
const LLInventoryObject *obj = getObject(object_id);
if (!obj || obj->getIsLinkType())
return;
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
LLLinkedItemIDMatches is_linked_item_match(object_id);
@ -536,16 +540,31 @@ void LLInventoryModel::updateLinkedObjects(const LLUUID& object_id)
notifyObservers();
}
void LLInventoryModel::collectLinkedItems(const LLUUID& id,
item_array_t& items)
const LLUUID& LLInventoryModel::getLinkedItemID(const LLUUID& object_id) const
{
const LLInventoryItem *item = gInventory.getItem(object_id);
if (!item)
{
return object_id;
}
// Find the base item in case this a link (if it's not a link,
// this will just be inv_item_id)
return item->getLinkedUUID();
}
LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID& id,
const LLUUID& start_folder_id)
{
item_array_t items;
LLInventoryModel::cat_array_t cat_array;
LLLinkedItemIDMatches is_linked_item_match(id);
collectDescendentsIf(gInventory.getRootFolderID(),
collectDescendentsIf((start_folder_id == LLUUID::null ? gInventory.getRootFolderID() : start_folder_id),
cat_array,
items,
LLInventoryModel::INCLUDE_TRASH,
is_linked_item_match);
return items;
}
// Generates a string containing the path to the item specified by
@ -909,8 +928,7 @@ void LLInventoryModel::purgeLinkedObjects(const LLUUID &id)
return;
}
LLInventoryModel::item_array_t item_array;
collectLinkedItems(id, item_array);
LLInventoryModel::item_array_t item_array = collectLinkedItems(id);
for (LLInventoryModel::item_array_t::iterator iter = item_array.begin();
iter != item_array.end();
@ -1131,6 +1149,13 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
{
mChangedItemIDs.insert(referent);
}
// Update all linked items. Starting with just LABEL because I'm
// not sure what else might need to be accounted for this.
if (mModifyMask & LLInventoryObserver::LABEL)
{
updateLinkedItems(referent);
}
}
// This method to prepares a set of mock inventory which provides

View File

@ -190,10 +190,13 @@ public:
// Collect all items in inventory that are linked to item_id.
// Assumes item_id is itself not a linked item.
void collectLinkedItems(const LLUUID& item_id,
item_array_t& items);
// Updates all linked objects pointing to this id.
void updateLinkedObjects(const LLUUID& object_id);
item_array_t collectLinkedItems(const LLUUID& item_id,
const LLUUID& start_folder_id = LLUUID::null);
// Updates all linked items pointing to this id.
void updateLinkedItems(const LLUUID& object_id);
// Get the inventoryID that this item points to, else just return item_id
const LLUUID& getLinkedItemID(const LLUUID& object_id) const;
// The inventory model usage is sensitive to the initial construction of the
// model.

View File

@ -1905,7 +1905,7 @@ BOOL LLToolDragAndDrop::isInventoryGroupGiveAcceptable(LLInventoryItem* item)
switch(item->getType())
{
case LLAssetType::AT_OBJECT:
if(my_avatar->isWearingAttachment(item->getUUID(), TRUE))
if(my_avatar->isWearingAttachment(item->getUUID()))
{
acceptable = FALSE;
}

View File

@ -657,7 +657,6 @@ void LLViewerInventoryCategory::changeType(LLAssetType::EType new_folder_type)
setPreferredType(new_folder_type);
gInventory.addChangedMask(LLInventoryObserver::LABEL, folder_id);
gInventory.updateLinkedObjects(folder_id);
}
///----------------------------------------------------------------------------

View File

@ -6918,7 +6918,7 @@ void handle_debug_avatar_textures(void*)
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
if (objectp)
{
LLFloaterReg::showInstance( "avatar_tetures", LLSD(objectp->getID()) );
LLFloaterReg::showInstance( "avatar_textures", LLSD(objectp->getID()) );
}
}

View File

@ -43,6 +43,7 @@
#include "llagent.h" // Get state values from here
#include "llagentwearables.h"
#include "llanimationstates.h"
#include "llavatarpropertiesprocessor.h"
#include "llviewercontrol.h"
#include "lldrawpoolavatar.h"
#include "lldriverparam.h"
@ -5792,9 +5793,38 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
loading = TRUE;
}
updateRuthTimer(loading);
return processFullyLoadedChange(loading);
}
void LLVOAvatar::updateRuthTimer(bool loading)
{
if (isSelf() || !loading)
{
return;
}
if (mPreviousFullyLoaded)
{
mRuthTimer.reset();
}
const F32 LOADING_TIMEOUT = 120.f;
if (mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT)
{
/*
llinfos << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' "
<< "( Params loaded : " << !visualParamWeightsAreDefault() << " ) "
<< "( Lower : " << isTextureDefined(TEX_LOWER_BAKED) << " ) "
<< "( Upper : " << isTextureDefined(TEX_UPPER_BAKED) << " ) "
<< "( Head : " << isTextureDefined(TEX_HEAD_BAKED) << " )."
<< llendl;
*/
LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID());
mRuthTimer.reset();
}
}
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
{
// we wait a little bit before giving the all clear,

View File

@ -195,7 +195,6 @@ public:
public:
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
bool isBuilt() const { return mIsBuilt; }
private:
BOOL mSupportsAlphaLayers; // For backwards compatibility, TRUE for 1.23+ clients
@ -247,15 +246,18 @@ public:
//--------------------------------------------------------------------
public:
BOOL isFullyLoaded() const;
protected:
virtual BOOL updateIsFullyLoaded();
BOOL processFullyLoadedChange(bool loading);
void updateRuthTimer(bool loading);
private:
BOOL mFullyLoaded;
BOOL mPreviousFullyLoaded;
BOOL mFullyLoadedInitialized;
S32 mFullyLoadedFrameCounter;
LLFrameTimer mFullyLoadedTimer;
LLFrameTimer mRuthTimer;
/** State
** **
*******************************************************************************/
@ -800,7 +802,6 @@ public:
BOOL isSitting(){return mIsSitting;}
void sitOnObject(LLViewerObject *sit_object);
void getOffObject();
private:
// set this property only with LLVOAvatar::sitDown method
BOOL mIsSitting;

View File

@ -61,14 +61,17 @@ LLVOAvatarDictionary::Textures::Textures()
addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERSHIRT));
addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERPANTS));
addEntry(TEX_SKIRT, new TextureEntry("skirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", WT_SKIRT));
addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA));
addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA));
addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA));
addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA));
addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA));
addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO));
addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO));
addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO));
addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD));
addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER));
addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER));

View File

@ -975,11 +975,9 @@ void LLVOAvatarSelf::wearableUpdated( EWearableType type )
//-----------------------------------------------------------------------------
// isWearingAttachment()
//-----------------------------------------------------------------------------
// Warning: include_linked_items = TRUE makes this operation expensive.
BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id, BOOL include_linked_items) const
BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const
{
const LLUUID& base_inv_item_id = getBaseAttachmentObject(inv_item_id);
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@ -990,30 +988,6 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id, BOOL include
return TRUE;
}
}
if (include_linked_items)
{
LLInventoryModel::item_array_t item_array;
gInventory.collectLinkedItems(base_inv_item_id, item_array);
for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
iter != item_array.end();
++iter)
{
const LLViewerInventoryItem *linked_item = (*iter);
const LLUUID &item_id = linked_item->getUUID();
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
{
const LLViewerJointAttachment* attachment = iter->second;
if (attachment->getAttachedObject(item_id))
{
return TRUE;
}
}
}
}
return FALSE;
}
@ -1022,7 +996,7 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id, BOOL include
//-----------------------------------------------------------------------------
LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
{
const LLUUID& base_inv_item_id = getBaseAttachmentObject(inv_item_id);
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@ -1038,7 +1012,7 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const
{
const LLUUID& base_inv_item_id = getBaseAttachmentObject(inv_item_id);
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@ -1076,7 +1050,6 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view
LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:");
LLAppearanceManager::wearItem(item,false); // Add COF link for item.
gInventory.addChangedMask(LLInventoryObserver::LABEL, attachment_id);
gInventory.updateLinkedObjects(attachment_id);
}
}
gInventory.notifyObservers();
@ -1123,24 +1096,12 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
// BAP - needs to change for label to track link.
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
gInventory.updateLinkedObjects(item_id);
gInventory.notifyObservers();
return TRUE;
}
return FALSE;
}
const LLUUID& LLVOAvatarSelf::getBaseAttachmentObject(const LLUUID &object_id) const
{
const LLInventoryItem *item = gInventory.getItem(object_id);
if (!item)
return LLUUID::null;
// Find the base object in case this a link (if it's not a link,
// this will just be inv_item_id)
return item->getLinkedUUID();
}
void LLVOAvatarSelf::getAllAttachmentsArray(LLDynamicArray<S32>& attachments)
{
for (LLVOAvatar::attachment_map_t::const_iterator iter = mAttachmentPoints.begin();

View File

@ -276,14 +276,12 @@ protected:
//--------------------------------------------------------------------
public:
void updateAttachmentVisibility(U32 camera_mode);
BOOL isWearingAttachment(const LLUUID& inv_item_id, BOOL include_linked_items = FALSE) const;
BOOL isWearingAttachment(const LLUUID& inv_item_id) const;
LLViewerObject* getWornAttachment(const LLUUID& inv_item_id);
const std::string getAttachedPointName(const LLUUID& inv_item_id) const;
/*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object);
/*virtual*/ BOOL detachObject(LLViewerObject *viewer_object);
void getAllAttachmentsArray(LLDynamicArray<S32>& attachments);
protected:
const LLUUID& getBaseAttachmentObject(const LLUUID &object_id) const;
//--------------------------------------------------------------------
// HUDs

View File

@ -74,21 +74,8 @@ LLWearableList::~LLWearableList()
mList.clear();
}
void LLWearableList::getAsset(const LLAssetID& _assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata)
void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata)
{
LLAssetID assetID = _assetID;
// A bit of a hack since wearables database doesn't contain asset types...
// Perform indirection in case this assetID is in fact a link. This only works
// because of the assumption that all assetIDs and itemIDs are unique (i.e.
// no assetID is also used as an itemID elsewhere); therefore if the assetID
// exists as an itemID in the user's inventory, then this must be a link.
const LLInventoryItem *linked_item = gInventory.getItem(_assetID);
if (linked_item)
{
assetID = linked_item->getAssetUUID();
asset_type = linked_item->getType();
}
llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) );
LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL );
if( instance )

View File

@ -5,7 +5,7 @@
name="avatar_texture_debug"
help_topic="avatar_texture_debug"
title="Avatar Textures"
width="960">
width="1250">
<floater.string
name="InvalidAvatar">
INVALID AVATAR
@ -41,6 +41,7 @@
name="Dump"
top_delta="1"
width="150" />
<texture_picker
height="143"
label="Hair"
@ -54,9 +55,18 @@
label="Hair"
layout="topleft"
left_pad="7"
name="hair"
name="hair_grain"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Hair Alpha"
layout="topleft"
left_pad="7"
name="hair_alpha"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Head"
@ -70,9 +80,26 @@
label="Makeup"
layout="topleft"
left_pad="7"
name="head bodypaint"
name="head_bodypaint"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Head Alpha"
layout="topleft"
left_pad="7"
name="head_alpha"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Head Tattoo"
layout="topleft"
left_pad="7"
name="head_tattoo"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Eyes"
@ -86,9 +113,18 @@
label="Eye"
layout="topleft"
left_pad="7"
name="iris"
name="eyes_iris"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Eyes Alpha"
layout="topleft"
left_pad="7"
name="eyes_alpha"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Upper Body"
@ -99,10 +135,10 @@
width="128" />
<texture_picker
height="143"
label="Upper Body Tattoo"
label="Upper Body Bodypaint"
layout="topleft"
left_pad="7"
name="upper bodypaint"
name="upper_bodypaint"
top_delta="0"
width="128" />
<texture_picker
@ -110,7 +146,7 @@
label="Undershirt"
layout="topleft"
left_pad="7"
name="undershirt"
name="upper_undershirt"
top_delta="0"
width="128" />
<texture_picker
@ -118,7 +154,7 @@
label="Gloves"
layout="topleft"
left_pad="7"
name="gloves"
name="upper_gloves"
top_delta="0"
width="128" />
<texture_picker
@ -126,7 +162,7 @@
label="Shirt"
layout="topleft"
left_pad="7"
name="shirt"
name="upper_shirt"
top_delta="0"
width="128" />
<texture_picker
@ -134,9 +170,26 @@
label="Upper Jacket"
layout="topleft"
left_pad="7"
name="upper jacket"
name="upper_jacket"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Upper Alpha"
layout="topleft"
left_pad="7"
name="upper_alpha"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Upper Tattoo"
layout="topleft"
left_pad="7"
name="upper_tattoo"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Lower Body"
@ -147,10 +200,10 @@
width="128" />
<texture_picker
height="143"
label="Lower Body Tattoo"
label="Lower Body Bodypaint"
layout="topleft"
left_pad="7"
name="lower bodypaint"
name="lower_bodypaint"
top_delta="0"
width="128" />
<texture_picker
@ -158,7 +211,7 @@
label="Underpants"
layout="topleft"
left_pad="7"
name="underpants"
name="lower_underpants"
top_delta="0"
width="128" />
<texture_picker
@ -166,7 +219,7 @@
label="Socks"
layout="topleft"
left_pad="7"
name="socks"
name="lower_socks"
top_delta="0"
width="128" />
<texture_picker
@ -174,7 +227,7 @@
label="Shoes"
layout="topleft"
left_pad="7"
name="shoes"
name="lower_shoes"
top_delta="0"
width="128" />
<texture_picker
@ -182,7 +235,7 @@
label="Pants"
layout="topleft"
left_pad="7"
name="pants"
name="lower_pants"
top_delta="0"
width="128" />
<texture_picker
@ -190,9 +243,26 @@
label="Jacket"
layout="topleft"
left_pad="7"
name="lower jacket"
name="lower_jacket"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Lower Alpha"
layout="topleft"
left_pad="7"
name="lower_alpha"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Lower Tattoo"
layout="topleft"
left_pad="7"
name="lower_tattoo"
top_delta="0"
width="128" />
<texture_picker
height="143"
label="Skirt"
@ -209,4 +279,5 @@
name="skirt"
top_delta="0"
width="128" />
</floater>

View File

@ -2925,7 +2925,8 @@
function="Advanced.GrabBakedTexture"
parameter="iris" />
<menu_item_call.on_enable
function="Advanced.EnableGrabBakedTexture" />
function="Advanced.EnableGrabBakedTexture"
parameter="iris" />
</menu_item_call>
<menu_item_call
label="Head"
@ -2935,7 +2936,8 @@
function="Advanced.GrabBakedTexture"
parameter="head" />
<menu_item_call.on_enable
function="Advanced.EnableGrabBakedTexture" />
function="Advanced.EnableGrabBakedTexture"
parameter="head" />
</menu_item_call>
<menu_item_call
label="Upper Body"
@ -2945,7 +2947,8 @@
function="Advanced.GrabBakedTexture"
parameter="upper" />
<menu_item_call.on_enable
function="Advanced.EnableGrabBakedTexture" />
function="Advanced.EnableGrabBakedTexture"
parameter="upper" />
</menu_item_call>
<menu_item_call
label="Lower Body"
@ -2955,7 +2958,8 @@
function="Advanced.GrabBakedTexture"
parameter="lower" />
<menu_item_call.on_enable
function="Advanced.EnableGrabBakedTexture" />
function="Advanced.EnableGrabBakedTexture"
parameter="lower" />
</menu_item_call>
<menu_item_call
label="Skirt"
@ -2965,17 +2969,8 @@
function="Advanced.GrabBakedTexture"
parameter="skirt" />
<menu_item_call.on_enable
function="Advanced.EnableGrabBakedTexture" />
</menu_item_call>
<menu_item_call
label="Skirt"
layout="topleft"
name="Hair">
<menu_item_call.on_click
function="Advanced.GrabBakedTexture"
parameter="hair" />
<menu_item_call.on_enable
function="Advanced.EnableGrabBakedTexture" />
function="Advanced.EnableGrabBakedTexture"
parameter="skirt" />
</menu_item_call>
</menu>
<menu