Add wearable exporting / importing in linden_genepool format.
As importing has been broken for a long time, I decided to hijack the existing (broken) buttons of the Appearance floater for the following new implementation: The currently selected wearable, if full perm and the agent is owner (of course) and creator, then that wearable can be exported to disk with AIFilePicker in the context "archetype". The used format is now XML, linden_genepool version 1.0, the same format that is used when saving from Advanced --> Character --> Character Tests --> Appearance to XML in any viewer. However, unlike that Advanced option (which normally only works when DebugAvatarAppearanceMessage is set to TRUE, ie in the official Linden Viewer; but that does a lot more, most likely unwanted things: it causes to dump files in this format to the LL_PATH_LOGS directory whenever appearance data comes by and other stuff for debugging purposes only), now ONLY the selected wearable is written to the file. In the case of multiwear with several layers, that means the selected layer, as well. When importing these XML files again, only the selected wearable/layer is overwritten (assuming it is modifiable) with the data in the file that corresponds to that wearable (if the file contains data of another wearable then nothing happens). Note that this file format can be read by blender-avastar: Using this feature to save the shape you created in SL will allow you to import that into blender. Likewise, a shape created or modified in blender can be imported into SL using this feature.
This commit is contained in:
@@ -4439,7 +4439,7 @@ void LLAgent::requestLeaveGodMode()
|
||||
sendReliableMessage();
|
||||
}
|
||||
|
||||
extern void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value);
|
||||
extern void dump_visual_param(LLAPRFile& file, LLVisualParam const* viewer_param, F32 value);
|
||||
extern std::string get_sequential_numbered_file_name(const std::string& prefix,
|
||||
const std::string& suffix);
|
||||
|
||||
@@ -4465,7 +4465,7 @@ void LLAgent::dumpSentAppearance(const std::string& dump_prefix)
|
||||
if (appearance_version_param)
|
||||
{
|
||||
F32 value = appearance_version_param->getWeight();
|
||||
dump_visual_param(file, appearance_version_param, value);
|
||||
dump_visual_param(outfile, appearance_version_param, value);
|
||||
}
|
||||
for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
|
||||
iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
|
||||
|
||||
Reference in New Issue
Block a user