From 1727c4d26429dd256fb2cd90fa83085e976794cc Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 24 Oct 2025 01:38:56 -0400 Subject: Reintroduce llappearanceutility to viewer tree from archive/develop Signed-off-by: Rye --- indra/llappearanceutility/CMakeLists.txt | 78 ++ indra/llappearanceutility/README.md | 33 + indra/llappearanceutility/appearance_utility.cpp | 66 ++ .../llappearanceutility/llappappearanceutility.cpp | 681 ++++++++++++ indra/llappearanceutility/llappappearanceutility.h | 108 ++ indra/llappearanceutility/llbakingavatar.cpp | 177 +++ indra/llappearanceutility/llbakingavatar.h | 139 +++ indra/llappearanceutility/llbakingjoint.cpp | 54 + indra/llappearanceutility/llbakingjoint.h | 44 + indra/llappearanceutility/llbakingjointmesh.cpp | 43 + indra/llappearanceutility/llbakingjointmesh.h | 45 + indra/llappearanceutility/llbakingprocess.cpp | 47 + indra/llappearanceutility/llbakingprocess.h | 60 ++ indra/llappearanceutility/llbakingshadermgr.cpp | 250 +++++ indra/llappearanceutility/llbakingshadermgr.h | 137 +++ indra/llappearanceutility/llbakingtexlayer.cpp | 373 +++++++ indra/llappearanceutility/llbakingtexlayer.h | 77 ++ indra/llappearanceutility/llbakingtexture.cpp | 81 ++ indra/llappearanceutility/llbakingtexture.h | 69 ++ indra/llappearanceutility/llbakingwearable.cpp | 77 ++ indra/llappearanceutility/llbakingwearable.h | 48 + .../llappearanceutility/llbakingwearablesdata.cpp | 131 +++ indra/llappearanceutility/llbakingwearablesdata.h | 55 + indra/llappearanceutility/llbakingwindow.cpp | 94 ++ indra/llappearanceutility/llbakingwindow.h | 45 + indra/llappearanceutility/llprocessparams.cpp | 281 +++++ indra/llappearanceutility/llprocessparams.h | 49 + indra/llappearanceutility/llprocessskin.cpp | 118 ++ indra/llappearanceutility/llprocessskin.h | 43 + indra/llappearanceutility/llprocesstexture.cpp | 285 +++++ indra/llappearanceutility/llprocesstexture.h | 63 ++ indra/llappearanceutility/tests/joint-offsets.xml | 1 + .../tests/joint-offsets.xml.output | 1 + indra/llappearanceutility/tests/params.xml | 1140 ++++++++++++++++++++ indra/llappearanceutility/tests/params.xml.output | 1 + .../llappearanceutility/tests/texture.llsd.binary | Bin 0 -> 170423 bytes .../llappearanceutility/tests/texture.llsd.output | Bin 0 -> 112866 bytes 37 files changed, 4994 insertions(+) create mode 100644 indra/llappearanceutility/CMakeLists.txt create mode 100644 indra/llappearanceutility/README.md create mode 100644 indra/llappearanceutility/appearance_utility.cpp create mode 100644 indra/llappearanceutility/llappappearanceutility.cpp create mode 100644 indra/llappearanceutility/llappappearanceutility.h create mode 100644 indra/llappearanceutility/llbakingavatar.cpp create mode 100644 indra/llappearanceutility/llbakingavatar.h create mode 100644 indra/llappearanceutility/llbakingjoint.cpp create mode 100644 indra/llappearanceutility/llbakingjoint.h create mode 100644 indra/llappearanceutility/llbakingjointmesh.cpp create mode 100644 indra/llappearanceutility/llbakingjointmesh.h create mode 100644 indra/llappearanceutility/llbakingprocess.cpp create mode 100644 indra/llappearanceutility/llbakingprocess.h create mode 100644 indra/llappearanceutility/llbakingshadermgr.cpp create mode 100644 indra/llappearanceutility/llbakingshadermgr.h create mode 100644 indra/llappearanceutility/llbakingtexlayer.cpp create mode 100644 indra/llappearanceutility/llbakingtexlayer.h create mode 100644 indra/llappearanceutility/llbakingtexture.cpp create mode 100644 indra/llappearanceutility/llbakingtexture.h create mode 100644 indra/llappearanceutility/llbakingwearable.cpp create mode 100644 indra/llappearanceutility/llbakingwearable.h create mode 100644 indra/llappearanceutility/llbakingwearablesdata.cpp create mode 100644 indra/llappearanceutility/llbakingwearablesdata.h create mode 100644 indra/llappearanceutility/llbakingwindow.cpp create mode 100644 indra/llappearanceutility/llbakingwindow.h create mode 100755 indra/llappearanceutility/llprocessparams.cpp create mode 100644 indra/llappearanceutility/llprocessparams.h create mode 100644 indra/llappearanceutility/llprocessskin.cpp create mode 100644 indra/llappearanceutility/llprocessskin.h create mode 100644 indra/llappearanceutility/llprocesstexture.cpp create mode 100644 indra/llappearanceutility/llprocesstexture.h create mode 100644 indra/llappearanceutility/tests/joint-offsets.xml create mode 100644 indra/llappearanceutility/tests/joint-offsets.xml.output create mode 100644 indra/llappearanceutility/tests/params.xml create mode 100644 indra/llappearanceutility/tests/params.xml.output create mode 100644 indra/llappearanceutility/tests/texture.llsd.binary create mode 100644 indra/llappearanceutility/tests/texture.llsd.output (limited to 'indra/llappearanceutility') diff --git a/indra/llappearanceutility/CMakeLists.txt b/indra/llappearanceutility/CMakeLists.txt new file mode 100644 index 0000000000..1d4e5309ba --- /dev/null +++ b/indra/llappearanceutility/CMakeLists.txt @@ -0,0 +1,78 @@ +# -*- cmake -*- + +project(appearance_utility) + +include(00-Common) +include(Boost) +include(LLAppearance) +include(LLCommon) +include(LLImage) +include(LLMath) +include(LLWindow) +include(Linking) + +set(appearance_utility_SOURCE_FILES + appearance_utility.cpp + llappappearanceutility.cpp + llbakingavatar.cpp + llbakingjoint.cpp + llbakingjointmesh.cpp + llbakingprocess.cpp + llbakingshadermgr.cpp + llbakingtexlayer.cpp + llbakingtexture.cpp + llbakingwearable.cpp + llbakingwearablesdata.cpp + llbakingwindow.cpp + llprocessparams.cpp + llprocessskin.cpp + llprocesstexture.cpp + ) + +set(appearance_utility_HEADER_FILES + CMakeLists.txt + llappappearanceutility.h + llbakingavatar.h + llbakingjoint.h + llbakingjointmesh.h + llbakingprocess.h + llbakingshadermgr.h + llbakingtexlayer.h + llbakingtexture.h + llbakingwearable.h + llbakingwearablesdata.h + llbakingwindow.h + llprocessparams.h + llprocessskin.h + llprocesstexture.h + ) + +set_source_files_properties(${appearance_utility_HEADER_FILES} + PROPERTIES HEADER_FILES_ONLY TRUE) + +list(APPEND appearance_utility_SOURCE_FILES ${appearance_utility_HEADER_FILES}) + +add_executable(appearance-utility-bin ${appearance_utility_SOURCE_FILES}) + +target_link_libraries(appearance-utility-bin + llcharacter + llinventory + llappearance + llwindow + llrender + llxml + ) + +if (BUILD_HEADLESS) + add_executable(appearance-utility-headless-bin ${appearance_utility_SOURCE_FILES}) + + target_link_libraries(appearance-utility-headless-bin + llcharacter + llinventory + llappearanceheadless + llwindowheadless + llrenderheadless + llxml + ) +endif (BUILD_HEADLESS) + diff --git a/indra/llappearanceutility/README.md b/indra/llappearanceutility/README.md new file mode 100644 index 0000000000..21019ffd27 --- /dev/null +++ b/indra/llappearanceutility/README.md @@ -0,0 +1,33 @@ +# llappearanceutility + +This directory contains the appearance utility employed by the bake service to process avatar textures and handle various other appearance-related functions. Please note that this utility is currently configured to build only on Linux systems. + +## Prerequisites + +Ensure the following prerequisites are met before building and testing the utility: + +- **X11 Display**: Ensure an X11 display is available, either virtual or physical, with the `DISPLAY` environment variable set appropriately (e.g., `DISPLAY=:1`). +- **Linux Build Environment**: Confirm that the Second Life Viewer can be built on your Linux system. + +## Testing + +Given the constraints with GitHub runners, we instead utilize Behavior-Driven Development (BDD) tests to evaluate the `llappearanceutility` through the bake service. For local development, test inputs and their expected outputs are provided below. + +### Test Commands + +1. **Baking Textures**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --texture /viewer/indra/llappearanceutility/tests/texture.llsd.binary > /viewer/indra/llappearanceutility/tests/texture.llsd.output + ``` + +2. **Generating Bake Parameters**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --params /viewer/indra/llappearanceutility/tests/params.xml > /viewer/indra/llappearanceutility/tests/params.xml.output + ``` + +3. **Calculating Joint Offsets**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --joint-offsets /viewer/indra/llappearanceutility/tests/joint-offsets.xml > /viewer/indra/llappearanceutility/tests/joint-offsets.xml.output + ``` + +These commands will execute the utility with specific test inputs and direct the output to corresponding files for validation. \ No newline at end of file diff --git a/indra/llappearanceutility/appearance_utility.cpp b/indra/llappearanceutility/appearance_utility.cpp new file mode 100644 index 0000000000..88034cd171 --- /dev/null +++ b/indra/llappearanceutility/appearance_utility.cpp @@ -0,0 +1,66 @@ +/** + * @file appearance_utility.cpp + * @author Don Kjer , Nyx Linden + * @brief Utility for processing avatar appearance without a full viewer implementation. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" +#include "llapr.h" + +// project includes +#include "llappappearanceutility.h" + +int main(int argc, char** argv) +{ + // Create an application instance. + ll_init_apr(); + LLAppAppearanceUtility* app = new LLAppAppearanceUtility(argc, argv); + + // Assume success, unless exception is thrown. + EResult rv = RV_SUCCESS; + try + { + // Process command line and initialize system. + if (app->init()) + { + // Run process. + app->frame(); + } + } + catch (LLAppException& e) + { + // Deal with errors. + rv = e.getStatusCode(); + } + + // Clean up application instance. + app->cleanup(); + delete app; + ll_cleanup_apr(); + + return (int) rv; +} + + diff --git a/indra/llappearanceutility/llappappearanceutility.cpp b/indra/llappearanceutility/llappappearanceutility.cpp new file mode 100644 index 0000000000..d223c859ab --- /dev/null +++ b/indra/llappearanceutility/llappappearanceutility.cpp @@ -0,0 +1,681 @@ +/** + * @file llappappearanceutility.cpp + * @brief Implementation of LLAppAppearanceUtility class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include +#include +#include +#include "boost/bind.hpp" + +// linden includes +#include "linden_common.h" + +#include "llapr.h" +#include "llerrorcontrol.h" +#include "llfasttimer.h" +#include "llgl.h" +#include "llmd5.h" +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llquantize.h" +#include "lltreeiterators.h" +#include "v3color.h" +#include "llwindow.h" +#include "lltrace.h" + +// appearance includes +#include "llavatarappearance.h" +#include "llwearabletype.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingprocess.h" +#include "llprocessparams.h" +#include "llprocesstexture.h" +#include "llprocessskin.h" + +const std::string NOTHING_EXTRA(""); + +//////////////////////////////////////////// +// LLAppException +//////////////////////////////////////////// + +static const std::string MESSAGE_RV_UNKNOWN("Unknown error."); +static const std::string MESSAGE_RV_ARGUMENTS +("Invalid arguments: "); +static const std::string MESSAGE_RV_UNABLE_OPEN("Unable to open file: "); +static const std::string MESSAGE_RV_UNABLE_TO_PARSE("Unable to parse input LLSD."); +static const std::string MESSAGE_RV_UNABLE_TO_DECODE("Unable to decode input J2C."); +static const std::string MESSAGE_RV_UNABLE_TO_ENCODE("Unable to encode output J2C."); +static const std::string MESSAGE_RV_UNABLE_TO_INIT_GL("Unable to initialize GL."); +static const std::string MESSAGE_RV_UNABLE_TO_BAKE("Unable to bake texture."); +static const std::string MESSAGE_RV_INVALID_SKIN_BLOCK("Invalid skin block."); +static const std::string MESSAGE_DUPLICATE_MODES = "Cannot specify more than one process mode."; + + +LLAppException::LLAppException(EResult status_code, const std::string& extra) : + mStatusCode(status_code) +{ + switch(status_code) + { + case RV_UNKNOWN_ERROR: + printErrorLLSD("unknown", MESSAGE_RV_UNKNOWN); + case RV_BAD_ARGUMENTS: + printErrorLLSD("arguments", MESSAGE_RV_ARGUMENTS + extra); + break; + case RV_UNABLE_OPEN: + printErrorLLSD("file", MESSAGE_RV_UNABLE_OPEN + extra); + break; + case RV_UNABLE_TO_PARSE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_PARSE + extra); + break; + case RV_UNABLE_TO_DECODE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_DECODE + extra); + break; + case RV_UNABLE_TO_ENCODE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_ENCODE + extra); + break; + case RV_UNABLE_TO_INIT_GL: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_INIT_GL + extra); + break; + case RV_UNABLE_TO_BAKE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_BAKE + extra); + break; + case RV_INVALID_SKIN_BLOCK: + printErrorLLSD("input", MESSAGE_RV_INVALID_SKIN_BLOCK + extra); + break; + default: + printErrorLLSD("arguments", "Unknown exception."); + break; + } +} + +void LLAppException::printErrorLLSD(const std::string& key, const std::string& message) +{ + LLSD error_llsd; + error_llsd["success"] = false; + error_llsd["error"]["key"] = key; + error_llsd["error"]["message"] = message; + + std::cerr << LLSDOStreamer(error_llsd); +} + + + +//////////////////////////////////////////// +// LLAppAppearanceUtility +//////////////////////////////////////////// + +///////// Option Parsing ///////// + +// Simple usage command. +class LLProcessUsage : public LLBakingProcess +{ +public: + LLProcessUsage(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + void process(std::ostream& output) override + { + mApp->usage(output); + } +}; + + +static const apr_getopt_option_t APPEARANCE_UTILITY_OPTIONS[] = +{ + {"params", 'p', 0, "Generate appearance parameters for an agent."}, + {"texture", 't', 0, "Generate baked texture for a slot."}, + {"output", 'o', 1, "The output file to write to. Default is stdout"}, + {"agent-id", 'a', 1, "The agent-id of the user."}, + {"bake-size", 'b', 1, "The bake texture size. eg use 512 for 512*512 textures, 1024 for 1024*1024 textures" }, + //{"grid", 'g', 1, "The grid."}, + {"debug", 'd', 0, "Enable debug spam. Default is warn/info spam only."}, + {"treemap", 'm', 1, "Output LLFrameTimer to specified file in graphviz treemap/pachwork format."}, + {"threshold", 's', 1, "Percent threshold of max LLFrameTimer time in order to appear on treemap. Default is 1%."}, + {"joint-offsets",'j',0,"Extract joint positions from skin."}, + {"help", 'h', 0, "Print the help message."}, + {0, 0, 0, 0} +}; + +void LLAppAppearanceUtility::usage(std::ostream& ostr) +{ + ostr << "Utilities for processing agent appearance data." + << std::endl << std::endl + << "Usage:" << std::endl + << "\t" << mAppName << " [options] filename" << std::endl << std::endl + << "Will read from stdin if filename is set to '-'." << std::endl << std::endl + << "Options:" << std::endl; + const apr_getopt_option_t* option = &APPEARANCE_UTILITY_OPTIONS[0]; + while(option->name) + { + ostr << "\t--" << option->name << "\t\t" + << option->description << std::endl; + ++option; + } + ostr << std::endl << "Return Values:" << std::endl + << "\t0\t\tSuccess." << std::endl + << "\t1\t\tUnknown error." << std::endl + << "\t2\t\tBad arguments." << std::endl + << "\t3\t\tUnable to open file. Possibly wrong filename" + << " or bad permissions." << std::endl + << "\t4\t\tUnable to parse input LLSD." << std::endl + << std::endl + << "Output:" << std::endl + << "If a non-zero status code is returned, additional error information" + << " will be returned on stderr." << std::endl + << "* This will be in the form of an LLSD document." << std::endl + << "* Check ['error']['message'] to get a human readable message." << std::endl + << "If a zero status code is returned, processed output will be written" + << " to the file specified by --out (or stdout, if not specified)." << std::endl + << std::endl + << std::endl; +} + + +/////// LLApp Interface //////// + +LLAppAppearanceUtility::LLAppAppearanceUtility(int argc, char** argv) : + LLApp(), + mArgc(argc), + mArgv(argv), + mProcess(nullptr), + mInput(nullptr), + mOutput(nullptr), + mAppName(argv[0]), + mDebugMode(false), + mTreeMapThreshold(1), + mBakeTextureSize(512) +{ +} + +// virtual +LLAppAppearanceUtility::~LLAppAppearanceUtility() +{ +} + +void LLAppAppearanceUtility::verifyNoProcess() +{ + if (mProcess) + { + std::cerr << "Invalid arguments. " << MESSAGE_DUPLICATE_MODES << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, MESSAGE_DUPLICATE_MODES); + } +} + +void LLAppAppearanceUtility::parseArguments() +{ + ////// BEGIN OPTION PARSING ////// + // Check for '-' as last option, since apr doesn't seem to like that. + if (std::string(mArgv[mArgc-1]) == "-") + { + mInputFilename.assign("-"); + mArgc--; + } + + apr_status_t apr_err; + const char* opt_arg = nullptr; + int opt_id = 0; + apr_getopt_t* os = nullptr; + if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, mArgc, mArgv)) + { + std::cerr << "Unable to initialize apr" << std::endl; + throw LLAppException(RV_UNKNOWN_ERROR); + } + + //std::string grid; + while(true) + { + apr_err = apr_getopt_long(os, APPEARANCE_UTILITY_OPTIONS, &opt_id, &opt_arg); + if(APR_STATUS_IS_EOF(apr_err)) break; + if(apr_err) + { + char buf[MAX_STRING]; /* Flawfinder: ignore */ + std::cerr << "Error parsing options: " + << apr_strerror(apr_err, buf, MAX_STRING) << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, buf); + } + switch (opt_id) + { + case 'h': + verifyNoProcess(); + mProcess = new LLProcessUsage(this); + break; + case 'p': + verifyNoProcess(); + mProcess = new LLProcessParams(this); + break; + case 't': + verifyNoProcess(); + mProcess = new LLProcessTexture(this); + break; + case 'j': + verifyNoProcess(); + mProcess = new LLProcessSkin( this ); + break; + case 'o': + mOutputFilename.assign(opt_arg); + break; + case 'a': + mAgentID.set(opt_arg); + if (mAgentID.isNull()) + { + const char* INVALID_AGENT_ID="agent-id must be a valid uuid."; + std::cerr << "Invalid arguments. " << INVALID_AGENT_ID << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_AGENT_ID); + } + break; + case 'b': + mBakeTextureSize = atoi(opt_arg); + break; + //case 'g': + // grid = opt_arg; + // break; + case 'd': + mDebugMode = true; + break; + case 'm': + mTreeMapFilename.assign(opt_arg); + break; + case 's': + mTreeMapThreshold = atoi(opt_arg); + break; + default: + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, "Unknown option."); + } + } + + if ("-" != mInputFilename) + { + bool valid_input_filename = false; + // Try to grab the input filename. + if (os->argv && os->argv[os->ind]) + { + mInputFilename.assign(os->argv[os->ind]); + if (! mInputFilename.empty() ) + { + valid_input_filename = true; + } + } + if (!valid_input_filename) + { + const char* INVALID_FILENAME="Must specify input file."; + std::cerr << "Invalid arguments. " << INVALID_FILENAME << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_FILENAME); + } + } + + ////// END OPTION PARSING ////// +} + +void LLAppAppearanceUtility::validateArguments() +{ + ///// BEGIN ARGUMENT VALIDATION ///// + + // Make sure we have a command specified. + if (!mProcess) + { + const char* INVALID_MODE="No process mode specified."; + std::cerr << "Invalid arguments. " << INVALID_MODE + << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_MODE); + } + + ///// END ARGUMENT VALIDATION ///// +} + +void LLAppAppearanceUtility::initializeIO() +{ + ///// BEGIN OPEN INPUT FILE //// + + if ( "-" == mInputFilename ) + { + // Read unformated data from stdin in to memory. + std::stringstream* data = new std::stringstream(); + const S32 BUFFER_SIZE = BUFSIZ; + char buffer[BUFFER_SIZE]; + while (true) + { + std::cin.read(buffer, BUFFER_SIZE); + // Check if anything out of the ordinary happened. + if (!std::cin) + { + // See if something 'really bad' happened, or if we just + // used up all of our buffer. + if (std::cin.bad()) + { + std::cerr << "Problem reading standard input." << std::endl; + delete data; + throw (RV_UNKNOWN_ERROR); + } + else + { + // Output normally. + data->write(buffer, std::cin.gcount()); + if (std::cin.eof()) break; + + // Clear this problem. We have handled it. + std::cin.clear(); + } + } + else + { + data->write(buffer, std::cin.gcount()); + if (std::cin.eof()) break; + } + } + mInput = data; + } + else + { + // Make sure we can open the input file. + std::ifstream* input_file = new std::ifstream(); + input_file->open( mInputFilename.c_str(), std::fstream::in | std::fstream::binary ); + if ( input_file->fail()) + { + std::cerr << "Couldn't open input file '" << mInputFilename << "'." << std::endl; + delete input_file; + throw LLAppException(RV_UNABLE_OPEN, mInputFilename); + } + mInput = input_file; + } + ///// END OPEN INPUT FILE //// + + ///// BEGIN OPEN OUTPUT FILE //// + + if ("" == mOutputFilename) + { + mOutput = &std::cout; + } + else + { + // Make sure we can open the output file. + std::fstream* output_file = new std::fstream(); + output_file->open( mOutputFilename.c_str(), std::fstream::out ); + if ( output_file->fail() ) + { + std::cerr << "Couldn't open output file '" << mOutputFilename << "'." << std::endl; + delete output_file; + throw LLAppException(RV_UNABLE_OPEN, mOutputFilename); + } + mOutput = output_file; + } + ///// END OPEN OUTPUT FILE //// + + ///// BEGIN INPUT PARSING //// + if (mProcess) + { + mProcess->parseInput( *mInput ); + } + ///// END INPUT PARSING //// +} + +class LLPassthroughTranslationBridge : public LLTranslationBridge +{ +public: + virtual std::string getString(const std::string &xml_desc) + { + // Just pass back the input string. + return xml_desc; + } +}; + + +bool LLAppAppearanceUtility::init() +{ + parseArguments(); + + bool log_to_stderr = true; + LLError::initForApplication(".", ".", true); + if (mDebugMode) + { + mRecording.start(); + LLError::setDefaultLevel(LLError::LEVEL_DEBUG); + } + else + { + LLError::setDefaultLevel(LLError::LEVEL_WARN); + } + + validateArguments(); + + LL_DEBUGS() << "BakeSize: " << mBakeTextureSize << LL_ENDL; + + // Initialize classes. + // Values taken from settings.xml. + const bool USE_TEXTURE_NEW_BYTE_RANGE=true; + const S32 TEXTURE_REVERSE_BYTE_RANGE=50; + LLImage::initClass(USE_TEXTURE_NEW_BYTE_RANGE, TEXTURE_REVERSE_BYTE_RANGE); + const bool SKIP_ANALYZE_ALPHA=true; + + LLTranslationBridge::ptr_t trans = std::make_shared(); + LLWearableType::initParamSingleton(trans); + + // *TODO: Create a texture bridge? + LLAvatarAppearance::initClass(); + + initializeIO(); + if (mProcess) + { + mProcess->init(); + } + return true; +} + + +void add_cluster(LLTrace::Recording& recording, std::ostream& tree, LLTrace::BlockTimerStatHandle& node, std::vector < S32 > & clusters, F64Milliseconds threshold) +{ + LLMD5 hash; + hash.update((const unsigned char*)node.getName().c_str(), node.getName().size()); + hash.finalize(); + char buf[33]; + hash.hex_digest(buf); + buf[6] = 0; + LLColor3 color(buf); + if (color.brightness() < 0.25f) + { + color.normalize(); + } + std::ostringstream color_str; + color_str << "#" << std::hex << std::setfill('0') << std::setw(2) + << (S32) F32_to_U8(color.mV[0], 0.0f, 1.0f) + << (S32) F32_to_U8(color.mV[1], 0.0f, 1.0f) + << (S32) F32_to_U8(color.mV[2], 0.0f, 1.0f); + + std::vector::iterator iter = clusters.begin(); + std::vector::iterator end = clusters.end(); + std::ostringstream padding; + for(; iter != end; ++iter) + { + padding << " "; + } + + std::ostringstream node_id; + bool first = true; + iter = clusters.begin(); + for(; iter != end; ++iter) + { + if (!first) + { + node_id << "_"; + } + first = false; + node_id << (*iter); + } + + if (node.getChildren().size() == 0) + { + F64Milliseconds leaf_time_ms(recording.getSum(node)); + if (leaf_time_ms > threshold) + { + tree << padding.str() << "n" << node_id.str() << " [" + << "label=\"" << node.getName() << " (" << leaf_time_ms.value() << ")\" " + << "fillcolor=\"" << color_str.str() << "\" " + << "area=" << leaf_time_ms.value() / 10 << "]" << std::endl; + } + } + else + { + if (clusters.size()) + { + tree << padding.str() << "subgraph cluster" << node_id.str(); + tree << " {" << std::endl; + } + + S32Milliseconds node_area(recording.getSum(node)); + std::vector::iterator child_iter = node.getChildren().begin(); + for (S32 num=0; child_iter != node.getChildren().end(); ++child_iter, ++num) + { + clusters.push_back(num); + add_cluster(recording, tree, *(*child_iter), clusters, threshold); + clusters.pop_back(); + node_area -= recording.getSum(*(*child_iter)); + } + + S32Milliseconds node_time_ms(node_area); + if (node_time_ms > threshold) + { + tree << padding.str() << "n" << node_id.str() << " [" + << "label=\"" << node.getName() << " (" << node_time_ms.value() << ")\" " + << "fillcolor=\"" << color_str.str() << "\" " + << "area=" << node_time_ms.value() / 10 << "]" << std::endl; + } + if (clusters.size()) + { + tree << padding.str() << "}" << std::endl;; + } + } +} + +bool LLAppAppearanceUtility::cleanup() +{ + if (mProcess) + { + mProcess->cleanup(); + } + + // Spam fast timer information in debug mode. + if (mDebugMode) + { + mRecording.stop(); + LLTrace::BlockTimer::processTimes(); + + S32Milliseconds max_time_ms(0); + for (LLTrace::block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(LLTrace::BlockTimer::getRootTimeBlock()); + it != LLTrace::end_block_timer_tree_df(); + ++it) + { + LLTrace::BlockTimerStatHandle* idp = (*it); + // Skip near-zero time leafs. + S32Milliseconds leaf_time_ms(mRecording.getSum(*idp)); + if (leaf_time_ms > max_time_ms) max_time_ms = leaf_time_ms; + if ((S32Milliseconds)0 == leaf_time_ms) continue; + + std::vector< LLTrace::BlockTimerStatHandle* > parents; + LLTrace::BlockTimerStatHandle* parentp = idp->getParent(); + while (parentp) + { + parents.push_back(parentp); + if (parentp->getParent() == parentp) break; + parentp = parentp->getParent(); + } + + std::ostringstream fullname; + bool is_first = true; + for ( std::vector< LLTrace::BlockTimerStatHandle* >::reverse_iterator iter = parents.rbegin(); + iter != parents.rend(); ++iter) + { + // Skip root + if (is_first) + { + is_first = false; + continue; + } + LLTrace::BlockTimerStatHandle* parent_idp = (*iter); + U32Milliseconds time_ms(mRecording.getSum(parent_idp->selfTime())); + fullname << parent_idp->getName() << " "; + fullname << "("; + if (time_ms > (U32Milliseconds)0) + { + fullname << time_ms.value() << " ms, "; + } + fullname << mRecording.getSum(parent_idp->callCount()) << " call)-> "; + } + LL_DEBUGS() << fullname.str() << LL_ENDL; + } + if (!mTreeMapFilename.empty()) + { + std::ofstream tree(mTreeMapFilename.c_str()); + tree << "graph G {" << std::endl; + tree << " node[style=filled]" << std::endl; + + LLTrace::BlockTimerStatHandle& root = LLTrace::BlockTimer::getRootTimeBlock(); + std::vector clusters; + add_cluster(mRecording, tree, root, clusters, (((F32) mTreeMapThreshold / 100.f) * max_time_ms) ); + + tree << "}" << std::endl; + + LL_DEBUGS() << "To generate a treemap of LLFrameTimer results, run:" << LL_ENDL; + LL_DEBUGS() << "patchwork " << mTreeMapFilename << " -Tpng > rendered.png" << LL_ENDL; + } + } + + LLAvatarAppearance::cleanupClass(); + LLImageGL::cleanupClass(); + LLImage::cleanupClass(); + + if (mProcess) + { + delete mProcess; + mProcess = nullptr; + } + if ("-" != mInputFilename && mInput) + { + static_cast(mInput)->close(); + } + if ("" != mOutputFilename && mOutput) + { + static_cast(mOutput)->close(); + delete mOutput; + mOutput = nullptr; + } + delete mInput; + mInput = nullptr; + return true; +} + +bool LLAppAppearanceUtility::frame() +{ + // This isn't really a loop, for this application. We just execute the requested command. + mProcess->process(*mOutput); + return true; +} + diff --git a/indra/llappearanceutility/llappappearanceutility.h b/indra/llappearanceutility/llappappearanceutility.h new file mode 100644 index 0000000000..80d1e8b1bf --- /dev/null +++ b/indra/llappearanceutility/llappappearanceutility.h @@ -0,0 +1,108 @@ +/** + * @file llappappearanceutility.h + * @brief Declaration of LLAppAppearanceUtility class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLAPPAPPEARANCEUTILITY_H +#define LL_LLAPPAPPEARANCEUTILITY_H + +#include + +#include "llapp.h" +#include "lltracerecording.h" + +enum EResult +{ + RV_SUCCESS = 0, + RV_UNKNOWN_ERROR, + RV_BAD_ARGUMENTS, + RV_UNABLE_OPEN, + RV_UNABLE_TO_PARSE, + RV_UNABLE_TO_DECODE, + RV_UNABLE_TO_ENCODE, + RV_UNABLE_TO_INIT_GL, + RV_UNABLE_TO_BAKE, + RV_INVALID_SKIN_BLOCK, +}; + +extern const std::string NOTHING_EXTRA; + +class LLAppAppearanceUtility; +class LLBakingProcess; + +// Translate error status into error messages. +class LLAppException : public std::exception +{ +public: + LLAppException(EResult status_code, const std::string& extra = NOTHING_EXTRA); + EResult getStatusCode() { return mStatusCode; } + +private: + void printErrorLLSD(const std::string& key, const std::string& message); + EResult mStatusCode; +}; + + +class LLAppAppearanceUtility : public LLApp +{ +public: + LLAppAppearanceUtility(int argc, char** argv); + virtual ~LLAppAppearanceUtility(); + + // LLApp interface. + bool init() override; + bool cleanup() override; + bool frame() override; + +private: + // Option parsing. + void verifyNoProcess(); + void parseArguments(); + void validateArguments(); + void initializeIO(); +public: + void usage(std::ostream& ostr); + bool isDebugMode() const { return mDebugMode; } + S32 bakeTextureSize() const { return mBakeTextureSize; } + +private: + int mArgc; + char** mArgv; + LLBakingProcess* mProcess; + std::istream* mInput; + std::ostream* mOutput; + std::string mAppName; + std::string mInputFilename; + std::string mOutputFilename; + LLUUID mAgentID; + S32 mBakeTextureSize; + bool mDebugMode; + LLTrace::Recording mRecording; + S32 mTreeMapThreshold; + std::string mTreeMapFilename; +}; + + +#endif /* LL_LLAPPAPPEARANCEUTILITY_H */ + diff --git a/indra/llappearanceutility/llbakingavatar.cpp b/indra/llappearanceutility/llbakingavatar.cpp new file mode 100644 index 0000000000..426fa705e9 --- /dev/null +++ b/indra/llappearanceutility/llbakingavatar.cpp @@ -0,0 +1,177 @@ +/** + * @File llbakingavatar.cpp + * @brief Implementation of LLBakingAvatar class which is a derivation of LLAvatarAppearance + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" +#include "v3dmath.h" + +// appearance includes +#include "llavatarappearancedefines.h" + +// project includes +#include "llbakingavatar.h" +#include "llbakingjoint.h" +#include "llbakingjointmesh.h" +#include "llbakingtexlayer.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingAvatar::LLBakingAvatar(LLWearableData* wearable_data,S32 bakeTextureSize) : + LLAvatarAppearance(wearable_data), + mBakeTextureSize(bakeTextureSize) +{ +} + +// virtual +LLBakingAvatar::~LLBakingAvatar() +{ +} + +//----------------------------------------------------------------------------- +// Implemented methods +//----------------------------------------------------------------------------- + +LLAvatarJoint* LLBakingAvatar::createAvatarJoint() +{ + return new LLBakingJoint(); +} + +LLAvatarJoint* LLBakingAvatar::createAvatarJoint(S32 joint_num) +{ + return new LLBakingJoint(joint_num); +} + +LLAvatarJointMesh* LLBakingAvatar::createAvatarJointMesh() +{ + return new LLBakingJointMesh(); +} + +LLTexLayerSet* LLBakingAvatar::createTexLayerSet() +{ + return new LLBakingTexLayerSet(this); +} + +void LLBakingAvatar::bakedTextureDatasAsLLSD(LLSD& sd) const +{ + bakedtexturedata_vec_t::const_iterator baked_iter = mBakedTextureDatas.begin(); + bakedtexturedata_vec_t::const_iterator baked_end = mBakedTextureDatas.end(); + for (; baked_iter != baked_end; ++baked_iter) + { + LLBakingTexLayerSet* layer_set = dynamic_cast(baked_iter->mTexLayerSet); + LLSD layer_sd; + layer_set->asLLSD(layer_sd); + sd[LLAvatarAppearance::getDictionary()->getTexture(baked_iter->mTextureIndex)->mName] = layer_sd; + } +} + +//----------------------------------------------------------------------------- +// (Ignored) Non-implemented methods. +//----------------------------------------------------------------------------- + +void LLBakingAvatar::applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, + LLAvatarAppearanceDefines::EBakedTextureIndex index) {} +void LLBakingAvatar::invalidateComposite(LLTexLayerSet* layerset) {} +void LLBakingAvatar::updateMeshTextures() {} +void LLBakingAvatar::dirtyMesh() {} +void LLBakingAvatar::dirtyMesh(S32 priority) {} +void LLBakingAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) {} + +bool LLBakingAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const +{ + return true; +} + + +//----------------------------------------------------------------------------- +// (LLERR) Non-implemented methods. +//----------------------------------------------------------------------------- + +LLVector3 LLBakingAvatar::getCharacterPosition() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +LLQuaternion LLBakingAvatar::getCharacterRotation() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLQuaternion::DEFAULT; +} + +LLVector3 LLBakingAvatar::getCharacterVelocity() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +LLVector3 LLBakingAvatar::getCharacterAngularVelocity() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +const LLUUID& LLBakingAvatar::getID() const +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLUUID::null; +} + +void LLBakingAvatar::addDebugText(const std::string& text) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; +} + +F32 LLBakingAvatar::getTimeDilation() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return 0.0f; +} + +void LLBakingAvatar::getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; +} + +F32 LLBakingAvatar::getPixelArea() const +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return 0.0f; +} + +LLVector3d LLBakingAvatar::getPosGlobalFromAgent(const LLVector3 &position) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3d::zero; +} + +LLVector3 LLBakingAvatar::getPosAgentFromGlobal(const LLVector3d &position) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + + + diff --git a/indra/llappearanceutility/llbakingavatar.h b/indra/llappearanceutility/llbakingavatar.h new file mode 100644 index 0000000000..8261dfc814 --- /dev/null +++ b/indra/llappearanceutility/llbakingavatar.h @@ -0,0 +1,139 @@ +/** + * @file llbakingavatar.h + * @brief Declaration of LLBakingAvatar class which is a derivation of LLAvatarAppearance + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGAVATAR_H +#define LL_LLBAKINGAVATAR_H + +#include "llavatarappearance.h" + +class LLBakingAvatar : public LLAvatarAppearance +{ + LOG_CLASS(LLBakingAvatar); + +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ +public: + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + + LLBakingAvatar(LLWearableData* wearable_data, S32 bakeTextureSize = 512); + virtual ~LLBakingAvatar(); + + static void initClass(); // initializes static members + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLCharacter interface + //-------------------------------------------------------------------- +public: + LLVector3 getCharacterPosition() override; + LLQuaternion getCharacterRotation() override; + LLVector3 getCharacterVelocity() override; + LLVector3 getCharacterAngularVelocity() override; + + const LLUUID& getID() const override; + void addDebugText(const std::string& text) override; + F32 getTimeDilation() override; + void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) override; + F32 getPixelArea() const override; + LLVector3d getPosGlobalFromAgent(const LLVector3 &position) override; + LLVector3 getPosAgentFromGlobal(const LLVector3d &position) override; + + //-------------------------------------------------------------------- + // LLAvatarAppearance interface + //-------------------------------------------------------------------- +public: + void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, + LLAvatarAppearanceDefines::EBakedTextureIndex index) override; + void invalidateComposite(LLTexLayerSet* layerset) override; + void updateMeshTextures() override; + void dirtyMesh() override; // Dirty the avatar mesh + void onGlobalColorChanged(const LLTexGlobalColor* global_color) override; + bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const override; + bool isUsingLocalAppearance() const override { return false; } + bool isEditingAppearance() const override { return false; } +private: + void dirtyMesh(S32 priority) override; // Dirty the avatar mesh, with priority + + // LLAvatarAppearance instance factories: +protected: + LLAvatarJoint* createAvatarJoint() override; + LLAvatarJoint* createAvatarJoint(S32 joint_num) override; + LLAvatarJointMesh* createAvatarJointMesh() override; + LLTexLayerSet* createTexLayerSet() override; + + +/** Inherited + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** STATE + **/ +public: + bool isSelf() const override { return true; } + bool isValid() const override { return true; } + +/** State + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** BAKING + **/ +public: + void bakedTextureDatasAsLLSD(LLSD& sd) const; + S32 bakeTextureSize() const { return mBakeTextureSize; } + +/** Baking + ** ** + *******************************************************************************/ + +private: + S32 mBakeTextureSize; +}; + +#endif /* LL_LLBAKINGAVATAR_H */ + diff --git a/indra/llappearanceutility/llbakingjoint.cpp b/indra/llappearanceutility/llbakingjoint.cpp new file mode 100644 index 0000000000..25edaa645f --- /dev/null +++ b/indra/llappearanceutility/llbakingjoint.cpp @@ -0,0 +1,54 @@ +/** + * @file llbakingjoint.cpp + * @brief Implementation of LLBakingJoint class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "linden_common.h" + +#include "llbakingjoint.h" + + +LLBakingJoint::LLBakingJoint() : + LLAvatarJoint() +{ +} + +LLBakingJoint::LLBakingJoint(S32 joint_num) : + LLAvatarJoint(joint_num) +{ +} + +// virtual +LLBakingJoint::~LLBakingJoint() +{ +} + +// virtual +U32 LLBakingJoint::render( F32 pixelArea, bool first_pass, bool is_dummy) +{ + LL_ERRS() << "LLBakingJoint::render() should never be called!" << LL_ENDL; + return 0; +} + diff --git a/indra/llappearanceutility/llbakingjoint.h b/indra/llappearanceutility/llbakingjoint.h new file mode 100644 index 0000000000..07e15a1d04 --- /dev/null +++ b/indra/llappearanceutility/llbakingjoint.h @@ -0,0 +1,44 @@ +/** + * @file llbakingjoint.h + * @brief Declaration of LLBakingJoint class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGJOINT_H +#define LL_LLBAKINGJOINT_H + +#include "llavatarjoint.h" + +class LLBakingJoint : public virtual LLAvatarJoint +{ +public: + LLBakingJoint(); + LLBakingJoint(S32 joint_num); + virtual ~LLBakingJoint(); + + // LLViewerJoint interface + U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) override; +}; + +#endif /* LL_LLBAKINGJOINT_H */ + diff --git a/indra/llappearanceutility/llbakingjointmesh.cpp b/indra/llappearanceutility/llbakingjointmesh.cpp new file mode 100644 index 0000000000..b8e3283df2 --- /dev/null +++ b/indra/llappearanceutility/llbakingjointmesh.cpp @@ -0,0 +1,43 @@ +/** + * @file llbakingjointmesh.cpp + * @brief Implementation of LLBakingJointMesh class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "linden_common.h" + +#include "llbakingjointmesh.h" + + +LLBakingJointMesh::LLBakingJointMesh() : + LLAvatarJointMesh() +{ +} + +// virtual +LLBakingJointMesh::~LLBakingJointMesh() +{ +} + + diff --git a/indra/llappearanceutility/llbakingjointmesh.h b/indra/llappearanceutility/llbakingjointmesh.h new file mode 100644 index 0000000000..a66bf3f61b --- /dev/null +++ b/indra/llappearanceutility/llbakingjointmesh.h @@ -0,0 +1,45 @@ +/** + * @file llbakingjoint.h + * @brief Implementation of LLBakingJointMesh class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGJOINTMESH_H +#define LL_LLBAKINGJOINTMESH_H + +#include "llavatarjointmesh.h" +#include "llbakingjoint.h" + +class LLBakingJointMesh : public LLAvatarJointMesh, public LLBakingJoint +{ +public: + LLBakingJointMesh(); + LLBakingJointMesh(S32 joint_num); + virtual ~LLBakingJointMesh(); + + U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) + { return LLBakingJoint::render(pixelArea,first_pass,is_dummy); } +}; + +#endif /* LL_LLBAKINGJOINTMESH_H */ + diff --git a/indra/llappearanceutility/llbakingprocess.cpp b/indra/llappearanceutility/llbakingprocess.cpp new file mode 100644 index 0000000000..85553b0fdb --- /dev/null +++ b/indra/llappearanceutility/llbakingprocess.cpp @@ -0,0 +1,47 @@ +/** + * @file llbakingprocess.cpp + * @brief Implementation of LLBakingProcess class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingprocess.h" + +// virtual +void LLBakingProcess::parseInput(std::istream& input) +{ + LLSDSerialize::fromXML( mInputData, input ); + if (mInputData.isUndefined()) + { + throw LLAppException(RV_UNABLE_TO_PARSE); + } +} + + diff --git a/indra/llappearanceutility/llbakingprocess.h b/indra/llappearanceutility/llbakingprocess.h new file mode 100644 index 0000000000..de38b7a36b --- /dev/null +++ b/indra/llappearanceutility/llbakingprocess.h @@ -0,0 +1,60 @@ +/** + * @file llbakingprocess.h + * @brief Declaration of LLBakingProcess interface. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGPROCESS_H +#define LL_LLBAKINGPROCESS_H + +#include + +class LLAppAppearanceUtility; +class LLSD; + +// Simple wrapper for various process modes. +class LLBakingProcess +{ +private: + // Hide default constructor. + LLBakingProcess() {} +public: + LLBakingProcess(LLAppAppearanceUtility* app) : + mApp(app) {} + virtual ~LLBakingProcess() {} + + virtual void parseInput(std::istream& input); + //virtual std::string getProcessName() const = 0; + virtual void process(std::ostream& output) = 0; + + virtual void init() {} + virtual void cleanup() {} + +protected: + LLAppAppearanceUtility* mApp; + LLSD mInputData; +}; + + +#endif /* LL_LLBAKINGPROCESS_H */ + diff --git a/indra/llappearanceutility/llbakingshadermgr.cpp b/indra/llappearanceutility/llbakingshadermgr.cpp new file mode 100644 index 0000000000..07c747a8a0 --- /dev/null +++ b/indra/llappearanceutility/llbakingshadermgr.cpp @@ -0,0 +1,250 @@ + +/** + * @file LLBakingShaderMgr.cpp + * @brief Viewer shader manager implementation. + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "linden_common.h" + +#include "llbakingshadermgr.h" + +#include "lldir.h" +#include "llfile.h" +#include "llrender.h" +#include "llvertexbuffer.h" + +#if LL_DARWIN +#include "OpenGL/OpenGL.h" +#endif + +#ifdef LL_RELEASE_FOR_DOWNLOAD +#define UNIFORM_ERRS LL_WARNS_ONCE("Shader") +#else +#define UNIFORM_ERRS LL_ERRS("Shader") +#endif + +// Lots of STL stuff in here, using namespace std to keep things more readable +using std::vector; +using std::pair; +using std::make_pair; +using std::string; + +bool LLBakingShaderMgr::sInitialized = false; +bool LLBakingShaderMgr::sSkipReload = false; + +//utility shaders +LLGLSLShader gAlphaMaskProgram; + + +LLBakingShaderMgr::LLBakingShaderMgr() : + mVertexShaderLevel(SHADER_COUNT, 0), + mMaxAvatarShaderLevel(0) +{ +} + +LLBakingShaderMgr::~LLBakingShaderMgr() +{ + mVertexShaderLevel.clear(); + mShaderList.clear(); +} + +// static +LLBakingShaderMgr * LLBakingShaderMgr::instance() +{ + if(nullptr == sInstance) + { + sInstance = new LLBakingShaderMgr(); + } + + return static_cast(sInstance); +} + +void LLBakingShaderMgr::initAttribsAndUniforms(void) +{ + if (mReservedAttribs.empty()) + { + LLShaderMgr::initAttribsAndUniforms(); + } +} + + +//============================================================================ +// Set Levels + +S32 LLBakingShaderMgr::getVertexShaderLevel(S32 type) +{ + return mVertexShaderLevel[type]; +} + +//============================================================================ +// Shader Management + +void LLBakingShaderMgr::setShaders() +{ + //setShaders might be called redundantly by gSavedSettings, so return on reentrance + static bool reentrance = false; + + if (!sInitialized || reentrance || sSkipReload) + { + return; + } + + LLGLSLShader::sIndexedTextureChannels = llmax(gGLManager.mNumTextureImageUnits, 1); + + //NEVER use more than 16 texture channels (work around for prevalent driver bug) + LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16); + + if (gGLManager.mGLSLVersionMajor < 1 || + (gGLManager.mGLSLVersionMajor == 1 && gGLManager.mGLSLVersionMinor <= 20)) + { //NEVER use indexed texture rendering when GLSL version is 1.20 or earlier + LLGLSLShader::sIndexedTextureChannels = 1; + } + + reentrance = true; + + initAttribsAndUniforms(); + + // Shaders + LL_INFOS("ShaderLoading") << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << LL_ENDL; + LL_INFOS("ShaderLoading") << llformat("Using GLSL %d.%d", gGLManager.mGLSLVersionMajor, gGLManager.mGLSLVersionMinor) << LL_ENDL; + + for (S32 i = 0; i < SHADER_COUNT; i++) + { + mVertexShaderLevel[i] = 0; + } + mMaxAvatarShaderLevel = 0; + + LLVertexBuffer::unbind(); + bool loaded = false; + if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10) + { + S32 light_class = 2; + mVertexShaderLevel[SHADER_INTERFACE] = light_class; + + // loadBasicShaders + vector< pair > shaders; + if (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30) + { + shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); + } + shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); + shaders.push_back( make_pair( "deferred/textureUtilV.glsl", 1 ) ); + loaded = true; + for (U32 i = 0; i < shaders.size(); i++) + { + // Note usage of GL_VERTEX_SHADER_ARB + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB) == 0) + { + LL_WARNS("Shader") << "Failed to load vertex shader " << shaders[i].first << LL_ENDL; + loaded = false; + break; + } + } + + shaders.clear(); + + // fragment shaders + shaders.push_back( make_pair( "deferred/globalF.glsl", 1 ) ); + + for (U32 i = 0; i < shaders.size(); i++) + { + // Note usage of GL_FRAGMENT_SHADER + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB) == 0) + { + LL_WARNS("Shader") << "Failed to load fragment shader " << shaders[i].first << LL_ENDL; + loaded = false; + break; + } + } + + if (loaded) + { + loaded = loadShadersInterface(); + } + } + + if (!loaded) + { + //gPipeline.mVertexShadersEnabled = false; + //gPipeline.mVertexShadersLoaded = 0; + mVertexShaderLevel[SHADER_LIGHTING] = 0; + mVertexShaderLevel[SHADER_INTERFACE] = 0; + mVertexShaderLevel[SHADER_ENVIRONMENT] = 0; + mVertexShaderLevel[SHADER_WATER] = 0; + mVertexShaderLevel[SHADER_OBJECT] = 0; + mVertexShaderLevel[SHADER_EFFECT] = 0; + mVertexShaderLevel[SHADER_WINDLIGHT] = 0; + mVertexShaderLevel[SHADER_AVATAR] = 0; + } + + //gPipeline.createGLBuffers(); + + reentrance = false; +} + +void LLBakingShaderMgr::unloadShaders() +{ + gAlphaMaskProgram.unload(); + + mVertexShaderLevel[SHADER_INTERFACE] = 0; + + //gPipeline.mVertexShadersLoaded = 0; +} + +bool LLBakingShaderMgr::loadShadersInterface() +{ + gAlphaMaskProgram.mName = "Alpha Mask Shader"; + gAlphaMaskProgram.mShaderFiles.clear(); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER_ARB)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + + if( !gAlphaMaskProgram.createShader() ) + { + mVertexShaderLevel[SHADER_INTERFACE] = 0; + return false; + } + + return true; +} + +std::string LLBakingShaderMgr::getShaderDirPrefix(void) +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class"); +} + +void LLBakingShaderMgr::updateShaderUniforms(LLGLSLShader * shader) +{ +} + +LLBakingShaderMgr::shader_iter LLBakingShaderMgr::beginShaders() const +{ + return mShaderList.begin(); +} + +LLBakingShaderMgr::shader_iter LLBakingShaderMgr::endShaders() const +{ + return mShaderList.end(); +} diff --git a/indra/llappearanceutility/llbakingshadermgr.h b/indra/llappearanceutility/llbakingshadermgr.h new file mode 100644 index 0000000000..60ab3f94e8 --- /dev/null +++ b/indra/llappearanceutility/llbakingshadermgr.h @@ -0,0 +1,137 @@ +/** + * @file llbakingshadermgr.h + * @brief Texture Baking Shader Manager + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_BAKING_SHADER_MGR_H +#define LL_BAKING_SHADER_MGR_H + +#include "llshadermgr.h" + +class LLBakingShaderMgr: public LLShaderMgr +{ +public: + static bool sInitialized; + static bool sSkipReload; + + LLBakingShaderMgr(); + ~LLBakingShaderMgr(); + + // singleton pattern implementation + static LLBakingShaderMgr * instance(); + + void initAttribsAndUniforms(void) override; + void setShaders(); + void unloadShaders(); + S32 getVertexShaderLevel(S32 type); + bool loadShadersInterface(); + + std::vector mVertexShaderLevel; + S32 mMaxAvatarShaderLevel; + + enum EShaderClass + { + SHADER_LIGHTING, + SHADER_OBJECT, + SHADER_AVATAR, + SHADER_ENVIRONMENT, + SHADER_INTERFACE, + SHADER_EFFECT, + SHADER_WINDLIGHT, + SHADER_WATER, + SHADER_DEFERRED, + SHADER_TRANSFORM, + SHADER_COUNT + }; + + // simple model of forward iterator + // http://www.sgi.com/tech/stl/ForwardIterator.html + class shader_iter + { + private: + friend bool operator == (shader_iter const & a, shader_iter const & b); + friend bool operator != (shader_iter const & a, shader_iter const & b); + + typedef std::vector::const_iterator base_iter_t; + public: + shader_iter() + { + } + + shader_iter(base_iter_t iter) : mIter(iter) + { + } + + LLGLSLShader & operator * () const + { + return **mIter; + } + + LLGLSLShader * operator -> () const + { + return *mIter; + } + + shader_iter & operator++ () + { + ++mIter; + return *this; + } + + shader_iter operator++ (int) + { + return mIter++; + } + + private: + base_iter_t mIter; + }; + + shader_iter beginShaders() const; + shader_iter endShaders() const; + + std::string getShaderDirPrefix(void) override; + + void updateShaderUniforms(LLGLSLShader * shader) override; + +private: + + // the list of shaders we need to propagate parameters to. + std::vector mShaderList; + +}; //LLBakingShaderMgr + +inline bool operator == (LLBakingShaderMgr::shader_iter const & a, LLBakingShaderMgr::shader_iter const & b) +{ + return a.mIter == b.mIter; +} + +inline bool operator != (LLBakingShaderMgr::shader_iter const & a, LLBakingShaderMgr::shader_iter const & b) +{ + return a.mIter != b.mIter; +} + +extern LLVector4 gShinyOrigin; + +#endif // LL_BAKING_SHADER_MGR_H diff --git a/indra/llappearanceutility/llbakingtexlayer.cpp b/indra/llappearanceutility/llbakingtexlayer.cpp new file mode 100644 index 0000000000..3427331a96 --- /dev/null +++ b/indra/llappearanceutility/llbakingtexlayer.cpp @@ -0,0 +1,373 @@ +/** + * @file llbakingtexlayer.cpp + * @brief Implementation of LLBakingTexLayer class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "indra_constants.h" +#include "llappappearanceutility.h" +#include "llavatarappearance.h" +#include "llbakingtexlayer.h" +#include "llbakingwearable.h" +#include "llfasttimer.h" +#include "lllocaltextureobject.h" +#include "llimagej2c.h" +#include "llwearabledata.h" +#include "llmd5.h" +#include "llbakingavatar.h" + +//#define DEBUG_TEXTURE_IDS 1 + +static const char* BAKE_HASH_VERSION = "3"; + +using namespace LLAvatarAppearanceDefines; + +LLBakingTexLayerSetBuffer::LLBakingTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height) + : LLTexLayerSetBuffer(owner), + LLBakingTexture( width, height, 4 ) +{} + +// virtual +LLBakingTexLayerSetBuffer::~LLBakingTexLayerSetBuffer() +{ + destroyGLTexture(); +} + +bool LLBakingTexLayerSetBuffer::render() +{ + bool result = false; + + preRenderTexLayerSet(); + result = renderTexLayerSet(nullptr); + postRenderTexLayerSet(result); + + return result; +} + +static LLFastTimer::DeclareTimer FTM_MID_RENDER("midRenderTexLayerSet"); +static LLFastTimer::DeclareTimer FTM_CREATE_J2C("Encode J2C image."); +void LLBakingTexLayerSetBuffer::midRenderTexLayerSet(bool success) +{ + LL_RECORD_BLOCK_TIME(FTM_MID_RENDER); + if (!mTexLayerSet->isVisible()) + { + // Should have used IMG_INVISIBLE during hash id generation? + LL_ERRS() << "Rendered texture for non-visible tex layer set!" << LL_ENDL; + } + + if (!success) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Rendering process failed."); + } + + // Get the COLOR information from our texture + LL_DEBUGS() << "glReadPixels..." << LL_ENDL; + LL_DEBUGS() << "getCompositeWidth()" << getCompositeWidth() << "getCompositeHeight()" << getCompositeHeight() << LL_ENDL; + + U8* baked_color_data = new U8[ getCompositeWidth() * getCompositeHeight() * 4 ]; + glReadPixels(getCompositeOriginX(), getCompositeOriginY(), + getCompositeWidth(), getCompositeHeight(), + GL_RGBA, GL_UNSIGNED_BYTE, baked_color_data ); + stop_glerror(); + + // Get the MASK information from our texture + LLGLSUIDefault gls_ui; + LL_DEBUGS() << "Creating baked mask image raw.." << LL_ENDL; + LLPointer baked_mask_image = new LLImageRaw(getCompositeWidth(), getCompositeHeight(), 1 ); + U8* baked_mask_data = baked_mask_image->getData(); + + LL_DEBUGS() << "Gathering Morph Mask Alpha..." << LL_ENDL; + mTexLayerSet->gatherMorphMaskAlpha(baked_mask_data, + getCompositeOriginX(), getCompositeOriginY(), + getCompositeWidth(), getCompositeHeight(), nullptr); + + // Create the baked image from our color and mask information + const S32 baked_image_components = 5; // red green blue [bump] clothing + LL_DEBUGS() << "Creating baked image raw.." << LL_ENDL; + LLPointer baked_image = new LLImageRaw( getCompositeWidth(), getCompositeHeight(), baked_image_components ); + U8* baked_image_data = baked_image->getData(); + S32 i = 0; + LL_DEBUGS() << "Running ugly loop..." << LL_ENDL; + for (S32 u=0; u < getCompositeWidth(); u++) + { + for (S32 v=0; v < getCompositeHeight(); v++) + { + baked_image_data[5*i + 0] = baked_color_data[4*i + 0]; + baked_image_data[5*i + 1] = baked_color_data[4*i + 1]; + baked_image_data[5*i + 2] = baked_color_data[4*i + 2]; + baked_image_data[5*i + 3] = baked_color_data[4*i + 3]; // alpha should be correct for eyelashes. + baked_image_data[5*i + 4] = baked_mask_data[i]; + i++; + } + } + + { + LL_RECORD_BLOCK_TIME(FTM_CREATE_J2C); + LL_DEBUGS() << "Creating J2C..." << LL_ENDL; + mCompressedImage = new LLImageJ2C; + const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask) + if (!mCompressedImage->encode(baked_image, comment_text)) + { + throw LLAppException(RV_UNABLE_TO_ENCODE); + } + } + + delete [] baked_color_data; +} + +LLBakingTexLayerSet::LLBakingTexLayerSet(LLAvatarAppearance* const appearance) : + LLTexLayerSet(appearance) +{ +} + +// virtual +LLBakingTexLayerSet::~LLBakingTexLayerSet() +{ +} + +// Ignored. +void LLBakingTexLayerSet::requestUpdate() +{ +} + +void LLBakingTexLayerSet::createComposite() +{ + if(!mComposite) + { + const LLBakingAvatar* avatar = dynamic_cast (mAvatarAppearance); + S32 width = avatar->bakeTextureSize(); + S32 height = avatar->bakeTextureSize(); + + LL_DEBUGS() << "Creating composite with width and height " << width << " " << height << LL_ENDL; + + mComposite = new LLBakingTexLayerSetBuffer(this, width, height); + } +} + +LLSD LLBakingTexLayerSet::computeTextureIDs() const +{ + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = + LLAvatarAppearance::getDictionary()->getBakedTexture(getBakedTexIndex()); +#ifdef DEBUG_TEXTURE_IDS + const std::string& slot_name = LLAvatarAppearance::getDictionary()->getTexture( + LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(getBakedTexIndex()) )->mDefaultImageName; + const LLAvatarAppearanceDictionary::TextureEntry* entry = LLAvatarAppearance::getDictionary()->getTexture(baked_dict->mTextureIndex); + LL_DEBUGS() << "-----------------------------------------------------------------" << LL_ENDL; + LL_DEBUGS() << "BakedTexIndex = " << (S32) getBakedTexIndex() << " (" << slot_name << ") " + << "BakedEntry::mTextureIndex = " << (S32) baked_dict->mTextureIndex + << " (" << entry->mDefaultImageName + << ")" << LL_ENDL; + //LL_DEBUGS() << "LLAvatarAppearanceDictionary::getTEWearableType(" << baked_dict->mTextureIndex << ") = " << (S32) LLAvatarAppearanceDictionary::getTEWearableType(baked_dict->mTextureIndex) << LL_ENDL; + + texture_vec_t::const_iterator idx_iter = baked_dict->mLocalTextures.begin(); + texture_vec_t::const_iterator idx_end = baked_dict->mLocalTextures.end(); + std::ostringstream idx_str; + for (; idx_iter != idx_end; ++idx_iter) + { + entry = LLAvatarAppearance::getDictionary()->getTexture((*idx_iter)); + idx_str << (*idx_iter) << " (" << entry->mDefaultImageName + << ";" << LLWearableType::getInstance()->getTypeName( entry->mWearableType ) + << "), "; + } + LL_DEBUGS() << "BakedEntry::mLocalTextures: " << idx_str.str() << LL_ENDL; + wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin(); + wearables_vec_t::const_iterator type_end = baked_dict->mWearables.end(); + std::ostringstream type_str; + for (; type_iter != type_end; ++type_iter) + { + type_str << (S32) (*type_iter) << " (" + << LLWearableType::getInstance()->getTypeName( (*type_iter) ) + << "), "; + } + LL_DEBUGS() << "BakedEntry::mWearables: " << type_str.str() << LL_ENDL; + //LL_DEBUGS() << "BakedEntry::mWearablesHashID: " << baked_dict->mWearablesHashID << LL_ENDL; +#endif + + LLMD5 hash; + std::set texture_ids; + + bool is_visible = true; + bool hash_computed = computeLayerListTextureIDs(hash, texture_ids, mLayerList, is_visible); + if (is_visible) + { + hash_computed |= computeLayerListTextureIDs(hash, texture_ids, mMaskLayerList, is_visible); + } + + LLUUID hash_id; + if (!is_visible) + { + hash_id = IMG_INVISIBLE; + texture_ids.clear(); + } + else if (hash_computed) + { + if ((getBakedTexIndex() == EBakedTextureIndex::BAKED_LEFT_ARM) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_LEFT_LEG) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX1) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX2) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX3)) + { + hash.update(BAKE_HASH_VERSION); + } + + hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES); + hash.finalize(); + hash.raw_digest(hash_id.mData); + } + + if (hash_id.isNull()) + { + hash_id = IMG_DEFAULT_AVATAR; + } + + if (getBakedTexIndex() == EBakedTextureIndex::BAKED_SKIRT) + { + if (getAvatarAppearance()->getWearableData()->getWearableCount(LLWearableType::WT_SKIRT) == 0) + { + hash_id = IMG_DEFAULT_AVATAR; + texture_ids.clear(); + } + } + LLSD sd; + sd["hash_id"] = hash_id; + sd["texture_ids"] = LLSD::emptyArray(); + std::set::iterator id_iter = texture_ids.begin(); + std::set::iterator id_end = texture_ids.end(); + for (; id_iter != id_end; ++id_iter) + { + sd["texture_ids"].append( *id_iter ); + } + return sd; +} + +bool LLBakingTexLayerSet::computeLayerListTextureIDs(LLMD5& hash, + std::set& texture_ids, + const layer_list_t& layer_list, + bool& is_visible) const +{ + is_visible = true; + bool hash_computed = false; + layer_list_t::const_iterator iter = layer_list.begin(); + layer_list_t::const_iterator end = layer_list.end(); + for (; iter != end; ++iter) + { + const LLTexLayerInterface* layer_template = *iter; + LLWearableType::EType wearable_type = layer_template->getWearableType(); + ETextureIndex te = layer_template->getLocalTextureIndex(); + U32 num_wearables = getAvatarAppearance()->getWearableData()->getWearableCount(wearable_type); +#ifdef DEBUG_TEXTURE_IDS + const LLAvatarAppearanceDictionary::TextureEntry* entry = LLAvatarAppearance::getDictionary()->getTexture(te); + if (entry) + { + LL_DEBUGS() << "LLTexLayerInterface(" << layer_template->getName() << ") type = " + << (S32) wearable_type << " (" + << LLWearableType::getInstance()->getTypeName( wearable_type ) << ") te = " + << (S32) te << " ("<< entry->mDefaultImageName + << ";" << LLWearableType::getInstance()->getTypeName( entry->mWearableType ) + << ") wearable_count = " << num_wearables << LL_ENDL; + } + else + { + LL_DEBUGS() << "LLTexLayerInterface(" << layer_template->getName() << ") type = " + << (S32) wearable_type << " (" + << LLWearableType::getInstance()->getTypeName( wearable_type ) + << ") wearable_count = " << num_wearables << LL_ENDL; + } +#endif + if (LLWearableType::WT_INVALID == wearable_type) + { + //LL_DEBUGS() << "Skipping invalid wearable type" << LL_ENDL; + continue; + } + + for (U32 i = 0; i < num_wearables; i++) + { + LLBakingWearable* wearable = dynamic_cast ( + getAvatarAppearance()->getWearableData()->getWearable(wearable_type, i)); + if (!wearable) + { + //LL_DEBUGS() << "Skipping wearable" << LL_ENDL; + continue; + } +#ifdef DEBUG_TEXTURE_IDS + S32 num_ltos = wearable->getLocalTextureListSeq().size(); + LL_DEBUGS() << "LLWearable (" << wearable->getName() << ") type = " + << (S32) wearable->getAssetType() << " (" + << LLAssetType::lookup(wearable->getAssetType()) + << ") num_ltos = " << num_ltos << LL_ENDL; +#endif + LLLocalTextureObject *lto = wearable->getLocalTextureObject(te); + if (lto) + { +#ifdef DEBUG_TEXTURE_IDS + LL_DEBUGS() << "LocalTextureObject id = " << lto->getID() << " num texlayers = " << lto->getNumTexLayers() << LL_ENDL; +#endif + // Hash texture id + LLUUID texture_id = lto->getID(); + if (IMG_INVISIBLE == texture_id) + { + is_visible = false; + } + hash.update((const unsigned char*)texture_id.mData, UUID_BYTES); + hash_computed = true; + // Add texture to list. + texture_ids.insert(texture_id); + } +#ifdef DEBUG_TEXTURE_IDS + else + { + LL_DEBUGS() << "LLWearable -- no LocalTextureObject for te " << (S32) te << LL_ENDL; + } + + + for(S32 i = 0; i < (S32)TEX_NUM_INDICES; i++) + { + lto = wearable->getLocalTextureObject(i); + if (lto) + { + LL_DEBUGS() << "LTO (" << i << ") id = " << lto->getID() << " num texlayers = " << lto->getNumTexLayers() << LL_ENDL; + } + } +#endif + + for( LLVisualParam* param = getAvatarAppearance()->getFirstVisualParam(); + param; param = getAvatarAppearance()->getNextVisualParam() ) + { + // cross-wearable parameters are not authoritative, as they are driven by a different wearable. + if( (((LLViewerVisualParam*)param)->getWearableType() == wearable_type) && + (!((LLViewerVisualParam*)param)->getCrossWearable()) ) + { + std::ostringstream ostr; + F32 weight = wearable->getVisualParamWeight(param->getID()); + ostr << param->getID() << " " << weight; + hash.update(ostr.str()); + hash_computed = true; + } + } + } + } + return hash_computed; +} + diff --git a/indra/llappearanceutility/llbakingtexlayer.h b/indra/llappearanceutility/llbakingtexlayer.h new file mode 100644 index 0000000000..dc82b27ce2 --- /dev/null +++ b/indra/llappearanceutility/llbakingtexlayer.h @@ -0,0 +1,77 @@ +/** + * @file llbakingtexlayer.h + * @brief Declaration of LLBakingTexLayerSet. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGTEXLAYER_H +#define LL_LLBAKINGTEXLAYER_H + +#include "llbakingtexture.h" +#include "llimagej2c.h" +#include "llpointer.h" +#include "lltexlayer.h" + +class LLMD5; + +class LLBakingTexLayerSetBuffer : public LLTexLayerSetBuffer, public LLBakingTexture +{ + LOG_CLASS(LLBakingTexLayerSetBuffer); +public: + LLBakingTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height); + virtual ~LLBakingTexLayerSetBuffer(); + + LLImageJ2C* getCompressedImage() { return mCompressedImage; } + + bool render(); + bool bindDebugImage(const S32 stage = 0) override { return false; } + bool isActiveFetching() override { return false; }; + +private: + S32 getCompositeOriginX() const override { return 0; } + S32 getCompositeOriginY() const override { return 0; } + S32 getCompositeWidth() const override { return getFullWidth(); } + S32 getCompositeHeight() const override { return getFullHeight(); } + void midRenderTexLayerSet(bool success) override; + + LLPointer mCompressedImage; +}; + +class LLBakingTexLayerSet : public LLTexLayerSet +{ +public: + LLBakingTexLayerSet(LLAvatarAppearance* const appearance); + virtual ~LLBakingTexLayerSet(); + + LLSD computeTextureIDs() const; + bool computeLayerListTextureIDs(LLMD5& hash, + std::set& texture_ids, + const layer_list_t& layer_list, + bool& is_visible) const; + + void requestUpdate() override; + void createComposite() override; +}; + +#endif /* LL_LLBAKINGTEXLAYER_H */ + diff --git a/indra/llappearanceutility/llbakingtexture.cpp b/indra/llappearanceutility/llbakingtexture.cpp new file mode 100644 index 0000000000..ae83081aef --- /dev/null +++ b/indra/llappearanceutility/llbakingtexture.cpp @@ -0,0 +1,81 @@ +/** + * @file llbakingtexture.cpp + * @brief Implementation of LLBakingTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llbakingtexture.h" +#include "llgltexture.h" +#include "llimage.h" + +static const bool USE_MIP_MAPS = true; + +LLBakingTexture::LLBakingTexture(const LLUUID& id, const LLImageRaw* raw) + : LLGLTexture(raw, USE_MIP_MAPS), + mID(id) +{ +} + +LLBakingTexture::LLBakingTexture(bool usemipmaps) + : LLGLTexture(usemipmaps), + mID(LLUUID::null) +{ +} + +LLBakingTexture::LLBakingTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps) + : LLGLTexture(width, height, components, USE_MIP_MAPS), + mID(LLUUID::null) +{ +} + +// virtual +LLBakingTexture::~LLBakingTexture() +{ +} + +void LLBakingTexture::setKnownDrawSize(S32 width, S32 height) +{ + //nothing here. + LL_ERRS() << "Not implemented." << LL_ENDL; +} + +bool LLBakingTexture::bindDefaultImage(S32 stage) +{ + LL_ERRS() << "Not implemented." << LL_ENDL; + return false; +} + +void LLBakingTexture::forceImmediateUpdate() +{ + LL_ERRS() << "Not implemented." << LL_ENDL; +} + +void LLBakingTexture::updateBindStatsForTester() +{ + LL_ERRS() << "Not implemented." << LL_ENDL; +} + diff --git a/indra/llappearanceutility/llbakingtexture.h b/indra/llappearanceutility/llbakingtexture.h new file mode 100644 index 0000000000..50b4193b2e --- /dev/null +++ b/indra/llappearanceutility/llbakingtexture.h @@ -0,0 +1,69 @@ +/** + * @file llbakingtexture.h + * @brief Declaration of LLBakingTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGTEXTURE_H +#define LL_LLBAKINGTEXTURE_H + +#include "llgltexture.h" +#include "lluuid.h" + +class LLImageRaw; + +class LLBakingTexture : public LLGLTexture +{ +public: + enum + { + LOCAL_TEXTURE, + BAKING_TEXTURE, + INVALID_TEXTURE_TYPE + }; + LLBakingTexture(const LLUUID& id, const LLImageRaw* raw); + LLBakingTexture(bool usemipmaps); + LLBakingTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps = true); + const LLUUID& getID() const override { return mID; } + S8 getType() const override { return BAKING_TEXTURE; } + + // Not implemented. + void setKnownDrawSize(S32 width, S32 height) override; + bool bindDefaultImage(const S32 stage = 0) override ; + void forceImmediateUpdate() override; + void updateBindStatsForTester() override ; + bool bindDebugImage(const S32 stage = 0) override { return false; } + bool isActiveFetching() override { return false; } + +protected: + virtual ~LLBakingTexture(); + LOG_CLASS(LLBakingTexture); +private: + // Hide default constructor. + LLBakingTexture() {} + + LLUUID mID; +}; + +#endif /* LL_LLBAKINGTEXTURE_H */ + diff --git a/indra/llappearanceutility/llbakingwearable.cpp b/indra/llappearanceutility/llbakingwearable.cpp new file mode 100644 index 0000000000..0e5251aba1 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearable.cpp @@ -0,0 +1,77 @@ +/** + * @file llbakingwearable.cpp + * @brief Implementation of LLBakingWearable class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "linden_common.h" + +#include "llavatarappearance.h" +#include "llavatarappearancedefines.h" +#include "llbakingwearable.h" +#include "llmd5.h" +#include "indra_constants.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingWearable::LLBakingWearable() +{ +} + +// virtual +LLBakingWearable::~LLBakingWearable() +{ +} + +// virtual +void LLBakingWearable::setUpdated() const +{ +} + +// virtual +void LLBakingWearable::addToBakedTextureHash(LLMD5& hash) const +{ +} + +// virtual +LLUUID LLBakingWearable::getDefaultTextureImageID(ETextureIndex index) const +{ + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearance::getDictionary()->getTexture(index); + const std::string &default_image_name = texture_dict->mDefaultImageName; + if (default_image_name == "") + { + return IMG_DEFAULT_AVATAR; + } + else + { + //return LLUUID(gSavedSettings.getString(default_image_name)); + // *TODO: Fix this. + return LLUUID::null; + } +} + +void LLBakingWearable::asLLSD(LLSD& sd) const +{ + // stub implementation. TODO: fill in. +} diff --git a/indra/llappearanceutility/llbakingwearable.h b/indra/llappearanceutility/llbakingwearable.h new file mode 100644 index 0000000000..bb96dc3709 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearable.h @@ -0,0 +1,48 @@ +/** + * @file llbakingwearable.h + * @brief Declaration of LLBakingWearable class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGWEARABLE_H +#define LL_LLBAKINGWEARABLE_H + +#include "llwearable.h" +#include "llmd5.h" + +class LLBakingWearable : public LLWearable +{ +public: + LLBakingWearable(); + virtual ~LLBakingWearable(); + + virtual void setUpdated() const; + virtual void addToBakedTextureHash(LLMD5& hash) const; + virtual LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; + + void asLLSD(LLSD& sd) const; + +}; + +#endif /* LL_LLBAKINGWEARABLE_H */ + diff --git a/indra/llappearanceutility/llbakingwearablesdata.cpp b/indra/llappearanceutility/llbakingwearablesdata.cpp new file mode 100644 index 0000000000..18edb86348 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearablesdata.cpp @@ -0,0 +1,131 @@ +/** + * @file llbakingwearablesdata.cpp + * @brief Implementation of LLBakingWearablesData class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "linden_common.h" + +#include "llbakingwearablesdata.h" +#include "llbakingwearable.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingWearablesData::LLBakingWearablesData() +{ +} + +// virtual +LLBakingWearablesData::~LLBakingWearablesData() +{ + std::for_each(mWearables.begin(), mWearables.end(), DeletePointer()); + mWearables.clear(); +} + +void LLBakingWearablesData::setWearableOutfit(LLSD& sd) +{ + LLSD::array_const_iterator type_iter = sd.beginArray(); + LLSD::array_const_iterator type_end = sd.endArray(); + S32 wearable_index = 0; + for (; type_iter != type_end && wearable_index < (S32) LLWearableType::WT_COUNT; ++type_iter, ++wearable_index) + { + LLSD::array_const_iterator wearable_iter = type_iter->beginArray(); + LLSD::array_const_iterator wearable_end = type_iter->endArray(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + if ( wearable_iter->isDefined() ) + { + LLBakingWearable* wearable = new LLBakingWearable(); + std::istringstream istr( (*wearable_iter)["contents"].asString() ); + wearable->importStream(istr, mAvatarAppearance); + + // Sanity check the wearable type. + if (wearable->getType() != wearable_index) + { + LL_WARNS() << "Unexpected wearable type! Expected " << wearable_index + << ", processed " << (S32) wearable->getType() << LL_ENDL; + // *TODO: Throw exception? + delete wearable; + continue; + } + mWearables.push_back(wearable); + + const LLWearableType::EType type = wearable->getType(); + if (wearable->getAssetType() == LLAssetType::AT_BODYPART) + { + // exactly one wearable per body part + setWearable(type,0,wearable); + } + else + { + pushWearable(type,wearable); + } + } + } + } + + wearable_list_t::const_iterator wearable_iter = mWearables.begin(); + wearable_list_t::const_iterator wearable_end = mWearables.end(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + LLBakingWearable* wearable = (*wearable_iter); + const bool removed = false; + wearableUpdated(wearable, removed); + } + + for(wearable_index = 0; wearable_index < (S32) LLWearableType::WT_COUNT; wearable_index++) + { + LLWearable* top_wearable = getTopWearable((LLWearableType::EType)wearable_index); + if (top_wearable) + { + top_wearable->writeToAvatar(mAvatarAppearance); + } + } +} + + +void LLBakingWearablesData::asLLSD(LLSD& sd) const +{ + sd = LLSD::emptyMap(); + wearableentry_map_t::const_iterator type_iter = mWearableDatas.begin(); + wearableentry_map_t::const_iterator type_end = mWearableDatas.end(); + for (; type_iter != type_end; ++type_iter) + { + LLSD wearable_type_sd = LLSD::emptyArray(); + LLWearableType::EType wearable_type = type_iter->first; + wearableentry_vec_t::const_iterator wearable_iter = type_iter->second.begin(); + wearableentry_vec_t::const_iterator wearable_end = type_iter->second.end(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + const LLBakingWearable* wearable = dynamic_cast(*wearable_iter); + LLSD wearable_sd; + wearable->asLLSD(wearable_sd); + wearable_type_sd.append(wearable_sd); + } + sd[LLWearableType::getInstance()->getTypeName(wearable_type)] = wearable_type_sd; + } +} + + + diff --git a/indra/llappearanceutility/llbakingwearablesdata.h b/indra/llappearanceutility/llbakingwearablesdata.h new file mode 100644 index 0000000000..1db2ca4bc1 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearablesdata.h @@ -0,0 +1,55 @@ +/** + * @file llbakingwearablesdata.h + * @brief Declaration of LLBakingWearablesData class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGWEARABLESDATA_H +#define LL_LLBAKINGWEARABLESDATA_H + +#include "llwearabledata.h" + +class LLBakingWearable; + +class LLBakingWearablesData : public LLWearableData +{ +public: + LLBakingWearablesData(); + virtual ~LLBakingWearablesData(); + + void setWearableOutfit(LLSD& sd); + + //-------------------------------------------------------------------- + // I/O methods + //-------------------------------------------------------------------- +public: + void asLLSD(LLSD& sd) const; + +private: + typedef std::vector wearable_list_t; + wearable_list_t mWearables; + +}; + +#endif /* LL_LLBAKINGWEARABLESDATA_H */ + diff --git a/indra/llappearanceutility/llbakingwindow.cpp b/indra/llappearanceutility/llbakingwindow.cpp new file mode 100644 index 0000000000..8799105932 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.cpp @@ -0,0 +1,94 @@ +/** + * @file llbakingwindow.cpp + * @brief Implementation of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingshadermgr.h" +#include "llbakingwindow.h" +#include "llgl.h" +#include "llgltexture.h" +#include "llvertexbuffer.h" + +LLBakingWindow::LLBakingWindow(S32 width, S32 height) +{ + const S32 WINDOW_ORIGIN_X = 0; + const S32 WINDOW_ORIGIN_Y = 0; + const U32 FLAGS = 32; // *TODO: Why did mapserver use this? mFlags looks unused. + const bool NO_FULLSCREEN = false; + const bool NO_CLEAR_BG = false; + const bool NO_DISABLE_VSYNC = false; + const bool NO_IGNORE_PIXEL_DEPTH = false; + const bool USE_GL = true; + mWindow = LLWindowManager::createWindow(this, + "appearanceutility", "Appearance Utility", + WINDOW_ORIGIN_X, WINDOW_ORIGIN_Y, + width, height, + FLAGS, + NO_FULLSCREEN, + NO_CLEAR_BG, + NO_DISABLE_VSYNC, //gSavedSettings.getBOOL("DisableVerticalSync"), + USE_GL, // not headless + NO_IGNORE_PIXEL_DEPTH); //gIgnorePixelDepth = false + + if (nullptr == mWindow) + { + throw LLAppException(RV_UNABLE_TO_INIT_GL); + } + + LLVertexBuffer::initClass(mWindow); + + gGL.init(true); + + if (!LLBakingShaderMgr::sInitialized) + { //immediately initialize shaders + LLBakingShaderMgr::sInitialized = true; + LLBakingShaderMgr::instance()->setShaders(); + } + + LLImageGL::initClass(mWindow, LLGLTexture::MAX_GL_IMAGE_CATEGORY, true, false); + + // mWindow->show(); + // mWindow->bringToFront(); + // mWindow->focusClient(); + // mWindow->gatherInput(); +} + +LLBakingWindow::~LLBakingWindow() +{ + if (mWindow) + { + LLWindowManager::destroyWindow(mWindow); + } + mWindow = nullptr; +} + +void LLBakingWindow::swapBuffers() +{ + mWindow->swapBuffers(); +} diff --git a/indra/llappearanceutility/llbakingwindow.h b/indra/llappearanceutility/llbakingwindow.h new file mode 100644 index 0000000000..a6bf1d8714 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.h @@ -0,0 +1,45 @@ +/** + * @file llbakingwindow.h + * @brief Declaration of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGWINDOW_H +#define LL_LLBAKINGWINDOW_H + +#include "llwindow.h" +#include "llwindowcallbacks.h" + +class LLBakingWindow : public LLWindowCallbacks +{ +public: + LLBakingWindow(S32 width, S32 height); + ~LLBakingWindow(); + + void swapBuffers(); +private: + LLWindow* mWindow; +}; + +#endif /* LL_LLBAKINGWINDOW_H */ + diff --git a/indra/llappearanceutility/llprocessparams.cpp b/indra/llappearanceutility/llprocessparams.cpp new file mode 100755 index 0000000000..ad1b44e794 --- /dev/null +++ b/indra/llappearanceutility/llprocessparams.cpp @@ -0,0 +1,281 @@ +/** + * @file llprocessparams.cpp + * @brief Implementation of LLProcessParams class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llsdutil_math.h" +#include "llstl.h" +#include "llmath.h" +#include "llquantize.h" + +// appearance includes +#include "lltexturemanagerbridge.h" +#include "llwearabletype.h" +#include "llavatarappearancedefines.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingavatar.h" +#include "llbakingtexlayer.h" +#include "llbakingwearable.h" +#include "llbakingwearablesdata.h" +#include "llprocessparams.h" + +#define APPEARANCE_PARAM_VERSION 11000 + +const U32 FULL_RIG_JOINT_COUNT = 20; + +using namespace LLAvatarAppearanceDefines; + +// Create a bridge to the viewer texture manager. +class LLNullTextureManagerBridge : public LLTextureManagerBridge +{ +public: + LLPointer getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true) override + { + return nullptr; + } + + LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true) override + { + return nullptr; + } + + LLGLTexture* getFetchedTexture(const LLUUID &image_id) override + { + return nullptr; + } +}; + +LLSD dump_joint_offsets_for_avatar(LLBakingAvatar& avatar) +{ + LLSD joints = LLSD::emptyArray(); + + for (U32 joint_index = 0;; joint_index++) + { + LLJoint* pJoint = avatar.getCharacterJoint(joint_index); + if (!pJoint) + { + break; + } + LLVector3 pos; + LLUUID mesh_id; + if (pJoint->hasAttachmentPosOverride(pos, mesh_id)) + { + LLSD info; + info["name"] = pJoint->getName(); + info["pos"] = ll_sd_from_vector3(pos); + info["mesh_id"] = mesh_id; + joints.append(info); + } + } + + return joints; +} + +void LLProcessParams::process(std::ostream& output) +{ + if (!mInputData.has("wearables")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing wearables"); + + // Create a null-texture manager bridge. + gTextureManagerBridgep = new LLNullTextureManagerBridge(); + + // Construct the avatar. + LLBakingWearablesData wearable_data; + LLBakingAvatar avatar(&wearable_data, mApp->bakeTextureSize()); + avatar.initInstance(); + wearable_data.setAvatarAppearance(&avatar); + + //Process the params data for joint information + //bool bodySizeSet = processInputDataForJointInfo( avatar ); + + // Extract and parse wearables. + wearable_data.setWearableOutfit(mInputData["wearables"]); + + // Set appearance parameter to flag server-side baking. + avatar.setVisualParamWeight(APPEARANCE_PARAM_VERSION, 1.0f); + + avatar.setSex( (avatar.getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + + avatar.updateVisualParams(); + + // Extract texture ids, texture hashes, and avatar scale. + LLSD texture_ids = LLSD::emptyMap(); + + //Process the params data for joint information + bool bodySizeSet = processInputDataForJointInfo( avatar ); + + //if we didn't compute a body size from a mesh attachment that included + //joint offsets we need to do it now + if (!bodySizeSet ) + { + avatar.computeBodySize(); + } + + for (U32 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) + { + EBakedTextureIndex bake_type = (EBakedTextureIndex) baked_index; + LLBakingTexLayerSet* layer_set = dynamic_cast(avatar.getAvatarLayerSet(bake_type)); + const std::string& slot_name = LLAvatarAppearance::getDictionary()->getTexture( + LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(bake_type) )->mDefaultImageName; + texture_ids[slot_name] = layer_set->computeTextureIDs(); + } + + // Extract visual params + U32 count = 0; + LLSD params = LLSD::emptyMap(); + LLSD debug_params = LLSD::emptyMap(); + for (LLViewerVisualParam* param = (LLViewerVisualParam*)avatar.getFirstVisualParam(); + param; + param = (LLViewerVisualParam*)avatar.getNextVisualParam()) + { + if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE || + param->getGroup() == VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + { + const F32 param_value = param->getWeight(); + const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); + LLSD body; + body["name"] = param->getName(); + body["value"] = param_value; + body["weight"] = new_weight; + debug_params[LLSD(param->getID()).asString()] = body; + params.append(new_weight); + count++; + } + } + + // Output + LLSD result; + result["success"] = true; + result["params"] = params; + result["debug_params"] = debug_params; + result["slot_textures"] = texture_ids; + result["avatar_scale"] = ll_sd_from_vector3(avatar.mBodySize + avatar.mAvatarOffset); + result["dump_joint_offsets"] = dump_joint_offsets_for_avatar(avatar); + output << LLSDOStreamer(result); +} + +bool LLProcessParams::processInputDataForJointInfo( LLBakingAvatar& avatar ) +{ + bool returnResult = false; + + if ( !mInputData.has("skindata") || mInputData["skindata"].isUndefined() ) + { + LL_DEBUGS() << "Skipping missing skindata" << LL_ENDL; + return returnResult; + } + + const LLSD& skindata = mInputData["skindata"]; + + //float pelvisOffset = 0.0f; + std::vector jointNames; + std::vector jointOffsets; + + LLSD::map_const_iterator skinIter = skindata.beginMap(); + LLSD::map_const_iterator skinIterEnd = skindata.endMap(); + + for ( ; skinIter!=skinIterEnd; ++skinIter ) + { + const LLSD& skin = skinIter->second; + const char *uuid_str = skinIter->first.c_str(); + const LLUUID mesh_id(uuid_str); + + if ( !skin.has("joint_names") || !skin.has("joint_offset") ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + // Build list of joints + { + LLSD::array_const_iterator iter(skin["joint_names"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_names"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + jointNames.push_back( iter->asString() ); + } + } + // Extract joint offsets + { + LLSD::array_const_iterator iter(skin["joint_offset"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_offset"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + jointOffsets.push_back( ll_vector3_from_sd(*iter) ); + } + } + + // get at the *optional* pelvis offset + //if ( skin.has("pelvis_offset") ) + //{ + // pelvisOffset = skin["pelvis_offset"].asReal(); + //} + // Now apply the extracted joint data to the avatar + U32 jointCount = narrow(jointNames.size()); + + if ( jointOffsets.size() < jointCount ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + bool fullRig = ( jointCount>= FULL_RIG_JOINT_COUNT ) ? true : false; + //bool pelvisGotSet = false; + + returnResult = fullRig; + + if ( fullRig ) + { + for ( U32 i=0; istoreCurrentXform( jointOffsets[i] ); + + bool active_override_changed = false; + pJoint->addAttachmentPosOverride(jointOffsets[i], mesh_id, "", active_override_changed); + } + } + + avatar.computeBodySize(); + avatar.mRoot->touch(); + avatar.mRoot->updateWorldMatrixChildren(); + + } + + jointNames.clear(); + jointOffsets.clear(); + } + return returnResult; +} diff --git a/indra/llappearanceutility/llprocessparams.h b/indra/llappearanceutility/llprocessparams.h new file mode 100644 index 0000000000..6df893fe21 --- /dev/null +++ b/indra/llappearanceutility/llprocessparams.h @@ -0,0 +1,49 @@ +/** + * @file llprocessparams.h + * @brief Declaration of LLProcessParams class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPROCESSPARAMS_H +#define LL_LLPROCESSPARAMS_H + +#include "llbakingprocess.h" + +class LLBakingAvatar; +class LLProcessParams : public LLBakingProcess +{ +public: + LLProcessParams(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + + void process(std::ostream& output) override; +private: + + bool processInputDataForJointInfo( LLBakingAvatar& avatar ); +}; + + + + +#endif /* LL_LLPROCESSPARAMS_H */ + diff --git a/indra/llappearanceutility/llprocessskin.cpp b/indra/llappearanceutility/llprocessskin.cpp new file mode 100644 index 0000000000..a3d4d3c6f3 --- /dev/null +++ b/indra/llappearanceutility/llprocessskin.cpp @@ -0,0 +1,118 @@ +/** + * @file llprocessskin.cpp + * @brief Implementation of LLProcesSkin class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llsdutil_math.h" +#include "llstl.h" +#include "llmath.h" +#include "m4math.h" +#include "v4math.h" + +// project includes +#include "llappappearanceutility.h" +#include "llprocessskin.h" + +void LLProcessSkin::process(std::ostream& output) +{ + const LLSD& dataBlock = mInputData; + LLSD skinData = LLSD::emptyMap(); + + LLSD::map_const_iterator skinIter = dataBlock.beginMap(); + LLSD::map_const_iterator skinIterEnd = dataBlock.endMap(); + + for ( ; skinIter!=skinIterEnd; ++skinIter ) + { + const LLSD& skin = skinIter->second; + if ( !skin.has("joint_names") || !skin.has("alt_inverse_bind_matrix") ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + LLSD entry = LLSD::emptyMap(); + + //get all joint names from the skin + { + entry["joint_names"] = LLSD::emptyArray(); + LLSD& joint_names = entry["joint_names"]; + LLSD::array_const_iterator iter(skin["joint_names"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_names"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + LL_DEBUGS() << "joint: " << iter->asString() << LL_ENDL; + joint_names.append(*iter); + } + } + //get at the translational component for the joint offsets + { + entry["joint_offset"] = LLSD::emptyArray(); + LLSD& joint_offsets = entry["joint_offset"]; + LLSD::array_const_iterator iter(skin["alt_inverse_bind_matrix"].beginArray()); + LLSD::array_const_iterator iter_end(skin["alt_inverse_bind_matrix"].endArray()); + //just get at the translational component + for ( ; iter != iter_end; ++iter ) + { + LLMatrix4 mat; + for (U32 j = 0; j < 4; j++) + { + for (U32 k = 0; k < 4; k++) + { + mat.mMatrix[j][k] = static_cast((*iter)[j*4+k].asReal()); + } + } + joint_offsets.append( ll_sd_from_vector3( mat.getTranslation() )); + LL_DEBUGS() << "offset: [" << mat.getTranslation()[0] << " " + << mat.getTranslation()[1] << " " + << mat.getTranslation()[2] << " ]" << LL_ENDL; + } + } + + //get at the *optional* pelvis offset + if (skin.has("pelvis_offset")) + { + entry["pelvis_offset"] = skin["pelvis_offset"]; + } + else + { + entry["pelvis_offset"] = LLSD::Real(0.f); + } + + //add block to outgoing result llsd + skinData[skinIter->first] = entry; + } + + //dump the result llsd into the outgoing output + LLSD result; + result["success"] = true; + result["skindata"] = skinData; + LL_DEBUGS() << "---------------------------\n" << result << LL_ENDL; + output << LLSDOStreamer(result); +} + diff --git a/indra/llappearanceutility/llprocessskin.h b/indra/llappearanceutility/llprocessskin.h new file mode 100644 index 0000000000..a3cc8c7087 --- /dev/null +++ b/indra/llappearanceutility/llprocessskin.h @@ -0,0 +1,43 @@ +/** + * @file llprocessskin.h + * @brief Declaration of LLProcessSkin class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPROCESSSKIN_H +#define LL_LLPROCESSSKIN_H + +#include "llbakingprocess.h" +class LLProcessSkin : public LLBakingProcess +{ +public: + LLProcessSkin(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + void process(std::ostream& output) override; + +private: + +}; + +#endif /* LL_LLPROCESSSKIN_H */ + diff --git a/indra/llappearanceutility/llprocesstexture.cpp b/indra/llappearanceutility/llprocesstexture.cpp new file mode 100644 index 0000000000..91ceedc8f6 --- /dev/null +++ b/indra/llappearanceutility/llprocesstexture.cpp @@ -0,0 +1,285 @@ +/** + * @file llprocesstexture.cpp + * @brief Implementation of LLProcessTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +#include "llfasttimer.h" +#include "llgl.h" +#include "llimagej2c.h" +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" + +// appearance includes +#include "llwearabletype.h" +#include "llavatarappearancedefines.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingavatar.h" +#include "llbakingtexlayer.h" +#include "llbakingtexture.h" +#include "llbakingwearable.h" +#include "llbakingwearablesdata.h" +#include "llbakingwindow.h" +#include "llprocesstexture.h" + +static const S32 MAX_SIZE_LLSD_HEADER = 1024 * 1024; +static const bool USE_MIP_MAPS = true; + +static const S32 EYES_SLOT_DIMENSIONS=512; + +using namespace LLAvatarAppearanceDefines; + +LLProcessTexture::LLProcessTexture(LLAppAppearanceUtility* app) + : LLBakingProcess(app), + mWindow(nullptr), + mInputRaw(nullptr), + mBakeSize(512) +{ +} + +void LLProcessTexture::cleanup() +{ + delete mWindow; +} + +static LLFastTimer::DeclareTimer FTM_CREATE_TEXTURE_FROM_STREAM("Create texture from stream."); +static LLPointer create_texture_from_stream(std::istream& input, + S32 texture_size, + const LLUUID& id) +{ + LL_RECORD_BLOCK_TIME(FTM_CREATE_TEXTURE_FROM_STREAM); + // Read compressed j2c texture data from the input stream. + U8* buffer = (U8*) ll_aligned_malloc_16(texture_size); + input.read((char*) buffer, texture_size); + + if (input.gcount() < texture_size) + { + ll_aligned_free_16(buffer); + throw LLAppException(RV_UNABLE_TO_DECODE, " Early EOF in input stream."); + } + if (input.gcount() > texture_size) + { + ll_aligned_free_16(buffer); + throw LLAppException(RV_UNABLE_TO_DECODE, " Read too much data from input stream: Programming Error."); + } + + const S32 DISCARD_FULL_TEXTURE_RESOLUTION = 0; + LLPointer j2c = new LLImageJ2C(); + j2c->setDiscardLevel(DISCARD_FULL_TEXTURE_RESOLUTION); + // Transfer the j2c buffer to an LLImageJ2C object. + // This gives memory ownership of buffer to LLImageJ2C + if (!j2c->validate(buffer, texture_size)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Unable to validate J2C: " + LLImage::getLastThreadError()); + } + if (!(j2c->getWidth() * j2c->getHeight() * j2c->getComponents() > 0)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Invalid dimensions."); + } + + // Decompress the J2C image into a raw image. + LLPointer image_raw = new LLImageRaw(j2c->getWidth(), + j2c->getHeight(), + j2c->getComponents()); + const F32 MAX_DECODE_TIME = 60.f; + j2c->setDiscardLevel(0); + if (!j2c->decode(image_raw, MAX_DECODE_TIME)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Decoding timeout."); + } + // *TODO: Check for decode failure? + LL_DEBUGS() << "ID: " << id << ", Raw Width: " << image_raw->getWidth() << ", Raw Height: " << image_raw->getHeight() + << ", Raw Components: " << (S32) image_raw->getComponents() + << ", J2C Width: " << j2c->getWidth() << ", J2C Height: " << j2c->getHeight() + << ", J2C Components: " << (S32) j2c->getComponents() << LL_ENDL; + + return image_raw; +} + +void LLProcessTexture::parseInput(std::istream& input) +{ + mInputRaw = &input; + LL_DEBUGS() << "Reading..." << LL_ENDL; + // Parse LLSD header. + mInputData = LLSDSerialize::fromBinary( *mInputRaw, MAX_SIZE_LLSD_HEADER ); + if (mInputData.isUndefined()) throw LLAppException(RV_UNABLE_TO_PARSE); + if (!mInputData.has("slot_id")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing slot id"); + if (!mInputData.has("textures")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing texture header"); + if (!mInputData.has("wearables")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing wearables"); + + // Verify the slot_id is valid. + if (BAKED_NUM_INDICES == LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString())) + { + throw LLAppException(RV_UNABLE_TO_PARSE, " Invalid slot id"); + } +} + +void LLProcessTexture::init() +{ + if (mApp->isDebugMode()) gDebugGL = true; + + S32 maxTextureDecodedWidth = 0; + S32 maxTextureDecodedHeight = 0; + + // Extract texture data. + LLSD::array_const_iterator iter = mInputData["textures"].beginArray(); + LLSD::array_const_iterator end = mInputData["textures"].endArray(); + std::map< LLUUID, LLPointer > imageRawMap; + + for (; iter != end; ++iter) + { + LLUUID texture_id = (*iter)[0].asUUID(); + S32 texture_size = (*iter)[1]; + imageRawMap[texture_id] = create_texture_from_stream(*mInputRaw, texture_size, texture_id); + maxTextureDecodedWidth = imageRawMap[texture_id]->getWidth() > maxTextureDecodedWidth ? imageRawMap[texture_id]->getWidth() : maxTextureDecodedWidth; + maxTextureDecodedHeight = imageRawMap[texture_id]->getHeight() > maxTextureDecodedHeight ? imageRawMap[texture_id]->getHeight() : maxTextureDecodedHeight; + } + + if ("eyes" == mInputData["slot_id"].asString()) + { + mBakeSize = 512; + } + else + { + // optimization: maybe we could use maxTextureDecodedWidth and + // maxTextureDecodedHeight for new LLBakingWindow below? + if ((maxTextureDecodedWidth > 1024) || (maxTextureDecodedHeight > 1024)) + { + mBakeSize = 2048; + } + else if ((maxTextureDecodedWidth > 512) || (maxTextureDecodedHeight > 512)) + { + mBakeSize = 1024; + } + else + { + mBakeSize = 512; + } + } + + mWindow = new LLBakingWindow(mBakeSize, mBakeSize); + + for (iter = mInputData["textures"].beginArray(); iter != mInputData["textures"].endArray(); ++iter) + { + LLUUID texture_id = (*iter)[0].asUUID(); + + LLPointer texture = new LLBakingTexture(texture_id, imageRawMap[texture_id]); + texture->forceActive(); + texture->setGLTextureCreated(true); + + mTextureData[texture_id] = texture; + } + +} + +LLPointer LLProcessTexture::getLocalTexture(bool usemipmaps, bool generate_gl_tex) +{ + LLPointer tex = new LLBakingTexture(usemipmaps); + if(generate_gl_tex) + { + tex->generateGLTexture() ; + tex->setCategory(LLGLTexture::LOCAL) ; + } + return tex ; +} + +LLPointer LLProcessTexture::getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex) +{ + LLPointer tex = new LLBakingTexture(width, height, components, usemipmaps) ; + if(generate_gl_tex) + { + tex->generateGLTexture() ; + tex->setCategory(LLGLTexture::LOCAL) ; + } + return tex ; +} + +LLGLTexture* LLProcessTexture::getFetchedTexture(const LLUUID &image_id) +{ + texture_map_t::iterator texture_iter = mTextureData.find(image_id); + if (mTextureData.end() == texture_iter) + { + LL_DEBUGS() << "Ignoring unused texture id: " << image_id << LL_ENDL; + return nullptr; + } + + return texture_iter->second; +} + +void LLProcessTexture::process(std::ostream& output) +{ + LL_DEBUGS() << "Building avatar..." << LL_ENDL; + // Set ourself as the texture bridge. + gTextureManagerBridgep = this; + + // Construct the avatar. + LLBakingWearablesData wearable_data; + LLBakingAvatar avatar(&wearable_data, mBakeSize); + avatar.initInstance(); + wearable_data.setAvatarAppearance(&avatar); + + // Extract and parse wearables. + wearable_data.setWearableOutfit(mInputData["wearables"]); + + avatar.setSex( (avatar.getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + + avatar.updateVisualParams(); + + // Prepare gl for avatar baking + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + LLGLEnable color_mat(GL_COLOR_MATERIAL); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + EBakedTextureIndex bake_type = LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString()); + LLTexLayerSet* layer_set = avatar.getAvatarLayerSet(bake_type); + LLBakingTexLayerSetBuffer* composite = dynamic_cast (layer_set->getComposite()); + if (!composite) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Could not build composite."); + } + + LL_DEBUGS() << "Rendering..." << LL_ENDL; + if (!composite->render()) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Failed to render composite."); + } + + mWindow->swapBuffers(); + + LL_DEBUGS() << "Compressing..." << LL_ENDL; + LLImageJ2C* j2c = composite->getCompressedImage(); + if (!j2c) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Could not build image."); + } + + LL_DEBUGS() << "Writing..." << LL_ENDL; + output.write((char*)j2c->getData(), j2c->getDataSize()); + LL_DEBUGS() << "Done." << LL_ENDL; +} diff --git a/indra/llappearanceutility/llprocesstexture.h b/indra/llappearanceutility/llprocesstexture.h new file mode 100644 index 0000000000..8bf2c7396f --- /dev/null +++ b/indra/llappearanceutility/llprocesstexture.h @@ -0,0 +1,63 @@ +/** + * @file llprocesstexture.h + * @brief Declaration of LLProcessTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPROCESSTEXTURE_H +#define LL_LLPROCESSTEXTURE_H + +#include "llbakingprocess.h" +#include "llbakingtexture.h" +#include "llpointer.h" +#include "lltexturemanagerbridge.h" +#include "llbakingwindow.h" + +class LLBakingWindow; + +class LLProcessTexture : public LLBakingProcess, public LLTextureManagerBridge +{ +public: + LLProcessTexture(LLAppAppearanceUtility* app); + + /////// LLBakingProcess interface. ///////// + void parseInput(std::istream& input) override; + void process(std::ostream& output) override; + void init() override; + void cleanup() override; + + /////// LLTextureManagerBridge interface. //////// + LLPointer getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true) override; + LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true) override; + LLGLTexture* getFetchedTexture(const LLUUID &image_id) override; + +private: + typedef std::map< LLUUID, LLPointer > texture_map_t; + texture_map_t mTextureData; + LLBakingWindow* mWindow; + std::istream* mInputRaw; + S32 mBakeSize; +}; + +#endif /* LL_LLPROCESSTEXTURE_H */ + diff --git a/indra/llappearanceutility/tests/joint-offsets.xml b/indra/llappearanceutility/tests/joint-offsets.xml new file mode 100644 index 0000000000..4dca3c3429 --- /dev/null +++ b/indra/llappearanceutility/tests/joint-offsets.xml @@ -0,0 +1 @@ +92a7dd5c-bc30-9952-3b3b-e6cc10336cbebind_shape_matrix0.048803295940160750.00.00.00.00.0488033369183540340.00.00.00.00.049029946327209470.00.05886554718017578-0.03438653051853181.75724506378173831.0joint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.090427502989768980.037174601107835770.080562800168991091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.09042750298976898-0.037174601107835770.080562800168991091.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.06363839656114578-0.03717460110783577-1.89970004558563231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.063638396561145780.03717460110783577-1.89970004558563231.0971cf873-afce-8b69-44d6-3f5879cb94c2bind_shape_matrix0.029928008094429970.00.00.00.00.046580597758293150.00.00.00.00.0094699859619140620.00.137737005949020395.450006574392319e-051.68836498260498051.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.07e7a6834-8b41-4029-8f87-ce57b7d05beebind_shape_matrix0.27415099740028380.00.00.00.00.152832403779029850.00.00.00.00.23362004756927490.00.033084496855735780.01.74006009101867681.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0547d8392-9f19-35fb-3508-121eea388f0abind_shape_matrix0.12420170754194260.00.00.00.00.040834598243236540.00.00.00.00.0144999027252197270.00.077383153140544890.01.68994998931884771.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvismFaceTongueBasemFaceTeethLowermFaceTongueTipalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0298503991216421130.00.0078316899016499521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0389162003993988040.0-0.0027754299808293581.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.087354503571987150.0-1.82828998565673831.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.126270994544029240.0-1.8255100250244141.0ed796a27-cff0-454a-ecec-fd10794ca2c9bind_shape_matrix0.0071529899723827840.00.00.00.00.0193126909434795380.00.00.00.00.0236200094223022460.00.163101494312286380.00020919507369399071.71106004714965821.0joint_namesmFaceNoseBasemFaceRootmHeadmNeckmChestmTorsomPelvismFaceLipUpperCentermFaceTeethUpperalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.0fa0aabfe-4b1c-fa9b-4942-74e7e7f50fe2bind_shape_matrix0.022715998813509940.00.00.00.00.022715998813509940.00.00.00.00.0227099657058715820.00.00.01.06701493263244631.0joint_namesmPelvismHandMiddle1LeftmHandMiddle2LeftmHandMiddle3LeftmHandIndex1LeftmHandIndex2LeftmHandIndex3LeftmHandRing1LeftmHandRing2LeftmHandRing3LeftmHandPinky1LeftmHandPinky2LeftmHandPinky3LeftmHandThumb1LeftmHandThumb2LeftmHandThumb3LeftmHandMiddle1RightmHandMiddle2RightmHandMiddle3RightmHandIndex1RightmHandIndex2RightmHandIndex3RightmHandRing1RightmHandRing2RightmHandRing3RightmHandPinky1RightmHandPinky2RightmHandPinky3RightmHandThumb1RightmHandThumb2RightmHandThumb3Rightalt_inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.00.99873197078704830.04983130097389221-0.0070897499099373820.0-0.0301342997699975970.7048000097274780.7087659835815430.00.040315598249435425-0.70765399932861330.7054079771041870.00.0151886995881795880.098942197859287260.0104294996708631521.00.99894601106643680.045610301196575165-0.005135800223797560.0-0.0289570000022649770.71308398246765140.70047998428344730.00.03561139851808548-0.69959300756454470.71365398168563840.0-0.00105056003667414190.04202070087194443-0.0063029900193214421.00.99634701013565060.08039940148591995-0.028780499473214150.0-0.0383009985089302060.72195601463317870.69087797403335570.00.07632440328598022-0.68725198507308960.72239899635314940.0-0.00050425098743289710.024710899218916893-0.0040346500463783741.00.9319689869880676-0.248298004269599910.264160990715026860.00.023382499814033510.7682970166206360.63966602087020870.0-0.3617820143699646-0.5899729728698730.72183501720428470.00.03427390009164810.094680696725845340.0096299396827816961.00.9427329897880554-0.223545998334884640.24755300581455230.00.017677599564194680.7746199965476990.63217902183532710.0-0.333079993724823-0.59160000085830690.73421198129653930.00.0171910002827644350.03640490025281906-0.0060679200105369091.00.9429500102996826-0.21653699874877930.25289699435234070.00.002694060094654560.76453900337219240.64457201957702640.0-0.3329229950904846-0.60711801052093510.72150599956512450.00.0102137001231312750.023345300927758217-0.0043774899095296861.00.9654129743576050.157709002494812-0.207616999745368960.00.0155645003542304040.76002901792526250.64970201253890990.00.2602590024471283-0.63046300411224370.73128801584243770.0-0.00364764011465013030.096580803394317630.0044052097946405411.00.97247397899627690.11432900279760361-0.203038007020950320.00.044799100607633590.76336401700973510.64441400766372680.00.2286670058965683-0.63577097654342650.73722898960113530.0-0.0123153002932667730.035998500883579254-0.0075785201042890551.00.96376097202301030.15707699954509735-0.21561999619007110.00.0189111009240150450.76600497961044310.64255702495574950.00.2660970091819763-0.62334901094436650.73527497053146360.0-0.0065627098083496090.02019299939274788-0.0045438897795975211.00.82219499349594120.3776470124721527-0.42588400840759280.0-0.118125997483730320.84512501955032350.5213530063629150.00.5568130016326904-0.37834599614143370.7394679784774780.0-0.0232133995741605760.08812329918146133-0.0041738501749932771.00.86176002025604250.33954399824142456-0.37693598866462710.0-0.106248997151851650.84731501340866090.52035301923751830.00.49606600403785706-0.40837100148200990.76625800132751460.0-0.0222677998244762420.02319590002298355-0.0055669201537966731.00.87477701902389530.3211840093135834-0.36277499794960020.0-0.108980998396873470.85996502637863160.49858099222183230.00.47211000323295593-0.39661198854446410.78728097677230830.0-0.012436700053513050.014924099668860435-0.0033164799679070711.00.9163669943809509-0.072017200291156770.39380899071693420.0-0.11881099641323090.89044702053070070.4393039941787720.0-0.38230299949645996-0.44935199618339540.8074200153350830.00.032215598970651630.02088090032339096-0.008553059771656991.00.9283679723739624-0.0201622005552053450.37111499905586240.0-0.166196003556251530.87061101198196410.46305000782012940.0-0.33243298530578613-0.49155899882316590.80489701032638550.00.0294509995728731160.03365840017795563-0.00105202000122517351.00.9289919734001160.079554900527000430.36144900321960450.0-0.26165801286697390.83187001943588260.48941498994827270.0-0.2617430090904236-0.54923802614212040.79361701011657710.00.0209248997271060940.028203699737787247-0.0009096220019273461.00.9987319707870483-0.04983120039105415-0.0070897699333727360.00.0301342997699975970.704800009727478-0.7087659835815430.00.0403155013918876650.70765399932861330.7054079771041870.00.015188699588179588-0.098942197859287260.0104294996708631521.00.9989460110664368-0.045610301196575165-0.005135800223797560.00.0289570000022649770.7130839824676514-0.70047998428344730.00.035611398518085480.69959300756454470.71365398168563840.0-0.0010505500249564648-0.042020801454782486-0.0063028801232576371.00.9963470101356506-0.08039940148591995-0.028780499473214150.00.0383009985089302060.7219560146331787-0.69087797403335570.00.076324403285980220.68725198507308960.72239899635314940.0-0.0005042660050094128-0.024710899218916893-0.00403465982526540761.00.93196898698806760.248298004269599910.264160990715026860.0-0.0233826003968715670.768297016620636-0.63966697454452510.0-0.36178201436996460.5899729728698730.72183501720428470.00.0342739000916481-0.094680696725845340.0096299396827816961.00.94273298978805540.223545998334884640.24755300581455230.0-0.0176777001470327380.774619996547699-0.63217902183532710.0-0.3330799937248230.59160000085830690.73421198129653930.00.017191000282764435-0.03640500083565712-0.0060678198933601381.00.94295001029968260.21653699874877930.25289699435234070.0-0.0026940701063722370.7645390033721924-0.64457201957702640.0-0.33292299509048460.60711801052093510.72150599956512450.00.010213700123131275-0.023345300927758217-0.0043774899095296861.00.965412974357605-0.157709002494812-0.207616999745368960.0-0.0155645003542304040.7600290179252625-0.64970201253890990.00.26025900244712830.63046300411224370.73128801584243770.0-0.0036476401146501303-0.096580803394317630.0044052097946405411.00.9724739789962769-0.11432900279760361-0.203038007020950320.0-0.044799100607633590.7633640170097351-0.64441400766372680.00.22866700589656830.63577097654342650.73722898960113530.0-0.012315300293266773-0.035998400300741196-0.0075783901847898961.00.9637609720230103-0.15707699954509735-0.21561999619007110.0-0.0189111009240150450.7660049796104431-0.64255702495574950.00.26609700918197630.62334901094436650.73527497053146360.0-0.006562769878655672-0.02019290067255497-0.0045436499640345571.00.8221949934959412-0.3776470124721527-0.42588400840759280.00.118125997483730320.8451250195503235-0.5213530063629150.00.55681300163269040.37834599614143370.7394679784774780.0-0.023213399574160576-0.08812329918146133-0.0041738501749932771.00.8617600202560425-0.33954399824142456-0.37693598866462710.00.106248997151851650.8473150134086609-0.52035301923751830.00.496066004037857060.40837100148200990.76625800132751460.0-0.022267799824476242-0.023195700719952583-0.0055669001303613191.00.8747770190238953-0.3211840093135834-0.36277499794960020.00.108980998396873470.8599650263786316-0.49858099222183230.00.472110003232955930.39661198854446410.78728097677230830.0-0.012436600401997566-0.014924000017344952-0.00331673002801835541.00.91636699438095090.072017401456832890.39380899071693420.00.11881099641323090.8904470205307007-0.4393039941787720.0-0.382302999496459960.44935199618339540.8074200153350830.00.03221559897065163-0.02088090032339096-0.008553059771656991.00.92836797237396240.0201622005552053450.37111499905586240.00.166196003556251530.8706110119819641-0.46305000782012940.0-0.332432985305786130.49155899882316590.80489701032638550.00.029450900852680206-0.03365840017795563-0.00105209997855126861.00.928991973400116-0.079554900527000430.36144900321960450.00.26165801286697390.8318700194358826-0.48941498994827270.0-0.26174300909042360.54923802614212040.79361701011657710.00.020925000309944153-0.028203800320625305-0.00090978998923674231.0pelvis_offset0.0inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.0670200586318971.00.99873197078704830.04983130097389221-0.0070897499099373820.0-0.0301342997699975970.7048000097274780.7087659835815430.00.040315598249435425-0.70765399932861330.7054079771041870.0-0.0084887603297829630.41053301095962524-1.20159995555877691.00.99894601106643680.045610301196575165-0.005135800223797560.0-0.0289570000022649770.71308398246765140.70047998428344730.00.03561139851808548-0.69959300756454470.71365398168563840.0-0.00293081998825073240.35466399788856506-1.19949996471405031.00.99634701013565060.08039940148591995-0.028780499473214150.0-0.0383009985089302060.72195601463317870.69087797403335570.00.07632440328598022-0.68725198507308960.72239899635314940.0-0.040985401719808580.3118860125541687-1.19960999488830571.00.9319689869880676-0.248298004269599910.264160990715026860.00.023382499814033510.7682970166206360.63966602087020870.0-0.3617820143699646-0.5899729728698730.72183501720428470.00.401042997837066650.2437240034341812-1.18042004108428961.00.9427329897880554-0.223545998334884640.24755300581455230.00.017677599564194680.7746199965476990.63217902183532710.0-0.333079993724823-0.59160000085830690.73421198129653930.00.355307996273040770.2053389996290207-1.1836500167846681.00.9429500102996826-0.21653699874877930.25289699435234070.00.002694060094654560.76453900337219240.64457201957702640.0-0.3329229950904846-0.60711801052093510.72150599956512450.00.353888005018234250.2048649936914444-1.17289996147155761.00.9654129743576050.157709002494812-0.207616999745368960.00.0155645003542304040.76002901792526250.64970201253890990.00.2602590024471283-0.63046300411224370.73128801584243770.0-0.26629498600959780.2996309995651245-1.20013999938964841.00.97247397899627690.11432900279760361-0.203038007020950320.00.044799100607633590.76336401700973510.64441400766372680.00.2286670058965683-0.63577097654342650.73722898960113530.0-0.23568700253963470.26565900444984436-1.19586002826690671.00.96376097202301030.15707699954509735-0.21561999619007110.00.0189111009240150450.76600497961044310.64255702495574950.00.2660970091819763-0.62334901094436650.73527497053146360.0-0.25492200255393980.23242099583148956-1.1886899471282961.00.82219499349594120.3776470124721527-0.42588400840759280.0-0.118125997483730320.84512501955032350.5213530063629150.00.5568130016326904-0.37834599614143370.7394679784774780.0-0.5196760296821594-0.007902019657194614-1.14863002300262451.00.86176002025604250.33954399824142456-0.37693598866462710.0-0.106248997151851650.84731501340866090.52035301923751830.00.49606600403785706-0.40837100148200990.76625800132751460.0-0.4340290129184723-0.0015098199946805835-1.1690100431442261.00.87477701902389530.3211840093135834-0.36277499794960020.0-0.108980998396873470.85996502637863160.49858099222183230.00.47211000323295593-0.39661198854446410.78728097677230830.0-0.3928540050983429-0.03789449855685234-1.17518997192382811.00.9163669943809509-0.072017200291156770.39380899071693420.0-0.11881099641323090.89044702053070070.4393039941787720.0-0.38230299949645996-0.44935199618339540.8074200153350830.00.513168990612030.09074380248785019-1.16830003261566161.00.9283679723739624-0.0201622005552053450.37111499905586240.0-0.166196003556251530.87061101198196410.46305000782012940.0-0.33243298530578613-0.49155899882316590.80489701032638550.00.450581997632980350.11499100178480148-1.17621004581451421.00.9289919734001160.079554900527000430.36144900321960450.0-0.26165801286697390.83187001943588260.48941498994827270.0-0.2617430090904236-0.54923802614212040.79361701011657710.00.4012039899826050.1690800040960312-1.17639994621276861.00.9987319707870483-0.04983120039105415-0.0070897699333727360.00.0301342997699975970.704800009727478-0.7087659835815430.00.0403155013918876650.70765399932861330.7054079771041870.0-0.008488760329782963-0.41053301095962524-1.20159995555877691.00.9989460110664368-0.045610301196575165-0.005135800223797560.00.0289570000022649770.7130839824676514-0.70047998428344730.00.035611398518085480.69959300756454470.71365398168563840.0-0.0029308199882507324-0.35466399788856506-1.19949996471405031.00.9963470101356506-0.08039940148591995-0.028780499473214150.00.0383009985089302060.7219560146331787-0.69087797403335570.00.076324403285980220.68725198507308960.72239899635314940.0-0.04098540171980858-0.3118860125541687-1.19960999488830571.00.93196898698806760.248298004269599910.264160990715026860.0-0.0233826003968715670.768297016620636-0.63966697454452510.0-0.36178201436996460.5899729728698730.72183501720428470.00.40104299783706665-0.2437240034341812-1.18042004108428961.00.94273298978805540.223545998334884640.24755300581455230.0-0.0176777001470327380.774619996547699-0.63217902183532710.0-0.3330799937248230.59160000085830690.73421198129653930.00.35530799627304077-0.2053389996290207-1.1836500167846681.00.94295001029968260.21653699874877930.25289699435234070.0-0.0026940701063722370.7645390033721924-0.64457201957702640.0-0.33292299509048460.60711801052093510.72150599956512450.00.35388800501823425-0.2048649936914444-1.17289996147155761.00.965412974357605-0.157709002494812-0.207616999745368960.0-0.0155645003542304040.7600290179252625-0.64970201253890990.00.26025900244712830.63046300411224370.73128801584243770.0-0.2662949860095978-0.2996309995651245-1.20013999938964841.00.9724739789962769-0.11432900279760361-0.203038007020950320.0-0.044799100607633590.7633640170097351-0.64441400766372680.00.22866700589656830.63577097654342650.73722898960113530.0-0.2356870025396347-0.26565900444984436-1.19586002826690671.00.9637609720230103-0.15707699954509735-0.21561999619007110.0-0.0189111009240150450.7660049796104431-0.64255702495574950.00.26609700918197630.62334901094436650.73527497053146360.0-0.2549220025539398-0.23242099583148956-1.1886899471282961.00.8221949934959412-0.3776470124721527-0.42588400840759280.00.118125997483730320.8451250195503235-0.5213530063629150.00.55681300163269040.37834599614143370.7394679784774780.0-0.51967602968215940.007902019657194614-1.14863002300262451.00.8617600202560425-0.33954399824142456-0.37693598866462710.00.106248997151851650.8473150134086609-0.52035301923751830.00.496066004037857060.40837100148200990.76625800132751460.0-0.43402901291847230.0015098199946805835-1.1690100431442261.00.8747770190238953-0.3211840093135834-0.36277499794960020.00.108980998396873470.8599650263786316-0.49858099222183230.00.472110003232955930.39661198854446410.78728097677230830.0-0.39285400509834290.03789449855685234-1.17518997192382811.00.91636699438095090.072017401456832890.39380899071693420.00.11881099641323090.8904470205307007-0.4393039941787720.0-0.382302999496459960.44935199618339540.8074200153350830.00.51316899061203-0.0907440036535263-1.16830003261566161.00.92836797237396240.0201622005552053450.37111499905586240.00.166196003556251530.8706110119819641-0.46305000782012940.0-0.332432985305786130.49155899882316590.80489701032638550.00.45058199763298035-0.11499100178480148-1.17621004581451421.00.928991973400116-0.079554900527000430.36144900321960450.00.26165801286697390.8318700194358826-0.48941498994827270.0-0.26174300909042360.54923802614212040.79361701011657710.00.401203989982605-0.1690800040960312-1.17639994621276861.015659a9a-f1c1-3e38-8343-2e23e9f65d20bind_shape_matrix0.129504993557930.00.00.00.00.097699806094169620.00.00.00.00.138080000877380370.00.021911798045039177-0.0570470988750457761.83544993400573731.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.01d5936bc-0501-7376-f70c-06dcfac920edbind_shape_matrix0.048803295940160750.00.00.00.00.0488033369183540340.00.00.00.00.049029946327209470.00.058865547180175780.03438653051853181.75724506378173831.0joint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.090427502989768980.037174601107835770.080562800168991091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.09042750298976898-0.037174601107835770.080562800168991091.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.06363839656114578-0.03717460110783577-1.89970004558563231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.063638396561145780.03717460110783577-1.89970004558563231.09174c7f1-bd5f-68d2-2f4f-cc9b36312067bind_shape_matrix0.083263903856277470.00.00.00.00.125166594982147220.00.00.00.00.105179905891418460.00.113597050309181210.01.73993992805480961.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253964997828006741.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.0260765999555587771.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.057003501802682881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.057003501802682881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.056274298578500751.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.056274298578500751.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087502397596836091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171770993620157241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.00385225005447864531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.0045324601233005521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.0045324601233005521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.8401499986648561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.8204499483108521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.95114994049072271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0d73dea3b-b8cb-59ff-c76b-cfdcc8119bb5bind_shape_matrix0.088992610573768620.00.00.00.00.063932202756404880.00.00.00.00.0207600593566894530.00.103547699749469760.01.6937500238418581.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.0d0328b82-d9ca-6071-b248-17edfc7612cbbind_shape_matrix0.135498702526092530.00.00.00.00.14647419750690460.00.00.00.00.120779991149902340.00.103381648659706120.01.74884998798370361.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.005bf604d-d1c0-352b-cb2f-c37caca6f542bind_shape_matrix0.0145499994978308680.00.00.00.00.0359961986541748050.00.00.00.00.0196599960327148440.00.13412399590015410.01.69300997257232671.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.046ee8fb2-15f0-fa2e-d260-e7e6e8295445bind_shape_matrix0.144471108913421630.00.00.00.00.079346001148223880.00.00.00.00.03420996665954590.00.078120440244674680.01.697255015373231.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.0d2205615-2ce0-4ff1-2bfd-bdc77a3825ccbind_shape_matrix0.065835200250148770.00.00.00.00.19282799959182740.00.00.00.00.105929970741271970.00.020774498581886290.01.71460509300231931.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.08665c374-cb61-d418-d412-7f4ea828e119bind_shape_matrix0.66893059015274050.00.00.00.00.171288996934890750.00.00.00.00.19170999526977540.0-0.406830698251724240.01.12604498863220211.0joint_namesmTail1mPelvismTail2mTail3mTail4mTail6mTail5alt_inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.0-0.165999993681907650.00.067000001668930051.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.0-0.147750005125999450.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.126000002026557920.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.106499999761581420.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.070500001311302190.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.083999998867511750.00.01.0pelvis_offset0.0inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.165999993681907650.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.31374999880790710.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.439749985933303830.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.54624998569488530.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.70074999332427980.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.63024997711181640.0-1.13401997089385991.0e678576a-dc9f-5187-6ed5-5b4aafb65d7bbind_shape_matrix0.0103429928421974180.00.00.00.00.060677599161863330.00.00.00.00.0129300355911254880.00.111756503582000730.01.68668508529663091.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.08d23b8c8-fadf-c1b3-0b04-a3ecea292576bind_shape_matrix0.129504993557930.00.00.00.00.097699806094169620.00.00.00.00.138080000877380370.00.0219117980450391770.0570470988750457761.83544993400573731.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.02a30e7ec-9840-f495-daa1-2b8d0d025a78bind_shape_matrix0.064477898180484770.00.00.00.00.069889500737190250.00.00.00.00.105170004069805150.00.0064538493752479550.078819252550601961.84524500370025631.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.03bd8d73d-be6f-8de2-39ae-1f680189bc27bind_shape_matrix0.064477898180484770.00.00.00.00.069889500737190250.00.00.00.00.105170004069805150.00.006453849375247955-0.078819252550601961.84524500370025631.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.034db2e33-e79f-ea57-14af-c1ce9cbc63ffbind_shape_matrix0.037142097949981690.00.00.00.00.146102800965309140.00.00.00.00.032979965209960940.00.079298749566078190.01.75784003734588621.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0 \ No newline at end of file diff --git a/indra/llappearanceutility/tests/joint-offsets.xml.output b/indra/llappearanceutility/tests/joint-offsets.xml.output new file mode 100644 index 0000000000..d0f94b8f11 --- /dev/null +++ b/indra/llappearanceutility/tests/joint-offsets.xml.output @@ -0,0 +1 @@ +skindata05bf604d-d1c0-352b-cb2f-c37caca6f542joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset015659a9a-f1c1-3e38-8343-2e23e9f65d20joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset01d5936bc-0501-7376-f70c-06dcfac920edjoint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightjoint_offset0.090427502989768981933593750.037174601107835769653320310.0805628001689910888671875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.09042750298976898193359375-0.037174601107835769653320310.0805628001689910888671875pelvis_offset02a30e7ec-9840-f495-daa1-2b8d0d025a78joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset034db2e33-e79f-ea57-14af-c1ce9cbc63ffjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset03bd8d73d-be6f-8de2-39ae-1f680189bc27joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset046ee8fb2-15f0-fa2e-d260-e7e6e8295445joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset0547d8392-9f19-35fb-3508-121eea388f0ajoint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvismFaceTongueBasemFaceTeethLowermFaceTongueTipjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625-0.0298503991216421127319335900.0078316899016499519348144530.083006501197814941406250-0.020363999530673027038574220.03891620039939880371093750-0.002775429980829358100891113pelvis_offset07e7a6834-8b41-4029-8f87-ce57b7d05beejoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset08665c374-cb61-d418-d412-7f4ea828e119joint_namesmTail1mPelvismTail2mTail3mTail4mTail6mTail5joint_offset-0.165999993681907653808593800.0670000016689300537109375001.06702005863189697265625-0.147750005125999450683593800-0.126000002026557922363281200-0.106499999761581420898437500-0.0705000013113021850585937500-0.0839999988675117492675781200pelvis_offset08d23b8c8-fadf-c1b3-0b04-a3ecea292576joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset09174c7f1-bd5f-68d2-2f4f-cc9b36312067joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025396499782800674438476560.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607659995555877685546875-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038352798670530319213867190.0449016988277435302734375-0.036976300179958343505859380.038352798670530319213867190.018112899735569953918457030.016734100878238677978515620.057003501802682876586914060.01811289973556995391845703-0.016734100878238677978515620.05700350180268287658691406-0.0082314396277070045471191410.037603501230478286743164060.05627429857850074768066406-0.008231439627707004547119141-0.037603501230478286743164060.056274298578500747680664060.0731943026185035705566406200.087502397596836090087890620.104399003088474273681640600.017177099362015724182128910.150499001145362854003906200.0038522500544786453247070310.04490169882774353027343750.036976300179958343505859380.038352798670530319213867190.0449016988277435302734375-0.036976300179958343505859380.038352798670530319213867190.029158199205994606018066410.05687420070171356201171875-0.0045324601233005523681640620.02915819920599460601806641-0.05687420070171356201171875-0.0045324601233005523681640620.0167011991143226623535156200.009711739607155323028564453pelvis_offset092a7dd5c-bc30-9952-3b3b-e6cc10336cbejoint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightjoint_offset0.090427502989768981933593750.037174601107835769653320310.0805628001689910888671875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.09042750298976898193359375-0.037174601107835769653320310.0805628001689910888671875pelvis_offset0971cf873-afce-8b69-44d6-3f5879cb94c2joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d0328b82-d9ca-6071-b248-17edfc7612cbjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d2205615-2ce0-4ff1-2bfd-bdc77a3825ccjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d73dea3b-b8cb-59ff-c76b-cfdcc8119bb5joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset0e678576a-dc9f-5187-6ed5-5b4aafb65d7bjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0ed796a27-cff0-454a-ecec-fd10794ca2c9joint_namesmFaceNoseBasemFaceRootmHeadmNeckmChestmTorsomPelvismFaceLipUpperCentermFaceTeethUpperjoint_offset0.150499001145362854003906200.0038539199158549308776855470.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.0167011991143226623535156200.0097117396071553230285644530.10700099915266036987304690-0.02607489936053752899169922pelvis_offset0fa0aabfe-4b1c-fa9b-4942-74e7e7f50fe2joint_namesmPelvismHandMiddle1LeftmHandMiddle2LeftmHandMiddle3LeftmHandIndex1LeftmHandIndex2LeftmHandIndex3LeftmHandRing1LeftmHandRing2LeftmHandRing3LeftmHandPinky1LeftmHandPinky2LeftmHandPinky3LeftmHandThumb1LeftmHandThumb2LeftmHandThumb3LeftmHandMiddle1RightmHandMiddle2RightmHandMiddle3RightmHandIndex1RightmHandIndex2RightmHandIndex3RightmHandRing1RightmHandRing2RightmHandRing3RightmHandPinky1RightmHandPinky2RightmHandPinky3RightmHandThumb1RightmHandThumb2RightmHandThumb3Rightjoint_offset001.067020058631896972656250.015188699588179588317871090.098942197859287261962890620.01042949967086315155029297-0.0010505600366741418838500980.04202070087194442749023438-0.006302990019321441650390625-0.00050425098743289709091186520.02471089921891689300537109-0.0040346500463783740997314450.034273900091648101806640620.09468069672584533691406250.0096299396827816963195800780.017191000282764434814453120.03640490025281906127929688-0.0060679200105369091033935550.010213700123131275177001950.02334530092775821685791016-0.004377489909529685974121094-0.0036476401146501302719116210.0965808033943176269531250.004405209794640541076660156-0.012315300293266773223876950.03599850088357925415039062-0.007578520104289054870605469-0.0065627098083496093750.02019299939274787902832031-0.00454388977959752082824707-0.023213399574160575866699220.08812329918146133422851562-0.004173850174993276596069336-0.022267799824476242065429690.02319590002298355102539062-0.005566920153796672821044922-0.01243670005351305007934570.01492409966886043548583984-0.0033164799679070711135864260.032215598970651626586914060.02088090032339096069335938-0.0085530597716569900512695310.029450999572873115539550780.03365840017795562744140625-0.0010520200012251734733581540.020924899727106094360351560.02820369973778724670410156-0.00090962200192734599113464360.01518869958817958831787109-0.098942197859287261962890620.01042949967086315155029297-0.001050550024956464767456055-0.04202080145478248596191406-0.006302880123257637023925781-0.0005042660050094127655029297-0.02471089921891689300537109-0.0040346598252654075622558590.03427390009164810180664062-0.09468069672584533691406250.0096299396827816963195800780.01719100028276443481445312-0.03640500083565711975097656-0.0060678198933601379394531250.01021370012313127517700195-0.02334530092775821685791016-0.004377489909529685974121094-0.003647640114650130271911621-0.0965808033943176269531250.004405209794640541076660156-0.01231530029326677322387695-0.03599840030074119567871094-0.007578390184789896011352539-0.006562769878655672073364258-0.02019290067255496978759766-0.004543649964034557342529297-0.02321339957416057586669922-0.08812329918146133422851562-0.004173850174993276596069336-0.02226779982447624206542969-0.02319570071995258331298828-0.005566900130361318588256836-0.01243660040199756622314453-0.01492400001734495162963867-0.0033167300280183553695678710.03221559897065162658691406-0.02088090032339096069335938-0.0085530597716569900512695310.02945090085268020629882812-0.03365840017795562744140625-0.0010520999785512685775756840.02092500030994415283203125-0.02820380032062530517578125-0.0009097899892367422580718994pelvis_offset0success1 diff --git a/indra/llappearanceutility/tests/params.xml b/indra/llappearanceutility/tests/params.xml new file mode 100644 index 0000000000..7d7ff646b7 --- /dev/null +++ b/indra/llappearanceutility/tests/params.xml @@ -0,0 +1,1140 @@ + + + + skindata + + 270bb701-8643-c4b3-6a93-7a2b6503b30a + + joint_names + + mTail1 + mPelvis + mTail2 + mTorso + mSpine2 + mSpine1 + mHipLeft + mKneeLeft + mHipRight + mKneeRight + mChest + mSpine4 + mSpine3 + mShoulderRight + mCollarRight + mShoulderLeft + mCollarLeft + mElbowRight + mElbowLeft + mNeck + mAnkleRight + mAnkleLeft + + joint_offset + + + -0.12795400619506836 + 0.0 + 0.001858999952673912 + + + 0.0 + 0.0 + 1.081987977027893 + + + -0.018850000575184822 + 0.0 + -0.09493499994277954 + + + 0.0 + 0.0 + 0.08407299965620041 + + + 0.0 + 0.0 + -0.08407299965620041 + + + 0.0 + 0.0 + 0.08407299965620041 + + + 0.03375700116157532 + 0.12676499783992767 + -0.04099800065159798 + + + -0.0008870000019669533 + -0.04556800052523613 + -0.4910529851913452 + + + 0.03361999988555908 + -0.1288059949874878 + -0.041085999459028244 + + + -0.0007800000021234155 + 0.04863499850034714 + -0.4909220039844513 + + + -0.01536799967288971 + 0.0 + 0.20487700402736664 + + + 0.01536799967288971 + 0.0 + -0.20487700402736664 + + + -0.01536799967288971 + 0.0 + 0.20487700402736664 + + + 0.0 + -0.07941800355911255 + 0.0 + + + -0.020927000790834427 + -0.08500000089406967 + 0.16539600491523743 + + + 0.0 + 0.07900000363588333 + 0.0 + + + -0.020927000790834427 + 0.08466500043869019 + 0.16539600491523743 + + + 0.0 + -0.24799999594688416 + 0.0 + + + 0.0 + 0.24799999594688416 + 0.0 + + + -0.00950700044631958 + 0.0 + 0.25110799074172974 + + + -0.02886899933218956 + 0.0 + -0.4684939980506897 + + + -0.028886999934911728 + 0.0013780000153928995 + -0.4684489965438843 + + + pelvis_offset + 0.0 + + + wearables + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 7e3e76fc-7fa4-ec8f-a785-8956dbce6e72 + contents + LLWearable version 22 +Fashionista Male - Shape (new) + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 0 +parameters 142 +1 0 +2 .16 +4 -.23 +5 -.1 +6 -.3 +7 0 +8 0 +10 0 +11 .04 +12 0 +13 0 +14 0 +15 0 +17 0 +18 0 +19 -.1 +20 .56 +21 .07 +22 0 +23 .42 +24 -.66 +25 .51 +26 0 +27 .02 +28 .6 +29 0 +30 0 +32 1 +33 -.41 +34 .4 +35 0 +36 -.49 +37 0 +38 .42 +40 1 +80 1 +100 1 +104 0 +105 .5 +106 0 +107 0 +151 .16 +152 0 +153 1 +155 -.13 +156 0 +157 0 +185 -.44 +186 0 +187 0 +188 0 +189 0 +193 .5 +194 -.12 +195 -.06 +196 -.59 +505 .65 +506 -.04 +507 0 +515 -.2 +517 .12 +518 -.3 +626 0 +627 0 +629 .5 +630 0 +631 0 +633 .01 +634 .01 +635 .01 +637 .01 +646 0 +647 0 +648 0 +649 .5 +650 -.67 +651 .03 +652 .49 +653 .26 +655 -.08 +656 0 +657 .03 +658 0 +659 .51 +660 0 +661 0 +662 .5 +663 -.2 +664 .13 +665 .04 +675 .03 +676 -.43 +677 .34 +678 .37 +679 -.08 +680 -.08 +681 -.08 +682 .5 +683 -.14 +684 0 +685 .14 +686 -.68 +687 -.09 +688 -.09 +689 -.34 +690 .33 +691 -.09 +692 .24 +693 .1 +694 -.08 +695 -.09 +753 .06 +756 -.08 +758 -1.05 +759 .67 +760 0 +764 -.5 +765 1.02 +767 .08 +768 .08 +769 .52 +770 0 +772 0 +773 .5 +794 0 +795 .41 +796 0 +797 .15 +798 0 +799 .45 +841 0 +842 -.8 +843 0 +853 0 +854 .06 +855 -.43 +879 -.1 +880 -.82 +1103 0 +1104 0 +1105 0 +11001 0 +textures 0 + + created_at + 1724256027 + desc + + flags + 256 + inv_type + 18 + item_id + 8bbf11b0-b86b-3b4c-8c5c-c84902425f42 + metadata + + + name + Leonard - Shape + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 573440 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 540672 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 573440 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 573440 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 0 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 9e675544-77c0-0db6-3694-462be7460b76 + contents + LLWearable version 22 +Formal Male - Skin (less old) + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 1 +parameters 37 +108 0 +110 0 +111 0 +116 0 +117 0 +118 0 +125 0 +126 0 +150 0 +158 0 +159 0 +161 0 +162 0 +163 0 +165 0 +700 .25 +701 0 +702 0 +703 0 +704 0 +705 .5 +706 .6 +707 0 +708 0 +709 0 +710 0 +711 .5 +712 0 +713 .7 +714 0 +715 0 +775 0 +776 0 +777 0 +873 0 +874 0 +878 0 +textures 3 +0 a21d4081-601e-f9f0-0acc-9192c72863dc +5 a85bf749-952d-3835-d9ac-a307c780930c +6 ab169525-d46c-918b-3195-7f2b92fd76c5 + + created_at + 1724256027 + desc + + flags + 257 + inv_type + 18 + item_id + 9e6c5696-cae0-337e-a5c6-aa6fede08ec6 + metadata + + + name + Leonard - Skin + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 1 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 0b935621-92da-099e-a248-cfbfa3624c68 + contents + LLWearable version 22 +Fashionista Male - Brows (new) + + permissions 0 + { + base_mask 00082000 + owner_mask 00082000 + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 2 +parameters 90 +16 .41 +31 1.04 +112 0 +113 0 +114 0 +115 0 +119 .5 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 .5 +140 0 +141 0 +142 0 +143 -4 +144 1 +145 0 +146 1 +147 0 +148 1 +149 0 +166 0 +167 0 +168 0 +169 0 +171 0 +172 1 +173 0 +174 1 +175 0 +176 1 +177 0 +178 0 +179 1 +180 0 +181 -1 +182 -1 +183 -1 +184 0 +190 0 +191 0 +192 0 +400 .75 +640 -.01 +641 .2 +642 0 +643 0 +644 .24 +645 0 +674 -.3 +750 .65 +751 0 +752 .5 +754 0 +755 .05 +757 -1.6 +761 1.3 +762 0 +763 0 +771 -.08 +774 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +870 -.11 +871 -.4 +872 .52 +1000 .5 +1001 .5 +1002 .65 +1003 .65 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 .25 +textures 1 +4 3cc3add8-6ff0-0640-79ba-b15137f64008 + + created_at + 1724256027 + desc + + flags + 258 + inv_type + 18 + item_id + 3ddd2d41-fbe4-3076-9732-c5f3b12973b1 + metadata + + + name + Leonard - Brows + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 2 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 052ca46d-9612-7a43-25a9-d7c8a5387cf6 + contents + LLWearable version 22 +Fashionista Male - Eyes + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 3 +parameters 2 +98 1 +99 0 +textures 1 +3 579e320c-0f16-2a1d-2018-2a00cc657068 + + created_at + 1724256027 + desc + + flags + 259 + inv_type + 18 + item_id + 9d4e7072-0e92-39a1-95a4-b5330450b1ee + metadata + + + name + Leonard - Eyes + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 3 + + + + + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 5f049939-bb34-ad27-66cb-38c9151a105d + contents + LLWearable version 22 +Fashionista Male - Shoe Base + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + last_owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 6 +parameters 20 +197 0 +198 0 +500 0 +501 .1 +502 .1 +503 .1 +508 -.52 +509 1 +510 0 +511 .82 +512 0 +513 0 +514 .09 +616 .3 +654 .06 +812 1 +813 1 +817 1 +1052 .3 +1053 .3 +textures 1 +7 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + created_at + 1724256027 + desc + @600 + flags + 262 + inv_type + 18 + item_id + dc5e279a-4a34-36ee-9075-028df446392c + metadata + + + name + Leonard - Shoes BASE + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 6 + + + + + + + + + + + + + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + ab0bd2c6-3776-7ea6-264f-102842c6328b + contents + LLWearable version 22 +Fashionista Female - Heels Alpha + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + last_owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 b5b09502-8305-af43-cc4e-7238cb715b11 +22 5748decc-f629-461c-9a36-a35a221fe21f +23 5748decc-f629-461c-9a36-a35a221fe21f +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1300 + flags + 269 + inv_type + 18 + item_id + b76dde5f-0da2-3e21-b505-d587b16ddb3c + metadata + + + name + Leonard - Shoes ALPHA + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + cb80f44f-8265-f56b-c812-ddf729cee73b + contents + LLWearable version 22 +New Alpha + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + owner_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + last_owner_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 d9413239-769d-abc9-e929-4fa98f52c07b +22 b5d465f9-ca8e-8ba4-efd8-ee8929c592b8 +23 5748decc-f629-461c-9a36-a35a221fe21f +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1301 + flags + 269 + inv_type + 18 + item_id + efc7da55-02ba-3286-8458-780aede51b49 + metadata + + + name + Leonard - Suit Alpha + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + f235a6a9-062a-bb40-46c2-c8a7bec95fbf + contents + LLWearable version 22 +System Eyelash Remover + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 5748decc-f629-461c-9a36-a35a221fe21f +22 5748decc-f629-461c-9a36-a35a221fe21f +23 9e460914-daed-b03f-0f2a-afbe67833b11 +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1302 + flags + 269 + inv_type + 18 + item_id + 624f9c12-72e8-3409-a3f3-b3fe8f496b13 + metadata + + + name + System Eyelash Remover + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + + + + + + + + + diff --git a/indra/llappearanceutility/tests/params.xml.output b/indra/llappearanceutility/tests/params.xml.output new file mode 100644 index 0000000000..58449dd37a --- /dev/null +++ b/indra/llappearanceutility/tests/params.xml.output @@ -0,0 +1 @@ +avatar_scale0.4499999880790710449218750.600000023841857910156251.76146829128265380859375debug_params1namebig_browvalue0weight3310namesunken_cheeksvalue0weight8510000namebreast_physics_massvalue0.1000000014901161193847656weight010001namebreast_physics_gravityvalue0weight010002namebreast_physics_dragvalue1weight2510003namebreast_physics_updown_max_effectvalue0weight010004namebreast_physics_updown_springvalue10weight2510005namebreast_physics_updown_gainvalue10weight2310006namebreast_physics_updown_dampingvalue0.2000000029802322387695312weight5110007namebreast_physics_inout_max_effectvalue0weight010008namebreast_physics_inout_springvalue10weight2510009namebreast_physics_inout_gainvalue10weight2310010namebreast_physics_inout_dampingvalue0.2000000029802322387695312weight5110011namebelly_physics_massvalue0.1000000014901161193847656weight010012namebelly_physics_gravityvalue0weight010013namebelly_physics_dragvalue1weight2510014namebelly_physics_updown_max_effectvalue0weight010015namebelly_physics_updown_springvalue10weight2510016namebelly_physics_updown_gainvalue10weight2310017namebelly_physics_updown_dampingvalue0.2000000029802322387695312weight5110018namebutt_physics_massvalue0.1000000014901161193847656weight010019namebutt_physics_gravityvalue0weight010020namebutt_physics_dragvalue1weight2510021namebutt_physics_updown_max_effectvalue0weight010022namebutt_physics_updown_springvalue10weight2510023namebutt_physics_updown_gainvalue10weight2310024namebutt_physics_updown_dampingvalue0.2000000029802322387695312weight5110025namebutt_physics_leftright_max_effectvalue0weight010026namebutt_physics_leftright_springvalue10weight2510027namebutt_physics_leftright_gainvalue10weight2310028namebutt_physics_leftright_dampingvalue0.2000000029802322387695312weight5110029namebreast_physics_leftright_max_effectvalue0weight010030namebreast_physics_leftright_springvalue10weight2510031namebreast_physics_leftright_gainvalue10weight2310032namebreast_physics_leftright_dampingvalue0.2000000029802322387695312weight51105namebreast sizevalue0.5weight127108namerainbow colorvalue0weight011namenoble_nose_bridgevalue0.03999999910593032836914062weight68110namered skinvalue0weight011000nameappearancemessage_versionvalue1weight111001namehovervalue0weight127111namepigmentvalue0weight0112namerainbow colorvalue0weight0113namered hairvalue0weight0114nameblonde hairvalue0weight0115namewhite hairvalue0weight0116namerosy complexionvalue0weight0117namelip pinknessvalue0weight0119nameeyebrow sizevalue0.5weight12712namejowlsvalue0weight4213namecleft_chin_uppervalue0weight0130namefront fringevalue0weight0131nameside fringevalue0weight0132nameback fringevalue0weight0133namehair frontvalue0weight0134namehair sidesvalue0weight0135namehair backvalue0weight0136namehair sweepvalue0weight0137namehair tiltvalue0.5weight12714namehigh_cheek_bonesvalue0weight85140namehair_part_middlevalue0weight0141namehair_part_rightvalue0weight0142namehair_part_leftvalue0weight0143namehair_sides_fullvalue-4weight015nameears_outvalue0weight63150namebody definitionvalue0weight0155namelip widthvalue-0.12999999523162841796875weight89157namebelly sizevalue0weight016namepointy_eyebrowsvalue0.4099999964237213134765625weight66162namefacial definitionvalue0weight0163namewrinklesvalue0weight0165namefrecklesvalue0weight0166namesideburnsvalue0weight0167namemoustachevalue0weight0168namesoulpatchvalue0weight0169namechin curtainsvalue0weight017namesquare_jawvalue0weight85177namehair_rumpledvalue0weight018namepuffy_upper_cheeksvalue0weight95181namehair_big_frontvalue-1weight0182namehair_big_topvalue-1weight0183namehair_big_backvalue-1weight0184namehair_spikedvalue0weight0185namedeep_chinvalue-0.439999997615814208984375weight7119nameupturned_nose_tipvalue-0.1000000014901161193847656weight142192namebangs_part_middlevalue0weight0193namehead shapevalue0.5weight127196nameeye spacingvalue-0.589999973773956298828125weight119198nameheel heightvalue0weight02namenose_big_outvalue0.1599999964237213134765625weight7420namebulbous_nosevalue0.560000002384185791015625weight13521nameupper_eyelid_foldvalue0.07000000029802322387695312weight4522nameattached_earlobesvalue0weight023namebaggy_eyesvalue0.4199999868869781494140625weight11724namewide_eyesvalue-0.660000026226043701171875weight6125namewide_lip_cleftvalue0.5099999904632568359375weight14527namewide_nose_bridgevalue0.01999999955296516418457031weight13431namearced_eyebrowsvalue1.03999996185302734375weight13233nameheightvalue-0.4099999964237213134765625weight11234namethicknessvalue0.4000000059604644775390625weight12735namebig_earsvalue0weight8536nameshouldersvalue-0.4900000095367431640625weight10437namehip widthvalue0weight13638nametorso lengthvalue0.4199999868869781494140625weight1814namebroad_nostrilsvalue-0.2300000041723251342773438weight455namecleft_chinvalue-0.1000000014901161193847656weight0503nameplatform heightvalue0.1000000014901161193847656weight25505namelip thicknessvalue0.64999997615814208984375weight165506namemouth_heightvalue-0.03999999910593032836914062weight124507namebreast_gravityvalue0weight109508nameshoe_platform_widthvalue-0.519999980926513671875weight40513nameheel shapevalue0weight0514nametoe shapevalue0.0900000035762786865234375weight22515namefoot_sizevalue-0.2000000029802322387695312weight51517namewide_nosevalue0.1199999973177909851074219weight105518nameeyelashes_longvalue-0.300000011920928955078125weight06namebulbous_nose_tipvalue-0.300000011920928955078125weight0603namesleeve lengthvalue0.4000000059604644775390625weight100604namebottomvalue0.85000002384185791015625weight216605namecollar frontvalue0.839999973773956298828125weight214606namesleeve lengthvalue0.800000011920928955078125weight204607namecollar frontvalue0.800000011920928955078125weight204608namebottom length lowervalue0.800000011920928955078125weight204609nameopen jacketvalue0.2000000029802322387695312weight51616nameshoe heightvalue0.300000011920928955078125weight76617namesocks lengthvalue0.3499999940395355224609375weight89619namepants lengthvalue0.300000011920928955078125weight76624namepants waistvalue0.800000011920928955078125weight204625nameleg_pantflairvalue0weight0629nameforehead anglevalue0.5weight127637namebody fatvalue0.009999999776482582092285156weight2638namelow_crotchvalue0weight0646nameegg_headvalue0weight144647namesquash_stretch_headvalue0weight85649nametorso musclesvalue0.5weight127650nameeyelid_corner_upvalue-0.670000016689300537109375weight64652nameleg musclesvalue0.4900000095367431640625weight124653nametall_lipsvalue0.2599999904632568359375weight107654nameshoe_toe_thickvalue0.05999999865889549255371094weight7656namecrooked_nosevalue0weight127659namemouth cornervalue0.5099999904632568359375weight130662nameface shearvalue0.5weight127663nameshift_mouthvalue-0.2000000029802322387695312weight114664namepop_eyevalue0.12999999523162841796875weight140665namejaw_jutvalue0.03999999910593032836914062weight130674namehair_shear_backvalue-0.300000011920928955078125weight59675namehand sizevalue0.02999999932944774627685547weight140676namelove_handlesvalue-0.430000007152557373046875weight48678nametorso musclesvalue0.37000000476837158203125weight94682namehead sizevalue0.5weight127683nameneck thicknessvalue-0.1400000005960464477539062weight110684namebreast_female_cleavagevalue0weight47685namechest_male_no_pecsvalue0.1400000005960464477539062weight101690nameeye sizevalue0.3300000131130218505859375weight84692nameleg lengthvalue0.2399999946355819702148438weight158693namearm lengthvalue0.1000000014901161193847656weight1407nameweak_chinvalue0weight127700namelipstick colorvalue0.25weight63701namelipstickvalue0weight0702namelipglossvalue0weight0703nameeyelinervalue0weight0704nameblushvalue0weight0705nameblush colorvalue0.5weight127706nameout shdw opacityvalue0.60000002384185791015625weight127707nameouter shadowvalue0weight0708nameout shdw colorvalue0weight0709nameinner shadowvalue0weight0710namenail polishvalue0weight0711nameblush opacityvalue0.5weight127712namein shdw colorvalue0weight0713namein shdw opacityvalue0.699999988079071044921875weight159714nameeyeliner colorvalue0weight0715namenail polish colorvalue0weight0750nameeyebrow densityvalue0.64999997615814208984375weight165752namehair thicknessvalue0.5weight127753namesaddlebagsvalue0.05999999865889549255371094weight40754namehair_taper_backvalue0weight85755namehair_taper_frontvalue0.05000000074505805969238281weight131756nameneck lengthvalue-0.07999999821186065673828125weight117757namelower_eyebrowsvalue-1.60000002384185791015625weight102758namelower_bridge_nosevalue-1.0499999523162841796875weight38759namelow_septum_nosevalue0.670000016689300537109375weight170760namejaw_anglevalue0weight95762namehair_shear_frontvalue0weight0763namehair volumevalue0weight0764namelip_cleft_deepvalue-0.5weight0765namepuffy_lower_lidsvalue1.019999980926513671875weight120769nameeye depthvalue0.519999980926513671875weight132773namehead lengthvalue0.5weight127775namebody frecklesvalue0weight0779namecollar backvalue0.839999973773956298828125weight214780namecollar backvalue0.800000011920928955078125weight204781namecollar backvalue0.7799999713897705078125weight198785namepigtailsvalue0weight0789nameponytailvalue0weight0795namebutt sizevalue0.4099999964237213134765625weight104796namepointy_earsvalue0weight30799namelip ratiovalue0.449999988079071044921875weight1148namedouble_chinvalue0weight6380namemalevalue1weight255800namesleeve lengthvalue0.88999998569488525390625weight226801nameshirt bottomvalue1weight255802namecollar frontvalue0.7799999713897705078125weight198803nameshirt_redvalue1weight255804nameshirt_greenvalue1weight255805nameshirt_bluevalue1weight255806namepants_redvalue1weight255807namepants_greenvalue1weight255808namepants_bluevalue1weight255812nameshoes_redvalue1weight255813nameshoes_greenvalue1weight255814namewaist heightvalue1weight255815namepants lengthvalue0.800000011920928955078125weight204816nameloose lower clothingvalue0weight0817nameshoes_bluevalue1weight255818namesocks_redvalue1weight255819namesocks_greenvalue1weight255820namesocks_bluevalue1weight255821nameundershirt_redvalue1weight255822nameundershirt_greenvalue1weight255823nameundershirt_bluevalue1weight255824nameunderpants_redvalue1weight255825nameunderpants_greenvalue1weight255826nameunderpants_bluevalue1weight255827namegloves_redvalue1weight255828nameloose upper clothingvalue0weight0829namegloves_greenvalue1weight255830namegloves_bluevalue1weight255834namejacket_redvalue1weight255835namejacket_greenvalue1weight255836namejacket_bluevalue1weight255840nameshirtsleeve_flairvalue0weight0841namebowed_legsvalue0weight127842namehip lengthvalue-0.800000011920928955078125weight25844nameglove fingersvalue1weight255848nameskirt_bustlevalue0.2000000029802322387695312weight25858nameskirt lengthvalue0.4000000059604644775390625weight100859nameslit frontvalue1weight255860nameslit backvalue1weight255861nameslit leftvalue1weight255862nameslit rightvalue1weight255863nameskirt_loosenessvalue0.333000004291534423828125weight84868nameshirt wrinklesvalue0weight0869namepants wrinklesvalue0weight0877namejacket wrinklesvalue0weight0879namemale_packagevalue-0.1000000014901161193847656weight40880nameeyelid_inner_corner_upvalue-0.819999992847442626953125weight48921nameskirt_redvalue1weight255922nameskirt_greenvalue1weight255923nameskirt_bluevalue1weight25593nameglove lengthvalue0.800000011920928955078125weight20398nameeye lightnessvalue1weight25599nameeye colorvalue0weight0dump_joint_offsetsmesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemPelvispos001.08198797702789306640625mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine1pos000.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine2pos00-0.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTorsopos000.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine3pos-0.0153679996728897094726562500.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine4pos0.015367999672889709472656250-0.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemChestpos-0.0153679996728897094726562500.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemNeckpos-0.00950700044631958007812500.251107990741729736328125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemCollarLeftpos-0.020927000790834426879882810.0846650004386901855468750.1653960049152374267578125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemShoulderLeftpos00.079000003635883331298828120mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemElbowLeftpos00.24799999594688415527343750mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemCollarRightpos-0.02092700079083442687988281-0.085000000894069671630859380.1653960049152374267578125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemShoulderRightpos0-0.0794180035591125488281250mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemElbowRightpos0-0.24799999594688415527343750mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemHipRightpos0.03361999988555908203125-0.12880599498748779296875-0.04108599945902824401855469mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemKneeRightpos-0.0007800000021234154701232910.04863499850034713745117188-0.4909220039844512939453125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemAnkleRightpos-0.028868999332189559936523440-0.468493998050689697265625mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemHipLeftpos0.03375700116157531738281250.1267649978399276733398438-0.04099800065159797668457031mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemKneeLeftpos-0.0008870000019669532775878906-0.04556800052523612976074219-0.49105298519134521484375mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemAnkleLeftpos-0.028886999934911727905273440.001378000015392899513244629-0.46844899654388427734375mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTail1pos-0.12795400619506835937500.001858999952673912048339844mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTail2pos-0.018850000575184822082519530-0.094934999942779541015625params3374450012763856842085636685951421354501176114513413211212785104136181255203255012700000000012700000001270000089000000000000071012711902516512410940022511050100216214204204204517689762040127201448512764124107712713012711414013059140489412711047101841581406300001271270000127015900165127408513111710238170950001201321270214204198001043011422625519825525525525525525525525525520402552552552552552552552552552552550255255255255255012725255251002552552552558400040482552552550025025235102523510025025235100250252351025235102523511127slot_texturesaux1hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsaux2hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsaux3hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idseyeshash_id812bffac-704c-d4bb-487d-0674ccbd5d9dtexture_ids5748decc-f629-461c-9a36-a35a221fe21f579e320c-0f16-2a1d-2018-2a00cc657068hairhash_idfc7ad735-99b6-aaf1-a1bf-676ea304b624texture_ids3cc3add8-6ff0-0640-79ba-b15137f640085748decc-f629-461c-9a36-a35a221fe21fheadhash_id799f44a9-82ec-78bd-7800-3e17367229fatexture_ids5748decc-f629-461c-9a36-a35a221fe21f9e460914-daed-b03f-0f2a-afbe67833b11a21d4081-601e-f9f0-0acc-9192c72863dcleftarmhash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsleftleghash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idslowerhash_id6d752c11-c33a-43c4-8631-3f8a6722ba59texture_ids5748decc-f629-461c-9a36-a35a221fe21f8dcd4a48-2d37-4909-9f78-f7a9eb4ef903ab169525-d46c-918b-3195-7f2b92fd76c5b5b09502-8305-af43-cc4e-7238cb715b11d9413239-769d-abc9-e929-4fa98f52c07bskirthash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsupperhash_id5b4d5c23-3073-26d1-8d68-78d5bfa308e4texture_ids5748decc-f629-461c-9a36-a35a221fe21fa85bf749-952d-3835-d9ac-a307c780930cb5d465f9-ca8e-8ba4-efd8-ee8929c592b8success1 diff --git a/indra/llappearanceutility/tests/texture.llsd.binary b/indra/llappearanceutility/tests/texture.llsd.binary new file mode 100644 index 0000000000..6b4f34831c Binary files /dev/null and b/indra/llappearanceutility/tests/texture.llsd.binary differ diff --git a/indra/llappearanceutility/tests/texture.llsd.output b/indra/llappearanceutility/tests/texture.llsd.output new file mode 100644 index 0000000000..6c7690decc Binary files /dev/null and b/indra/llappearanceutility/tests/texture.llsd.output differ -- cgit v1.3 From 37f89080ba5ce1ddd7848d2029794a5f5aabb7be Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 23 Oct 2025 09:15:38 -0400 Subject: Introduce global precompiled header to accelerate build Signed-off-by: Rye --- indra/CMakeLists.txt | 3 ++ indra/cmake/LLAddBuildTest.cmake | 14 +++++++- indra/llappearance/CMakeLists.txt | 8 +++++ indra/llappearanceutility/CMakeLists.txt | 8 +++++ indra/llaudio/CMakeLists.txt | 4 +++ indra/llcharacter/CMakeLists.txt | 4 +++ indra/llcommon/CMakeLists.txt | 28 +++++++++++++--- indra/llcommon/llsd.cpp | 5 ++- indra/llcommon/llsdjson.cpp | 1 - indra/llcorehttp/CMakeLists.txt | 8 ++++- indra/llcrashlogger/CMakeLists.txt | 4 +++ indra/llfilesystem/CMakeLists.txt | 11 +++++++ indra/llimage/CMakeLists.txt | 4 +++ indra/llimagej2coj/CMakeLists.txt | 3 ++ indra/llinventory/CMakeLists.txt | 4 +++ indra/llmath/CMakeLists.txt | 8 +++-- indra/llmeshoptimizer/CMakeLists.txt | 4 +++ indra/llmessage/CMakeLists.txt | 4 +++ indra/llphysicsextensionsos/CMakeLists.txt | 4 +++ indra/llplugin/CMakeLists.txt | 5 +++ indra/llplugin/slplugin/CMakeLists.txt | 10 ++++++ indra/llprecompiled/CMakeLists.txt | 53 ++++++++++++++++++++++++++++++ indra/llprecompiled/cmake_dummy.cpp | 24 ++++++++++++++ indra/llprimitive/CMakeLists.txt | 4 +++ indra/llrender/CMakeLists.txt | 7 ++++ indra/llui/CMakeLists.txt | 4 +++ indra/llwindow/CMakeLists.txt | 15 +++++++++ indra/llxml/CMakeLists.txt | 3 ++ 28 files changed, 241 insertions(+), 13 deletions(-) create mode 100644 indra/llprecompiled/CMakeLists.txt create mode 100644 indra/llprecompiled/cmake_dummy.cpp (limited to 'indra/llappearanceutility') diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 571465c707..a7f0ab0486 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -58,6 +58,9 @@ endif (NOT CMAKE_BUILD_TYPE) add_subdirectory(cmake) +if (USE_PRECOMPILED_HEADERS) + add_subdirectory(${LIBS_OPEN_PREFIX}llprecompiled) +endif () add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) add_subdirectory(${LIBS_OPEN_PREFIX}llappearance) add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 83725ffd1b..4959051617 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -100,6 +100,10 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ) endif(DARWIN) + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(PROJECT_${project}_TEST_${name} REUSE_FROM llprecompiled) + endif () + # # Per-codefile additional / external project dep and lib dep property extraction # @@ -122,7 +126,9 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS "${${name}_test_additional_CFLAGS}" - COMPILE_DEFINITIONS "LL_TEST=${name};LL_TEST_${name}") + COMPILE_DEFINITIONS "LL_TEST=${name};LL_TEST_${name}" + FOLDER "Tests" + ) if(LL_TEST_VERBOSE) message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}") endif() @@ -217,6 +223,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" COMPILE_DEFINITIONS "LL_TEST=${testname};LL_TEST_${testname}" + FOLDER "Tests" ) # The following was copied to llcorehttp/CMakeLists.txt's texture_load target. @@ -246,6 +253,11 @@ FUNCTION(LL_ADD_INTEGRATION_TEST target_link_libraries(INTEGRATION_TEST_${testname} ${libraries}) target_include_directories (INTEGRATION_TEST_${testname} PRIVATE ${LIBS_OPEN_DIR}/test ) + if (USE_PRECOMPILED_HEADERS) + target_include_directories (INTEGRATION_TEST_${testname} PRIVATE ${LIBS_OPEN_DIR}/llmath ) + target_precompile_headers(INTEGRATION_TEST_${testname} REUSE_FROM llprecompiled) + endif () + # Create the test running command set(test_command ${ARGN}) set(TEST_EXE $) diff --git a/indra/llappearance/CMakeLists.txt b/indra/llappearance/CMakeLists.txt index 40a1036597..5b6d68fa37 100644 --- a/indra/llappearance/CMakeLists.txt +++ b/indra/llappearance/CMakeLists.txt @@ -69,6 +69,10 @@ target_link_libraries(llappearance ) target_include_directories( llappearance INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llappearance REUSE_FROM llprecompiled) +endif () + if (BUILD_HEADLESS) add_library (llappearanceheadless ${llappearance_SOURCE_FILES}) target_include_directories( llappearanceheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) @@ -85,4 +89,8 @@ if (BUILD_HEADLESS) llcorehttp llcommon ) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llappearanceheadless REUSE_FROM llprecompiled) + endif () endif (BUILD_HEADLESS) diff --git a/indra/llappearanceutility/CMakeLists.txt b/indra/llappearanceutility/CMakeLists.txt index 1d4e5309ba..53b5ce1cbe 100644 --- a/indra/llappearanceutility/CMakeLists.txt +++ b/indra/llappearanceutility/CMakeLists.txt @@ -63,6 +63,10 @@ target_link_libraries(appearance-utility-bin llxml ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(appearance-utility-bin REUSE_FROM llprecompiled) +endif () + if (BUILD_HEADLESS) add_executable(appearance-utility-headless-bin ${appearance_utility_SOURCE_FILES}) @@ -74,5 +78,9 @@ if (BUILD_HEADLESS) llrenderheadless llxml ) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(appearance-utility-headless-bin REUSE_FROM llprecompiled) + endif () endif (BUILD_HEADLESS) diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 9278d3c488..18e29fb194 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -54,3 +54,7 @@ endif() if( TARGET ll::fmodstudio ) target_link_libraries( llaudio ll::fmodstudio ) endif() + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llaudio REUSE_FROM llprecompiled) +endif () diff --git a/indra/llcharacter/CMakeLists.txt b/indra/llcharacter/CMakeLists.txt index bc45eb474a..1f019e6aef 100644 --- a/indra/llcharacter/CMakeLists.txt +++ b/indra/llcharacter/CMakeLists.txt @@ -70,3 +70,7 @@ target_link_libraries( llfilesystem llxml ) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcharacter REUSE_FROM llprecompiled) +endif () diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 2de9deea70..c3b892b204 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -68,7 +68,7 @@ set(llcommon_SOURCE_FILES llmetricperformancetester.cpp llmortician.cpp llmutex.cpp - llptrto.cpp + llptrto.cpp llpredicate.cpp llprocess.cpp llprocessor.cpp @@ -108,7 +108,7 @@ set(llcommon_SOURCE_FILES workqueue.cpp StackWalker.cpp ) - + set(llcommon_HEADER_FILES CMakeLists.txt @@ -255,14 +255,28 @@ set(llcommon_HEADER_FILES workqueue.h StackWalker.h ) - + if (DARWIN) list(APPEND llcommon_HEADER_FILES llsys_objc.h) list(APPEND llcommon_SOURCE_FILES llsys_objc.mm) + + set_source_files_properties( + llsys_objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) if (USE_TRACY) list(APPEND llcommon_SOURCE_FILES llprofiler.cpp) + + # Skip precompiled headers on these files due to special compilation needs + set_source_files_properties( + llfasttimer.cpp + llprofiler.cpp + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif () list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) @@ -280,8 +294,12 @@ target_link_libraries( ll::sse2neon ) -target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llcommon PRIVATE ${CMAKE_SOURCE_DIR}/llmath) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcommon REUSE_FROM llprecompiled) +endif () add_dependencies(llcommon stage_third_party_libs) diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 77fe545c3f..ea6d6a308a 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -32,7 +32,6 @@ #include "llbase64.h" #include "llerror.h" -#include "../llmath/llmath.h" #include "llformat.h" #include "llsdserialize.h" #include "stringize.h" @@ -291,10 +290,10 @@ namespace }; LLSD::Boolean ImplReal::asBoolean() const - { return !llisnan(mValue) && mValue != 0.0; } + { return !std::isnan(mValue) && mValue != 0.0; } LLSD::Integer ImplReal::asInteger() const - { return !llisnan(mValue) ? (LLSD::Integer)mValue : 0; } + { return !std::isnan(mValue) ? (LLSD::Integer)mValue : 0; } LLSD::String ImplReal::asString() const { return llformat("%lg", mValue); } diff --git a/indra/llcommon/llsdjson.cpp b/indra/llcommon/llsdjson.cpp index 655869a704..542a3c26e3 100644 --- a/indra/llcommon/llsdjson.cpp +++ b/indra/llcommon/llsdjson.cpp @@ -33,7 +33,6 @@ #include "llsdutil.h" #include "llerror.h" -#include "../llmath/llmath.h" #include diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 05b788a433..46503a8a4b 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -81,6 +81,7 @@ list(APPEND llcorehttp_SOURCE_FILES ${llcorehttp_HEADER_FILES}) add_library (llcorehttp ${llcorehttp_SOURCE_FILES}) target_link_libraries( llcorehttp + llmath llcommon ll::libcurl ll::openssl @@ -92,6 +93,10 @@ target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # lead to circular dependencies (or in case of cmake, the first project declaring it's dependencies wins) target_include_directories( llcorehttp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../llmessage) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcorehttp REUSE_FROM llprecompiled) +endif () + # tests set(LLCOREHTTP_TESTS ON CACHE BOOL "Build and run llcorehttp integration tests specifically") @@ -131,7 +136,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py" ) - + # # Example Programs # @@ -151,6 +156,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) set_target_properties(http_texture_load PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" + FOLDER "Tests" ) if (WINDOWS) diff --git a/indra/llcrashlogger/CMakeLists.txt b/indra/llcrashlogger/CMakeLists.txt index 6ac73c0d32..7a1c3eef54 100644 --- a/indra/llcrashlogger/CMakeLists.txt +++ b/indra/llcrashlogger/CMakeLists.txt @@ -21,3 +21,7 @@ list(APPEND llcrashlogger_SOURCE_FILES ${llcrashlogger_HEADER_FILES}) add_library(llcrashlogger ${llcrashlogger_SOURCE_FILES}) target_link_libraries( llcrashlogger llcommon llmessage llcorehttp llxml llfilesystem ) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcrashlogger REUSE_FROM llprecompiled) +endif () diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 9f24f75eab..a552e4bdbc 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -28,6 +28,12 @@ if (DARWIN) LIST(APPEND llfilesystem_SOURCE_FILES lldir_utils_objc.h) LIST(APPEND llfilesystem_SOURCE_FILES lldir_mac.cpp) LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h) + + set_source_files_properties( + lldir_utils_objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) if (LINUX) @@ -52,10 +58,15 @@ list(APPEND llfilesystem_SOURCE_FILES ${llfilesystem_HEADER_FILES}) add_library (llfilesystem ${llfilesystem_SOURCE_FILES}) target_link_libraries(llfilesystem + llmath llcommon ) target_include_directories( llfilesystem INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llfilesystem REUSE_FROM llprecompiled) +endif () + # Add tests if (LL_TESTS) include(LLAddBuildTest) diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index cc75c463bc..a81808343f 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -63,6 +63,10 @@ target_link_libraries(llimage ll::libjpeg ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llimage REUSE_FROM llprecompiled) +endif () + # Add tests if (LL_TESTS) SET(llimage_TEST_SOURCE_FILES diff --git a/indra/llimagej2coj/CMakeLists.txt b/indra/llimagej2coj/CMakeLists.txt index 93e85668dd..b7ef696b20 100644 --- a/indra/llimagej2coj/CMakeLists.txt +++ b/indra/llimagej2coj/CMakeLists.txt @@ -27,3 +27,6 @@ target_link_libraries( llimagej2coj ll::openjpeg ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llimagej2coj REUSE_FROM llprecompiled) +endif () diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt index 93a586759f..22966bc55b 100644 --- a/indra/llinventory/CMakeLists.txt +++ b/indra/llinventory/CMakeLists.txt @@ -59,6 +59,10 @@ add_library (llinventory ${llinventory_SOURCE_FILES}) target_link_libraries( llinventory llcommon llmath llmessage llxml ) target_include_directories( llinventory INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llinventory REUSE_FROM llprecompiled) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index bd860adc31..fb57e5db11 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -99,10 +99,14 @@ set(llmath_HEADER_FILES list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) -add_library (llmath ${llmath_SOURCE_FILES}) +add_library(llmath ${llmath_SOURCE_FILES}) target_link_libraries(llmath llcommon llmeshoptimizer ll::sse2neon) -target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llmath REUSE_FROM llprecompiled) +endif () # Add tests if (LL_TESTS) diff --git a/indra/llmeshoptimizer/CMakeLists.txt b/indra/llmeshoptimizer/CMakeLists.txt index dfac44c296..5b1ab9d8e4 100644 --- a/indra/llmeshoptimizer/CMakeLists.txt +++ b/indra/llmeshoptimizer/CMakeLists.txt @@ -30,5 +30,9 @@ target_link_libraries(llmeshoptimizer llmath ll::meshoptimizer) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llmeshoptimizer REUSE_FROM llprecompiled) +endif () + # Add tests diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index b2757a7306..46f28abc9c 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -194,6 +194,10 @@ target_link_libraries( ) target_include_directories( llmessage INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llmessage REUSE_FROM llprecompiled) +endif () + # tests if (LL_TESTS) SET(llmessage_TEST_SOURCE_FILES diff --git a/indra/llphysicsextensionsos/CMakeLists.txt b/indra/llphysicsextensionsos/CMakeLists.txt index c04115ef26..ff1b703dc7 100644 --- a/indra/llphysicsextensionsos/CMakeLists.txt +++ b/indra/llphysicsextensionsos/CMakeLists.txt @@ -43,5 +43,9 @@ if(WINDOWS) target_compile_options(llphysicsextensionsos PRIVATE /bigobj) endif() +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llphysicsextensionsos REUSE_FROM llprecompiled) +endif () + # Add tests diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index e008a4093e..f67975365a 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -36,5 +36,10 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( llplugin llcommon llmath llmessage llxml ) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llplugin REUSE_FROM llprecompiled) +endif () + add_subdirectory(slplugin) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 4df3e306cb..f746160ada 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -18,6 +18,12 @@ if (DARWIN) list(APPEND SLPlugin_HEADER_FILES slplugin-objc.h ) + + set_source_files_properties( + slplugin-objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) if (SLPlugin_HEADER_FILES) @@ -37,6 +43,10 @@ target_link_libraries(SLPlugin ll::pluginlibraries ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(SLPlugin REUSE_FROM llprecompiled) +endif () + if (WINDOWS) set_target_properties(SLPlugin PROPERTIES diff --git a/indra/llprecompiled/CMakeLists.txt b/indra/llprecompiled/CMakeLists.txt new file mode 100644 index 0000000000..ea230f4a98 --- /dev/null +++ b/indra/llprecompiled/CMakeLists.txt @@ -0,0 +1,53 @@ +# -*- cmake -*- + +project(llprecompiled) + +include(00-Common) +include(APR) +include(bugsplat) +include(Linking) +include(Boost) +include(LLSharedLibs) +include(ZLIBNG) +include(Tracy) +include(EXPAT) +include(SSE2NEON) + +set(llprecompiled_SOURCE_FILES + cmake_dummy.cpp + ) + +add_library (llprecompiled ${llprecompiled_SOURCE_FILES}) + +target_include_directories(llprecompiled PRIVATE + ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX}llmath + ) + +target_link_libraries(llprecompiled + llcommon + ll::apr + ll::expat + ll::zlib-ng + ll::boost + ll::oslibraries + ll::tracy + ll::sse2neon + ) + +target_precompile_headers(llprecompiled PRIVATE + [["linden_common.h"]] + [["llwin32headers.h"]] + [["llprofiler.h"]] + [["llmath.h"]] + + + + + + + + + + + + ) diff --git a/indra/llprecompiled/cmake_dummy.cpp b/indra/llprecompiled/cmake_dummy.cpp new file mode 100644 index 0000000000..21a47a9b14 --- /dev/null +++ b/indra/llprecompiled/cmake_dummy.cpp @@ -0,0 +1,24 @@ +/** + * @file cmake_dummy.cpp + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index ff0cad58d6..f05be03034 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -79,6 +79,10 @@ else() ) endif () +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llprimitive REUSE_FROM llprecompiled) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index d0ae2d6b93..77af0693f3 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -86,6 +86,10 @@ if (BUILD_HEADLESS) ll::freetype OpenGL::GL ) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llrenderheadless REUSE_FROM llprecompiled) + endif() endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) @@ -104,3 +108,6 @@ target_link_libraries(llrender OpenGL::GL ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llrender REUSE_FROM llprecompiled) +endif () diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 908e94b24c..b543a12281 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -272,6 +272,10 @@ target_link_libraries(llui llcommon ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llui REUSE_FROM llprecompiled) +endif () + # Add tests if(LL_TESTS) include(LLAddBuildTest) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index fe45df4021..1f846de35d 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -101,6 +101,13 @@ if (DARWIN) PROPERTIES COMPILE_FLAGS "-fpascal-strings" ) + + set_source_files_properties( + llwindowmacosx-objc.mm + llopenglview-objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) @@ -170,6 +177,10 @@ if (BUILD_HEADLESS) dl ) target_include_directories(llwindowheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llwindowheadless REUSE_FROM llprecompiled) + endif () endif (BUILD_HEADLESS) if (llwindow_HEADER_FILES) @@ -190,6 +201,10 @@ if (USE_SDL_WINDOW) target_compile_definitions( llwindow PUBLIC LL_SDL_WINDOW=1 ) endif() +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llwindow REUSE_FROM llprecompiled) +endif () + if (DARWIN) target_link_libraries(llwindow ${CARBON_LIBRARY}) endif (DARWIN) diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index 508c2b919b..bc79e2ef19 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -34,6 +34,9 @@ target_link_libraries( llxml ) target_include_directories( llxml INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llxml REUSE_FROM llprecompiled) +endif () # tests -- cgit v1.3 From e803bbc0db695abe73de9797510ba22646528e23 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 27 Oct 2025 02:55:56 -0400 Subject: Modernize viewer alignment macros to use alignas and fix misaligned class issues reported by ubsan/asan Signed-off-by: Rye --- indra/llappearance/llavatarjoint.h | 6 ++++-- indra/llappearance/llavatarjointmesh.h | 3 ++- indra/llappearance/lldriverparam.h | 2 +- indra/llappearance/llpolymorph.h | 2 +- indra/llappearance/llpolyskeletaldistortion.h | 4 ++-- indra/llappearance/lltexlayerparams.h | 5 ++--- indra/llappearance/llviewervisualparam.h | 5 ++--- indra/llappearanceutility/llbakingavatar.h | 10 +--------- indra/llappearanceutility/llbakingjoint.h | 3 ++- indra/llappearanceutility/llbakingjointmesh.h | 3 ++- indra/llcharacter/lleditingmotion.h | 15 +++++++-------- indra/llcharacter/lljoint.h | 7 +++---- indra/llcharacter/llkeyframestandmotion.h | 5 ++--- indra/llcharacter/llpose.h | 7 +++---- indra/llcharacter/llvisualparam.h | 5 ++--- indra/llcommon/llmemory.h | 16 ---------------- indra/llmath/llcamera.h | 12 ++++++------ indra/llmath/llmatrix3a.cpp | 2 +- indra/llmath/llmatrix3a.h | 5 +++-- indra/llmath/llmatrix4a.h | 5 +++-- indra/llmath/llplane.h | 7 +++---- indra/llmath/llquantize.h | 8 ++++---- indra/llmath/llquaternion2.h | 3 ++- indra/llmath/llquaternion2.inl | 2 +- indra/llmath/llsimdtypes.inl | 4 ++-- indra/llmath/llvector4a.cpp | 4 ++-- indra/llmath/llvector4a.inl | 10 +++++----- indra/llmath/llvector4logical.h | 4 ++-- indra/llmath/llvolumeoctree.h | 6 +++--- indra/llmath/tests/alignment_test.cpp | 5 ++--- indra/llprimitive/llmodel.h | 12 +++++------- indra/newview/lldrawable.h | 5 ++--- indra/newview/lldynamictexture.h | 4 ++-- indra/newview/llspatialpartition.cpp | 9 ++++----- indra/newview/llspatialpartition.h | 13 +++++++------ indra/newview/llviewerjoint.h | 3 ++- indra/newview/llviewerjointattachment.h | 3 ++- indra/newview/llviewerjointmesh.h | 3 ++- indra/newview/llvieweroctree.h | 26 +++++++++++--------------- indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvoavatar.h | 2 +- 41 files changed, 114 insertions(+), 143 deletions(-) (limited to 'indra/llappearanceutility') diff --git a/indra/llappearance/llavatarjoint.h b/indra/llappearance/llavatarjoint.h index 13f025fd5f..71fe4b61b6 100644 --- a/indra/llappearance/llavatarjoint.h +++ b/indra/llappearance/llavatarjoint.h @@ -41,9 +41,10 @@ extern const F32 DEFAULT_AVATAR_JOINT_LOD; //----------------------------------------------------------------------------- // class LLViewerJoint //----------------------------------------------------------------------------- -class LLAvatarJoint : +class alignas(16) LLAvatarJoint : public LLJoint { + LL_ALIGN_NEW public: LLAvatarJoint(); LLAvatarJoint(S32 joint_num); @@ -121,8 +122,9 @@ protected: S32 mMeshID; }; -class LLAvatarJointCollisionVolume : public LLAvatarJoint +class alignas(16) LLAvatarJointCollisionVolume : public LLAvatarJoint { + LL_ALIGN_NEW public: LLAvatarJointCollisionVolume(); virtual ~LLAvatarJointCollisionVolume() {}; diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h index 33f50fce00..153a2b88fe 100644 --- a/indra/llappearance/llavatarjointmesh.h +++ b/indra/llappearance/llavatarjointmesh.h @@ -59,8 +59,9 @@ public: //----------------------------------------------------------------------------- // class LLViewerJointMesh //----------------------------------------------------------------------------- -class LLAvatarJointMesh : public virtual LLAvatarJoint +class alignas(16) LLAvatarJointMesh : public virtual LLAvatarJoint { + LL_ALIGN_NEW protected: LLColor4 mColor; // color value // LLColor4 mSpecular; // specular color (always white for now) diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index 59092988dd..df8733dde7 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -128,7 +128,7 @@ protected: void setDrivenWeight(LLDrivenEntry* driven, F32 driven_weight); - LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder + LLVector4a mDefaultVec; // temp holder entry_list_t mDriven; LLViewerVisualParam* mCurrentDistortionParam{ nullptr }; // Backlink only; don't make this an LLPointer. diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 8c76689f2c..64434bd5d9 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -71,7 +71,7 @@ public: private: void freeData(); -} LL_ALIGN_POSTFIX(16); +}; //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index 9ba4cf66e9..37f35d50ba 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -111,13 +111,13 @@ public: protected: LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther); - LL_ALIGN_16(LLVector4a mDefaultVec); + LLVector4a mDefaultVec; typedef std::map joint_vec_map_t; joint_vec_map_t mJointScales; joint_vec_map_t mJointOffsets; // Backlink only; don't make this an LLPointer. LLAvatarAppearance *mAvatar; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLPOLYSKELETALDISTORTION_H diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 116eb3bee0..2c243d0e9b 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -63,7 +63,6 @@ protected: // LLTexLayerParamAlpha // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL_ALIGN_PREFIX(16) class alignas(16) LLTexLayerParamAlpha : public LLTexLayerParam { LL_ALIGN_NEW @@ -103,7 +102,7 @@ private: LLPointer mStaticImageRaw; std::atomic mNeedsCreateTexture; bool mStaticImageInvalid; - LL_ALIGN_16(LLVector4a mAvgDistortionVec); + LLVector4a mAvgDistortionVec; F32 mCachedEffectiveWeight; public: @@ -113,7 +112,7 @@ public: typedef std::list< LLTexLayerParamAlpha* > param_alpha_ptr_list_t; static param_alpha_ptr_list_t sInstances; -} LL_ALIGN_POSTFIX(16); +}; class LLTexLayerParamAlphaInfo : public LLViewerVisualParamInfo { friend class LLTexLayerParamAlpha; diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h index b79983df8e..37771cc8d3 100644 --- a/indra/llappearance/llviewervisualparam.h +++ b/indra/llappearance/llviewervisualparam.h @@ -65,8 +65,7 @@ protected: // VIRTUAL CLASS // a viewer side interface class for a generalized parametric modification of the avatar mesh //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLViewerVisualParam : public LLVisualParam +class alignas(16) LLViewerVisualParam : public LLVisualParam { public: LLViewerVisualParam(); @@ -107,6 +106,6 @@ public: protected: LLViewerVisualParam(const LLViewerVisualParam& pOther); -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLViewerVisualParam_H diff --git a/indra/llappearanceutility/llbakingavatar.h b/indra/llappearanceutility/llbakingavatar.h index 8261dfc814..b4cf99cbfb 100644 --- a/indra/llappearanceutility/llbakingavatar.h +++ b/indra/llappearanceutility/llbakingavatar.h @@ -38,15 +38,7 @@ class LLBakingAvatar : public LLAvatarAppearance ** INITIALIZATION **/ public: - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } + LL_ALIGN_NEW LLBakingAvatar(LLWearableData* wearable_data, S32 bakeTextureSize = 512); virtual ~LLBakingAvatar(); diff --git a/indra/llappearanceutility/llbakingjoint.h b/indra/llappearanceutility/llbakingjoint.h index 07e15a1d04..10201cc7b8 100644 --- a/indra/llappearanceutility/llbakingjoint.h +++ b/indra/llappearanceutility/llbakingjoint.h @@ -29,8 +29,9 @@ #include "llavatarjoint.h" -class LLBakingJoint : public virtual LLAvatarJoint +class alignas(16) LLBakingJoint : public virtual LLAvatarJoint { + LL_ALIGN_NEW public: LLBakingJoint(); LLBakingJoint(S32 joint_num); diff --git a/indra/llappearanceutility/llbakingjointmesh.h b/indra/llappearanceutility/llbakingjointmesh.h index a66bf3f61b..9c7b276bd8 100644 --- a/indra/llappearanceutility/llbakingjointmesh.h +++ b/indra/llappearanceutility/llbakingjointmesh.h @@ -30,8 +30,9 @@ #include "llavatarjointmesh.h" #include "llbakingjoint.h" -class LLBakingJointMesh : public LLAvatarJointMesh, public LLBakingJoint +class alignas(16) LLBakingJointMesh : public LLAvatarJointMesh, public LLBakingJoint { + LL_ALIGN_NEW public: LLBakingJointMesh(); LLBakingJointMesh(S32 joint_num); diff --git a/indra/llcharacter/lleditingmotion.h b/indra/llcharacter/lleditingmotion.h index f94756d43d..a3c0ee94b7 100644 --- a/indra/llcharacter/lleditingmotion.h +++ b/indra/llcharacter/lleditingmotion.h @@ -42,8 +42,7 @@ //----------------------------------------------------------------------------- // class LLEditingMotion //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLEditingMotion : +class alignas(16) LLEditingMotion : public LLMotion { LL_ALIGN_NEW @@ -110,11 +109,11 @@ public: //------------------------------------------------------------------------- // joint states to be animated //------------------------------------------------------------------------- - LL_ALIGN_16(LLJoint mParentJoint); - LL_ALIGN_16(LLJoint mShoulderJoint); - LL_ALIGN_16(LLJoint mElbowJoint); - LL_ALIGN_16(LLJoint mWristJoint); - LL_ALIGN_16(LLJoint mTarget); + LLJoint mParentJoint; + LLJoint mShoulderJoint; + LLJoint mElbowJoint; + LLJoint mWristJoint; + LLJoint mTarget; LLJointSolverRP3 mIKSolver; LLCharacter *mCharacter; @@ -129,7 +128,7 @@ public: static S32 sHandPose; static S32 sHandPosePriority; LLVector3 mLastSelectPt; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLKEYFRAMEMOTION_H diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index b58dc797f8..481fb0a1bb 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -86,8 +86,7 @@ inline bool operator!=(const LLVector3OverrideMap& a, const LLVector3OverrideMap //----------------------------------------------------------------------------- // class LLJoint //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLJoint +class alignas(16) LLJoint { LL_ALIGN_NEW public: @@ -118,7 +117,7 @@ public: }; protected: // explicit transformation members - LL_ALIGN_16(LLMatrix4a mWorldMatrix); + LLMatrix4a mWorldMatrix; LLXformMatrix mXform; std::string mName; @@ -302,6 +301,6 @@ public: // These are used in checks of whether a pos/scale override is considered significant. bool aboveJointPosThreshold(const LLVector3& pos) const; bool aboveJointScaleThreshold(const LLVector3& scale) const; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLJOINT_H diff --git a/indra/llcharacter/llkeyframestandmotion.h b/indra/llcharacter/llkeyframestandmotion.h index df458c7a0c..7d1acb7c5a 100644 --- a/indra/llcharacter/llkeyframestandmotion.h +++ b/indra/llcharacter/llkeyframestandmotion.h @@ -37,8 +37,7 @@ //----------------------------------------------------------------------------- // class LLKeyframeStandMotion //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLKeyframeStandMotion : +class alignas(16) LLKeyframeStandMotion : public LLKeyframeMotion { LL_ALIGN_NEW @@ -112,7 +111,7 @@ public: bool mTrackAnkles; S32 mFrameNum; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLKEYFRAMESTANDMOTION_H diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index f2032220e0..fbcd482211 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -80,8 +80,7 @@ public: const S32 JSB_NUM_JOINT_STATES = 6; -LL_ALIGN_PREFIX(16) -class LLJointStateBlender +class alignas(16) LLJointStateBlender { LL_ALIGN_NEW protected: @@ -98,8 +97,8 @@ public: void resetCachedJoint(); public: - LL_ALIGN_16(LLJoint mJointCache); -} LL_ALIGN_POSTFIX(16); + LLJoint mJointCache; +}; class LLMotion; diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 3caddb9c62..c99577ed80 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -100,8 +100,7 @@ protected: // An interface class for a generalized parametric modification of the avatar mesh // Contains data that is specific to each Avatar //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLVisualParam +class alignas(16) LLVisualParam { public: typedef boost::function visual_param_mapper; @@ -180,6 +179,6 @@ protected: S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; EParamLocation mParamLocation; // where does this visual param live? -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLVisualParam_H diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index b47138b0eb..a25387d321 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -92,22 +92,6 @@ template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) (uintptr_t(address) + 0x3F) & ~0x3F); } -#if LL_LINUX || LL_DARWIN - -#define LL_ALIGN_PREFIX(x) -#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) - -#elif LL_WINDOWS - -#define LL_ALIGN_PREFIX(x) __declspec(align(x)) -#define LL_ALIGN_POSTFIX(x) - -#else -#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" -#endif - -#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) - #define LL_ALIGN_NEW \ public: \ void* operator new(size_t size) \ diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 6201761c46..3863588407 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -60,10 +60,10 @@ constexpr F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD; // roll(), pitch(), yaw() // etc... -LL_ALIGN_PREFIX(16) -class LLCamera +class alignas(16) LLCamera : public LLCoordFrame { + LL_ALIGN_NEW public: LLCamera(const LLCamera& rhs) { @@ -120,9 +120,9 @@ public: }; private: - LL_ALIGN_16(LLPlane mAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP - LL_ALIGN_16(LLPlane mRegionPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in a local region space, derived from mAgentPlanes - LL_ALIGN_16(LLPlane mLastAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]); + LLPlane mAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]; //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP + LLPlane mRegionPlanes[AGENT_PLANE_USER_CLIP_NUM]; //frustum planes in a local region space, derived from mAgentPlanes + LLPlane mLastAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]; U8 mPlaneMask[PLANE_MASK_NUM]; // 8 for alignment F32 mView; // angle between top and bottom frustum planes in radians. @@ -218,7 +218,7 @@ protected: void calculateFrustumPlanes(); void calculateFrustumPlanes(F32 left, F32 right, F32 top, F32 bottom); void calculateFrustumPlanesFromWindow(F32 x1, F32 y1, F32 x2, F32 y2); -} LL_ALIGN_POSTFIX(16); +}; #endif diff --git a/indra/llmath/llmatrix3a.cpp b/indra/llmath/llmatrix3a.cpp index c0b00201cf..904c9de2a1 100644 --- a/indra/llmath/llmatrix3a.cpp +++ b/indra/llmath/llmatrix3a.cpp @@ -28,7 +28,7 @@ #include "llmath.h" -static LL_ALIGN_16(const F32 M_IDENT_3A[12]) = +alignas(16) static const F32 M_IDENT_3A[12] = { 1.f, 0.f, 0.f, 0.f, // Column 1 0.f, 1.f, 0.f, 0.f, // Column 2 0.f, 0.f, 1.f, 0.f }; // Column 3 diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h index 9b173c22ed..742a2488fd 100644 --- a/indra/llmath/llmatrix3a.h +++ b/indra/llmath/llmatrix3a.h @@ -40,8 +40,9 @@ // LLMatrix3a is the base class for LLRotation, which should be used instead any time you're dealing with a // rotation matrix. -class LLMatrix3a +class alignas(16) LLMatrix3a { + LL_ALIGN_NEW public: // Utility function for quickly transforming an array of LLVector4a's @@ -111,7 +112,7 @@ public: protected: - LL_ALIGN_16(LLVector4a mColumns[3]); + LLVector4a mColumns[3]; }; diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index 377203098e..2967949993 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -31,10 +31,11 @@ #include "m4math.h" #include "m3math.h" -class LLMatrix4a +class alignas(16) LLMatrix4a { + LL_ALIGN_NEW public: - LL_ALIGN_16(LLVector4a mMatrix[4]); + LLVector4a mMatrix[4]; LLMatrix4a() = default; diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h index 832004bb64..822e6a7b6f 100644 --- a/indra/llmath/llplane.h +++ b/indra/llmath/llplane.h @@ -36,10 +36,9 @@ // The plane normal = [A, B, C] // The closest approach = D / sqrt(A*A + B*B + C*C) - -LL_ALIGN_PREFIX(16) -class LLPlane +class alignas(16) LLPlane { + LL_ALIGN_NEW public: // Constructors @@ -102,7 +101,7 @@ public: private: LLVector4a mV; -} LL_ALIGN_POSTFIX(16); +}; static_assert(std::is_trivial::value, "LLPlane must be a trivial type"); diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h index e8d880122e..2a53fdbf84 100644 --- a/indra/llmath/llquantize.h +++ b/indra/llmath/llquantize.h @@ -29,16 +29,16 @@ #define LL_LLQUANTIZE_H const U16 U16MAX = 65535; -LL_ALIGN_16( const F32 F_U16MAX_4A[4] ) = { 65535.f, 65535.f, 65535.f, 65535.f }; +alignas(16) const F32 F_U16MAX_4A[4] = { 65535.f, 65535.f, 65535.f, 65535.f }; const F32 OOU16MAX = 1.f/(F32)(U16MAX); -LL_ALIGN_16( const F32 F_OOU16MAX_4A[4] ) = { OOU16MAX, OOU16MAX, OOU16MAX, OOU16MAX }; +alignas(16) const F32 F_OOU16MAX_4A[4] = { OOU16MAX, OOU16MAX, OOU16MAX, OOU16MAX }; const U8 U8MAX = 255; -LL_ALIGN_16( const F32 F_U8MAX_4A[4] ) = { 255.f, 255.f, 255.f, 255.f }; +alignas(16) const F32 F_U8MAX_4A[4] = { 255.f, 255.f, 255.f, 255.f }; const F32 OOU8MAX = 1.f/(F32)(U8MAX); -LL_ALIGN_16( const F32 F_OOU8MAX_4A[4] ) = { OOU8MAX, OOU8MAX, OOU8MAX, OOU8MAX }; +alignas(16) const F32 F_OOU8MAX_4A[4] = { OOU8MAX, OOU8MAX, OOU8MAX, OOU8MAX }; const U8 FIRSTVALIDCHAR = 54; const U8 MAXSTRINGVAL = U8MAX - FIRSTVALIDCHAR; //we don't allow newline or null diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index c9dcc4573f..d73e1a0ca2 100644 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h @@ -40,8 +40,9 @@ ///////////////////////////// #include "llquaternion.h" -class LLQuaternion2 +class alignas(16) LLQuaternion2 { + LL_ALIGN_NEW public: ////////////////////////// diff --git a/indra/llmath/llquaternion2.inl b/indra/llmath/llquaternion2.inl index ce5ed73926..2ebc8e0bfb 100644 --- a/indra/llmath/llquaternion2.inl +++ b/indra/llmath/llquaternion2.inl @@ -57,7 +57,7 @@ inline LLVector4a& LLQuaternion2::getVector4aRw() // Set this quaternion to the conjugate of src inline void LLQuaternion2::setConjugate(const LLQuaternion2& src) { - static LL_ALIGN_16( const U32 F_QUAT_INV_MASK_4A[4] ) = { 0x80000000, 0x80000000, 0x80000000, 0x00000000 }; + alignas(16) static const U32 F_QUAT_INV_MASK_4A[4] = { 0x80000000, 0x80000000, 0x80000000, 0x00000000 }; mQ = _mm_xor_ps(src.mQ, *reinterpret_cast(&F_QUAT_INV_MASK_4A)); } diff --git a/indra/llmath/llsimdtypes.inl b/indra/llmath/llsimdtypes.inl index 125f4b9df5..20ea7640b6 100644 --- a/indra/llmath/llsimdtypes.inl +++ b/indra/llmath/llsimdtypes.inl @@ -61,7 +61,7 @@ inline LLSimdScalar operator/(const LLSimdScalar& a, const LLSimdScalar& b) inline LLSimdScalar operator-(const LLSimdScalar& a) { - static LL_ALIGN_16(const U32 signMask[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000 }; + alignas(16) static const U32 signMask[4] = {0x80000000, 0x80000000, 0x80000000, 0x80000000 }; ll_assert_aligned(signMask,16); return _mm_xor_ps(*reinterpret_cast(signMask), a); } @@ -146,7 +146,7 @@ inline LLSimdScalar& LLSimdScalar::operator/=(const LLSimdScalar& rhs) inline LLSimdScalar LLSimdScalar::getAbs() const { - static const LL_ALIGN_16(U32 F_ABS_MASK_4A[4]) = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; + alignas(16) static const U32 F_ABS_MASK_4A[4] = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; ll_assert_aligned(F_ABS_MASK_4A,16); return _mm_and_ps( mQ, *reinterpret_cast(F_ABS_MASK_4A)); } diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index b81d50f0f9..6bdc97e420 100644 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -101,7 +101,7 @@ void LLVector4a::quantize8( const LLVector4a& low, const LLVector4a& high ) // 8-bit quantization means we can do with just 12 bits of reciprocal accuracy const LLVector4a oneOverDelta = _mm_rcp_ps(delta.mQ); // { -// static LL_ALIGN_16( const F32 F_TWO_4A[4] ) = { 2.f, 2.f, 2.f, 2.f }; +// alignas(16) static const F32 F_TWO_4A[4] = { 2.f, 2.f, 2.f, 2.f }; // LLVector4a two; two.load4a( F_TWO_4A ); // // // Here we use _mm_rcp_ps plus one round of newton-raphson @@ -146,7 +146,7 @@ void LLVector4a::quantize16( const LLVector4a& low, const LLVector4a& high ) // 16-bit quantization means we need a round of Newton-Raphson LLVector4a oneOverDelta; { - static LL_ALIGN_16( const F32 F_TWO_4A[4] ) = { 2.f, 2.f, 2.f, 2.f }; + alignas(16) static const F32 F_TWO_4A[4] = { 2.f, 2.f, 2.f, 2.f }; ll_assert_aligned(F_TWO_4A,16); LLVector4a two; two.load4a( F_TWO_4A ); diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 443a46c317..b6e2a4fce5 100644 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -196,7 +196,7 @@ inline void LLVector4a::setDiv(const LLVector4a& a, const LLVector4a& b) // Set this to the element-wise absolute value of src inline void LLVector4a::setAbs(const LLVector4a& src) { - static const LL_ALIGN_16(U32 F_ABS_MASK_4A[4]) = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; + alignas(16) static const U32 F_ABS_MASK_4A[4] = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; mQ = _mm_and_ps(src.mQ, *reinterpret_cast(F_ABS_MASK_4A)); } @@ -448,7 +448,7 @@ inline void LLVector4a::normalize3fast_checked(LLVector4a* d) // Return true if this vector is normalized with respect to x,y,z up to tolerance inline LLBool32 LLVector4a::isNormalized3( F32 tolerance ) const { - static LL_ALIGN_16(const U32 ones[4]) = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; + alignas(16) static const U32 ones[4] = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; LLSimdScalar tol = _mm_load_ss( &tolerance ); tol = _mm_mul_ss( tol, tol ); LLVector4a lenSquared; lenSquared.setAllDot3( *this, *this ); @@ -460,7 +460,7 @@ inline LLBool32 LLVector4a::isNormalized3( F32 tolerance ) const // Return true if this vector is normalized with respect to all components up to tolerance inline LLBool32 LLVector4a::isNormalized4( F32 tolerance ) const { - static LL_ALIGN_16(const U32 ones[4]) = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; + alignas(16) static const U32 ones[4] = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; LLSimdScalar tol = _mm_load_ss( &tolerance ); tol = _mm_mul_ss( tol, tol ); LLVector4a lenSquared; lenSquared.setAllDot4( *this, *this ); @@ -507,7 +507,7 @@ inline void LLVector4a::setLerp(const LLVector4a& lhs, const LLVector4a& rhs, F3 inline LLBool32 LLVector4a::isFinite3() const { - static LL_ALIGN_16(const U32 nanOrInfMask[4]) = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; + alignas(16) static const U32 nanOrInfMask[4] = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; ll_assert_aligned(nanOrInfMask,16); const __m128i nanOrInfMaskV = *reinterpret_cast (nanOrInfMask); const __m128i maskResult = _mm_and_si128( _mm_castps_si128(mQ), nanOrInfMaskV ); @@ -517,7 +517,7 @@ inline LLBool32 LLVector4a::isFinite3() const inline LLBool32 LLVector4a::isFinite4() const { - static LL_ALIGN_16(const U32 nanOrInfMask[4]) = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; + alignas(16) static const U32 nanOrInfMask[4] = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; const __m128i nanOrInfMaskV = *reinterpret_cast (nanOrInfMask); const __m128i maskResult = _mm_and_si128( _mm_castps_si128(mQ), nanOrInfMaskV ); const LLVector4Logical equalityCheck = _mm_castsi128_ps(_mm_cmpeq_epi32( maskResult, nanOrInfMaskV )); diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h index 77cb5862e5..411971c42d 100644 --- a/indra/llmath/llvector4logical.h +++ b/indra/llmath/llvector4logical.h @@ -39,7 +39,7 @@ // contact someone with SSE experience (Falcon, Richard, Davep, e.g.) //////////////////////////// -static LL_ALIGN_16(const U32 S_V4LOGICAL_MASK_TABLE[4*4]) = +alignas(16) static const U32 S_V4LOGICAL_MASK_TABLE[4*4] = { 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000, @@ -77,7 +77,7 @@ public: // Invert this mask inline LLVector4Logical& invert() { - static const LL_ALIGN_16(U32 allOnes[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + alignas(16) static const U32 allOnes[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; ll_assert_aligned(allOnes,16); mQ = _mm_andnot_ps( mQ, *(LLQuad*)(allOnes) ); return *this; diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 1d74644715..4200e0d5a1 100644 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h @@ -53,7 +53,7 @@ public: } - LL_ALIGN_16(LLVector4a mPositionGroup); + LLVector4a mPositionGroup; const LLVector4a* mV[3]; U32 mIndex[3]; @@ -99,8 +99,8 @@ public: public: - LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects) - LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children + LLVector4a mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) + LLVector4a mExtents[2]; // extents (min, max) of this node and all its children }; class LLOctreeTriangleRayIntersect : public LLOctreeTraveler diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index eb6fa4a3b8..f41ebe82aa 100644 --- a/indra/llmath/tests/alignment_test.cpp +++ b/indra/llmath/tests/alignment_test.cpp @@ -46,8 +46,7 @@ typedef test_group alignment_test_t; typedef alignment_test_t::object alignment_test_object_t; tut::alignment_test_t tut_alignment_test("LLAlignment"); -LL_ALIGN_PREFIX(16) -class MyVector4a +class alignas(16) MyVector4a { public: void* operator new(size_t size) @@ -71,7 +70,7 @@ public: } LLQuad mQ; -} LL_ALIGN_POSTFIX(16); +}; // Verify that aligned allocators perform as advertised. diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index ac88af18f0..26448069c6 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -40,8 +40,7 @@ class domMesh; #define MAX_MODEL_FACES 8 -LL_ALIGN_PREFIX(16) -class LLMeshSkinInfo : public LLRefCount +class alignas(16) LLMeshSkinInfo : public LLRefCount { LL_ALIGN_NEW public: @@ -65,17 +64,16 @@ public: // cached multiply of mBindShapeMatrix and mInvBindMatrix matrix_list_t mBindPoseMatrix; - LL_ALIGN_16(LLMatrix4a mBindShapeMatrix); + LLMatrix4a mBindShapeMatrix; float mPelvisOffset; bool mLockScaleIfJointPosition; bool mInvalidJointsScrubbed; bool mJointNumsInitialized; U64 mHash = 0; -} LL_ALIGN_POSTFIX(16); +}; -LL_ALIGN_PREFIX(16) -class LLModel : public LLVolume +class alignas(16) LLModel : public LLVolume { LL_ALIGN_NEW public: @@ -323,7 +321,7 @@ public: // A model/object can only have 8 faces, spillover faces will // be moved to new model/object and assigned a submodel id. int mSubmodelID; -} LL_ALIGN_POSTFIX(16); +}; typedef std::vector > model_list; typedef std::queue > model_queue; diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index a7ac9da618..d05cd0ee2b 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -59,8 +59,7 @@ class LLViewerTexture; const U32 SILHOUETTE_HIGHLIGHT = 0; // All data for new renderer goes into this class. -LL_ALIGN_PREFIX(16) -class LLDrawable +class alignas(16) LLDrawable : public LLViewerOctreeEntryData { LL_ALIGN_NEW; @@ -313,7 +312,7 @@ private: static U32 sNumZombieDrawables; static std::vector > sDeadList; -} LL_ALIGN_POSTFIX(16); +}; inline LLFace* LLDrawable::getFace(const S32 i) const diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h index 375828fefa..cc5e39c5fb 100644 --- a/indra/newview/lldynamictexture.h +++ b/indra/newview/lldynamictexture.h @@ -33,7 +33,7 @@ #include "llviewertexture.h" #include "llcamera.h" -class LLViewerDynamicTexture : public LLViewerTexture +class alignas(16) LLViewerDynamicTexture : public LLViewerTexture { LL_ALIGN_NEW public: @@ -90,7 +90,7 @@ protected: protected: bool mClamp; LLCoordGL mOrigin; - LL_ALIGN_16(LLCamera mCamera); + LLCamera mCamera; LLRenderTarget* mBoundTarget; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index f3cfbd9565..4ba47aa4da 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3625,12 +3625,11 @@ bool LLSpatialPartition::isVisible(const LLVector3& v) return true; } -LL_ALIGN_PREFIX(16) -class LLOctreeIntersect : public LLOctreeTraveler> +class alignas(16) LLOctreeIntersect : public LLOctreeTraveler> { public: - LL_ALIGN_16(LLVector4a mStart); - LL_ALIGN_16(LLVector4a mEnd); + LLVector4a mStart; + LLVector4a mEnd; S32 *mFaceHit; LLVector4a *mIntersection; @@ -3780,7 +3779,7 @@ public: return false; } -} LL_ALIGN_POSTFIX(16); +}; LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, bool pick_transparent, diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 3aaa3d60e8..4ca1ef7c7a 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -64,7 +64,7 @@ void pushVerts(LLFace* face); Make every effort to keep size minimal. Member ordering is important for cache coherency */ -class LLDrawInfo final : public LLRefCount +class alignas(16) LLDrawInfo final : public LLRefCount { LL_ALIGN_NEW; protected: @@ -198,12 +198,13 @@ public: }; }; -LL_ALIGN_PREFIX(16) -class LLSpatialGroup : public LLOcclusionCullingGroup +class alignas(16) LLSpatialGroup : public LLOcclusionCullingGroup { using super = LLOcclusionCullingGroup; friend class LLSpatialPartition; friend class LLOctreeStateCheck; + + LL_ALIGN_NEW public: LLSpatialGroup(const LLSpatialGroup& rhs) : LLOcclusionCullingGroup(rhs) @@ -338,8 +339,8 @@ public: virtual void rebound(); public: - LL_ALIGN_16(LLVector4a mViewAngle); - LL_ALIGN_16(LLVector4a mLastUpdateViewAngle); + LLVector4a mViewAngle; + LLVector4a mLastUpdateViewAngle; protected: virtual ~LLSpatialGroup(); @@ -369,7 +370,7 @@ public: U32 mRenderOrder = 0; // Reflection Probe associated with this node (if any) LLPointer mReflectionProbe = nullptr; -} LL_ALIGN_POSTFIX(16); +}; class LLGeometryManager { diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index 7f52ca9623..57959ec2fc 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -39,9 +39,10 @@ class LLViewerJointMesh; //----------------------------------------------------------------------------- // class LLViewerJoint //----------------------------------------------------------------------------- -class LLViewerJoint : +class alignas(16) LLViewerJoint : public virtual LLAvatarJoint { + LL_ALIGN_NEW public: LLViewerJoint(); LLViewerJoint(S32 joint_num); diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index fe66949f73..12075177b3 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -40,9 +40,10 @@ class LLViewerObject; //----------------------------------------------------------------------------- // class LLViewerJointAttachment //----------------------------------------------------------------------------- -class LLViewerJointAttachment : +class alignas(16) LLViewerJointAttachment : public LLViewerJoint { + LL_ALIGN_NEW public: LLViewerJointAttachment(); virtual ~LLViewerJointAttachment(); diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index cfe8ecdb67..a3afd84d06 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -41,8 +41,9 @@ class LLViewerTexLayerSet; //----------------------------------------------------------------------------- // class LLViewerJointMesh //----------------------------------------------------------------------------- -class LLViewerJointMesh : public LLAvatarJointMesh, public LLViewerJoint +class alignas(16) LLViewerJointMesh : public LLAvatarJointMesh, public LLViewerJoint { + LL_ALIGN_NEW public: // Constructor LLViewerJointMesh(); diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 60e17a6f58..83b8aa8d03 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -70,8 +70,7 @@ S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVect S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &radius_squared); //defines data needed for octree of an entry -//LL_ALIGN_PREFIX(16) -class LLViewerOctreeEntry : public LLRefCount +class alignas(16) LLViewerOctreeEntry : public LLRefCount { LL_ALIGN_NEW friend class LLViewerOctreeEntryData; @@ -115,16 +114,15 @@ private: LLViewerOctreeGroup* mGroup; //aligned members - LL_ALIGN_16(LLVector4a mExtents[2]); - LL_ALIGN_16(LLVector4a mPositionGroup); + LLVector4a mExtents[2]; + LLVector4a mPositionGroup; F32 mBinRadius; mutable S32 mBinIndex; mutable U32 mVisible; -} ;//LL_ALIGN_POSTFIX(16); +}; //defines an abstract class for entry data -//LL_ALIGN_PREFIX(16) class LLViewerOctreeEntryData : public LLRefCount { protected: @@ -173,11 +171,10 @@ protected: LLPointer mEntry; LLViewerOctreeEntry::eEntryDataType_t mDataType; static U32 sCurVisible; // Counter for what value of mVisible means currently visible -};//LL_ALIGN_POSTFIX(16); +}; //defines an octree group for an octree node, which contains multiple entries. -//LL_ALIGN_PREFIX(16) class LLViewerOctreeGroup : public OctreeListener { @@ -259,18 +256,17 @@ protected: U32 mState; OctreeNode* mOctreeNode; - LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects) - LL_ALIGN_16(LLVector4a mObjectBounds[2]); // bounding box (center, size) of objects in this node - LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children - LL_ALIGN_16(LLVector4a mObjectExtents[2]); // extents (min, max) of objects in this node + LLVector4a mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) + LLVector4a mObjectBounds[2]; // bounding box (center, size) of objects in this node + LLVector4a mExtents[2]; // extents (min, max) of this node and all its children + LLVector4a mObjectExtents[2]; // extents (min, max) of objects in this node S32 mAnyVisible; //latest visible to any camera S32 mVisible[LLViewerCamera::NUM_CAMERAS]; -};//LL_ALIGN_POSTFIX(16); +}; //octree group which has capability to support occlusion culling -//LL_ALIGN_PREFIX(16) class LLOcclusionCullingGroup : public LLViewerOctreeGroup { public: @@ -340,7 +336,7 @@ protected: public: static std::set sPendingQueries; -};//LL_ALIGN_POSTFIX(16); +}; class LLViewerOctreePartition { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c6a7a59034..25b7c58733 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3074,7 +3074,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) if (isImpostor() && !mNeedsImpostorUpdate) { - LL_ALIGN_16(LLVector4a ext[2]); + LLVector4a ext[2]; F32 distance; LLVector3 angle; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 5c062870a0..a1675e8a02 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -264,7 +264,7 @@ public: private: //aligned members - LL_ALIGN_16(LLVector4a mImpostorExtents[2]); + LLVector4a mImpostorExtents[2]; //-------------------------------------------------------------------- // Updates -- cgit v1.3 From 7495edffddd8facfaed4476b1f44f44ff008b91c Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 28 Oct 2025 03:06:16 -0400 Subject: Fix usage of deprecate opengl defines Signed-off-by: Rye --- indra/llappearanceutility/llbakingshadermgr.cpp | 10 +-- indra/llappearanceutility/llprocesstexture.cpp | 1 - indra/llrender/llimagegl.cpp | 4 +- indra/llrender/llrender.cpp | 76 ---------------------- indra/llrender/llrender.h | 2 - indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 2 +- indra/newview/lldrawpool.cpp | 2 +- indra/newview/llmaniprotate.cpp | 1 - indra/newview/llviewershadermgr.cpp | 24 +++---- indra/newview/pipeline.cpp | 6 +- 10 files changed, 24 insertions(+), 104 deletions(-) (limited to 'indra/llappearanceutility') diff --git a/indra/llappearanceutility/llbakingshadermgr.cpp b/indra/llappearanceutility/llbakingshadermgr.cpp index 07c747a8a0..5246f96ae4 100644 --- a/indra/llappearanceutility/llbakingshadermgr.cpp +++ b/indra/llappearanceutility/llbakingshadermgr.cpp @@ -154,8 +154,8 @@ void LLBakingShaderMgr::setShaders() loaded = true; for (U32 i = 0; i < shaders.size(); i++) { - // Note usage of GL_VERTEX_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB) == 0) + // Note usage of GL_VERTEX_SHADER + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER) == 0) { LL_WARNS("Shader") << "Failed to load vertex shader " << shaders[i].first << LL_ENDL; loaded = false; @@ -171,7 +171,7 @@ void LLBakingShaderMgr::setShaders() for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_FRAGMENT_SHADER - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER) == 0) { LL_WARNS("Shader") << "Failed to load fragment shader " << shaders[i].first << LL_ENDL; loaded = false; @@ -217,8 +217,8 @@ bool LLBakingShaderMgr::loadShadersInterface() { gAlphaMaskProgram.mName = "Alpha Mask Shader"; gAlphaMaskProgram.mShaderFiles.clear(); - gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER_ARB)); - gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER)); gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; if( !gAlphaMaskProgram.createShader() ) diff --git a/indra/llappearanceutility/llprocesstexture.cpp b/indra/llappearanceutility/llprocesstexture.cpp index 91ceedc8f6..527a6822f2 100644 --- a/indra/llappearanceutility/llprocesstexture.cpp +++ b/indra/llappearanceutility/llprocesstexture.cpp @@ -253,7 +253,6 @@ void LLProcessTexture::process(std::ostream& output) // Prepare gl for avatar baking glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - LLGLEnable color_mat(GL_COLOR_MATERIAL); gGL.setSceneBlendType(LLRender::BT_ALPHA); EBakedTextureIndex bake_type = LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString()); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 414a4db4a7..0a8d2090b4 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -2145,7 +2145,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() case GL_SRGB_ALPHA: mAlphaStride = 4; break; - case GL_BGRA_EXT: + case GL_BGRA: mAlphaStride = 4; break; default: @@ -2182,7 +2182,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() if( mAlphaStride < 1 || //unsupported format mAlphaOffset < 0 || //unsupported type - (mFormatPrimary == GL_BGRA_EXT && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation + (mFormatPrimary == GL_BGRA && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation { LL_WARNS() << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << LL_ENDL; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index cc67de8bf4..3f1dc3d3c1 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -535,82 +535,6 @@ void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions o } } -GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) -{ - switch(src) - { - // All four cases should return the same value. - case TBS_PREV_COLOR: - case TBS_PREV_ALPHA: - case TBS_ONE_MINUS_PREV_COLOR: - case TBS_ONE_MINUS_PREV_ALPHA: - return GL_PREVIOUS; - - // All four cases should return the same value. - case TBS_TEX_COLOR: - case TBS_TEX_ALPHA: - case TBS_ONE_MINUS_TEX_COLOR: - case TBS_ONE_MINUS_TEX_ALPHA: - return GL_TEXTURE; - - // All four cases should return the same value. - case TBS_VERT_COLOR: - case TBS_VERT_ALPHA: - case TBS_ONE_MINUS_VERT_COLOR: - case TBS_ONE_MINUS_VERT_ALPHA: - return GL_PRIMARY_COLOR; - - // All four cases should return the same value. - case TBS_CONST_COLOR: - case TBS_CONST_ALPHA: - case TBS_ONE_MINUS_CONST_COLOR: - case TBS_ONE_MINUS_CONST_ALPHA: - return GL_CONSTANT; - - default: - LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << LL_ENDL; - return GL_PRIMARY_COLOR; - } -} - -GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) -{ - switch(src) - { - // All four cases should return the same value. - case TBS_PREV_COLOR: - case TBS_TEX_COLOR: - case TBS_VERT_COLOR: - case TBS_CONST_COLOR: - return (isAlpha) ? GL_SRC_ALPHA: GL_SRC_COLOR; - - // All four cases should return the same value. - case TBS_PREV_ALPHA: - case TBS_TEX_ALPHA: - case TBS_VERT_ALPHA: - case TBS_CONST_ALPHA: - return GL_SRC_ALPHA; - - // All four cases should return the same value. - case TBS_ONE_MINUS_PREV_COLOR: - case TBS_ONE_MINUS_TEX_COLOR: - case TBS_ONE_MINUS_VERT_COLOR: - case TBS_ONE_MINUS_CONST_COLOR: - return (isAlpha) ? GL_ONE_MINUS_SRC_ALPHA : GL_ONE_MINUS_SRC_COLOR; - - // All four cases should return the same value. - case TBS_ONE_MINUS_PREV_ALPHA: - case TBS_ONE_MINUS_TEX_ALPHA: - case TBS_ONE_MINUS_VERT_ALPHA: - case TBS_ONE_MINUS_CONST_ALPHA: - return GL_ONE_MINUS_SRC_ALPHA; - - default: - LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Source Color or Alpha instead." << LL_ENDL; - return (isAlpha) ? GL_SRC_ALPHA: GL_SRC_COLOR; - } -} - // Useful for debugging that you've manually assigned a texture operation to the correct // texture unit based on the currently set active texture in opengl. void LLTexUnit::debugTextureUnit(void) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 72f2acc54a..8da0bde578 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -237,8 +237,6 @@ protected: bool mHasMipMaps; void debugTextureUnit(void); - GLint getTextureSource(eTextureBlendSrc src); - GLint getTextureSourceType(eTextureBlendSrc src, bool isAlpha = false); }; class LLLightState diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index ad0ecaf4ab..2356236d16 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -560,7 +560,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) message.setValueS32("default_height", 1024); message.setValueS32("depth", mDepth); message.setValueU32("internalformat", GL_RGB); - message.setValueU32("format", GL_BGRA_EXT); + message.setValueU32("format", GL_BGRA); message.setValueU32("type", GL_UNSIGNED_BYTE); message.setValueBoolean("coords_opengl", true); sendMessage(message); diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index e60b3eb5dc..3eca6059ed 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -369,7 +369,7 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color) void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color) { - glColor4ubv(color.mV); + gGL.diffuseColor4ubv(color.mV); } void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a) diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 5bdf3f81b5..4bf1b134ef 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -274,7 +274,6 @@ void LLManipRotate::render() } LLGLEnable cull_face(GL_CULL_FACE); - LLGLEnable clip_plane0(GL_CLIP_PLANE0); LLGLDepthTest gls_depth(GL_FALSE); //LLGLDisable gls_stencil(GL_STENCIL_TEST); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index b499125ccf..5bb165051c 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2657,10 +2657,10 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAAEdgeDetectProgram[i].addPermutations(defines); gSMAAEdgeDetectProgram[i].mShaderFiles.clear(); - gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAAEdgeDetectF.glsl", GL_FRAGMENT_SHADER_ARB)); - gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAAEdgeDetectV.glsl", GL_VERTEX_SHADER_ARB)); - gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_FRAGMENT_SHADER_ARB)); - gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER_ARB)); + gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAAEdgeDetectF.glsl", GL_FRAGMENT_SHADER)); + gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAAEdgeDetectV.glsl", GL_VERTEX_SHADER)); + gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_FRAGMENT_SHADER)); + gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER)); gSMAAEdgeDetectProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gSMAAEdgeDetectProgram[i].createShader(); // llassert(success); @@ -2683,10 +2683,10 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAABlendWeightsProgram[i].addPermutations(defines); gSMAABlendWeightsProgram[i].mShaderFiles.clear(); - gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAABlendWeightsF.glsl", GL_FRAGMENT_SHADER_ARB)); - gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAABlendWeightsV.glsl", GL_VERTEX_SHADER_ARB)); - gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_FRAGMENT_SHADER_ARB)); - gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER_ARB)); + gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAABlendWeightsF.glsl", GL_FRAGMENT_SHADER)); + gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAABlendWeightsV.glsl", GL_VERTEX_SHADER)); + gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_FRAGMENT_SHADER)); + gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER)); gSMAABlendWeightsProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gSMAABlendWeightsProgram[i].createShader(); // llassert(success); @@ -2709,10 +2709,10 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAANeighborhoodBlendProgram[i].addPermutations(defines); gSMAANeighborhoodBlendProgram[i].mShaderFiles.clear(); - gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAANeighborhoodBlendF.glsl", GL_FRAGMENT_SHADER_ARB)); - gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAANeighborhoodBlendV.glsl", GL_VERTEX_SHADER_ARB)); - gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_FRAGMENT_SHADER_ARB)); - gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER_ARB)); + gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAANeighborhoodBlendF.glsl", GL_FRAGMENT_SHADER)); + gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAANeighborhoodBlendV.glsl", GL_VERTEX_SHADER)); + gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_FRAGMENT_SHADER)); + gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER)); gSMAANeighborhoodBlendProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gSMAANeighborhoodBlendProgram[i].createShader(); // llassert(success); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 36bb15483e..e74da42180 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1006,7 +1006,7 @@ bool LLPipeline::allocateShadowBuffer(U32 resX, U32 resY) gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_ANISOTROPIC); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); } } @@ -1023,7 +1023,7 @@ bool LLPipeline::allocateShadowBuffer(U32 resX, U32 resY) gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_ANISOTROPIC); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); } } @@ -6989,7 +6989,7 @@ void apply_cube_face_rotation(U32 face) void validate_framebuffer_object() { GLenum status; - status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); switch(status) { case GL_FRAMEBUFFER_COMPLETE: -- cgit v1.3 From 76837f96554a683462bb9a28457b7b0d9c078bff Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Nov 2025 01:05:40 -0500 Subject: Fix support for setting thread names on linux and macos Signed-off-by: Rye --- .../llimage_libtest/llimage_libtest.cpp | 5 +++ indra/llappearanceutility/appearance_utility.cpp | 5 +++ indra/llcommon/llthread.cpp | 46 ++++++++++------------ indra/llcommon/llthread.h | 8 +--- indra/llcommon/threadpool.cpp | 1 + indra/llcorehttp/_httpservice.cpp | 3 +- indra/test/test.cpp | 5 +++ 7 files changed, 40 insertions(+), 33 deletions(-) (limited to 'indra/llappearanceutility') diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 1bd1bb2d2b..b82ced2f8d 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -345,6 +345,11 @@ public: int main(int argc, char** argv) { + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + // List of input and output files std::list input_filenames; std::list output_filenames; diff --git a/indra/llappearanceutility/appearance_utility.cpp b/indra/llappearanceutility/appearance_utility.cpp index 88034cd171..a9a310eb89 100644 --- a/indra/llappearanceutility/appearance_utility.cpp +++ b/indra/llappearanceutility/appearance_utility.cpp @@ -34,6 +34,11 @@ int main(int argc, char** argv) { + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + // Create an application instance. ll_init_apr(); LLAppAppearanceUtility* app = new LLAppAppearanceUtility(argc, argv); diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 692941a892..e1f0d531cf 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -42,6 +42,10 @@ #include #endif +#if LL_DARWIN || LL_LINUX +#include +#endif + #ifdef LL_WINDOWS @@ -56,25 +60,32 @@ typedef struct tagTHREADNAME_INFO DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #pragma pack(pop) +#endif -void set_thread_name( DWORD dwThreadID, const char* threadName) +void set_thread_name(const char* threadName) { +#if LL_WINDOWS THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = threadName; - info.dwThreadID = dwThreadID; - info.dwFlags = 0; + info.dwType = 0x1000; + info.szName = threadName; + info.dwThreadID = GetCurrentThreadId(); + info.dwFlags = 0; __try { - ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info ); + ::RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(DWORD), (ULONG_PTR*)&info); } - __except(EXCEPTION_CONTINUE_EXECUTION) + __except (EXCEPTION_CONTINUE_EXECUTION) { } -} +#elif LL_DARWIN + std::string truncated_name(std::string_view(threadName).substr(0, 15)); + pthread_setname_np(truncated_name.c_str()); +#elif LL_LINUX + std::string truncated_name(std::string_view(threadName).substr(0, 15)); + pthread_setname_np(pthread_self(), truncated_name.c_str()); #endif - +} //---------------------------------------------------------------------------- // Usage: @@ -148,27 +159,12 @@ LL_COMMON_API bool assert_main_thread() return false; } -// this function has become moot -void LLThread::registerThreadID() {} - // // Handed to the APR thread creation function // void LLThread::threadRun() { -#ifdef LL_WINDOWS - set_thread_name(-1, mName.c_str()); - -#if 0 // probably a bad idea, see usage of SetThreadIdealProcessor in LLWindowWin32) - HANDLE hThread = GetCurrentThread(); - if (hThread) - { - SetThreadAffinityMask(hThread, (DWORD_PTR) 0xFFFFFFFFFFFFFFFE); - } -#endif - -#endif - + set_thread_name(mName.c_str()); LL_PROFILER_SET_THREAD_NAME( mName.c_str() ); // this is the first point at which we're actually running in the new thread diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 8794ac93aa..b97d479abc 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -28,10 +28,11 @@ #define LL_LLTHREAD_H #include "llapr.h" -#include "boost/intrusive_ptr.hpp" #include "llrefcount.h" #include +extern void set_thread_name(const char* threadName); + namespace LLTrace { class ThreadRecorder; @@ -86,11 +87,6 @@ public: id_t getID() const { return mID; } - // Called by threads *not* created via LLThread to register some - // internal state used by LLMutex. You must call this once early - // in the running thread to prevent collisions with the main thread. - static void registerThreadID(); - private: bool mPaused; std::thread::native_handle_type mNativeHandle; // for termination in case of issues diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index 451e60c083..6adbdffba8 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -78,6 +78,7 @@ void LL::ThreadPoolBase::start() std::string tname{ stringize(mName, ':', (i+1), '/', mThreadCount) }; mThreads.emplace_back(tname, [this, tname]() { + set_thread_name(tname.c_str()); LL_PROFILER_SET_THREAD_NAME(tname.c_str()); run(tname); }); diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 5880fb7e87..03a2eab8e3 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -283,12 +283,11 @@ void HttpService::shutdown() // requested to stop. void HttpService::threadRun(LLCoreInt::HttpThread * thread) { + set_thread_name("HttpService"); LL_PROFILER_SET_THREAD_NAME("HttpService"); boost::this_thread::disable_interruption di; - LLThread::registerThreadID(); - ELoopSpeed loop(REQUEST_SLEEP); while (! mExitRequested) { diff --git a/indra/test/test.cpp b/indra/test/test.cpp index b611e52835..bf685ef20f 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -505,6 +505,11 @@ static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL; int main(int argc, char **argv) { + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + ll_init_apr(); apr_getopt_t* os = NULL; if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, argc, argv)) -- cgit v1.3 From 9440f969033b73e2e2a037c291bcb45619b1dfd1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Thu, 11 Dec 2025 01:43:58 +0200 Subject: Reapply "Add more functionality to LLFile and cleanup LLAPRFile"" # Conflicts: # indra/llcrashlogger/llcrashlock.cpp # indra/llrender/llshadermgr.cpp # indra/test/CMakeLists.txt --- .../llappearanceutility/llappappearanceutility.cpp | 2 + indra/llaudio/llaudiodecodemgr.cpp | 2 +- indra/llcommon/CMakeLists.txt | 1 + indra/llcommon/llapp.cpp | 4 +- indra/llcommon/llapr.cpp | 220 ---- indra/llcommon/llapr.h | 17 - indra/llcommon/llerror.cpp | 10 +- indra/llcommon/llfile.cpp | 1155 +++++++++++++++----- indra/llcommon/llfile.h | 488 ++++++--- indra/llcommon/tests/llfile_test.cpp | 253 +++++ indra/llfilesystem/lldir.cpp | 56 +- indra/llfilesystem/lldir_win32.cpp | 13 +- indra/llfilesystem/llfilesystem.cpp | 29 +- indra/llfilesystem/llfilesystem.h | 4 +- indra/llfilesystem/tests/lldir_test.cpp | 4 +- indra/llmessage/llassetstorage.cpp | 2 +- indra/llmessage/tests/llmessageconfig_test.cpp | 2 +- indra/llmessage/tests/message_test.cpp | 2 +- indra/llrender/llshadermgr.cpp | 20 +- indra/llxml/tests/llcontrol_test.cpp | 2 +- indra/newview/llappviewer.cpp | 28 +- indra/newview/llfloaterpreference.cpp | 12 +- indra/newview/llfloateruipreview.cpp | 37 +- indra/newview/llpreviewnotecard.cpp | 3 +- indra/newview/llpreviewscript.cpp | 3 +- indra/newview/lltexturecache.cpp | 87 +- indra/newview/llviewerassetstorage.cpp | 2 +- indra/newview/llviewerassetupload.cpp | 39 +- indra/newview/llviewerdisplay.cpp | 5 +- indra/newview/llviewermedia.cpp | 5 +- indra/newview/llvocache.cpp | 6 +- indra/newview/llvoicevivox.cpp | 3 +- 32 files changed, 1624 insertions(+), 892 deletions(-) mode change 100644 => 100755 indra/llcommon/llerror.cpp mode change 100644 => 100755 indra/llcommon/llfile.cpp mode change 100644 => 100755 indra/llcommon/llfile.h create mode 100644 indra/llcommon/tests/llfile_test.cpp mode change 100644 => 100755 indra/llfilesystem/lldir.cpp mode change 100644 => 100755 indra/llfilesystem/lldir_win32.cpp mode change 100644 => 100755 indra/llfilesystem/llfilesystem.cpp mode change 100644 => 100755 indra/llfilesystem/tests/lldir_test.cpp mode change 100644 => 100755 indra/llmessage/tests/llmessageconfig_test.cpp mode change 100644 => 100755 indra/llmessage/tests/message_test.cpp mode change 100644 => 100755 indra/llxml/tests/llcontrol_test.cpp mode change 100644 => 100755 indra/newview/llappviewer.cpp mode change 100644 => 100755 indra/newview/llfloaterpreference.cpp mode change 100644 => 100755 indra/newview/llfloateruipreview.cpp mode change 100644 => 100755 indra/newview/llpreviewnotecard.cpp mode change 100644 => 100755 indra/newview/llpreviewscript.cpp mode change 100644 => 100755 indra/newview/lltexturecache.cpp mode change 100644 => 100755 indra/newview/llviewerdisplay.cpp mode change 100644 => 100755 indra/newview/llviewermedia.cpp mode change 100644 => 100755 indra/newview/llvocache.cpp mode change 100644 => 100755 indra/newview/llvoicevivox.cpp (limited to 'indra/llappearanceutility') diff --git a/indra/llappearanceutility/llappappearanceutility.cpp b/indra/llappearanceutility/llappappearanceutility.cpp index d223c859ab..cdc9cfdf40 100644 --- a/indra/llappearanceutility/llappappearanceutility.cpp +++ b/indra/llappearanceutility/llappappearanceutility.cpp @@ -57,6 +57,8 @@ #include "llprocesstexture.h" #include "llprocessskin.h" +#include "apr_getopt.h" + const std::string NOTHING_EXTRA(""); //////////////////////////////////////////// diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index d8a6fffea6..232b429130 100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -199,7 +199,7 @@ bool LLVorbisDecodeState::initDecode() LL_DEBUGS("AudioEngine") << "Initing decode from vfile: " << mUUID << LL_ENDL; mInFilep = new LLFileSystem(mUUID, LLAssetType::AT_SOUND); - if (!mInFilep || !mInFilep->getSize()) + if (!mInFilep || mInFilep->getSize() <= 0) { LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL; delete mInFilep; diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 597a222b32..cb3f0d7842 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -322,6 +322,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(lleventdispatcher "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lleventfilter "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llevents "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llfile "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llhttpdate "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llheteromap "" "${test_libs}") diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 73b50d0a50..aa84895fb8 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -37,7 +37,7 @@ #endif #include "llcommon.h" -#include "llapr.h" + #include "llerrorcontrol.h" #include "llframetimer.h" #include "lllivefile.h" @@ -53,6 +53,8 @@ // // Signal handling #ifndef LL_WINDOWS +#include "apr_signal.h" + # include # include // for fork() void setup_signals(); diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 65ee383c6b..9ea7a34bac 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -526,226 +526,6 @@ S32 LLAPRFile::seek(apr_file_t* file_handle, apr_seek_where_t where, S32 offset) } } -//static -S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool) -{ - LL_PROFILE_ZONE_SCOPED; - //***************************************** - LLAPRFilePoolScope scope(pool); - apr_file_t* file_handle = open(filename, scope.getVolatileAPRPool(), APR_READ|APR_BINARY); - //***************************************** - if (!file_handle) - { - return 0; - } - - llassert(offset >= 0); - - if (offset > 0) - offset = LLAPRFile::seek(file_handle, APR_SET, offset); - - apr_size_t bytes_read; - if (offset < 0) - { - bytes_read = 0; - } - else - { - bytes_read = nbytes ; - apr_status_t s = apr_file_read(file_handle, buf, &bytes_read); - if (s != APR_SUCCESS) - { - LL_WARNS("APR") << " Attempting to read filename: " << filename << LL_ENDL; - ll_apr_warn_status(s); - bytes_read = 0; - } - else - { - llassert_always(bytes_read <= 0x7fffffff); - } - } - - //***************************************** - close(file_handle) ; - //***************************************** - return (S32)bytes_read; -} - -//static -S32 LLAPRFile::writeEx(const std::string& filename, const void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool) -{ - LL_PROFILE_ZONE_SCOPED; - apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY; - if (offset < 0) - { - flags |= APR_APPEND; - offset = 0; - } - - //***************************************** - LLAPRFilePoolScope scope(pool); - apr_file_t* file_handle = open(filename, scope.getVolatileAPRPool(), flags); - //***************************************** - if (!file_handle) - { - return 0; - } - - if (offset > 0) - { - offset = LLAPRFile::seek(file_handle, APR_SET, offset); - } - - apr_size_t bytes_written; - if (offset < 0) - { - bytes_written = 0; - } - else - { - bytes_written = nbytes ; - apr_status_t s = apr_file_write(file_handle, buf, &bytes_written); - if (s != APR_SUCCESS) - { - LL_WARNS("APR") << "Attempting to write filename: " << filename << LL_ENDL; - if (APR_STATUS_IS_ENOSPC(s)) - { - LLApp::notifyOutOfDiskSpace(); - } - ll_apr_warn_status(s); - bytes_written = 0; - } - else - { - llassert_always(bytes_written <= 0x7fffffff); - } - } - - //***************************************** - LLAPRFile::close(file_handle); - //***************************************** - - return (S32)bytes_written; -} - -//static -bool LLAPRFile::remove(const std::string& filename, LLVolatileAPRPool* pool) -{ - apr_status_t s; - - LLAPRFilePoolScope scope(pool); - s = apr_file_remove(filename.c_str(), scope.getVolatileAPRPool()); - - if (s != APR_SUCCESS) - { - ll_apr_warn_status(s); - LL_WARNS("APR") << " Attempting to remove filename: " << filename << LL_ENDL; - return false; - } - return true; -} - -//static -bool LLAPRFile::rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool) -{ - apr_status_t s; - - LLAPRFilePoolScope scope(pool); - s = apr_file_rename(filename.c_str(), newname.c_str(), scope.getVolatileAPRPool()); - - if (s != APR_SUCCESS) - { - ll_apr_warn_status(s); - LL_WARNS("APR") << " Attempting to rename filename: " << filename << LL_ENDL; - return false; - } - return true; -} - -//static -bool LLAPRFile::isExist(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags) -{ - apr_file_t* apr_file; - apr_status_t s; - - LLAPRFilePoolScope scope(pool); - s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, scope.getVolatileAPRPool()); - - if (s != APR_SUCCESS || !apr_file) - { - return false; - } - else - { - apr_file_close(apr_file) ; - return true; - } -} - -//static -S32 LLAPRFile::size(const std::string& filename, LLVolatileAPRPool* pool) -{ - apr_file_t* apr_file; - apr_finfo_t info; - apr_status_t s; - - LLAPRFilePoolScope scope(pool); - s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, scope.getVolatileAPRPool()); - - if (s != APR_SUCCESS || !apr_file) - { - return 0; - } - else - { - apr_status_t s = apr_file_info_get(&info, APR_FINFO_SIZE, apr_file); - - apr_file_close(apr_file) ; - - if (s == APR_SUCCESS) - { - return (S32)info.size; - } - else - { - return 0; - } - } -} - -//static -bool LLAPRFile::makeDir(const std::string& dirname, LLVolatileAPRPool* pool) -{ - apr_status_t s; - - LLAPRFilePoolScope scope(pool); - s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, scope.getVolatileAPRPool()); - - if (s != APR_SUCCESS) - { - ll_apr_warn_status(s); - LL_WARNS("APR") << " Attempting to make directory: " << dirname << LL_ENDL; - return false; - } - return true; -} - -//static -bool LLAPRFile::removeDir(const std::string& dirname, LLVolatileAPRPool* pool) -{ - apr_status_t s; - - LLAPRFilePoolScope scope(pool); - s = apr_file_remove(dirname.c_str(), scope.getVolatileAPRPool()); - - if (s != APR_SUCCESS) - { - ll_apr_warn_status(s); - LL_WARNS("APR") << " Attempting to remove directory: " << dirname << LL_ENDL; - return false; - } - return true; -} // //end of static components of LLAPRFile //******************************************************************************************************************************* diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 0e1e4277e7..8795a0f2c4 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -35,10 +35,6 @@ #include "llwin32headers.h" #include "apr_thread_proc.h" -#include "apr_getopt.h" -#include "apr_signal.h" - -#include "llstring.h" #include @@ -184,20 +180,7 @@ private: static apr_file_t* open(const std::string& filename, apr_pool_t* apr_pool, apr_int32_t flags); static apr_status_t close(apr_file_t* file) ; static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset); -public: - // returns false if failure: - static bool remove(const std::string& filename, LLVolatileAPRPool* pool = NULL); - static bool rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool = NULL); - static bool isExist(const std::string& filename, LLVolatileAPRPool* pool = NULL, apr_int32_t flags = APR_READ); - static S32 size(const std::string& filename, LLVolatileAPRPool* pool = NULL); - static bool makeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL); - static bool removeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL); - - // Returns bytes read/written, 0 if read/write fails: - static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL); - static S32 writeEx(const std::string& filename, const void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL); // offset<0 means append //******************************************************************************************************************************* }; - #endif // LL_LLAPR_H diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp old mode 100644 new mode 100755 index 8ae0fabcc6..5b42c83a14 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -481,13 +481,9 @@ namespace std::string file = user_dir + "/logcontrol-dev.xml"; - llstat stat_info; - if (LLFile::stat(file, &stat_info)) { - // NB: stat returns non-zero if it can't read the file, for example - // if it doesn't exist. LLFile has no better abstraction for - // testing for file existence. - - file = app_dir + "/logcontrol.xml"; + if (!LLFile::isfile(file)) + { + file = app_dir + "/logcontrol.xml"; } return * new LogControlFile(file); // NB: This instance is never freed diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp old mode 100644 new mode 100755 index a539e4fe28..ff87d8ce10 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -29,22 +29,17 @@ #include "linden_common.h" #include "llfile.h" -#include "llstring.h" #include "llerror.h" #include "stringize.h" #if LL_WINDOWS -#include "llwin32headers.h" -#include +#include #else #include +#include #endif -using namespace std; - -static std::string empty; - -// Many of the methods below use OS-level functions that mess with errno. Wrap +// Some of the methods below use OS-level functions that mess with errno. Wrap // variants of strerror() to report errors. #if LL_WINDOWS @@ -79,6 +74,7 @@ static errentry const errtable[] { ERROR_CURRENT_DIRECTORY, EACCES }, // 16 { ERROR_NOT_SAME_DEVICE, EXDEV }, // 17 { ERROR_NO_MORE_FILES, ENOENT }, // 18 + { ERROR_SHARING_VIOLATION, EACCES }, // 32 { ERROR_LOCK_VIOLATION, EACCES }, // 33 { ERROR_BAD_NETPATH, ENOENT }, // 53 { ERROR_NETWORK_ACCESS_DENIED, EACCES }, // 65 @@ -109,22 +105,25 @@ static errentry const errtable[] { ERROR_NOT_ENOUGH_QUOTA, ENOMEM } // 1816 }; -static int set_errno_from_oserror(unsigned long oserr) +static int get_errno_from_oserror(int oserr) { if (!oserr) return 0; // Check the table for the Windows OS error code - for (const struct errentry &entry : errtable) + for (const struct errentry& entry : errtable) { if (oserr == entry.oserr) { - _set_errno(entry.errcode); - return -1; + return entry.errcode; } } + return EINVAL; +} - _set_errno(EINVAL); +static int set_errno_from_oserror(unsigned long oserr) +{ + _set_errno(get_errno_from_oserror(oserr)); return -1; } @@ -136,69 +135,8 @@ std::string strerr(int errn) return buffer; } -inline bool is_slash(wchar_t const c) -{ - return c == L'\\' || c == L'/'; -} - -static std::wstring utf8path_to_wstring(const std::string& utf8path) -{ - if (utf8path.size() >= MAX_PATH) - { - // By prepending "\\?\" to a path, Windows widechar file APIs will not fail on long path names - std::wstring utf16path = L"\\\\?\\" + ll_convert(utf8path); - // We need to make sure that the path does not contain forward slashes as above - // prefix does bypass the path normalization that replaces slashes with backslashes - // before passing the path to kernel mode APIs - std::replace(utf16path.begin(), utf16path.end(), L'/', L'\\'); - return utf16path; - } - return ll_convert(utf8path); -} - -static unsigned short get_fileattr(const std::wstring& utf16path, bool dontFollowSymLink = false) -{ - unsigned long flags = FILE_FLAG_BACKUP_SEMANTICS; - if (dontFollowSymLink) - { - flags |= FILE_FLAG_OPEN_REPARSE_POINT; - } - HANDLE file_handle = CreateFileW(utf16path.c_str(), FILE_READ_ATTRIBUTES, - FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, - nullptr, OPEN_EXISTING, flags, nullptr); - if (file_handle != INVALID_HANDLE_VALUE) - { - FILE_ATTRIBUTE_TAG_INFO attribute_info; - if (GetFileInformationByHandleEx(file_handle, FileAttributeTagInfo, &attribute_info, sizeof(attribute_info))) - { - // A volume path alone (only drive letter) is not recognized as directory while it technically is - bool is_directory = (attribute_info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - (iswalpha(utf16path[0]) && utf16path[1] == ':' && - (!utf16path[2] || (is_slash(utf16path[2]) && !utf16path[3]))); - unsigned short st_mode = is_directory ? S_IFDIR : - (attribute_info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT ? S_IFLNK : S_IFREG); - st_mode |= (attribute_info.FileAttributes & FILE_ATTRIBUTE_READONLY) ? S_IREAD : S_IREAD | S_IWRITE; - // we do not try to guess executable flag - - // propagate user bits to group/other fields: - st_mode |= (st_mode & 0700) >> 3; - st_mode |= (st_mode & 0700) >> 6; - - CloseHandle(file_handle); - return st_mode; - } - } - // Retrieve last error and set errno before calling CloseHandle() - set_errno_from_oserror(GetLastError()); - - if (file_handle != INVALID_HANDLE_VALUE) - { - CloseHandle(file_handle); - } - return 0; -} - #else + // On Posix we want to call strerror_r(), but alarmingly, there are two // different variants. The one that returns int always populates the passed // buffer (except in case of error), whereas the other one always returns a @@ -245,9 +183,50 @@ std::string strerr(int errn) return message_from(errn, buffer, sizeof(buffer), strerror_r(errn, buffer, sizeof(buffer))); } + #endif // ! LL_WINDOWS -static int warnif(const std::string& desc, const std::string& filename, int rc, int accept = 0) +#if LL_WINDOWS && 0 // turn on to debug file-locking problems +#define PROCESS_LOCKING_CHECK 1 +static void find_locking_process(const std::string& filename) +{ + // Only do any of this stuff (before LL_ENDL) if it will be logged. + LL_DEBUGS("LLFile") << ""; + // wrong way + std::string TEMP = LLFile::tmpdir(); + if (TEMP.empty()) + { + LL_CONT << "No $TEMP, not running 'handle'"; + } + else + { + std::string tf(TEMP); + tf += "\\handle.tmp"; + // http://technet.microsoft.com/en-us/sysinternals/bb896655 + std::string cmd(STRINGIZE("handle \"" << filename + // "openfiles /query /v | fgrep -i \"" << filename + << "\" > \"" << tf << '"')); + LL_CONT << cmd; + if (system(cmd.c_str()) != 0) + { + LL_CONT << "\nDownload 'handle.exe' from http://technet.microsoft.com/en-us/sysinternals/bb896655"; + } + else + { + std::ifstream inf(tf); + std::string line; + while (std::getline(inf, line)) + { + LL_CONT << '\n' << line; + } + } + LLFile::remove(tf); + } + LL_CONT << LL_ENDL; +} +#endif // LL_WINDOWS hack to identify processes holding file open + +static int warnif(const std::string& desc, const std::string& filename, int rc, int suppress_warning = 0) { if (rc < 0) { @@ -256,319 +235,951 @@ static int warnif(const std::string& desc, const std::string& filename, int rc, // For certain operations, a particular errno value might be // acceptable -- e.g. stat() could permit ENOENT, mkdir() could permit - // EEXIST. Don't warn if caller explicitly says this errno is okay. - if (errn != accept) + // EEXIST. Don't log a warning if caller explicitly says this errno is okay. + if (errn != suppress_warning) { - LL_WARNS("LLFile") << "Couldn't " << desc << " '" << filename - << "' (errno " << errn << "): " << strerr(errn) << LL_ENDL; + LL_WARNS("LLFile") << "Couldn't " << desc << " '" << filename << "' (errno " << errn << "): " << strerr(errn) << LL_ENDL; } -#if 0 && LL_WINDOWS // turn on to debug file-locking problems +#if PROCESS_LOCKING_CHECK // If the problem is "Permission denied," maybe it's because another // process has the file open. Try to find out. - if (errn == EACCES) // *not* EPERM + if (errn == EACCES) // *not* EPERM { - // Only do any of this stuff (before LL_ENDL) if it will be logged. - LL_DEBUGS("LLFile") << empty; - // would be nice to use LLDir for this, but dependency goes the - // wrong way - const char* TEMP = LLFile::tmpdir(); - if (! (TEMP && *TEMP)) - { - LL_CONT << "No $TEMP, not running 'handle'"; - } - else - { - std::string tf(TEMP); - tf += "\\handle.tmp"; - // http://technet.microsoft.com/en-us/sysinternals/bb896655 - std::string cmd(STRINGIZE("handle \"" << filename - // "openfiles /query /v | fgrep -i \"" << filename - << "\" > \"" << tf << '"')); - LL_CONT << cmd; - if (system(cmd.c_str()) != 0) - { - LL_CONT << "\nDownload 'handle.exe' from http://technet.microsoft.com/en-us/sysinternals/bb896655"; - } - else - { - std::ifstream inf(tf); - std::string line; - while (std::getline(inf, line)) - { - LL_CONT << '\n' << line; - } - } - LLFile::remove(tf); - } - LL_CONT << LL_ENDL; + find_locking_process(filename); } -#endif // LL_WINDOWS hack to identify processes holding file open +#endif } return rc; } -// static -int LLFile::mkdir(const std::string& dirname, int perms) +static int warnif(const std::string& desc, const std::string& filename, const std::error_code& ec, int suppress_warning = 0) { - // We often use mkdir() to ensure the existence of a directory that might - // already exist. There is no known case in which we want to call out as - // an error the requested directory already existing. + if (ec) + { + // get Posix errno from the std::error_code so we can compare it to the suppress_warning parameter + // to see when a caller wants us to not generate a warning for a particular error code #if LL_WINDOWS - // permissions are ignored on Windows - int rc = 0; - std::wstring utf16dirname = utf8path_to_wstring(dirname); - if (!CreateDirectoryW(utf16dirname.c_str(), nullptr)) - { - // Only treat other errors than an already existing file as a real error - unsigned long oserr = GetLastError(); - if (oserr != ERROR_ALREADY_EXISTS) + int errn = get_errno_from_oserror(ec.value()); +#else + int errn = ec.value(); +#endif + // For certain operations, a particular errno value might be acceptable + // Don't warn if caller explicitly says this errno is okay. + if (errn != suppress_warning) + { + LL_WARNS("LLFile") << "Couldn't " << desc << " '" << filename << "' (errno " << errn << "): " << ec.message() << LL_ENDL; + } +#if PROCESS_LOCKING_CHECK + // Try to detect locked files by other processes + if (ec.value() == ERROR_SHARING_VIOLATION || ec.value() == ERROR_LOCK_VIOLATION) + { + find_locking_process(filename); + } +#endif + return -1; + } + return 0; +} + +#if LL_WINDOWS + +inline int set_ec_from_system_error(std::error_code& ec, DWORD error) +{ + ec.assign(error, std::system_category()); + return -1; +} + +static int set_ec_from_system_error(std::error_code& ec) +{ + return set_ec_from_system_error(ec, GetLastError()); +} + +inline int set_ec_to_parameter_error(std::error_code& ec) +{ + return set_ec_from_system_error(ec, ERROR_INVALID_PARAMETER); +} + +inline int set_ec_to_outofmemory_error(std::error_code& ec) +{ + return set_ec_from_system_error(ec, ERROR_NOT_ENOUGH_MEMORY); +} + +inline DWORD decode_access_mode(std::ios_base::openmode omode) +{ + switch (omode & (LLFile::in | LLFile::out)) + { + case LLFile::in: + return GENERIC_READ; + case LLFile::out: + return GENERIC_WRITE; + case static_cast(LLFile::in | LLFile::out): + return GENERIC_READ | GENERIC_WRITE; + } + if (omode & LLFile::app) + { + return GENERIC_WRITE; + } + return 0; +} + +inline DWORD decode_open_create_flags(std::ios_base::openmode omode) +{ + if (omode & LLFile::noreplace) + { + return CREATE_NEW; // create if it does not exist, otherwise fail + } + if (omode & LLFile::trunc) + { + if (!(omode & LLFile::out)) { - rc = set_errno_from_oserror(oserr); + return TRUNCATE_EXISTING; // open and truncate if it exists, otherwise fail } + return CREATE_ALWAYS; // open and truncate if it exists, otherwise create it + } + if (!(omode & LLFile::out)) + { + return OPEN_EXISTING; // open if it exists, otherwise fail + } + // LLFile::app or (LLFile::out and (!LLFile::trunc or !LLFile::noreplace)) + return OPEN_ALWAYS; // open if it exists, otherwise create it +} + +inline DWORD decode_share_mode(int omode) +{ + if (omode & LLFile::exclusive) + { + return 0; // allow no other access + } + if (omode & LLFile::shared) + { + return FILE_SHARE_READ; // allow read access + } + return FILE_SHARE_READ | FILE_SHARE_WRITE; // allow read and write access to others +} + +inline DWORD decode_attributes(std::ios_base::openmode omode, int perm) +{ + return (perm & S_IWRITE) ? FILE_ATTRIBUTE_NORMAL : FILE_ATTRIBUTE_READONLY; +} + +// Under Windows the values for the std::ios_base::seekdir constants match the according FILE_BEGIN +// and other constants but we do a programmatic translation for now to be sure +static DWORD seek_mode_from_dir(std::ios_base::seekdir seekdir) +{ + switch (seekdir) + { + case LLFile::beg: + return FILE_BEGIN; + case LLFile::cur: + return FILE_CURRENT; + case LLFile::end: + return FILE_END; } + return FILE_BEGIN; +} + #else - int rc = ::mkdir(dirname.c_str(), (mode_t)perms); - if (rc < 0 && errno == EEXIST) + +inline int set_ec_from_system_error(std::error_code& ec, int error) +{ + ec.assign(error, std::system_category()); + return -1; +} + +static int set_ec_from_system_error(std::error_code& ec) +{ + return set_ec_from_system_error(ec, errno); +} + +inline int set_ec_to_parameter_error(std::error_code& ec) +{ + return set_ec_from_system_error(ec, EINVAL); +} + +inline int set_ec_to_outofmemory_error(std::error_code& ec) +{ + return set_ec_from_system_error(ec, ENOMEM); +} + +inline int decode_access_mode(std::ios_base::openmode omode) +{ + if (omode & LLFile::out) { - // this is not the error you want, move along - return 0; + if (omode & LLFile::in) + { + return O_RDWR; + } + return O_WRONLY; + } + return O_RDONLY; + + /*switch (omode & (LLFile::in | LLFile::out)) + { + case LLFile::out: + return O_WRONLY; + case static_cast(LLFile::in | LLFile::out): + return O_RDWR; + } + return O_RDONLY;*/ +} + +inline int decode_open_mode(std::ios_base::openmode omode) +{ + int flags = O_CREAT | decode_access_mode(omode); + if (omode & LLFile::app) + { + flags |= O_APPEND; } + if (omode & LLFile::trunc) + { + flags |= O_TRUNC; + } + if (omode & LLFile::binary) + { + // Not a thing under *nix + } + if (omode & LLFile::noreplace) + { + flags |= O_EXCL; + } + return flags; +} + +inline int decode_lock_mode(std::ios_base::openmode omode) +{ + int lmode = omode & LLFile::noblock ? LOCK_NB : 0; + if (omode & LLFile::lock_mask) + { + if (omode & LLFile::exclusive) + { + return lmode | LOCK_EX; + } + return lmode | LOCK_SH; + } + return lmode | LOCK_UN; +} + +// Under Linux and Mac the values for the std::ios_base::seekdir constants match the according SEEK_SET +// and other constants but we do a programmatic translation for now to be sure +inline int seek_mode_from_dir(std::ios_base::seekdir seekdir) +{ + switch (seekdir) + { + case LLFile::beg: + return SEEK_SET; + case LLFile::cur: + return SEEK_CUR; + case LLFile::end: + return SEEK_END; + } + return SEEK_SET; +} + #endif - // anything else might be a problem - return warnif("mkdir", dirname, rc); + +inline int clear_error(std::error_code& ec) +{ + ec.clear(); + return 0; } -// static -int LLFile::rmdir(const std::string& dirname, int suppress_error) +inline bool are_open_mode_flags_invalid(std::ios_base::openmode omode) +{ + // at least one of input or output needs to be specified + if (!(omode & (LLFile::in | LLFile::out))) + { + return true; + } + // output must be possible for any of the extra options + if (!(omode & LLFile::out) && (omode & (LLFile::trunc | LLFile::app | LLFile::noreplace))) + { + return true; + } + // invalid combination, mutually exclusive + if ((omode & LLFile::app) && (omode & (LLFile::trunc | LLFile::noreplace))) + { + return true; + } + return false; +} + +//---------------------------------------------------------------------------------------- +// class member functions +//---------------------------------------------------------------------------------------- +int LLFile::open(const std::string& filename, std::ios_base::openmode omode, std::error_code& ec, int perm) { + close(ec); + if (are_open_mode_flags_invalid(omode)) + { + return set_ec_to_parameter_error(ec); + } #if LL_WINDOWS - std::wstring utf16dirname = utf8path_to_wstring(dirname); - int rc = _wrmdir(utf16dirname.c_str()); + DWORD access = decode_access_mode(omode), + share = decode_share_mode(omode), + create = decode_open_create_flags(omode), + attributes = decode_attributes(omode, perm); + + std::wstring file_path = utf8StringToWstring(filename); + mHandle = CreateFileW(file_path.c_str(), access, share, nullptr, create, attributes, nullptr); + // The dwShareMode = share parameter takes care of locking the file for other processes if indicated, + // no need to do anything else for file locking here #else - int rc = ::rmdir(dirname.c_str()); + int oflags = decode_open_mode(omode); + int lmode = omode & LLFile::lock_mask; + mHandle = ::open(filename.c_str(), oflags, perm); + if (mHandle != InvalidHandle && lmode && lock(lmode | LLFile::noblock, ec) != 0) + { + close(); + return -1; + } #endif - return warnif("rmdir", dirname, rc, suppress_error); + if (mHandle == InvalidHandle) + { + return set_ec_from_system_error(ec); + } + + if (omode & LLFile::ate && seek(0, LLFile::end, ec) != 0) + { + close(); + return -1; + } + mOpen = omode; + return clear_error(ec); } -// static -LLFILE* LLFile::fopen(const std::string& filename, const char* mode) +S64 LLFile::size(std::error_code& ec) { #if LL_WINDOWS - std::wstring utf16filename = utf8path_to_wstring(filename); - std::wstring utf16mode = ll_convert(std::string(mode)); - return _wfopen(utf16filename.c_str(), utf16mode.c_str()); + LARGE_INTEGER value = { 0 }; + if (GetFileSizeEx(mHandle, &value)) + { + clear_error(ec); + return value.QuadPart; + } #else - return ::fopen(filename.c_str(),mode); + struct stat statval; + if (fstat(mHandle, &statval) == 0) + { + clear_error(ec); + return statval.st_size; + } #endif + return set_ec_from_system_error(ec); } -// static -int LLFile::close(LLFILE * file) +S64 LLFile::tell(std::error_code& ec) { - int ret_value = 0; - if (file) +#if LL_WINDOWS + LARGE_INTEGER value = { 0 }; + if (SetFilePointerEx(mHandle, value, &value, FILE_CURRENT)) { - ret_value = fclose(file); + clear_error(ec); + return value.QuadPart; } - return ret_value; +#else + off_t offset = lseek(mHandle, 0, SEEK_CUR); + if (offset != -1) + { + clear_error(ec); + return offset; + } +#endif + return set_ec_from_system_error(ec); } -// static -std::string LLFile::getContents(const std::string& filename) +int LLFile::seek(S64 pos, std::error_code& ec) { - LLFILE* fp = LLFile::fopen(filename, "rb"); - if (fp) + return seek(pos, LLFile::beg, ec); +} + +int LLFile::seek(S64 offset, std::ios_base::seekdir dir, std::error_code& ec) +{ + S64 newOffset = 0; +#if LL_WINDOWS + DWORD seekdir = seek_mode_from_dir(dir); + LARGE_INTEGER value; + value.QuadPart = offset; + if (SetFilePointerEx(mHandle, value, (PLARGE_INTEGER)&newOffset, seekdir)) +#else + newOffset = lseek(mHandle, offset, seek_mode_from_dir(dir)); + if (newOffset != -1) +#endif { - fseek(fp, 0, SEEK_END); - U32 length = ftell(fp); - fseek(fp, 0, SEEK_SET); + return clear_error(ec); + } + return set_ec_from_system_error(ec); +} - std::vector buffer(length); - size_t nread = fread(buffer.data(), 1, length, fp); - fclose(fp); +#if LL_WINDOWS +inline DWORD next_buffer_size(S64 nbytes) +{ + return nbytes > 0x80000000 ? 0x80000000 : (DWORD)nbytes; +} +#endif - return std::string(buffer.data(), nread); +S64 LLFile::read(void* buffer, S64 nbytes, std::error_code& ec) +{ + if (nbytes == 0) + { + // Nothing to do + return clear_error(ec); } + else if (!buffer || nbytes < 0) + { + return set_ec_to_parameter_error(ec); + } +#if LL_WINDOWS + S64 totalBytes = 0; + char *ptr = (char*)buffer; + DWORD bytesRead, bytesToRead = next_buffer_size(nbytes); - return LLStringUtil::null; + // Read in chunks to support >4GB which the S64 nbytes value makes possible + while (ReadFile(mHandle, ptr, bytesToRead, &bytesRead, nullptr)) + { + totalBytes += bytesRead; + if (nbytes <= totalBytes || // requested amount read + bytesRead < bytesToRead) // ReadFile encountered eof + { + clear_error(ec); + return totalBytes; + } + ptr += bytesRead; + bytesToRead = next_buffer_size(nbytes - totalBytes); + } +#else + ssize_t bytesRead = ::read(mHandle, buffer, nbytes); + if (bytesRead != -1) + { + clear_error(ec); + return bytesRead; + } +#endif + return set_ec_from_system_error(ec); } -// static -int LLFile::remove(const std::string& filename, int suppress_error) +S64 LLFile::write(const void* buffer, S64 nbytes, std::error_code& ec) { + if (nbytes == 0) + { + // Nothing to do here + return clear_error(ec); + } + else if (!buffer || nbytes < 0) + { + return set_ec_to_parameter_error(ec); + } #if LL_WINDOWS - // Posix remove() works on both files and directories although on Windows - // remove() and its wide char variant _wremove() only removes files just - // as its siblings unlink() and _wunlink(). - // If we really only want to support files we should instead use - // unlink() in the non-Windows part below too - int rc = -1; - std::wstring utf16filename = utf8path_to_wstring(filename); - unsigned short st_mode = get_fileattr(utf16filename); - if (S_ISDIR(st_mode)) + // If this was opened in append mode, we emulate it on Windows + if (mOpen & LLFile::app && seek(0, LLFile::end, ec) != 0) + { + return -1; + } + + S64 totalBytes = 0; + char* ptr = (char*)buffer; + DWORD bytesWritten, bytesToWrite = next_buffer_size(nbytes); + + // Write in chunks to support >4GB which the S64 nbytes value makes possible + while (WriteFile(mHandle, ptr, bytesToWrite, &bytesWritten, nullptr)) + { + totalBytes += bytesWritten; + if (nbytes <= totalBytes) + { + clear_error(ec); + return totalBytes; + } + ptr += bytesWritten; + bytesToWrite = next_buffer_size(nbytes - totalBytes); + } +#else + ssize_t bytesWritten = ::write(mHandle, buffer, nbytes); + if (bytesWritten != -1) + { + clear_error(ec); + return bytesWritten; + } +#endif + return set_ec_from_system_error(ec); +} + +S64 LLFile::printf(const char* fmt, ...) +{ + va_list args1; + va_start(args1, fmt); + va_list args2; + va_copy(args2, args1); + int length = vsnprintf(nullptr, 0, fmt, args1); + va_end(args1); + if (length < 0) { - rc = _wrmdir(utf16filename.c_str()); + va_end(args2); + return -1; } - else if (S_ISREG(st_mode)) + void* buffer = malloc(length + 1); + if (!buffer) { - rc = _wunlink(utf16filename.c_str()); + va_end(args2); + return -1; } - else if (st_mode) + length = vsnprintf((char*)buffer, length + 1, fmt, args2); + va_end(args2); + std::error_code ec; + S64 written = write(buffer, length, ec); + free(buffer); + return written; +} + +int LLFile::lock(int mode, std::error_code& ec) +{ +#if LL_WINDOWS + if (!(mode & LLFile::lock_mask)) { - // it is something else than a file or directory - // this should not really happen as long as we do not allow for symlink - // detection in the optional parameter to get_fileattr() - rc = set_errno_from_oserror(ERROR_INVALID_PARAMETER); + if (UnlockFile(mHandle, 0, 0, MAXDWORD, MAXDWORD)) + { + return clear_error(ec); + } } else { - // get_fileattr() failed and already set errno, preserve it for correct error reporting + OVERLAPPED overlapped = { 0 }; + DWORD flags = (mode & LLFile::noblock) ? LOCKFILE_FAIL_IMMEDIATELY : 0; + if (mode & LLFile::exclusive) + { + flags |= LOCKFILE_EXCLUSIVE_LOCK; + } + // We lock the maximum range, since flock only supports locking the entire file too + if (LockFileEx(mHandle, flags, 0, MAXDWORD, MAXDWORD, &overlapped)) + { + return clear_error(ec); + } } #else - int rc = ::remove(filename.c_str()); + if (flock(mHandle, decode_lock_mode(static_cast(mode))) == 0) + { + return clear_error(ec); + } #endif - return warnif("remove", filename, rc, suppress_error); + return set_ec_from_system_error(ec); +} + +int LLFile::close(std::error_code& ec) +{ + if (mHandle != InvalidHandle) + { + llfile_handle_t handle = InvalidHandle; + std::swap(handle, mHandle); +#if LL_WINDOWS + if (!CloseHandle(handle)) +#else + if (::close(handle)) +#endif + { + return set_ec_from_system_error(ec); + } + } + return clear_error(ec); +} + +int LLFile::close() +{ + std::error_code ec; + return close(ec); } +//---------------------------------------------------------------------------------------- +// static member functions +//---------------------------------------------------------------------------------------- + // static -int LLFile::rename(const std::string& filename, const std::string& newname, int suppress_error) +LLFILE* LLFile::fopen(const std::string& filename, const char* mode, int lmode) { + LLFILE* file; #if LL_WINDOWS - // Posix rename() will gladly overwrite a file at newname if it exists, the Windows - // rename(), respectively _wrename(), will bark on that. Instead call directly the Windows - // API MoveFileEx() and use its flags to specify that overwrite is allowed. - std::wstring utf16filename = utf8path_to_wstring(filename); - std::wstring utf16newname = utf8path_to_wstring(newname); - int rc = 0; - if (!MoveFileExW(utf16filename.c_str(), utf16newname.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) + int shflag = _SH_DENYNO; + switch (lmode) { - rc = set_errno_from_oserror(GetLastError()); + case LLFile::exclusive: + shflag = _SH_DENYRW; + break; + case LLFile::shared: + shflag = _SH_DENYWR; + break; } + std::wstring file_path = utf8StringToWstring(filename); + std::wstring utf16mode = ll_convert(std::string(mode)); + file = _wfsopen(file_path.c_str(), utf16mode.c_str(), shflag); #else - int rc = ::rename(filename.c_str(),newname.c_str()); + file = ::fopen(filename.c_str(), mode); + if (file && (lmode & (LLFile::lock_mask))) + { + // Rather fail on a sharing conflict than block + if (flock(fileno(file), decode_lock_mode(static_cast(lmode | LLFile::noblock)))) + { + ::fclose(file); + file = nullptr; + } + } #endif - return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, suppress_error); + return file; +} + +// static +int LLFile::close(LLFILE* file) +{ + int ret_value = 0; + if (file) + { + ret_value = ::fclose(file); + } + return ret_value; +} + +// static +std::string LLFile::getContents(const std::string& filename) +{ + std::error_code ec; + return getContents(filename, ec); +} + +// static +std::string LLFile::getContents(const std::string& filename, std::error_code& ec) +{ + std::string buffer; + LLFile file(filename, LLFile::in | LLFile::binary, ec); + if (file) + { + S64 length = file.size(ec); + if (!ec && length > 0) + { + buffer = std::string(length, 0); + file.read(&buffer[0], length, ec); + if (ec) + { + buffer.clear(); + } + } + } + return buffer; } -// Make this a define rather than using magic numbers multiple times in the code -#define LLFILE_COPY_BUFFER_SIZE 16384 +// static +int LLFile::mkdir(const std::string& dirname) +{ + std::error_code ec; + std::filesystem::path file_path = utf8StringToPath(dirname); + // We often use mkdir() to ensure the existence of a directory that might + // already exist. There is no known case in which we want to call out as + // an error the requested directory already existing. + std::filesystem::create_directory(file_path, ec); + // The return value is only true if the directory was actually created. + // But if it already existed, ec still indicates success. + return warnif("mkdir", dirname, ec); +} // static -bool LLFile::copy(const std::string& from, const std::string& to) +int LLFile::remove(const std::string& filename, int suppress_warning) { - bool copied = false; - LLFILE* in = LLFile::fopen(from, "rb"); - if (in) + std::error_code ec; + std::filesystem::path file_path = utf8StringToPath(filename); + std::filesystem::remove(file_path, ec); + return warnif("remove", filename, ec, suppress_warning); +} + +// static +int LLFile::rename(const std::string& filename, const std::string& newname, int suppress_warning) +{ + std::error_code ec; + std::filesystem::path file_path = utf8StringToPath(filename); + std::filesystem::path new_path = utf8StringToPath(newname); + std::filesystem::rename(file_path, new_path, ec); + return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, ec, suppress_warning); +} + +// static +S64 LLFile::read(const std::string& filename, void* buf, S64 offset, S64 nbytes) +{ + std::error_code ec; + return read(filename, buf, offset, nbytes, ec); +} + +// static +S64 LLFile::read(const std::string& filename, void* buf, S64 offset, S64 nbytes, std::error_code& ec) +{ + // if number of bytes is 0 or less there is nothing to do here + if (nbytes <= 0) + { + clear_error(ec); + return 0; + } + + if (!buf || offset < 0) { - LLFILE* out = LLFile::fopen(to, "wb"); - if (out) + set_ec_to_parameter_error(ec); + } + else + { + std::ios_base::openmode omode = LLFile::in | LLFile::binary; + + LLFile file(filename, omode, ec); + if (!ec && (bool)file) { - char buf[LLFILE_COPY_BUFFER_SIZE]; - size_t readbytes; - bool write_ok = true; - while (write_ok && (readbytes = fread(buf, 1, LLFILE_COPY_BUFFER_SIZE, in))) + if (offset > 0) + { + file.seek(offset, ec); + } + // else (offset == 0) file was just opened and should already be at 0. + if (!ec) { - if (fwrite(buf, 1, readbytes, out) != readbytes) + S64 bytes_read = file.read(buf, nbytes, ec); + if (!ec) { - LL_WARNS("LLFile") << "Short write" << LL_ENDL; - write_ok = false; + return bytes_read; } } - if ( write_ok ) + } + } + return warnif("read from file failed", filename, ec); +} + +// static +S64 LLFile::write(const std::string& filename, const void* buf, S64 offset, S64 nbytes) +{ + std::error_code ec; + return write(filename, buf, offset, nbytes, ec); +} + +// static +S64 LLFile::write(const std::string& filename, const void* buf, S64 offset, S64 nbytes, std::error_code& ec) +{ + // if number of bytes is 0 or less there is nothing to do here + if (nbytes <= 0) + { + clear_error(ec); + return 0; + } + + if (!buf) + { + set_ec_to_parameter_error(ec); + } + else + { + std::ios_base::openmode omode = LLFile::out | LLFile::binary; + if (offset < 0) + { + omode |= LLFile::app; + } + + LLFile file(filename, omode, ec); + if (!ec && (bool)file) + { + if (offset > 0) + { + file.seek(offset, ec); + } + // else (offset == 0) we are not appending, file was just opened and should already be at 0. + if (!ec) { - copied = true; + S64 bytes_written = file.write(buf, nbytes, ec); + if (!ec) + { + return bytes_written; + } } - fclose(out); } - fclose(in); + } + return warnif("write to file failed", filename, ec); +} + +// static +bool LLFile::copy(const std::string& source, const std::string& target) +{ + std::error_code ec; + return copy(source, target, std::filesystem::copy_options::overwrite_existing, ec); +} + +// static +bool LLFile::copy(const std::string& source, const std::string& target, std::filesystem::copy_options options, std::error_code& ec) +{ + std::filesystem::path source_path = utf8StringToPath(source); + std::filesystem::path target_path = utf8StringToPath(target); + bool copied = std::filesystem::copy_file(source_path, target_path, options, ec); + if (!copied) + { + warnif(STRINGIZE("copy failed, to '" << target << "' from"), source, ec); } return copied; } // static -int LLFile::stat(const std::string& filename, llstat* filestatus, int suppress_error) +int LLFile::stat(const std::string& filename, llstat* filestatus, const char *fname, int suppress_warning) { #if LL_WINDOWS - std::wstring utf16filename = utf8path_to_wstring(filename); - int rc = _wstat64(utf16filename.c_str(), filestatus); + std::wstring file_path = utf8StringToWstring(filename); + int rc = _wstat64(file_path.c_str(), filestatus); #else int rc = ::stat(filename.c_str(), filestatus); #endif - return warnif("stat", filename, rc, suppress_error); + return warnif(fname ? fname : "stat", filename, rc, suppress_warning); } // static -unsigned short LLFile::getattr(const std::string& filename, bool dontFollowSymLink, int suppress_error) +std::time_t LLFile::getCreationTime(const std::string& filename, int suppress_warning) { -#if LL_WINDOWS - // _wstat64() is a bit heavyweight on Windows, use a more lightweight API - // to just get the attributes - int rc = -1; - std::wstring utf16filename = utf8path_to_wstring(filename); - unsigned short st_mode = get_fileattr(utf16filename, dontFollowSymLink); - if (st_mode) + // As of C++20 there is no functionality in std::filesystem to retrieve this information + llstat filestat; + int rc = stat(filename, &filestat, "getCreationTime", suppress_warning); + if (rc == 0) { - return st_mode; - } +#if LL_DARWIN + return filestat.st_birthtime; #else - llstat filestatus; - int rc = dontFollowSymLink ? ::lstat(filename.c_str(), &filestatus) : ::stat(filename.c_str(), &filestatus); + // Linux stat() doesn't have a creation/birth time (st_ctime really is the last status + // change or inode attributes change) unless we would use statx() instead. But that is + // a major effort, which would require Linux specific changes to LLFile::stat() above + // and possibly adaptions for other platforms that we leave for a later exercise if it + // is ever desired. + return filestat.st_ctime; +#endif + } + return 0; +} + +// static +std::time_t LLFile::getModificationTime(const std::string& filename, int suppress_warning) +{ + // tried to use std::filesystem::last_write_time() but the whole std::chrono infrastructure is as of + // C++20 still not fully implemented on all platforms. Specifically MacOS C++20 seems lacking here, + // and Windows requires a roundabout through std::chrono::utc_clock to then get a + // std::chrono::system_clock that can return a more useful time_t. + // So we take the easy way out in a similar way as with getCreationTime(). + llstat filestat; + int rc = stat(filename, &filestat, "getModificationTime", suppress_warning); if (rc == 0) { - return filestatus.st_mode; + return filestat.st_mtime; } -#endif - warnif("getattr", filename, rc, suppress_error); return 0; } +// static +S64 LLFile::size(const std::string& filename, int suppress_warning) +{ + std::error_code ec; + std::filesystem::path file_path = utf8StringToPath(filename); + std::intmax_t size = static_cast(std::filesystem::file_size(file_path, ec)); + if (ec) + { + return warnif("size", filename, ec, suppress_warning); + } + return size; +} + +// static +std::filesystem::file_status LLFile::getStatus(const std::string& filename, bool dontFollowSymLink, int suppress_warning) +{ + std::error_code ec; + std::filesystem::path file_path = utf8StringToPath(filename); + std::filesystem::file_status status; + if (dontFollowSymLink) + { + status = std::filesystem::symlink_status(file_path, ec); + } + else + { + status = std::filesystem::status(file_path, ec); + } + warnif("getStatus()", filename, ec, suppress_warning); + return status; +} + +// static +bool LLFile::exists(const std::string& filename) +{ + std::filesystem::file_status status = getStatus(filename); + return std::filesystem::exists(status); +} + // static bool LLFile::isdir(const std::string& filename) { - return S_ISDIR(getattr(filename)); + std::filesystem::file_status status = getStatus(filename); + return std::filesystem::is_directory(status); } // static bool LLFile::isfile(const std::string& filename) { - return S_ISREG(getattr(filename)); + std::filesystem::file_status status = getStatus(filename); + return std::filesystem::is_regular_file(status); } // static bool LLFile::islink(const std::string& filename) { - return S_ISLNK(getattr(filename, true)); + std::filesystem::file_status status = getStatus(filename, true); + return std::filesystem::is_symlink(status); } // static -const char *LLFile::tmpdir() +const std::string& LLFile::tmpdir() { - static std::string utf8path; - - if (utf8path.empty()) + static std::string temppath; + if (temppath.empty()) { - char sep; -#if LL_WINDOWS - sep = '\\'; + temppath = std::filesystem::temp_directory_path().string(); + } - std::vector utf16path(MAX_PATH + 1); - GetTempPathW(static_cast(utf16path.size()), &utf16path[0]); - utf8path = ll_convert_wide_to_string(&utf16path[0]); + char sep; +#if LL_WINDOWS + sep = '\\'; #else - sep = '/'; + sep = '/'; +#endif + if (temppath[temppath.size() - 1] != sep) + { + temppath += sep; + } + return temppath; +} - utf8path = LLStringUtil::getenv("TMPDIR", "/tmp/"); +// static +std::filesystem::path LLFile::utf8StringToPath(const std::string& pathname) +{ +#if LL_WINDOWS + return ll_convert(pathname); +#else + return pathname; #endif - if (utf8path[utf8path.size() - 1] != sep) +} + +#if LL_WINDOWS + +// static +std::wstring LLFile::utf8StringToWstring(const std::string& pathname) +{ + std::wstring utf16string(ll_convert(pathname)); + if (utf16string.size() >= MAX_PATH) + { + // By going through std::filesystem::path we get a lot of path sanitation done for us that + // is needed when passing a path with a kernel object space prefix to Windows API functions + // since this prefix disables the kernel32 path normalization + std::filesystem::path utf16path(utf16string); + + // By prepending "\\?\" to a path, Windows widechar file APIs will not fail on long path names + utf16string.assign(L"\\\\?\\").append(utf16path); + + /* remove trailing spaces and dots (yes, Windows really does that) */ + size_t last_valid = utf16string.find_last_not_of(L" \t."); + if (last_valid == std::wstring::npos) { - utf8path += sep; + return std::wstring(); } + return utf16string.substr(0, last_valid + 1); } - return utf8path.c_str(); + return utf16string; } -#if LL_WINDOWS - /************** input file stream ********************************/ llifstream::llifstream() {} @@ -586,10 +1197,8 @@ void llifstream::open(const std::string& _Filename, ios_base::openmode _Mode) _Mode | ios_base::in); } - /************** output file stream ********************************/ - llofstream::llofstream() {} // explicit @@ -605,30 +1214,4 @@ void llofstream::open(const std::string& _Filename, ios_base::openmode _Mode) _Mode | ios_base::out); } -/************** helper functions ********************************/ - -std::streamsize llifstream_size(llifstream& ifstr) -{ - if(!ifstr.is_open()) return 0; - std::streampos pos_old = ifstr.tellg(); - ifstr.seekg(0, ios_base::beg); - std::streampos pos_beg = ifstr.tellg(); - ifstr.seekg(0, ios_base::end); - std::streampos pos_end = ifstr.tellg(); - ifstr.seekg(pos_old, ios_base::beg); - return pos_end - pos_beg; -} - -std::streamsize llofstream_size(llofstream& ofstr) -{ - if(!ofstr.is_open()) return 0; - std::streampos pos_old = ofstr.tellp(); - ofstr.seekp(0, ios_base::beg); - std::streampos pos_beg = ofstr.tellp(); - ofstr.seekp(0, ios_base::end); - std::streampos pos_end = ofstr.tellp(); - ofstr.seekp(pos_old, ios_base::beg); - return pos_end - pos_beg; -} - #endif // LL_WINDOWS diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h old mode 100644 new mode 100755 index 04a2946ac4..0036e896c3 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -35,118 +35,359 @@ * Attempts to mostly mirror the POSIX style IO functions. */ -typedef FILE LLFILE; - #include +#include #include #if LL_WINDOWS +#include // The Windows version of stat function and stat data structure are called _stat64 // We use _stat64 here to support 64-bit st_size and time_t values -typedef struct _stat64 llstat; +typedef struct _stat64 llstat; #else -typedef struct stat llstat; #include +typedef struct stat llstat; #endif -#ifndef S_ISREG -# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) -#endif - -#ifndef S_ISDIR -# define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) -#endif - -// Windows C runtime library does not define this and does not support symlink detection in the -// stat functions but we do in our getattr() function -#ifndef S_IFLNK -#define S_IFLNK 0xA000 /* symlink */ -#endif - -#ifndef S_ISLNK -#define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK) -#endif +typedef FILE LLFILE; #include "llstring.h" // safe char* -> std::string conversion -/// LLFile is a class of static functions operating on paths +/// This class provides a selection of functions to operate on files through names and +/// a class implementation to represent a file for reading and writing to it /// All the functions with a path string input take UTF8 path/filenames +/// +/// @nosubgrouping +/// class LL_COMMON_API LLFile { public: + // ================================================================================ + /// @name Constants + /// + ///@{ + /** These can be passed to the omode parameter of LLFile::open() and its constructor + + This is similar to the openmode flags for std:fstream but not exactly the same + std::fstream open() does not allow to open a file for writing without either + forcing the file to be truncated on open or all write operations being always + appended to the end of the file or failing to open when the file does not exist. + But to allow implementing the LLAPRFile::writeEx() functionality we need to be + able to write at a random position to the file without truncating it on open. + + any other combinations than listed here are not allowed and will cause an error + + bin in out trunc app noreplace File exists File doesn't exist + ---------------------------------------------------------------------------------- + - + - - - - Open at begin Failure to open + + + - - - - " " + - - + - - - " Create new + + - + - - - " " + - + + - - - " " + + + + - - - " " + ---------------------------------------------------------------------------------- + - - + + - - Destroy contents Create new + + - + + - - " " + - + + + - - " " + + + + + - - " " + ---------------------------------------------------------------------------------- + - - + x - + Failure to open Create new + + - + x - + " " + - + + x - + " " + + + + x - + " " + ---------------------------------------------------------------------------------- + - - + - + - Write to end Create new + + - + - + - " " + - + + - + - " " + + + + - + - " " + ---------------------------------------------------------------------------------- + */ + static const std::ios_base::openmode app = static_cast(1 << 1); // append to end + static const std::ios_base::openmode ate = static_cast(1 << 2); // initialize to end + static const std::ios_base::openmode binary = static_cast(1 << 3); // binary mode + static const std::ios_base::openmode in = static_cast(1 << 4); // for reading + static const std::ios_base::openmode out = static_cast(1 << 5); // for writing // for writing and reading + static const std::ios_base::openmode trunc = static_cast(1 << 6); // truncate on open + static const std::ios_base::openmode noreplace = static_cast(1 << 7); // no replace if it exists + + /// Additional optional flags to omode in open() and lmode in fopen() or lock() + /// to indicate which sort of lock if any to attempt to get + /// + /// NOTE: there is a fundamental difference between platforms. + /// On Windows this lock is mandatory as it is part of the API to open a file handle and other + /// processes can not avoid it. If a file was opened denying other processes read and/or write + /// access, trying to open the same file in another process with that access will fail. + /// On Mac and Linux it is only an advisory lock implemented through the flock() system call. + /// This means that any other application needs to also attempt to at least acquire a shared + /// lock on the file in order to notice that the file is actually already locked. It can + /// therefore not be used to prevent random other applications from accessing the file, but it + /// works for other viewer processes when they use either the LLFile::open() or LLFile::fopen() + /// functions with the appropriate lock flags to open a file. + static const std::ios_base::openmode exclusive = static_cast(1 << 16); + static const std::ios_base::openmode shared = static_cast(1 << 17); + + /// Additional lmode flag to indicate to rather fail instead of blocking when trying + /// to acquire a lock with LLFile::lock() + static const std::ios_base::openmode noblock = static_cast(1 << 18); + + /// The mask value for the lock mask bits + static const std::ios_base::openmode lock_mask = static_cast(exclusive | shared); + + /// One of these can be passed to the dir parameter of LLFile::seek() + static const std::ios_base::seekdir beg = std::ios_base::beg; + static const std::ios_base::seekdir cur = std::ios_base::cur; + static const std::ios_base::seekdir end = std::ios_base::end; + ///@} + + // ================================================================================ + /// @name constructor/deconstructor + /// + ///@{ + /// default constructor + LLFile() : mHandle(InvalidHandle) {} + + /// no copy constructor + LLFile(const LLFile&) = delete; + + /// move constructor + LLFile(LLFile&& other) noexcept + { + mHandle = other.mHandle; + other.mHandle = InvalidHandle; + } + + /// constructor opening the file + LLFile(const std::string& filename, std::ios_base::openmode omode, std::error_code& ec, int perm = 0666) : + mHandle(InvalidHandle) + { + open(filename, omode, ec, perm); + } + + /// destructor always attempts to close the file + ~LLFile() { close(); } + ///@} + + // ================================================================================ + /// @name operators + /// + ///@{ + /// copy assignment deleted + LLFile& operator=(const LLFile&) = delete; + + /// move assignment + LLFile& operator=(LLFile&& other) noexcept + { + close(); + std::swap(mHandle, other.mHandle); + return *this; + } + + // detect whether the wrapped file descriptor/handle is open or not + explicit operator bool() const { return (mHandle != InvalidHandle); } + bool operator!() { return (mHandle == InvalidHandle); } + ///@} + + /// ================================================================================ + /// @name class member methods + /// + /// These methods provide read and write support as well as additional functionality to query the size of + /// the file, change the position of the current file pointer or query it. + /// + /// Most of these functions take as one of their parameters a std::error_code object which can be used to + /// determine in more detail what error occurred if required + ///@{ + + /// Open a file with the specific open mode flags + int open(const std::string& filename, std::ios_base::openmode omode, std::error_code& ec, int perm = 0666); + ///< @returns 0 on success, -1 on failure + + /// Determine the size of the opened file + S64 size(std::error_code& ec); + ///< @returns the number of bytes in the file or -1 on failure + + /// Query the position of the current file pointer in the file + S64 tell(std::error_code& ec); + ///< @returns the absolute offset of the file pointer in bytes relative to the start of the file or -1 on failure + + /// Move the file pointer to the specified absolute position relative to the start of the file + int seek(S64 pos, std::error_code& ec); + ///< @returns 0 on success, -1 on failure + + /// Move the file pointer to the specified position relative to dir + int seek(S64 offset, std::ios_base::seekdir dir, std::error_code& ec); + ///< @returns 0 on success, -1 on failure + + /// Read the specified number of bytes into the buffer starting at the current file pointer + S64 read(void* buffer, S64 nbytes, std::error_code& ec); + ///< If the file ends before the requested amount of bytes could be read, the function succeeds and + /// returns the bytes up to the end of the file. The return value indicates the number of actually + /// read bytes and can be therefore smaller than the requested amount. + /// @returns the number of bytes read from the file or -1 on failure + + /// Write the specified number of bytes to the file starting at the current file pointer + S64 write(const void* buffer, S64 nbytes, std::error_code& ec); + ///< @returns the number of bytes written to the file or -1 on failure + + /// Write into the file starting at the current file pointer using printf style format and + /// additional optional parameters as specified in the fmt string + S64 printf(const char* fmt, ...); + ///< @returns the number of bytes written to the file or -1 on failure + + /// Attempt to acquire or release a lock on the file + int lock(int lmode, std::error_code& ec); + ///< lmode can be one of LLFile::exclusive or LLFile::shared to acquire the according lock + /// or 0 to give up an earlier acquired lock. Adding LLFile::noblock together with one of + /// the lock requests will cause the function to fail if the lock can not be acquired, + /// otherwise the function will block until the lock can be acquired. + /// @returns 0 on success, -1 on failure + + /// close the file explicitly + int close(std::error_code& ec); + ///< @returns 0 on success, -1 on failure + + /// Convenience function to close the file without additional parameters + int close(); + ///< @returns 0 on success, -1 on failure + ///@} + + /// ================================================================================ + /// @name static member functions + /// + /// These functions are static and operate with UTF8 filenames as one of their parameters. + /// + ///@{ /// open a file with the specified access mode - static LLFILE* fopen(const std::string& filename, const char* accessmode); /* Flawfinder: ignore */ + static LLFILE* fopen(const std::string& filename, const char* accessmode, int lmode = 0); ///< 'accessmode' follows the rules of the Posix fopen() mode parameter - /// "r" open the file for reading only and positions the stream at the beginning - /// "r+" open the file for reading and writing and positions the stream at the beginning - /// "w" open the file for reading and writing and truncate it to zero length - /// "w+" open or create the file for reading and writing and truncate to zero length if it existed - /// "a" open the file for reading and writing and position the stream at the end of the file - /// "a+" open or create the file for reading and writing and position the stream at the end of the file + /// "r" open the file for reading only and positions the stream at the beginning + /// "r+" open the file for reading and writing and positions the stream at the beginning + /// "w" open the file for reading and writing and truncate it to zero length + /// "w+" open or create the file for reading and writing and truncate to zero length if it existed + /// "a" open the file for reading and writing and before every write position the stream at the end of the file + /// "a+" open or create the file for reading and writing and before every write position the stream at the end of the file + /// + /// in addition to these values, "b" can be appended to indicate binary stream access, but on Linux and Mac + /// this is strictly for compatibility and has no effect. On Windows this makes the file functions not + /// try to translate line endings. Windows also allows to append "t" to indicate text mode. If neither + /// "b" or "t" is defined, Windows uses the value set by _fmode which by default is _O_TEXT. + /// This means that it is always a good idea to append "b" specifically for binary file access to + /// avoid corruption of the binary consistency of the data stream when reading or writing + /// Other characters in 'accessmode', while possible on some platforms (Windows), will usually + /// cause an error on other platforms as fopen will verify this parameter /// - /// in addition to these values, "b" can be appended to indicate binary stream access, but on Linux and Mac - /// this is strictly for compatibility and has no effect. On Windows this makes the file functions not - /// try to translate line endings. Windows also allows to append "t" to indicate text mode. If neither - /// "b" or "t" is defined, Windows uses the value set by _fmode which by default is _O_TEXT. - /// This means that it is always a good idea to append "b" specifically for binary file access to - /// avoid corruption of the binary consistency of the data stream when reading or writing - /// Other characters in 'accessmode' will usually cause an error as fopen will verify this parameter - /// @returns a valid LLFILE* pointer on success or NULL on failure + /// lmode is optional and allows to lock the file for other processes either as a shared lock or an + /// exclusive lock. If the requested lock conflicts with an already existing lock, the open fails. + /// Pass either LLFIle::exclusive or LLFile::shared to this parameter if you want to prevent other + /// processes from reading (exclusive lock) or writing (shared lock) to the file. It will always use + /// LLFile::noblock, meaning the open will immediately fail if it conflicts with an existing lock on the + /// file. + /// + /// @returns a valid LLFILE* pointer on success that can be passed to the fread() and fwrite() functions + /// and some other f functions in the Standard C library that accept a FILE* as parameter + /// or NULL on failure + /// Close a file handle opened with fopen() above static int close(LLFILE * file); - - /// retrieve the content of a file into a string - static std::string getContents(const std::string& filename); - ///< @returns the content of the file or an empty string on failure + ///< @returns 0 on success and -1 on failure. /// create a directory - static int mkdir(const std::string& filename, int perms = 0700); - ///< perms is a permissions mask like 0777 or 0700. In most cases it will be - /// overridden by the user's umask. It is ignored on Windows. - /// mkdir() considers "directory already exists" to be not an error. - /// @returns 0 on success and -1 on failure. - - //// remove a directory - static int rmdir(const std::string& filename, int suppress_error = 0); - ///< pass ENOENT in the optional 'suppress_error' parameter - /// if you don't want a warning in the log when the directory does not exist + static int mkdir(const std::string& filename); + ///< mkdir() considers "directory already exists" to be not an error. /// @returns 0 on success and -1 on failure. /// remove a file or directory - static int remove(const std::string& filename, int suppress_error = 0); - ///< pass ENOENT in the optional 'suppress_error' parameter - /// if you don't want a warning in the log when the directory does not exist + static int remove(const std::string& filename, int suppress_warning = 0); + ///< pass an errno value (e.g., ENOENT) in the optional 'suppress_warning' parameter if you want to + /// suppress a warning in the log when the failure matches that errno (e.g., suppress warning if + /// the file or directory does not exist) /// @returns 0 on success and -1 on failure. /// rename a file - static int rename(const std::string& filename, const std::string& newname, int suppress_error = 0); + static int rename(const std::string& filename, const std::string& newname, int suppress_warning = 0); ///< it will silently overwrite newname if it exists without returning an error /// Posix guarantees that if newname already exists, then there will be no moment /// in which for other processes newname does not exist. There is no such guarantee - /// under Windows at this time. It may do it in the same way but the used Windows API - /// does not make such guarantees. + /// under Windows at this time. It may do it in the same way but the used Windows + /// APIs do not make such guarantees. /// @returns 0 on success and -1 on failure. + /// copy the contents of the file from 'source' to 'target' + static bool copy(const std::string& source, const std::string& target); + ///< Copies the contents of the file 'source' to the file 'target', overwriting 'target' if it already + /// existed. + /// This is a convenience function that implements the previous behavior of silently overwriting an + /// already existing target file. Consider using the function below if you desire a different + /// behavior when the target file already exists + /// @returns true on success and false on failure. + + /// copy the contents of the file from 'from' to 'to' + static bool copy(const std::string& source, const std::string& target, std::filesystem::copy_options options, std::error_code& ec); + ///< Copies the contents of the file 'source' to the file 'target'. The options parameter allows to + /// specify what should happen if the "target" file already exists: + /// std::filesystem::copy_options::none - return an error in ec and fail + /// std::filesystem::copy_options::skip_existing - skip the operation and do not overwrite file + /// std::filesystem::copy_options::overwrite_existing - overwrite the file + /// std::filesystem::copy_options::update_existing - overwrite the file only if it is older than the file being copied + /// @returns true on success and false on failure. + + /// retrieve the content of a file into a string + static std::string getContents(const std::string& filename); + static std::string getContents(const std::string& filename, std::error_code& ec); + ///< @returns the entire content of the file as std::string or an empty string on failure + + /// read nBytes from the file into the buffer, starting at offset in the file + static S64 read(const std::string& filename, void* buf, S64 offset, S64 nbytes); + static S64 read(const std::string& filename, void* buf, S64 offset, S64 nbytes, std::error_code& ec); + ///< @returns bytes read on success, or -1 on failure - /// copy the contents of file from 'from' to 'to' filename - static bool copy(const std::string& from, const std::string& to); - ///< @returns true on success and false on failure. + /// write nBytes from the buffer into the file, starting at offset in the file + static S64 write(const std::string& filename, const void* buf, S64 offset, S64 nbytes); + static S64 write(const std::string& filename, const void* buf, S64 offset, S64 nbytes, std::error_code& ec); + ///< If a negative offset is provided, the file is opened in append mode and the + /// write will be appended to the end of the file. + /// @returns bytes written on success, or -1 on failure /// return the file stat structure for filename - static int stat(const std::string& filename, llstat* file_status, int suppress_error = ENOENT); + static int stat(const std::string& filename, llstat* file_status, const char *operation = nullptr, int suppress_warning = ENOENT); ///< for compatibility with existing uses of LL_File::stat() we use ENOENT as default in the - /// optional 'suppress_error' parameter to avoid spamming the log with warnings when the API + /// optional 'suppress_warning' parameter to avoid spamming the log with warnings when the API /// is used to detect if a file exists /// @returns 0 on success and -1 on failure. - /// get the file or directory attributes for filename - static unsigned short getattr(const std::string& filename, bool dontFollowSymLink = false, int suppress_error = ENOENT); - ///< a more lightweight function on Windows to stat, that just returns the file attribute flags - /// dontFollowSymLinks set to true returns the attributes of the symlink if it is one, rather than resolving it - /// we pass by default ENOENT in the optional 'suppress_error' parameter to not spam the log with - /// warnings when the file or directory does not exist - /// @returns 0 on failure and a st_mode value with either S_IFDIR or S_IFREG set otherwise - /// together with the three access bits which under Windows only the write bit is relevant. + /// get the creation data and time of a file + static std::time_t getCreationTime(const std::string& filename, int suppress_warning = 0); + ///< Different systems have different support for this. Under Windows this is supposedly + /// the actual time the file was created, on the Mac this is the actual birth date of + /// the file which is in fact the creation time. The according ctime entry in the stat + /// structure under Linux (and any other *nix really) is however contrary to what one + /// might expect based on the c in ctime not the creation time but the time the last + /// change to the inode entry was made. Changing access rights to a file will update + /// this value too. In order to have a true creation time under Linux, we would have + /// to use the statx() call which is available since kernel 4.19, but that will require + /// considerable changes to the implementation of above stat() function. + /// @returns the creation time (last status change under Linux) of the file or 0 on error + + /// get the last modification data and time of a file + static std::time_t getModificationTime(const std::string& filename, int suppress_warning = 0); + ///< @returns the modification time of the file or 0 on error + + /// get the std::filesystem::file_status for filename + static std::filesystem::file_status getStatus(const std::string& filename, bool dontFollowSymLink = false, int suppress_warning = ENOENT); + ///< dontFollowSymLinks set to true returns the std::filesystem::file_status of the symlink if it + /// is one, rather than resolving it. We pass by default ENOENT in the optional 'suppress_warning' + /// parameter to not spam the log with warnings when the file or directory does not exist + /// @returns a std::filesystem::file_status value that can be passed to the appropriate std::filesystem::exists() + /// and other APIs accepting a file_status. + + /// get the size of a file in bytes + static S64 size(const std::string& filename, int suppress_warning = ENOENT); + ///< we pass by default ENOENT in the optional 'suppress_warning' parameter to not spam + /// the log with warnings when the file does not exist + /// @returns the file size on success or -1 on failure. + + /// check if filename is an existing file or directory + static bool exists(const std::string& filename); + ///< @returns true if the path is for an existing file or directory /// check if filename is an existing directory static bool isdir(const std::string& filename); @@ -161,70 +402,44 @@ public: ///< @returns true if the path is pointing at a symlink /// return a path to the temporary directory on the system - static const char * tmpdir(); -}; - -/// RAII class -class LLUniqueFile -{ -public: - // empty - LLUniqueFile(): mFileHandle(nullptr) {} - // wrap (e.g.) result of LLFile::fopen() - LLUniqueFile(LLFILE* f): mFileHandle(f) {} - // no copy - LLUniqueFile(const LLUniqueFile&) = delete; - // move construction - LLUniqueFile(LLUniqueFile&& other) noexcept - { - mFileHandle = other.mFileHandle; - other.mFileHandle = nullptr; - } - // The point of LLUniqueFile is to close on destruction. - ~LLUniqueFile() - { - close(); - } - - // simple assignment - LLUniqueFile& operator=(LLFILE* f) - { - close(); - mFileHandle = f; - return *this; - } - // copy assignment deleted - LLUniqueFile& operator=(const LLUniqueFile&) = delete; - // move assignment - LLUniqueFile& operator=(LLUniqueFile&& other) noexcept - { - close(); - std::swap(mFileHandle, other.mFileHandle); - return *this; - } - - // explicit close operation - void close() - { - if (mFileHandle) - { - // in case close() throws, set mFileHandle null FIRST - LLFILE* h{nullptr}; - std::swap(h, mFileHandle); - LLFile::close(h); - } - } - - // detect whether the wrapped LLFILE is open or not - explicit operator bool() const { return bool(mFileHandle); } - bool operator!() { return ! mFileHandle; } + static const std::string& tmpdir(); - // LLUniqueFile should be usable for any operation that accepts LLFILE* - // (or FILE* for that matter) - operator LLFILE*() const { return mFileHandle; } + /// converts a string containing a path in utf8 encoding into an explicit filesystem path + static std::filesystem::path utf8StringToPath(const std::string& pathname); + ///< @returns the path as a std::filesystem::path + ///@} private: - LLFILE* mFileHandle; +#if LL_WINDOWS + typedef HANDLE llfile_handle_t; + const llfile_handle_t InvalidHandle = INVALID_HANDLE_VALUE; +#else + typedef int llfile_handle_t; + const llfile_handle_t InvalidHandle = -1; +#endif + + /// ================================================================================ + /// @name private static member functions + /// +#if LL_WINDOWS + /// convert a string containing a path in utf8 encoding into a Windows format std::wstring + static std::wstring utf8StringToWstring(const std::string& pathname); + ///< this will prepend the path with the Windows kernel object space prefix when the path is + /// equal or longer than MAX_PATH characters and do some sanitation on the path. + /// This allows the underlaying Windows APIs to process long path names. Do not pass such a path + /// to std::filesystem functions. These functions are not guaranteed to handle such paths properly. + /// It's only useful to pass the resulting string buffer to Microsoft Windows widechar APIs or + /// the Microsoft C runtime widechar file functions. + /// + /// Example: + /// + /// std::wstring file_path = utf8StringToWstring(filename); + /// HANDLE CreateFileW(file_path.c_str(), ......); + /// + /// @returns the path as a std::wstring path +#endif + llfile_handle_t mHandle; // The file handle/descriptor + std::ios_base::openmode mOpen; // Used to emulate std::ios_base::app under Windows }; #if LL_WINDOWS @@ -315,17 +530,6 @@ class LL_COMMON_API llofstream : public std::ofstream ios_base::openmode _Mode = ios_base::out|ios_base::trunc); }; - -/** - * @brief filesize helpers. - * - * The file size helpers are not considered particularly efficient, - * and should only be used for config files and the like -- not in a - * loop. - */ -std::streamsize LL_COMMON_API llifstream_size(llifstream& fstr); -std::streamsize LL_COMMON_API llofstream_size(llofstream& fstr); - #else // ! LL_WINDOWS // on non-windows, llifstream and llofstream are just mapped directly to the std:: equivalents diff --git a/indra/llcommon/tests/llfile_test.cpp b/indra/llcommon/tests/llfile_test.cpp new file mode 100644 index 0000000000..9f2a9b2988 --- /dev/null +++ b/indra/llcommon/tests/llfile_test.cpp @@ -0,0 +1,253 @@ +/** + * @file llfile_tut.cpp + * @author Frederick Martian + * @date 2025-11 + * @brief LLFile test cases. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include +#include "lltut.h" +#include "linden_common.h" +#include "llfile.h" + +namespace tut +{ + static void clear_entire_dir(std::filesystem::path &dir) + { + std::error_code ec; + std::filesystem::remove_all(dir, ec); + } + + static std::filesystem::path append_filename(const std::filesystem::path& dir, const std::string& element) + { + std::filesystem::path path = dir; + return path.append(element); + } + + static std::filesystem::path get_testdir(const std::filesystem::path& tempdir) + { + return append_filename(tempdir, std::string("test_dir")); + } + + struct llfile_test + { + std::filesystem::path tempdir = LLFile::tmpdir(); + std::filesystem::path testdir = get_testdir(tempdir); + }; + typedef test_group llfile_test_t; + typedef llfile_test_t::object llfile_test_object_t; + tut::llfile_test_t tut_llfile_test("llfile_test"); + + template<> template<> + void llfile_test_object_t::test<1>() + { + // Test creating directories and files and deleting them and checking if the + // relevant status functions work as expected + ensure("LLFile::tmpdir() empty", !tempdir.empty()); + ensure("LLFile::tmpdir() doesn't exist", LLFile::exists(tempdir.string())); + ensure("LLFile::tmpdir() is not a directory", LLFile::isdir(tempdir.string())); + ensure("LLFile::tmpdir() should not be a file", !LLFile::isfile(tempdir.string())); + + // Make sure there is nothing left from a previous test run + clear_entire_dir(testdir); + ensure("llfile_test should not exist anymore", !LLFile::exists(testdir.string())); + + int rc = LLFile::mkdir(testdir.string()); + ensure("LLFile::mkdir() failed", rc == 0); + ensure("llfile_test should be a directory", LLFile::isdir(testdir.string())); + rc = LLFile::mkdir(testdir.string()); + ensure("LLFile::mkdir() should not fail when the directory already exists", rc == 0); + + std::filesystem::path testfile1 = testdir; + testfile1.append("llfile_test.dat"); + ensure("llfile_test1.dat should not yet exist", !LLFile::exists(testfile1.string())); + + const char* testdata = "testdata"; + S64 bytes = LLFile::write(testfile1.string(), testdata, 0, sizeof(testdata)); + ensure("LLFile::write() did not write correctly", bytes == sizeof(testdata)); + + rc = LLFile::remove(testfile1.string()); + ensure("LLFile::remove() for file test_file.dat", rc == 0); + ensure("llfile_test.dat should not exist anymore", !LLFile::exists(testfile1.string())); + ensure("llfile_test.dat should not be a file", !LLFile::isfile(testfile1.string())); + ensure("llfile_test.dat should not be a directory", !LLFile::isdir(testfile1.string())); + ensure("llfile_test.dat should not be a symlink", !LLFile::islink(testfile1.string())); + + rc = LLFile::remove(testdir.string()); + ensure("LLFile::remove() for directory llfile_test failed", rc == 0); + ensure("llfile_test should not exist anymore", !LLFile::exists(testdir.string())); + } + + template<> template<> + void llfile_test_object_t::test<2>() + { + // High level static file IO functions to read and write data files + LLFile::mkdir(testdir.string()); + ensure("llfile_test should exist", LLFile::isdir(testdir.string())); + + std::filesystem::path testfile1 = testdir; + testfile1.append("llfile_test.dat"); + + std::string testdata1("testdata"); + std::string testdata2("datateststuff"); + std::time_t current = time(nullptr); + S64 bytes = LLFile::write(testfile1.string(), testdata1.c_str(), 0, testdata1.length()); + ensure("LLFile::write() did not write correctly", bytes == testdata1.length()); + ensure("llfile_test.dat should exist", LLFile::exists(testfile1.string())); + ensure("llfile_test.dat should be a file", LLFile::isfile(testfile1.string())); + ensure("llfile_test.dat should not be a directory", !LLFile::isdir(testfile1.string())); + + bytes = LLFile::size(testfile1.string()); + ensure("LLFile::size() did not return the correct size", bytes == testdata1.length()); + + std::string data = LLFile::getContents(testfile1.string()); + ensure("LLFile::getContents() did not return the correct size data", data.length() == testdata1.length()); + ensure_memory_matches("LLFile::getContents() did not read correct data", testdata1.c_str(), (U32)testdata1.length(), data.c_str(), (U32)data.length()); + + std::time_t ctime = LLFile::getCreationTime(testfile1.string()); + ensure_approximately_equals_range("LLFile::getCreationTime() did not return correct time", (F32)(ctime - current), 0.f, 1); + + std::time_t mtime = LLFile::getModificationTime(testfile1.string()); + ensure_approximately_equals_range("LLFile::getModificationTime() did not return correct time", (F32)(mtime - current), 0.f, 1); + + char buffer[1024]; + bytes = LLFile::read(testfile1.string(), buffer, 0, testdata1.length()); + ensure("LLFile:read() did not return the correct size", bytes == testdata1.length()); + ensure_memory_matches("LLFile::read() did not read correct data", testdata1.c_str(), (U32)bytes, buffer, (U32)bytes); + + // What if we try to read more data than there is in the file? + bytes = LLFile::read(testfile1.string(), buffer, 0, bytes + 10); + ensure("LLFile:read() did not correctly stop on eof", bytes == testdata1.length()); + ensure_memory_matches("LLFile::read() did not read correct data", testdata1.c_str(), (U32)bytes, buffer, (U32)bytes); + + // Let's append more data + bytes = LLFile::write(testfile1.string(), testdata2.c_str(), -1, testdata2.length()); + ensure("LLFile::write() did not write correctly", bytes == testdata2.length()); + + bytes = LLFile::size(testfile1.string()); + ensure("LLFile::size() did not return the correct size", bytes == testdata1.length() + testdata2.length()); + bytes = LLFile::read(testfile1.string(), buffer, 0, bytes); + ensure("LLFile:read() did not read correct number of bytes", bytes == testdata1.length() + testdata2.length()); + ensure_memory_matches("LLFile:read() did not read correct testdata1", testdata1.c_str(), (U32)testdata1.length(), buffer, (U32)testdata1.length()); + ensure_memory_matches("LLFile:read() did not read correct testdata2", testdata2.c_str(), (U32)testdata2.length(), buffer + testdata1.length(), (U32)testdata2.length()); + } + + template<> template<> + void llfile_test_object_t::test<3>() + { + const size_t numints = 1024; + + // Testing the LLFile class implementation + std::filesystem::path testfile = testdir; + testfile.append("llfile_test.bin"); + + int data[numints]; + for (int &t : data) + { + t = rand(); + } + + std::error_code ec; + LLFile fileout(testfile.string(), LLFile::out, ec); + ensure("LLFile constructor did not open correctly", (bool)fileout); + ensure("error_code from LLFile constructor should not indicate an error", !ec); + if (fileout) + { + S64 length = fileout.size(ec); + ensure("freshly created file should be empty", length == 0); + ensure("error_code from LLFile::size() should not indicate an error", !ec); + S64 bytes = fileout.write(data, sizeof(data), ec); + ensure("LLFile::write() did not write correctly", bytes == sizeof(data)); + ensure("error_code from LLFile::write() should not indicate an error", !ec); + bytes = fileout.write(data, sizeof(data), ec); + ensure("LLFile::write() did not write correctly", bytes == sizeof(data)); + ensure("error_code from LLFile::write() should not indicate an error", !ec); + bytes = fileout.size(ec); + ensure("LLFile::size() returned wrong size", bytes == 2 * sizeof(data)); + ensure("error_code from LLFile::size() should not indicate an error", !ec); + fileout.close(); + } + + LLFile filein(testfile.string(), LLFile::in, ec); + ensure("LLFile constructor did not open correctly", (bool)filein); + ensure("error_code from LLFile constructor should not indicate an error", !ec); + if (filein) + { + S64 length = filein.size(ec); + ensure("LLFile::size() returned wrong size", length == 2 * sizeof(data)); + ensure("error_code from LLFile::size() should not indicate an error", !ec); + char* buffer = (char*)malloc(length); + S64 bytes = filein.read(buffer, length, ec); + ensure("LLFile::read() did not read correctly", bytes == length); + ensure("error_code from LLFile::read() should not indicate an error", !ec); + ensure_memory_matches("LLFile:read() did not read correct data1", data, (U32)sizeof(data), buffer, (U32)sizeof(data)); + ensure_memory_matches("LLFile:read() did not read correct data2", data, (U32)sizeof(data), buffer + sizeof(data), (U32)sizeof(data)); + S64 offset = filein.tell(ec); + ensure("LLFile::tell() returned a bad offset", offset == length); + ensure("error_code from LLFile::read() should not indicate an error", !ec); + offset = sizeof(data) / 2; + int rc = filein.seek(offset, ec); + ensure("LLFile::seek() indicated an error", rc == 0); + ensure("error_code from LLFile::seek() should not indicate an error", !ec); + bytes = filein.read(buffer, 2 * sizeof(data), ec); + ensure("LLFile::read() did not read correctly", bytes == sizeof(data) + offset); + ensure("error_code from LLFile::read() should not indicate an error", !ec); + ensure_memory_matches("LLFile:read() did not read correct data3", (char*)data + offset, (U32)offset, buffer, (U32)offset); + ensure_memory_matches("LLFile:read() did not read correct data4", (char*)data, (U32)sizeof(data), buffer + offset, (U32)sizeof(data)); + filein.close(); + + free(buffer); + } + } + + template<> template<> + void llfile_test_object_t::test<4>() + { + // Testing the LLFile class implementation with wrong paths and parameters + std::filesystem::path testfile = testdir; + testfile.append("llfile_test.bin"); + + std::error_code ec; + LLFile file(testfile.string(), LLFile::out | LLFile::noreplace, ec); + ensure("LLFile constructor should not have opened the already existing file", !file); + ensure("error_code from LLFile constructor should indicate an error", (bool)ec); + + LLFile::remove(testfile.string()); + file = LLFile(testfile.string(), LLFile::out | LLFile::app | LLFile::trunc, ec); + ensure("LLFile constructor should not have opened the file with conflicting flags", !file); + ensure("error_code from LLFile constructor should indicate an error", (bool)ec); + + file = LLFile(testfile.string(), LLFile::out | LLFile::app | LLFile::noreplace, ec); + ensure("LLFile constructor should not have opened the file with conflicting flags", !file); + ensure("error_code from LLFile constructor should indicate an error", (bool)ec); + + testfile = testdir; + testfile.append("llfile_test"); + testfile.append("llfile_test.bin"); + + file = LLFile(testfile.string(), LLFile::in, ec); + ensure("LLFile constructor should not have been able to open the file in the non-existing directory", !file); + ensure("error_code from LLFile constructor should indicate an error", (bool)ec); + } +} // namespace tut diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp old mode 100644 new mode 100755 index 190539cea5..eb3c2d9909 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -30,8 +30,6 @@ #include #include #include -#else -#include #endif #include "lldir.h" @@ -43,7 +41,6 @@ #include "lldiriterator.h" #include "stringize.h" #include "llstring.h" -#include #include #include @@ -93,30 +90,20 @@ LLDir::~LLDir() std::vector LLDir::getFilesInDir(const std::string &dirname) { - //Returns a vector of fullpath filenames. - -#ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path p(ll_convert(dirname)); -#else - boost::filesystem::path p(dirname); -#endif - + // Returns a vector of filenames in the directory. + std::filesystem::path p = LLFile::utf8StringToPath(dirname); std::vector v; - - boost::system::error_code ec; - if (exists(p, ec) && !ec.failed()) + std::error_code ec; + if (std::filesystem::is_directory(p, ec)) { - if (is_directory(p, ec) && !ec.failed()) + std::filesystem::directory_iterator end_iter; + for (std::filesystem::directory_iterator dir_itr(p); + dir_itr != end_iter; + ++dir_itr) { - boost::filesystem::directory_iterator end_iter; - for (boost::filesystem::directory_iterator dir_itr(p); - dir_itr != end_iter; - ++dir_itr) + if (std::filesystem::is_regular_file(dir_itr->status())) { - if (boost::filesystem::is_regular_file(dir_itr->status())) - { - v.push_back(dir_itr->path().filename().string()); - } + v.push_back(dir_itr->path().filename().string()); } } } @@ -186,28 +173,23 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) //Removes the directory and its contents. Returns number of files deleted. U32 num_deleted = 0; + std::filesystem::path dir_path = LLFile::utf8StringToPath(dir_name); try { -#ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(ll_convert(dir_name)); -#else - boost::filesystem::path dir_path(dir_name); -#endif - - if (boost::filesystem::exists(dir_path)) + if (std::filesystem::is_directory(dir_path)) { - if (!boost::filesystem::is_empty(dir_path)) + if (!std::filesystem::is_empty(dir_path)) { // Directory has content - num_deleted = (U32)boost::filesystem::remove_all(dir_path); + num_deleted = (U32)std::filesystem::remove_all(dir_path); } else { // Directory is empty - boost::filesystem::remove(dir_path); + std::filesystem::remove(dir_path); } } } - catch (boost::filesystem::filesystem_error &er) + catch (std::filesystem::filesystem_error &er) { LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL; } @@ -1105,15 +1087,15 @@ void dir_exists_or_crash(const std::string &dir_name) #if LL_WINDOWS // *FIX: lame - it doesn't do the same thing on windows. not so // important since we don't deploy simulator to windows boxes. - LLFile::mkdir(dir_name, 0700); + LLFile::mkdir(dir_name); #else - struct stat dir_stat; + llstat dir_stat; if(0 != LLFile::stat(dir_name, &dir_stat)) { S32 stat_rv = errno; if(ENOENT == stat_rv) { - if(0 != LLFile::mkdir(dir_name, 0700)) // octal + if(0 != LLFile::mkdir(dir_name)) { LL_ERRS() << "Unable to create directory: " << dir_name << LL_ENDL; } diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp old mode 100644 new mode 100755 index 9624b1197f..1cfa157634 --- a/indra/llfilesystem/lldir_win32.cpp +++ b/indra/llfilesystem/lldir_win32.cpp @@ -376,18 +376,7 @@ std::string LLDir_Win32::getCurPath() bool LLDir_Win32::fileExists(const std::string &filename) const { - llstat stat_data; - // Check the age of the file - // Now, we see if the files we've gathered are recent... - int res = LLFile::stat(filename, &stat_data); - if (!res) - { - return true; - } - else - { - return false; - } + return LLFile::exists(filename); } diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp old mode 100644 new mode 100755 index 541266af4f..0c220fe7cf --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -77,21 +77,17 @@ bool LLFileSystem::getExists(const LLUUID& file_id, const LLAssetType::EType fil LL_PROFILE_ZONE_SCOPED; const std::string filename = LLDiskCache::metaDataToFilepath(file_id, file_type); - llifstream file(filename, std::ios::binary); - if (file.is_open()) - { - file.seekg(0, std::ios::end); - return file.tellg() > 0; - } - return false; + // not only test for existence but for the file to be not empty + S64 size = LLFile::size(filename); + return size > 0; } // static -bool LLFileSystem::removeFile(const LLUUID& file_id, const LLAssetType::EType file_type, int suppress_error /*= 0*/) +bool LLFileSystem::removeFile(const LLUUID& file_id, const LLAssetType::EType file_type, int suppress_warning /*= 0*/) { const std::string filename = LLDiskCache::metaDataToFilepath(file_id, file_type); - LLFile::remove(filename.c_str(), suppress_error); + LLFile::remove(filename.c_str(), suppress_warning); return true; } @@ -116,19 +112,10 @@ bool LLFileSystem::renameFile(const LLUUID& old_file_id, const LLAssetType::ETyp } // static -S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType file_type) +S64 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType file_type) { const std::string filename = LLDiskCache::metaDataToFilepath(file_id, file_type); - - S32 file_size = 0; - llifstream file(filename, std::ios::binary); - if (file.is_open()) - { - file.seekg(0, std::ios::end); - file_size = (S32)file.tellg(); - } - - return file_size; + return LLFile::size(filename); } bool LLFileSystem::read(U8* buffer, S32 bytes) @@ -269,7 +256,7 @@ S32 LLFileSystem::tell() const S32 LLFileSystem::getSize() const { - return LLFileSystem::getFileSize(mFileID, mFileType); + return (S32)LLFileSystem::getFileSize(mFileID, mFileType); } S32 LLFileSystem::getMaxSize() const diff --git a/indra/llfilesystem/llfilesystem.h b/indra/llfilesystem/llfilesystem.h index 10649b6920..7188683e7f 100644 --- a/indra/llfilesystem/llfilesystem.h +++ b/indra/llfilesystem/llfilesystem.h @@ -61,10 +61,10 @@ class LLFileSystem void updateFileAccessTime(const std::string& file_path); static bool getExists(const LLUUID& file_id, const LLAssetType::EType file_type); - static bool removeFile(const LLUUID& file_id, const LLAssetType::EType file_type, int suppress_error = 0); + static bool removeFile(const LLUUID& file_id, const LLAssetType::EType file_type, int suppress_warning = 0); static bool renameFile(const LLUUID& old_file_id, const LLAssetType::EType old_file_type, const LLUUID& new_file_id, const LLAssetType::EType new_file_type); - static S32 getFileSize(const LLUUID& file_id, const LLAssetType::EType file_type); + static S64 getFileSize(const LLUUID& file_id, const LLAssetType::EType file_type); public: static const S32 READ; diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp old mode 100644 new mode 100755 index a2104d1ef9..8b86da40b3 --- a/indra/llfilesystem/tests/lldir_test.cpp +++ b/indra/llfilesystem/tests/lldir_test.cpp @@ -557,8 +557,8 @@ namespace tut LLFile::remove(dir1files[i]); LLFile::remove(dir2files[i]); } - LLFile::rmdir(dir1); - LLFile::rmdir(dir2); + LLFile::remove(dir1); + LLFile::remove(dir2); } template<> template<> diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 10fd56a68e..34eeacb273 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -467,7 +467,7 @@ bool LLAssetStorage::findInCacheAndInvokeCallback(const LLUUID& uuid, LLAssetTyp else { LL_WARNS("AssetStorage") << "Asset vfile " << uuid << ":" << type - << " found in static cache with bad size " << file.getSize() << ", ignoring" << LL_ENDL; + << " found in static cache with bad size " << size << ", ignoring" << LL_ENDL; } } return false; diff --git a/indra/llmessage/tests/llmessageconfig_test.cpp b/indra/llmessage/tests/llmessageconfig_test.cpp old mode 100644 new mode 100755 index 93443467a2..b8942e99b3 --- a/indra/llmessage/tests/llmessageconfig_test.cpp +++ b/indra/llmessage/tests/llmessageconfig_test.cpp @@ -62,7 +62,7 @@ namespace tut int rmfile = LLFile::remove((mTestConfigDir + "/message.xml")); ensure_equals("rmfile value", rmfile, 0); // rm temp dir - int rmdir = LLFile::rmdir(mTestConfigDir); + int rmdir = LLFile::remove(mTestConfigDir); ensure_equals("rmdir value", rmdir, 0); } diff --git a/indra/llmessage/tests/message_test.cpp b/indra/llmessage/tests/message_test.cpp old mode 100644 new mode 100755 index 11cd710ef6..6fb2b92803 --- a/indra/llmessage/tests/message_test.cpp +++ b/indra/llmessage/tests/message_test.cpp @@ -113,7 +113,7 @@ namespace tut ensure_equals("rmfile value", rmfile, 0); // rm temp dir - int rmdir = LLFile::rmdir(mTestConfigDir); + int rmdir = LLFile::remove(mTestConfigDir); ensure_equals("rmdir value", rmdir, 0); } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 1da71e6bf4..7e8d31232b 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1014,7 +1014,6 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, mShaderCacheDir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "shader_cache"); LLFile::mkdir(mShaderCacheDir); - { std::string meta_out_path = gDirUtilp->add(mShaderCacheDir, "shaderdata.llsd"); if (gDirUtilp->fileExists(meta_out_path)) @@ -1077,7 +1076,7 @@ void LLShaderMgr::persistShaderCacheMetadata() // Settings and shader cache get saved at different time, thus making // RenderShaderCacheVersion unreliable when running multiple viewer // instances, or for cases where viewer crashes before saving settings. - // Dupplicate version to the cache itself. + // Duplicate version to the cache itself. out["version"] = mShaderCacheVersion; out["shaders"] = LLSD::emptyMap(); LLSD &shaders = out["shaders"]; @@ -1130,11 +1129,11 @@ bool LLShaderMgr::loadCachedProgramBinary(LLGLSLShader* shader) { std::vector in_data; in_data.resize(shader_info.mBinaryLength); - - LLUniqueFile filep = LLFile::fopen(in_path, "rb"); - if (filep) + std::error_code ec; + LLFile filep = LLFile(in_path, LLFile::in | LLFile::binary, ec); + if (!ec && (bool)filep) { - size_t result = fread(in_data.data(), sizeof(U8), in_data.size(), filep); + size_t result = filep.read(in_data.data(), in_data.size(), ec); filep.close(); if (result == in_data.size()) @@ -1179,11 +1178,12 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader) if (error == GL_NO_ERROR) { std::string out_path = gDirUtilp->add(mShaderCacheDir, shader->mShaderHash.asString() + ".shaderbin"); - LLUniqueFile outfile = LLFile::fopen(out_path, "wb"); - if (outfile) + std::error_code ec; + LLFile filep = LLFile(out_path, LLFile::out | LLFile::binary, ec); + if (filep) { - fwrite(program_binary.data(), sizeof(U8), program_binary.size(), outfile); - outfile.close(); + filep.write(program_binary.data(), program_binary.size(), ec); + filep.close(); binary_info.mLastUsedTime = (F32)LLTimer::getTotalSeconds(); diff --git a/indra/llxml/tests/llcontrol_test.cpp b/indra/llxml/tests/llcontrol_test.cpp old mode 100644 new mode 100755 index 4192e029c5..e15117fc29 --- a/indra/llxml/tests/llcontrol_test.cpp +++ b/indra/llxml/tests/llcontrol_test.cpp @@ -69,7 +69,7 @@ namespace tut LLFile::remove(filename); } LLFile::remove(mTestConfigFile); - LLFile::rmdir(mTestConfigDir); + LLFile::remove(mTestConfigDir); } void writeSettingsFile(const LLSD& config) { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp old mode 100644 new mode 100755 index ea380896ca..6058973176 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2267,7 +2267,7 @@ void errorCallback(LLError::ELevel level, const std::string &error_string) LLAppViewer::instance()->writeDebugInfo(); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if (!LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) + if (!LLFile::isfile(error_marker_file)) { // If marker doesn't exist, create a marker with llerror code for next launch // otherwise don't override existing file @@ -3030,13 +3030,11 @@ void LLAppViewer::initStrings() } else { - llstat st; - int rc = LLFile::stat(strings_path_full, &st); - if (rc != 0) + if (!LLFile::exists(strings_path_full)) { - crash_reason = "The file '" + strings_path_full + "' failed to get status. Error code: " + std::to_string(rc); + crash_reason = "The file '" + strings_path_full + "' doesn't seem to exist"; } - else if (S_ISDIR(st.st_mode)) + else if (LLFile::isdir(strings_path_full)) { crash_reason = "The filename '" + strings_path_full + "' is a directory name"; } @@ -3891,7 +3889,7 @@ void LLAppViewer::processMarkerFiles() bool marker_is_same_version = true; // first, look for the marker created at startup and deleted on a clean exit mMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,MARKER_FILE_NAME); - if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB)) + if (LLFile::isfile(mMarkerFileName)) { // File exists... // first, read it to see if it was created by the same version (we need this later) @@ -3983,7 +3981,7 @@ void LLAppViewer::processMarkerFiles() // check for any last exec event report based on whether or not it happened during logout // (the logout marker is created when logout begins) std::string logout_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LOGOUT_MARKER_FILE_NAME); - if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) + if(LLFile::isfile(logout_marker_file)) { if (markerIsSameVersion(logout_marker_file)) { @@ -3995,11 +3993,11 @@ void LLAppViewer::processMarkerFiles() { LL_INFOS("MarkerFile") << "Logout crash marker '"<< logout_marker_file << "' found, but versions did not match" << LL_ENDL; } - LLAPRFile::remove(logout_marker_file); + LLFile::remove(logout_marker_file); } // and last refine based on whether or not a marker created during a non-llerr crash is found std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) + if(LLFile::isfile(error_marker_file)) { S32 marker_code = getMarkerErrorCode(error_marker_file); if (marker_code >= 0) @@ -4024,7 +4022,7 @@ void LLAppViewer::processMarkerFiles() { LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' marker found, but versions did not match" << LL_ENDL; } - LLAPRFile::remove(error_marker_file); + LLFile::remove(error_marker_file); } #if LL_DARWIN @@ -4051,7 +4049,7 @@ void LLAppViewer::removeMarkerFiles() if (mMarkerFile.getFileHandle()) { mMarkerFile.close() ; - LLAPRFile::remove( mMarkerFileName ); + LLFile::remove( mMarkerFileName ); LL_DEBUGS("MarkerFile") << "removed exec marker '"<getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - return LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB); + return LLFile::isfile(error_marker_file); } void LLAppViewer::outOfMemorySoftQuit() diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp old mode 100644 new mode 100755 index 425e9e2269..4fa14a199d --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1500,7 +1500,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog() //Couldn't move the log and created a new directory so remove the new directory if(madeDirectory) { - LLFile::rmdir(chatLogPath); + LLFile::remove(chatLogPath); } return false; } @@ -1526,7 +1526,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog() if(madeDirectory) { - LLFile::rmdir(chatLogPath); + LLFile::remove(chatLogPath); } return false; @@ -2031,17 +2031,15 @@ void LLFloaterPreference::changed() { if (LLConversationLog::instance().getIsLoggingEnabled()) { - getChild("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0); + getChild("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0); } else { // onClearLog clears list, then notifies changed() and only then clears file, // so check presence of conversations before checking file, file will cleared later. - llstat st; bool has_logs = LLConversationLog::instance().getConversations().size() > 0 - && LLFile::stat(LLConversationLog::instance().getFileName(), &st) == 0 - && S_ISREG(st.st_mode) - && st.st_size > 0; + && LLFile::isfile(LLConversationLog::instance().getFileName()) + && LLFile::size(LLConversationLog::instance().getFileName()) > 0; getChild("clear_log")->setEnabled(has_logs); } diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp old mode 100644 new mode 100755 index c3bc24c6b9..0bf0946c42 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -484,47 +484,47 @@ bool LLFloaterUIPreview::postBuild() bool found_en_us = false; std::string language_directory; std::string xui_dir = get_xui_dir(); // directory containing localizations -- don't forget trailing delim - mLanguageSelection->removeall(); // clear out anything temporarily in list from XML + mLanguageSelection->removeall(); // clear out anything temporarily in list from XML LLDirIterator iter(xui_dir, "*"); - while(found) // for every directory + while (found) // for every directory { - if((found = iter.next(language_directory))) // get next directory + if ((found = iter.next(language_directory))) // get next directory { std::string full_path = gDirUtilp->add(xui_dir, language_directory); - if(LLFile::isfile(full_path.c_str())) // if it's not a directory, skip it + if (!LLFile::isdir(full_path.c_str())) // if it's not a directory, skip it { continue; } - if(strncmp("template",language_directory.c_str(),8) && -1 == language_directory.find(".")) // if it's not the template directory or a hidden directory + if (strncmp("template",language_directory.c_str(), 8) && -1 == language_directory.find(".")) // if it's not the template directory or a hidden directory { - if(!strncmp("en",language_directory.c_str(),5)) // remember if we've seen en, so we can make it default + if (!strncmp("en",language_directory.c_str(), 5)) // remember if we've seen en, so we can make it default { found_en_us = true; } else { - mLanguageSelection->add(std::string(language_directory)); // add it to the language selection dropdown menu + mLanguageSelection->add(std::string(language_directory)); // add it to the language selection dropdown menu mLanguageSelection_2->add(std::string(language_directory)); } } } } - if(found_en_us) + if (found_en_us) { - mLanguageSelection->add(std::string("en"),ADD_TOP); // make en first item if we found it - mLanguageSelection_2->add(std::string("en"),ADD_TOP); + mLanguageSelection->add(std::string("en"), ADD_TOP); // make en first item if we found it + mLanguageSelection_2->add(std::string("en"), ADD_TOP); } else { std::string warning = std::string("No EN localization found; check your XUI directories!"); popupAndPrintWarning(warning); } - mLanguageSelection->selectFirstItem(); // select the first item + mLanguageSelection->selectFirstItem(); // select the first item mLanguageSelection_2->selectFirstItem(); - refreshList(); // refresh the list of available floaters + refreshList(); // refresh the list of available floaters return true; } @@ -892,8 +892,7 @@ void LLFloaterUIPreview::displayFloater(bool click, S32 ID) // Add localization to title so user knows whether it's localized or defaulted to en std::string full_path = getLocalizedDirectory() + path; std::string floater_lang = "EN"; - llstat dummy; - if(!LLFile::stat(full_path.c_str(), &dummy)) // if the file does not exist + if (LLFile::isfile(full_path.c_str())) // use localized language if the file exists { floater_lang = getLocStr(ID); } @@ -966,9 +965,8 @@ void LLFloaterUIPreview::onClickEditFloater() } file_path = getLocalizedDirectory() + file_name; - // stat file to see if it exists (some localized versions may not have it there are no diffs, and then we try to open an nonexistent file) - llstat dummy; - if(LLFile::stat(file_path.c_str(), &dummy)) // if the file does not exist + // Does it exist? (Some localized versions may not have it when there are no diffs, and then we try to open a nonexistent file) + if (!LLFile::isfile(file_path.c_str())) // if the file does not exist { popupAndPrintWarning("No file for this floater exists in the selected localization. Opening the EN version instead."); file_path = get_xui_dir() + mDelim + "en" + mDelim + file_name; // open the en version instead, by default @@ -1117,15 +1115,14 @@ void LLFloaterUIPreview::onClickToggleDiffHighlighting() std::string path_in_textfield = mDiffPathTextBox->getText(); // get file path bool error = false; - if(std::string("") == path_in_textfield) // check for blank file + if(std::string("") == path_in_textfield) // check for blank file { std::string warning = "Unable to highlight differences because no file was provided; fill in the relevant text field"; popupAndPrintWarning(warning); error = true; } - llstat dummy; - if(LLFile::stat(path_in_textfield.c_str(), &dummy) && !error) // check if the file exists (empty check is reduntant but useful for the informative error message) + if (!LLFile::isfile(path_in_textfield.c_str()) && !error) // check if the file exists (empty check is redundant but useful for the informative error message) { std::string warning = std::string("Unable to highlight differences because an invalid path to a difference file was provided:\"") + path_in_textfield + "\""; popupAndPrintWarning(warning); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp old mode 100644 new mode 100755 index 9a991727b2..4fe661b055 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -575,8 +575,7 @@ void LLPreviewNotecard::syncExternal() { // Sync with external editor. std::string tmp_file = getTmpFileName(); - llstat s; - if (LLFile::stat(tmp_file, &s) == 0) // file exists + if (LLFile::isfile(tmp_file)) // file exists { if (mLiveFile) mLiveFile->ignoreNextUpdate(); writeToFile(tmp_file); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp old mode 100644 new mode 100755 index c2aa4925bd..2c436198e3 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -694,8 +694,7 @@ void LLScriptEdCore::sync() if (mLiveFile) { std::string tmp_file = mLiveFile->filename(); - llstat s; - if (LLFile::stat(tmp_file, &s) == 0) // file exists + if (LLFile::isfile(tmp_file)) // file exists { mLiveFile->ignoreNextUpdate(); writeToFile(tmp_file); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp old mode 100644 new mode 100755 index 612af0d147..be6c71ab86 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -180,8 +180,7 @@ private: bool LLTextureCacheLocalFileWorker::doRead() { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - S32 local_size = LLAPRFile::size(mFileName, mCache->getLocalAPRFilePool()); - + S32 local_size = (S32)LLFile::size(mFileName); if (local_size > 0 && mFileName.size() > 4) { mDataSize = local_size; // Only a complete file is valid @@ -210,8 +209,7 @@ bool LLTextureCacheLocalFileWorker::doRead() } mReadData = (U8*)ll_aligned_malloc_16(mDataSize); - S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); - + S32 bytes_read = (S32)LLFile::read(mFileName, mReadData, mOffset, mDataSize); if (bytes_read != mDataSize) { // LL_WARNS() << "Error reading file from local cache: " << mFileName @@ -296,7 +294,7 @@ bool LLTextureCacheRemoteWorker::doRead() // Is it a JPEG2000 file? { local_filename = filename + ".j2c"; - local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); + local_size = (S32)LLFile::size(local_filename); if (local_size > 0) { mImageFormat = IMG_CODEC_J2C; @@ -306,7 +304,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (local_size == 0) { local_filename = filename + ".jpg"; - local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); + local_size = (S32)LLFile::size(local_filename); if (local_size > 0) { mImageFormat = IMG_CODEC_JPEG; @@ -317,7 +315,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (local_size == 0) { local_filename = filename + ".tga"; - local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); + local_size = (S32)LLFile::size(local_filename); if (local_size > 0) { mImageFormat = IMG_CODEC_TGA; @@ -346,12 +344,10 @@ bool LLTextureCacheRemoteWorker::doRead() if (mReadData) { - S32 bytes_read = LLAPRFile::readEx( local_filename, - mReadData, - mOffset, - mDataSize, - mCache->getLocalAPRFilePool()); - + S32 bytes_read = (S32)LLFile::read(local_filename, + mReadData, + mOffset, + mDataSize); if (bytes_read != mDataSize) { LL_WARNS() << "Error reading file from local cache: " << local_filename @@ -410,8 +406,7 @@ bool LLTextureCacheRemoteWorker::doRead() mReadData = (U8*)ll_aligned_malloc_16(size); if (mReadData) { - S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, - mReadData, offset, size, mCache->getLocalAPRFilePool()); + S32 bytes_read = (S32)LLFile::read(mCache->mHeaderDataFileName, mReadData, offset, size); if (bytes_read != size) { LL_WARNS() << "LLTextureCacheWorker: " << mID @@ -446,9 +441,9 @@ bool LLTextureCacheRemoteWorker::doRead() if (!done && (mState == BODY)) { std::string filename = mCache->getTextureFileName(mID); - S32 filesize = LLAPRFile::size(filename, mCache->getLocalAPRFilePool()); + S32 filesize = (S32)LLFile::size(filename); - if (filesize && (filesize + TEXTURE_CACHE_ENTRY_SIZE) > mOffset) + if (filesize > 0 && (filesize + TEXTURE_CACHE_ENTRY_SIZE) > mOffset) { S32 max_datasize = TEXTURE_CACHE_ENTRY_SIZE + filesize - mOffset; mDataSize = llmin(max_datasize, mDataSize); @@ -487,10 +482,9 @@ bool LLTextureCacheRemoteWorker::doRead() mReadData = data; // Read the data at last - S32 bytes_read = LLAPRFile::readEx(filename, - mReadData + data_offset, - file_offset, file_size, - mCache->getLocalAPRFilePool()); + S32 bytes_read = (S32)LLFile::read(filename, + mReadData + data_offset, + file_offset, file_size); if (bytes_read != file_size) { LL_WARNS() << "LLTextureCacheWorker: " << mID @@ -636,13 +630,13 @@ bool LLTextureCacheRemoteWorker::doWrite() U8* padBuffer = (U8*)ll_aligned_malloc_16(TEXTURE_CACHE_ENTRY_SIZE); memset(padBuffer, 0, TEXTURE_CACHE_ENTRY_SIZE); // Init with zeros memcpy(padBuffer, mWriteData, mDataSize); // Copy the write buffer - bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size, mCache->getLocalAPRFilePool()); + bytes_written = (S32)LLFile::write(mCache->mHeaderDataFileName, padBuffer, offset, size); ll_aligned_free_16(padBuffer); } else { // Write the header record (== first TEXTURE_CACHE_ENTRY_SIZE bytes of the raw file) in the header file - bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size, mCache->getLocalAPRFilePool()); + bytes_written = (S32)LLFile::write(mCache->mHeaderDataFileName, mWriteData, offset, size); } if (bytes_written <= 0) @@ -678,15 +672,11 @@ bool LLTextureCacheRemoteWorker::doWrite() else { S32 file_size = mDataSize - TEXTURE_CACHE_ENTRY_SIZE; - { // build the cache file name from the UUID std::string filename = mCache->getTextureFileName(mID); // LL_INFOS() << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << LL_ENDL; - S32 bytes_written = LLAPRFile::writeEx(filename, - mWriteData + TEXTURE_CACHE_ENTRY_SIZE, - 0, file_size, - mCache->getLocalAPRFilePool()); + S32 bytes_written = (S32)LLFile::write(filename, mWriteData + TEXTURE_CACHE_ENTRY_SIZE, 0, file_size); if (bytes_written <= 0) { LL_WARNS() << "LLTextureCacheWorker: " << mID @@ -891,7 +881,7 @@ bool LLTextureCache::isInLocal(const LLUUID& id) // Is it a JPEG2000 file? { local_filename = filename + ".j2c"; - local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); + local_size = (S32)LLFile::size(local_filename); if (local_size > 0) { return true ; @@ -901,7 +891,7 @@ bool LLTextureCache::isInLocal(const LLUUID& id) // If not, is it a jpeg file? { local_filename = filename + ".jpg"; - local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); + local_size = (S32)LLFile::size(local_filename); if (local_size > 0) { return true ; @@ -911,7 +901,7 @@ bool LLTextureCache::isInLocal(const LLUUID& id) // Hmm... What about a targa file? (used for UI texture mostly) { local_filename = filename + ".tga"; - local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); + local_size = (S32)LLFile::size(local_filename); if (local_size > 0) { return true ; @@ -964,11 +954,10 @@ void LLTextureCache::purgeCache(ELLPath location, bool remove_dir) if(LLFile::isdir(mTexturesDirName)) { std::string file_name = gDirUtilp->getExpandedFilename(location, entries_filename); - // mHeaderAPRFilePoolp because we are under header mutex, and can be in main thread - LLAPRFile::remove(file_name, mHeaderAPRFilePoolp); + LLFile::remove(file_name); file_name = gDirUtilp->getExpandedFilename(location, cache_filename); - LLAPRFile::remove(file_name, mHeaderAPRFilePoolp); + LLFile::remove(file_name); purgeAllTextures(true); } @@ -1069,10 +1058,9 @@ void LLTextureCache::readEntriesHeader() { // mHeaderEntriesInfo initializes to default values so safe not to read it llassert_always(mHeaderAPRFile == NULL); - if (LLAPRFile::isExist(mHeaderEntriesFileName, mHeaderAPRFilePoolp)) + if (LLFile::isfile(mHeaderEntriesFileName)) { - LLAPRFile::readEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), - mHeaderAPRFilePoolp); + LLFile::read(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo)); } else //create an empty entries header. { @@ -1088,7 +1076,7 @@ void LLTextureCache::setEntriesHeader() // For simplicity we use predefined size of header, so if version string // doesn't fit, either getEngineInfo() returned malformed string or // sHeaderEncoderStringSize need to be increased. - // Also take into accout that c_str() returns additional null character + // Also take into account that c_str() returns additional null character LL_ERRS() << "Version string doesn't fit in header" << LL_ENDL; } @@ -1103,8 +1091,7 @@ void LLTextureCache::writeEntriesHeader() llassert_always(mHeaderAPRFile == NULL); if (!mReadOnly) { - LLAPRFile::writeEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), - mHeaderAPRFilePoolp); + LLFile::write(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo)); } } @@ -1208,8 +1195,7 @@ void LLTextureCache::writeEntryToHeaderImmediately(S32& idx, Entry& entry, bool idx = -1 ;//mark the idx invalid. return ; } - - mHeaderAPRFile->seek(APR_SET, offset); + aprfile->seek(APR_SET, offset); } else { @@ -1618,7 +1604,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) gDirUtilp->deleteFilesInDir(mTexturesDirName, mask); // headers, fast cache if (purge_directories) { - LLFile::rmdir(mTexturesDirName); + LLFile::remove(mTexturesDirName); } } mHeaderIDMap.clear(); @@ -1798,8 +1784,7 @@ void LLTextureCache::purgeTextures(bool validate) { std::string filename = getTextureFileName(entries[idx].mID); LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mBodySize << LL_ENDL; - // mHeaderAPRFilePoolp because this is under header mutex in main thread - S32 bodysize = LLAPRFile::size(filename, mHeaderAPRFilePoolp); + S32 bodysize = (S32)LLFile::size(filename); if (bodysize != entries[idx].mBodySize) { LL_WARNS("TextureCache") << "TEXTURE CACHE BODY HAS BAD SIZE: " << bodysize << " != " << entries[idx].mBodySize << filename << LL_ENDL; @@ -2150,7 +2135,7 @@ void LLTextureCache::openFastCache(bool first_time) mFastCachePadBuffer = (U8*)ll_aligned_malloc_16(TEXTURE_FAST_CACHE_ENTRY_SIZE); } mFastCachePoolp = new LLVolatileAPRPool(); // is_local= true by default, so not thread safe by default - if (LLAPRFile::isExist(mFastCacheFileName, mFastCachePoolp)) + if (LLFile::isfile(mFastCacheFileName)) { mFastCachep = new LLAPRFile(mFastCacheFileName, APR_READ|APR_WRITE|APR_BINARY, mFastCachePoolp) ; } @@ -2233,9 +2218,7 @@ void LLTextureCache::removeCachedTexture(const LLUUID& id) mTexturesSizeMap.erase(id); } mHeaderIDMap.erase(id); - // We are inside header's mutex so mHeaderAPRFilePoolp is safe to use, - // but getLocalAPRFilePool() is not safe, it might be in use by worker - LLAPRFile::remove(getTextureFileName(id), mHeaderAPRFilePoolp); + LLFile::remove(getTextureFileName(id)); } //called after mHeaderMutex is locked. @@ -2248,9 +2231,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) if (entry.mBodySize == 0) // Always attempt to remove when mBodySize > 0. { // Sanity check. Shouldn't exist when body size is 0. - // We are inside header's mutex so mHeaderAPRFilePoolp is safe to use, - // but getLocalAPRFilePool() is not safe, it might be in use by worker - if (LLAPRFile::isExist(filename, mHeaderAPRFilePoolp)) + if (LLFile::isfile(filename)) { LL_WARNS("TextureCache") << "Entry has body size of zero but file " << filename << " exists. Deleting this file, too." << LL_ENDL; } @@ -2270,7 +2251,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) if (file_maybe_exists) { - LLAPRFile::remove(filename, mHeaderAPRFilePoolp); + LLFile::remove(filename); } } diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 141f370ecb..e76d340eda 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -182,7 +182,7 @@ void LLViewerAssetStorage::storeAssetData( else { // LLAssetStorage metric: Successful Request - S32 size = LLFileSystem::getFileSize(asset_id, asset_type); + S32 size = (S32)LLFileSystem::getFileSize(asset_id, asset_type); const char *message = "Added to upload queue"; reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, size, MR_OKAY, __FILE__, __LINE__, message ); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 65a69acc88..5ac7d6b1fe 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -45,11 +45,7 @@ #include "llappviewer.h" #include "llviewerstats.h" #include "llfilesystem.h" -#include "llgesturemgr.h" -#include "llpreviewnotecard.h" -#include "llpreviewgesture.h" #include "llcoproceduremanager.h" -#include "llthread.h" #include "llkeyframemotion.h" #include "lldatapacker.h" #include "llvoavatarself.h" @@ -405,6 +401,7 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() std::string errorMessage; std::string errorLabel; + std::error_code ec; bool error = false; @@ -475,30 +472,38 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() error = true; // read from getFileName() - LLAPRFile infile; - infile.open(getFileName(),LL_APR_RB); - if (!infile.getFileHandle()) + LLFile infile(getFileName(), LLFile::in | LLFile::binary, ec); + if (ec || !infile) { LL_WARNS() << "Couldn't open file for reading: " << getFileName() << LL_ENDL; errorMessage = llformat("Failed to open animation file %s\n", getFileName().c_str()); } else { - S32 size = LLAPRFile::size(getFileName()); + S64 size = infile.size(ec); + if (ec || size <= 0) + { + LLError::LLUserWarningMsg::showMissingFiles(); + LL_ERRS() << "Invalid file" << LL_ENDL; + } + else if (size > INT_MAX) + { + LL_ERRS() << "File is too big, size: " << size << LL_ENDL; + } U8* buffer = new(std::nothrow) U8[size]; if (!buffer) { LLError::LLUserWarningMsg::showOutOfMemory(); LL_ERRS() << "Bad memory allocation for buffer, size: " << size << LL_ENDL; } - S32 size_read = infile.read(buffer,size); - if (size_read != size) + S64 size_read = infile.read(buffer, size, ec); + if (ec || size_read != size) { errorMessage = llformat("Failed to read animation file %s: wanted %d bytes, got %d\n", getFileName().c_str(), size, size_read); } else { - LLDataPackerBinaryBuffer dp(buffer, size); + LLDataPackerBinaryBuffer dp(buffer, (S32)size); LLKeyframeMotion *motionp = new LLKeyframeMotion(getAssetId()); motionp->setCharacter(gAgentAvatarp); if (motionp->deserialize(dp, getAssetId(), false)) @@ -544,18 +549,17 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() setAssetType(assetType); // copy this file into the cache for upload - S32 file_size; - LLAPRFile infile; - infile.open(filename, LL_APR_RB, NULL, &file_size); - if (infile.getFileHandle()) + LLFile infile(filename, LLFile::in | LLFile::binary, ec); + if (!ec && infile.size(ec) > 0) { LLFileSystem file(getAssetId(), assetType, LLFileSystem::APPEND); + S64 read_bytes; const S32 buf_size = 65536; U8 copy_buf[buf_size]; - while ((file_size = infile.read(copy_buf, buf_size))) + while (((read_bytes = infile.read(copy_buf, buf_size, ec))) > 0) { - file.write(copy_buf, file_size); + file.write(copy_buf, (S32)read_bytes); } } else @@ -569,7 +573,6 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() } return LLSD(); - } //========================================================================= diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp old mode 100644 new mode 100755 index ce59e844ec..5ad3344a6e --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1139,15 +1139,12 @@ std::string getProfileStatsFilename() // same second), may produce (e.g.) sec==61, but avoids collisions and // preserves chronological filename sort order. std::string name; - std::error_code ec; do { // base + missing 2-digit seconds, append ".json" // post-increment sec in case we have to try again name = stringize(base, std::setw(2), std::setfill('0'), sec++, ".json"); - } while (std::filesystem::exists(fsyspath(name), ec)); - // Ignoring ec means we might potentially return a name that does already - // exist -- but if we can't check its existence, what more can we do? + } while (LLFile::exists(fsyspath(name))); return name; } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp old mode 100644 new mode 100755 index 071a66209b..a8eaadc426 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1833,12 +1833,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ user_data_path_cache += gDirUtilp->getDirDelimiter(); // See if the plugin executable exists - llstat s; - if(LLFile::stat(launcher_name, &s)) + if (!LLFile::isfile(launcher_name)) { LL_WARNS_ONCE("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL; } - else if(LLFile::stat(plugin_name, &s)) + else if (!LLFile::isfile(plugin_name)) { LL_WARNS_ONCE("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL; } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp old mode 100644 new mode 100755 index 5d456b1a19..cdc41baa88 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -1250,7 +1250,7 @@ void LLVOCache::removeCache(ELLPath location, bool started) std::string cache_dir = gDirUtilp->getExpandedFilename(location, object_cache_dirname); LL_INFOS() << "Removing cache at " << cache_dir << LL_ENDL; gDirUtilp->deleteFilesInDir(cache_dir, mask); //delete all files - LLFile::rmdir(cache_dir); + LLFile::remove(cache_dir); clearCacheInMemory(); mInitialized = false; @@ -1370,7 +1370,7 @@ void LLVOCache::removeFromCache(HeaderEntryInfo* entry) std::string filename; getObjectCacheFilename(entry->mHandle, filename); LL_WARNS("GLTF", "VOCache") << "Removing object cache for handle " << entry->mHandle << "Filename: " << filename << LL_ENDL; - LLAPRFile::remove(filename, mLocalAPRFilePoolp); + LLFile::remove(filename); // Note: `removeFromCache` should take responsibility for cleaning up all cache artefacts specfic to the handle/entry. // as such this now includes the generic extras @@ -1394,7 +1394,7 @@ void LLVOCache::readCacheHeader() clearCacheInMemory(); bool success = true ; - if (LLAPRFile::isExist(mHeaderFileName, mLocalAPRFilePoolp)) + if (LLFile::isfile(mHeaderFileName)) { LLAPRFile apr_file(mHeaderFileName, APR_READ|APR_BINARY, mLocalAPRFilePoolp); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp old mode 100644 new mode 100755 index d132cbfa36..e58a6577f1 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -943,8 +943,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() gDirUtilp->append(exe_path, "SLVoice"); #endif // See if the vivox executable exists - llstat s; - if (!LLFile::stat(exe_path, &s)) + if (LLFile::isfile(exe_path)) { // vivox executable exists. Build the command line and launch the daemon. LLProcess::Params params; -- cgit v1.3 From b56986e9b40a1a16e3cabb02efdc77a06795b520 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Wed, 7 Jan 2026 19:59:13 +1000 Subject: Corrected file permissions, only permitting execution on .sh scripts and .py scripts with a shebang Signed-off-by: Hecklezz --- .gitignore | 0 LICENSE | 0 doc/LGPL-license.txt | 0 doc/LICENSE-logos.txt | 0 doc/LICENSE-source.txt | 0 doc/contributions.txt | 0 doc/releasenotes-where.txt | 0 doc/translations.txt | 0 indra/lib/python/indra/__init__.py | 0 indra/lib/python/indra/ipc/__init__.py | 0 indra/lib/python/indra/ipc/compatibility.py | 0 indra/lib/python/indra/ipc/llmessage.py | 0 indra/lib/python/indra/ipc/tokenstream.py | 0 indra/lib/python/indra/util/__init__.py | 0 indra/lib/python/indra/util/llmanifest.py | 0 indra/llappearanceutility/llprocessparams.cpp | 0 indra/llaudio/llaudiodecodemgr.cpp | 0 indra/llaudio/llaudioengine.h | 0 indra/llcommon/hexdump.h | 0 indra/llcorehttp/llhttpconstants.cpp | 0 indra/llcorehttp/llhttpconstants.h | 0 indra/llcorehttp/tests/llcorehttp_test.cpp | 0 indra/llui/tests/llurlentry_stub.cpp | 0 indra/media_plugins/base/media_plugin_base.exp | 0 indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp | 0 indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp | 0 .../cef/linux/volume_catcher_pulseaudio_glib_syms.inc | 0 .../cef/linux/volume_catcher_pulseaudio_syms.inc | 0 indra/newview/app_settings/llsd.xsd | 0 indra/newview/app_settings/message.xml | 0 indra/newview/installers/darwin/dmg-cleanup.applescript | 0 .../installers/darwin/release-dmg/Applications-alias.r | 0 indra/newview/installers/darwin/release-dmg/_DS_Store | Bin indra/newview/installers/windows/lang_de.nsi | 0 indra/newview/installers/windows/lang_es.nsi | Bin indra/newview/installers/windows/lang_fr.nsi | Bin indra/newview/installers/windows/lang_it.nsi | Bin indra/newview/installers/windows/lang_ja.nsi | Bin indra/newview/installers/windows/lang_pt-br.nsi | Bin indra/newview/installers/windows/lang_ru.nsi | Bin indra/newview/installers/windows/lang_tr.nsi | Bin indra/newview/installers/windows/lang_zh.nsi | Bin indra/newview/llfloatermap.cpp | 0 indra/newview/llfloaterworldmap.cpp | 0 indra/newview/llnavigationbar.h | 0 indra/newview/llviewerparceloverlay.cpp | 0 indra/newview/llviewerregion.cpp | 0 indra/newview/llworldmapview.cpp | 0 indra/newview/res/have_artwork_bundle.marker | 0 indra/newview/res/viewerRes.rc | 0 indra/newview/secondlife-i686.supp | 0 .../skins/default/xui/en/menu_gallery_outfit_tab.xml | 0 scripts/code_tools/fix_whitespace.py | 0 scripts/code_tools/fix_xml_indentations.py | 0 scripts/code_tools/modified-strings.sh | 0 scripts/code_tools/modified_strings.py | 0 scripts/content_tools/anim_tool.py | 0 scripts/content_tools/arche_tool.py | 0 scripts/content_tools/dae_tool.py | 0 scripts/content_tools/skel_tool.py | 0 scripts/messages/message_template.msg | 0 scripts/messages/message_template.msg.sha1 | 0 scripts/metrics/slp_conv.py | 0 scripts/metrics/viewer_asset_logs.py | 0 scripts/perf/logsdir.py | 0 scripts/perf/perfbot_run.py | 0 scripts/perf/profile_cmp.py | 0 scripts/perf/profile_csv.py | 0 scripts/perf/profile_pretty.py | 0 scripts/templates/template-cpp.cpp | 0 scripts/templates/template-h.h | 0 71 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .gitignore mode change 100755 => 100644 LICENSE mode change 100755 => 100644 doc/LGPL-license.txt mode change 100755 => 100644 doc/LICENSE-logos.txt mode change 100755 => 100644 doc/LICENSE-source.txt mode change 100755 => 100644 doc/contributions.txt mode change 100755 => 100644 doc/releasenotes-where.txt mode change 100755 => 100644 doc/translations.txt mode change 100755 => 100644 indra/lib/python/indra/__init__.py mode change 100755 => 100644 indra/lib/python/indra/ipc/__init__.py mode change 100755 => 100644 indra/lib/python/indra/ipc/compatibility.py mode change 100755 => 100644 indra/lib/python/indra/ipc/llmessage.py mode change 100755 => 100644 indra/lib/python/indra/ipc/tokenstream.py mode change 100755 => 100644 indra/lib/python/indra/util/__init__.py mode change 100755 => 100644 indra/lib/python/indra/util/llmanifest.py mode change 100755 => 100644 indra/llappearanceutility/llprocessparams.cpp mode change 100755 => 100644 indra/llaudio/llaudiodecodemgr.cpp mode change 100755 => 100644 indra/llaudio/llaudioengine.h mode change 100755 => 100644 indra/llcommon/hexdump.h mode change 100755 => 100644 indra/llcorehttp/llhttpconstants.cpp mode change 100755 => 100644 indra/llcorehttp/llhttpconstants.h mode change 100755 => 100644 indra/llcorehttp/tests/llcorehttp_test.cpp mode change 100755 => 100644 indra/llui/tests/llurlentry_stub.cpp mode change 100755 => 100644 indra/media_plugins/base/media_plugin_base.exp mode change 100755 => 100644 indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp mode change 100755 => 100644 indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp mode change 100755 => 100644 indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc mode change 100755 => 100644 indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc mode change 100755 => 100644 indra/newview/app_settings/llsd.xsd mode change 100755 => 100644 indra/newview/app_settings/message.xml mode change 100755 => 100644 indra/newview/installers/darwin/dmg-cleanup.applescript mode change 100755 => 100644 indra/newview/installers/darwin/release-dmg/Applications-alias.r mode change 100755 => 100644 indra/newview/installers/darwin/release-dmg/_DS_Store mode change 100755 => 100644 indra/newview/installers/windows/lang_de.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_es.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_fr.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_it.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_ja.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_pt-br.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_ru.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_tr.nsi mode change 100755 => 100644 indra/newview/installers/windows/lang_zh.nsi mode change 100755 => 100644 indra/newview/llfloatermap.cpp mode change 100755 => 100644 indra/newview/llfloaterworldmap.cpp mode change 100755 => 100644 indra/newview/llnavigationbar.h mode change 100755 => 100644 indra/newview/llviewerparceloverlay.cpp mode change 100755 => 100644 indra/newview/llviewerregion.cpp mode change 100755 => 100644 indra/newview/llworldmapview.cpp mode change 100755 => 100644 indra/newview/res/have_artwork_bundle.marker mode change 100755 => 100644 indra/newview/res/viewerRes.rc mode change 100755 => 100644 indra/newview/secondlife-i686.supp mode change 100755 => 100644 indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml mode change 100644 => 100755 scripts/code_tools/fix_whitespace.py mode change 100644 => 100755 scripts/code_tools/fix_xml_indentations.py mode change 100644 => 100755 scripts/code_tools/modified-strings.sh mode change 100644 => 100755 scripts/code_tools/modified_strings.py mode change 100644 => 100755 scripts/content_tools/anim_tool.py mode change 100644 => 100755 scripts/content_tools/arche_tool.py mode change 100644 => 100755 scripts/content_tools/dae_tool.py mode change 100644 => 100755 scripts/content_tools/skel_tool.py mode change 100755 => 100644 scripts/messages/message_template.msg mode change 100755 => 100644 scripts/messages/message_template.msg.sha1 mode change 100644 => 100755 scripts/metrics/slp_conv.py mode change 100644 => 100755 scripts/metrics/viewer_asset_logs.py mode change 100644 => 100755 scripts/perf/logsdir.py mode change 100644 => 100755 scripts/perf/perfbot_run.py mode change 100644 => 100755 scripts/perf/profile_cmp.py mode change 100644 => 100755 scripts/perf/profile_csv.py mode change 100644 => 100755 scripts/perf/profile_pretty.py mode change 100755 => 100644 scripts/templates/template-cpp.cpp mode change 100755 => 100644 scripts/templates/template-h.h (limited to 'indra/llappearanceutility') diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/doc/LGPL-license.txt b/doc/LGPL-license.txt old mode 100755 new mode 100644 diff --git a/doc/LICENSE-logos.txt b/doc/LICENSE-logos.txt old mode 100755 new mode 100644 diff --git a/doc/LICENSE-source.txt b/doc/LICENSE-source.txt old mode 100755 new mode 100644 diff --git a/doc/contributions.txt b/doc/contributions.txt old mode 100755 new mode 100644 diff --git a/doc/releasenotes-where.txt b/doc/releasenotes-where.txt old mode 100755 new mode 100644 diff --git a/doc/translations.txt b/doc/translations.txt old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/__init__.py b/indra/lib/python/indra/__init__.py old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/ipc/__init__.py b/indra/lib/python/indra/ipc/__init__.py old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/ipc/compatibility.py b/indra/lib/python/indra/ipc/compatibility.py old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/ipc/llmessage.py b/indra/lib/python/indra/ipc/llmessage.py old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/ipc/tokenstream.py b/indra/lib/python/indra/ipc/tokenstream.py old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/util/__init__.py b/indra/lib/python/indra/util/__init__.py old mode 100755 new mode 100644 diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py old mode 100755 new mode 100644 diff --git a/indra/llappearanceutility/llprocessparams.cpp b/indra/llappearanceutility/llprocessparams.cpp old mode 100755 new mode 100644 diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp old mode 100755 new mode 100644 diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h old mode 100755 new mode 100644 diff --git a/indra/llcommon/hexdump.h b/indra/llcommon/hexdump.h old mode 100755 new mode 100644 diff --git a/indra/llcorehttp/llhttpconstants.cpp b/indra/llcorehttp/llhttpconstants.cpp old mode 100755 new mode 100644 diff --git a/indra/llcorehttp/llhttpconstants.h b/indra/llcorehttp/llhttpconstants.h old mode 100755 new mode 100644 diff --git a/indra/llcorehttp/tests/llcorehttp_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp old mode 100755 new mode 100644 diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp old mode 100755 new mode 100644 diff --git a/indra/media_plugins/base/media_plugin_base.exp b/indra/media_plugins/base/media_plugin_base.exp old mode 100755 new mode 100644 diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp old mode 100755 new mode 100644 diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp old mode 100755 new mode 100644 diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc old mode 100755 new mode 100644 diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc old mode 100755 new mode 100644 diff --git a/indra/newview/app_settings/llsd.xsd b/indra/newview/app_settings/llsd.xsd old mode 100755 new mode 100644 diff --git a/indra/newview/app_settings/message.xml b/indra/newview/app_settings/message.xml old mode 100755 new mode 100644 diff --git a/indra/newview/installers/darwin/dmg-cleanup.applescript b/indra/newview/installers/darwin/dmg-cleanup.applescript old mode 100755 new mode 100644 diff --git a/indra/newview/installers/darwin/release-dmg/Applications-alias.r b/indra/newview/installers/darwin/release-dmg/Applications-alias.r old mode 100755 new mode 100644 diff --git a/indra/newview/installers/darwin/release-dmg/_DS_Store b/indra/newview/installers/darwin/release-dmg/_DS_Store old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi old mode 100755 new mode 100644 diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp old mode 100755 new mode 100644 diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp old mode 100755 new mode 100644 diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h old mode 100755 new mode 100644 diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp old mode 100755 new mode 100644 diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp old mode 100755 new mode 100644 diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp old mode 100755 new mode 100644 diff --git a/indra/newview/res/have_artwork_bundle.marker b/indra/newview/res/have_artwork_bundle.marker old mode 100755 new mode 100644 diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc old mode 100755 new mode 100644 diff --git a/indra/newview/secondlife-i686.supp b/indra/newview/secondlife-i686.supp old mode 100755 new mode 100644 diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml old mode 100755 new mode 100644 diff --git a/scripts/code_tools/fix_whitespace.py b/scripts/code_tools/fix_whitespace.py old mode 100644 new mode 100755 diff --git a/scripts/code_tools/fix_xml_indentations.py b/scripts/code_tools/fix_xml_indentations.py old mode 100644 new mode 100755 diff --git a/scripts/code_tools/modified-strings.sh b/scripts/code_tools/modified-strings.sh old mode 100644 new mode 100755 diff --git a/scripts/code_tools/modified_strings.py b/scripts/code_tools/modified_strings.py old mode 100644 new mode 100755 diff --git a/scripts/content_tools/anim_tool.py b/scripts/content_tools/anim_tool.py old mode 100644 new mode 100755 diff --git a/scripts/content_tools/arche_tool.py b/scripts/content_tools/arche_tool.py old mode 100644 new mode 100755 diff --git a/scripts/content_tools/dae_tool.py b/scripts/content_tools/dae_tool.py old mode 100644 new mode 100755 diff --git a/scripts/content_tools/skel_tool.py b/scripts/content_tools/skel_tool.py old mode 100644 new mode 100755 diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg old mode 100755 new mode 100644 diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 old mode 100755 new mode 100644 diff --git a/scripts/metrics/slp_conv.py b/scripts/metrics/slp_conv.py old mode 100644 new mode 100755 diff --git a/scripts/metrics/viewer_asset_logs.py b/scripts/metrics/viewer_asset_logs.py old mode 100644 new mode 100755 diff --git a/scripts/perf/logsdir.py b/scripts/perf/logsdir.py old mode 100644 new mode 100755 diff --git a/scripts/perf/perfbot_run.py b/scripts/perf/perfbot_run.py old mode 100644 new mode 100755 diff --git a/scripts/perf/profile_cmp.py b/scripts/perf/profile_cmp.py old mode 100644 new mode 100755 diff --git a/scripts/perf/profile_csv.py b/scripts/perf/profile_csv.py old mode 100644 new mode 100755 diff --git a/scripts/perf/profile_pretty.py b/scripts/perf/profile_pretty.py old mode 100644 new mode 100755 diff --git a/scripts/templates/template-cpp.cpp b/scripts/templates/template-cpp.cpp old mode 100755 new mode 100644 diff --git a/scripts/templates/template-h.h b/scripts/templates/template-h.h old mode 100755 new mode 100644 -- cgit v1.3