Merge sunshine -> sunshine-experimental

master
Don Kjer 2012-09-13 22:14:53 +00:00
commit 5bb8962c4e
16 changed files with 162 additions and 12 deletions

View File

@ -1046,7 +1046,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
// If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings.
// Do not touch!!!
mesh->setColor( 1.0f, 1.0f, 1.0f, 1.0f );
mesh->setColor( LLColor4::white );
LLPolyMesh *poly_mesh = NULL;

View File

@ -208,6 +208,11 @@ void LLAvatarJointMesh::setColor( F32 red, F32 green, F32 blue, F32 alpha )
mColor[3] = alpha;
}
void LLAvatarJointMesh::setColor( const LLColor4& color )
{
mColor = color;
}
//--------------------------------------------------------------------
// LLAvatarJointMesh::getTexture()

View File

@ -101,6 +101,7 @@ public:
// Sets the shape color
void setColor( F32 red, F32 green, F32 blue, F32 alpha );
void setColor( const LLColor4& color );
// Sets the shininess
void setSpecular( const LLColor4& color, F32 shiny ) { /*mSpecular = color;*/ mShiny = shiny; };

0
indra/llappearance/llwearable.cpp Normal file → Executable file
View File

View File

@ -1948,6 +1948,17 @@
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>DebugAvatarCompositeBaked</key>
<map>
<key>Comment</key>
<string>Colorize avatar meshes based on baked/composite state.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DebugBeaconLineWidth</key>
<map>

View File

@ -1596,11 +1596,26 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t
///////////////////////
class LLAdvancedEnableAppearanceToXML : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
return gSavedSettings.getBOOL("DebugAvatarCompositeBaked");
}
};
class LLAdvancedAppearanceToXML : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
LLVOAvatar::dumpArchetypeXML(NULL);
std::string emptyname;
LLVOAvatar* avatar =
find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
if (!avatar)
{
avatar = gAgentAvatarp;
}
avatar->dumpArchetypeXML(emptyname);
return true;
}
};
@ -8452,6 +8467,7 @@ void initialize_menus()
// Advanced > Character > Character Tests
view_listener_t::addMenu(new LLAdvancedAppearanceToXML(), "Advanced.AppearanceToXML");
view_listener_t::addMenu(new LLAdvancedEnableAppearanceToXML(), "Advanced.EnableAppearanceToXML");
view_listener_t::addMenu(new LLAdvancedToggleCharacterGeometry(), "Advanced.ToggleCharacterGeometry");
view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale");

View File

@ -320,6 +320,15 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp)
if (!avatarp || !viewer_avatar) return;
if (!viewer_avatar->isValid()) return;
#if 1
if (!viewer_avatar->isUsingLocalAppearance())
{
return;
}
#endif
ESex old_sex = avatarp->getSex();
LLWearable::writeToAvatar(avatarp);

View File

@ -30,6 +30,7 @@
#include <stdio.h>
#include <ctype.h>
#include <sstream>
#include "llaudioengine.h"
#include "noise.h"
@ -5568,7 +5569,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
{
mesh->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
mesh->setColor( color );
}
}
}
@ -5838,6 +5839,10 @@ void LLVOAvatar::updateMeshTextures()
if (mesh)
{
mesh->setTexture( baked_img );
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
{
mesh->setColor(LLColor4::red);
}
}
}
}
@ -5874,6 +5879,26 @@ void LLVOAvatar::updateMeshTextures()
if (mesh)
{
mesh->setLayerSet( layerset );
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
{
mesh->setColor( LLColor4::yellow );
}
}
}
}
else
{
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
{
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
for (; iter != end; ++iter)
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
{
mesh->setColor( LLColor4::blue );
}
}
}
}
@ -5893,7 +5918,7 @@ void LLVOAvatar::updateMeshTextures()
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
{
mesh->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
mesh->setColor( color );
mesh->setTexture( hair_img );
}
}
@ -6252,6 +6277,7 @@ bool LLVOAvatar::visualParamWeightsAreDefault()
//-----------------------------------------------------------------------------
void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
{
dumpArchetypeXML("process_start");
if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages"))
{
llwarns << "Blocking AvatarAppearance message" << llendl;
@ -6275,7 +6301,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
// llinfos << "processAvatarAppearance end " << mID << llendl;
return;
}
clearVisualParamWeights();
}
dumpArchetypeXML("process_post_clear");
ESex old_sex = getSex();
@ -6395,6 +6423,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
}
}
dumpArchetypeXML("process_post_set_weights");
const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
if (num_blocks != expected_tweakable_count)
{
@ -6459,6 +6489,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
updateMeshTextures();
dumpArchetypeXML("process_end");
// llinfos << "processAvatarAppearance end " << mID << llendl;
}
@ -6660,6 +6691,10 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
if (mesh)
{
mesh->setTexture( image_baked );
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
{
mesh->setColor( LLColor4::green );
}
}
}
if (mBakedTextureDatas[i].mTexLayerSet)
@ -6686,7 +6721,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
{
mesh->setColor( 1.f, 1.f, 1.f, 1.f );
mesh->setColor( LLColor4::white );
}
}
}
@ -6696,11 +6731,33 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
dirtyMesh();
}
// static
void LLVOAvatar::dumpArchetypeXML( void* )
void LLVOAvatar::dumpArchetypeXML(const std::string& prefix )
{
std::string outprefix(prefix);
if (outprefix.empty())
{
outprefix = getFullname();
}
if (outprefix.empty())
{
outprefix = std::string("new_archetype");
}
typedef std::map<std::string,S32> file_num_type;
static file_num_type file_nums;
file_num_type::iterator it = file_nums.find(outprefix);
S32 num = 0;
if (it != file_nums.end())
{
num = it->second;
}
std::ostringstream temp;
temp << std::setw(4) << std::setfill('0') << num;
file_nums[outprefix] = num+1;
std::string outfilename = outprefix + " " + temp.str() + ".xml";
std::replace(outfilename.begin(),outfilename.end(),' ','_');
LLAPRFile outfile;
outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"new archetype.xml"), LL_APR_WB );
outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,outfilename), LL_APR_WB );
apr_file_t* file = outfile.getFileHandle();
if (!file)
{
@ -6716,12 +6773,12 @@ void LLVOAvatar::dumpArchetypeXML( void* )
apr_file_printf( file, "\n\t<archetype name=\"???\">\n" );
// only body parts, not clothing.
for (S32 type = LLWearableType::WT_SHAPE; type <= LLWearableType::WT_EYES; type++)
for (S32 type = LLWearableType::WT_SHAPE; type <= LLWearableType::WT_COUNT; type++)
{
const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type);
apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() );
for (LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam())
for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam())
{
LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
if( (viewer_param->getWearableType() == type) &&
@ -6737,7 +6794,7 @@ void LLVOAvatar::dumpArchetypeXML( void* )
if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type)
{
// MULTIPLE_WEARABLES: extend to multiple wearables?
LLViewerTexture* te_image = ((LLVOAvatar *)(gAgentAvatarp))->getImage((ETextureIndex)te, 0);
LLViewerTexture* te_image = getImage((ETextureIndex)te, 0);
if( te_image )
{
std::string uuid_str;

View File

@ -636,6 +636,8 @@ public:
//--------------------------------------------------------------------
public:
BOOL getIsAppearanceAnimating() const { return mAppearanceAnimating; }
BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; }
private:
BOOL mAppearanceAnimating;
LLFrameTimer mAppearanceMorphTimer;
@ -907,7 +909,7 @@ private:
// General
//--------------------------------------------------------------------
public:
static void dumpArchetypeXML(void*);
void dumpArchetypeXML(const std::string& prefix);
static void dumpBakedStatus();
const std::string getBakedStatusForPrintout() const;
void dumpAvatarTEs(const std::string& context) const;

View File

@ -2653,6 +2653,7 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch)
gAgentCamera.changeCameraToCustomizeAvatar();
}
gAgentAvatarp->clearVisualParamWeights();
gAgentAvatarp->invalidateAll();
gAgentAvatarp->updateMeshTextures();
}

View File

@ -79,6 +79,14 @@
<menu_item_call.on_visible
function="IsGodCustomerService"/>
</menu_item_call>
<menu_item_call
label="Dump XML"
name="Dump XML">
<menu_item_call.on_click
function="Advanced.AppearanceToXML" />
<menu_item_call.on_visible
function="Advanced.EnableAppearanceToXML"/>
</menu_item_call>
<menu_item_call
label="Zoom In"
name="Zoom In">

View File

@ -123,6 +123,14 @@ name="Edit Outfit">
<menu_item_call.on_visible
function="IsGodCustomerService"/>
</menu_item_call>
<menu_item_call
label="Dump XML"
name="Dump XML">
<menu_item_call.on_click
function="Advanced.AppearanceToXML" />
<menu_item_call.on_visible
function="Advanced.EnableAppearanceToXML"/>
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_call

View File

@ -79,6 +79,14 @@
<menu_item_call.on_visible
function="IsGodCustomerService"/>
</menu_item_call>
<menu_item_call
label="Dump XML"
name="Dump XML">
<menu_item_call.on_click
function="Advanced.AppearanceToXML" />
<menu_item_call.on_visible
function="Advanced.EnableAppearanceToXML"/>
</menu_item_call>
<menu_item_call
label="Zoom In"
name="Zoom In">

View File

@ -261,4 +261,12 @@
<menu_item_call.on_visible
function="IsGodCustomerService"/>
</menu_item_call>
<menu_item_call
label="Dump XML"
name="Dump XML">
<menu_item_call.on_click
function="Advanced.AppearanceToXML" />
<menu_item_call.on_visible
function="Advanced.EnableAppearanceToXML"/>
</menu_item_call>
</context_menu>

View File

@ -112,6 +112,14 @@
<menu_item_call.on_visible
function="IsGodCustomerService"/>
</menu_item_call>
<menu_item_call
label="Dump XML"
name="Dump XML">
<menu_item_call.on_click
function="Advanced.AppearanceToXML" />
<menu_item_call.on_visible
function="Advanced.EnableAppearanceToXML"/>
</menu_item_call>
<menu_item_call
label="Find On Map"
name="find_on_map">

View File

@ -249,4 +249,12 @@
<menu_item_call.on_visible
function="IsGodCustomerService"/>
</menu_item_call>
<menu_item_call
label="Dump XML"
name="Dump XML">
<menu_item_call.on_click
function="Advanced.AppearanceToXML" />
<menu_item_call.on_visible
function="Advanced.EnableAppearanceToXML"/>
</menu_item_call>
</toggleable_menu>