enhanced XML archetype dumping, added to per-avatar menus
parent
259857b34e
commit
2b2fd9e975
|
|
@ -1600,7 +1600,14 @@ 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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "llaudioengine.h"
|
||||
#include "noise.h"
|
||||
|
|
@ -7762,11 +7763,35 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
|
|||
dirtyMesh();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLVOAvatar::dumpArchetypeXML( void* )
|
||||
void LLVOAvatar::dumpArchetypeXML(const std::string& filename )
|
||||
{
|
||||
std::string outfilename(filename);
|
||||
if (outfilename.empty())
|
||||
{
|
||||
std::string fullname = getFullname();
|
||||
if (!fullname.empty())
|
||||
{
|
||||
typedef std::map<std::string,S32> file_num_type;
|
||||
static file_num_type file_nums;
|
||||
file_num_type::iterator it = file_nums.find(fullname);
|
||||
S32 num = 0;
|
||||
if (it != file_nums.end())
|
||||
{
|
||||
num = it->second;
|
||||
}
|
||||
std::ostringstream temp;
|
||||
temp << std::setw(4) << std::setfill('0') << num;
|
||||
file_nums[fullname] = num+1;
|
||||
outfilename = fullname + " " + temp.str() + ".xml";
|
||||
}
|
||||
}
|
||||
if (outfilename.empty())
|
||||
{
|
||||
outfilename = std::string("new archetype.xml");
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
@ -7782,12 +7807,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) &&
|
||||
|
|
@ -7803,7 +7828,7 @@ void LLVOAvatar::dumpArchetypeXML( void* )
|
|||
if (LLVOAvatarDictionary::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;
|
||||
|
|
|
|||
|
|
@ -710,7 +710,9 @@ public:
|
|||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL getIsAppearanceAnimating() const { return mAppearanceAnimating; }
|
||||
BOOL isUsingBakedTextures() const { return mUseServerBakes; } // e.g. false if in appearance edit mode
|
||||
BOOL isUsingBakedTextures() const { return mUseServerBakes; } // e.g. false if in appearance edit mode
|
||||
BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; }
|
||||
|
||||
private:
|
||||
BOOL mAppearanceAnimating;
|
||||
LLFrameTimer mAppearanceMorphTimer;
|
||||
|
|
@ -1014,7 +1016,7 @@ private:
|
|||
// General
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
static void dumpArchetypeXML(void*);
|
||||
void dumpArchetypeXML(const std::string& filename);
|
||||
static void dumpBakedStatus();
|
||||
const std::string getBakedStatusForPrintout() const;
|
||||
void dumpAvatarTEs(const std::string& context) const;
|
||||
|
|
|
|||
|
|
@ -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="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Zoom In"
|
||||
name="Zoom In">
|
||||
|
|
|
|||
|
|
@ -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="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
<menu_item_separator
|
||||
layout="topleft" />
|
||||
<menu_item_call
|
||||
|
|
|
|||
|
|
@ -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="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Zoom In"
|
||||
name="Zoom In">
|
||||
|
|
|
|||
|
|
@ -261,4 +261,20 @@
|
|||
<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="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="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
</context_menu>
|
||||
|
|
|
|||
|
|
@ -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="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Find On Map"
|
||||
name="find_on_map">
|
||||
|
|
|
|||
|
|
@ -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="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
|
|
|
|||
Loading…
Reference in New Issue