Merge branch 'V2Baking' of git://github.com/Shyotl/SingularityViewer into V2Baking

Conflicts:
	indra/llrender/llshadermgr.cpp
	indra/newview/llmorphview.cpp
	indra/newview/lltexlayer.cpp
	indra/newview/lltexlayer.h
	indra/newview/lltoolmorph.cpp
	indra/newview/llvoavatar.cpp
	indra/newview/llvoavatar.h
This commit is contained in:
Siana Gearz
2012-01-06 14:18:46 +01:00
35 changed files with 3377 additions and 3609 deletions

View File

@@ -587,8 +587,8 @@ void handle_mesh_load_obj(void*);
void handle_morph_save_obj(void*);
void handle_morph_load_obj(void*);
void handle_debug_avatar_textures(void*);
void handle_grab_texture(void*);
BOOL enable_grab_texture(void*);
void handle_grab_baked_texture(void*);
BOOL enable_grab_baked_texture(void*);
void handle_dump_region_object_cache(void*);
BOOL menu_ui_enabled(void *user_data);
@@ -1650,12 +1650,12 @@ void init_debug_avatar_menu(LLMenuGL* menu)
void init_debug_baked_texture_menu(LLMenuGL* menu)
{
menu->append(new LLMenuItemCallGL("Iris", handle_grab_texture, enable_grab_texture, (void*) TEX_EYES_BAKED));
menu->append(new LLMenuItemCallGL("Head", handle_grab_texture, enable_grab_texture, (void*) TEX_HEAD_BAKED));
menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_texture, enable_grab_texture, (void*) TEX_UPPER_BAKED));
menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_texture, enable_grab_texture, (void*) TEX_LOWER_BAKED));
menu->append(new LLMenuItemCallGL("Skirt", handle_grab_texture, enable_grab_texture, (void*) TEX_SKIRT_BAKED));
menu->append(new LLMenuItemCallGL("Hair", handle_grab_texture, enable_grab_texture, (void*) TEX_HAIR_BAKED));
menu->append(new LLMenuItemCallGL("Iris", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_EYES));
menu->append(new LLMenuItemCallGL("Head", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_HEAD));
menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_UPPER));
menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_LOWER));
menu->append(new LLMenuItemCallGL("Skirt", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_SKIRT));
menu->append(new LLMenuItemCallGL("Hair", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_HAIR));
menu->createJumpKeys();
}
@@ -3048,9 +3048,9 @@ class LLAvatarDebug : public view_listener_t
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
if( avatar )
if( avatar == gAgentAvatarp )
{
avatar->dumpLocalTextures();
gAgentAvatarp->dumpLocalTextures();
// <edit> hell no don't tell them about that
/*
llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl;
@@ -8270,10 +8270,9 @@ void slow_mo_animations(void*)
void handle_dump_avatar_local_textures(void*)
{
LLVOAvatar* avatar = gAgentAvatarp;
if( avatar )
if( isAgentAvatarValid() )
{
avatar->dumpLocalTextures();
gAgentAvatarp->dumpLocalTextures();
}
}
@@ -8697,106 +8696,79 @@ void handle_debug_avatar_textures(void*)
// </edit>
}
void handle_grab_texture(void* data)
void handle_grab_baked_texture(void* data)
{
ETextureIndex index = (ETextureIndex)((intptr_t)data);
LLVOAvatar* avatar = gAgentAvatarp;
if ( avatar )
EBakedTextureIndex baked_tex_index = (EBakedTextureIndex)((intptr_t)data);
if (!isAgentAvatarValid()) return;
const LLUUID& asset_id = gAgentAvatarp->grabBakedTexture(baked_tex_index);
LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type));
if(folder_id.notNull())
{
const LLUUID& asset_id = avatar->grabLocalTexture(index);
LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
LLUUID folder_id(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE));
if(folder_id.notNull())
{
std::string name = "Baked ";
switch (index)
std::string name;
name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_tex_index)->mNameCapitalized + " Texture";
LLUUID item_id;
item_id.generate();
LLPermissions perm;
perm.init(gAgentID,
gAgentID,
LLUUID::null,
LLUUID::null);
U32 next_owner_perm = PERM_MOVE | PERM_TRANSFER;
perm.initMasks(PERM_ALL,
PERM_ALL,
PERM_NONE,
PERM_NONE,
next_owner_perm);
time_t creation_date_now = time_corrected();
LLPointer<LLViewerInventoryItem> item
= new LLViewerInventoryItem(item_id,
folder_id,
perm,
asset_id,
asset_type,
inv_type,
name,
LLStringUtil::null,
LLSaleInfo::DEFAULT,
LLInventoryItemFlags::II_FLAGS_NONE,
creation_date_now);
item->updateServer(TRUE);
gInventory.updateItem(item);
gInventory.notifyObservers();
LLInventoryView* view = LLInventoryView::getActiveInventory();
// Show the preview panel for textures to let
// user know that the image is now in inventory.
if(view)
{
case TEX_EYES_BAKED:
name.append("Iris");
break;
case TEX_HEAD_BAKED:
name.append("Head");
break;
case TEX_UPPER_BAKED:
name.append("Upper Body");
break;
case TEX_LOWER_BAKED:
name.append("Lower Body");
break;
case TEX_SKIRT_BAKED:
name.append("Skirt");
break;
case TEX_HAIR_BAKED:
name.append("Hair");
break;
default:
name.append("Unknown");
break;
}
name.append(" Texture");
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
LLUUID item_id;
item_id.generate();
LLPermissions perm;
perm.init(gAgentID,
gAgentID,
LLUUID::null,
LLUUID::null);
U32 next_owner_perm = PERM_MOVE | PERM_TRANSFER;
perm.initMasks(PERM_ALL,
PERM_ALL,
PERM_NONE,
PERM_NONE,
next_owner_perm);
time_t creation_date_now = time_corrected();
LLPointer<LLViewerInventoryItem> item
= new LLViewerInventoryItem(item_id,
folder_id,
perm,
asset_id,
asset_type,
inv_type,
name,
LLStringUtil::null,
LLSaleInfo::DEFAULT,
LLInventoryItemFlags::II_FLAGS_NONE,
creation_date_now);
item->updateServer(TRUE);
gInventory.updateItem(item);
gInventory.notifyObservers();
LLInventoryView* view = LLInventoryView::getActiveInventory();
// Show the preview panel for textures to let
// user know that the image is now in inventory.
if(view)
{
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
view->getPanel()->openSelected();
//LLInventoryView::dumpSelectionInformation((void*)view);
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus_ctrl);
}
}
else
{
llwarns << "Can't find a folder to put it in" << llendl;
view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
view->getPanel()->openSelected();
//LLInventoryView::dumpSelectionInformation((void*)view);
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus_ctrl);
}
}
else
{
llwarns << "Can't find a folder to put it in" << llendl;
}
}
BOOL enable_grab_texture(void* data)
BOOL enable_grab_baked_texture(void* data)
{
ETextureIndex index = (ETextureIndex)((intptr_t)data);
LLVOAvatar* avatar = gAgentAvatarp;
if ( avatar )
EBakedTextureIndex index = (EBakedTextureIndex)((intptr_t)data);
if (isAgentAvatarValid())
{
return avatar->canGrabLocalTexture(index);
return gAgentAvatarp->canGrabBakedTexture(index);
}
return FALSE;
}
@@ -9034,12 +9006,11 @@ void handle_buy_currency_test(void*)
void handle_rebake_textures(void*)
{
LLVOAvatar* avatar = gAgentAvatarp;
if (!avatar) return;
if (!isAgentAvatarValid()) return;
// Slam pending upload count to "unstick" things
bool slam_for_debug = true;
avatar->forceBakeAllTextures(slam_for_debug);
gAgentAvatarp->forceBakeAllTextures(slam_for_debug);
}
void toggle_visibility(void* user_data)