Usability changes and UI updates, rez dummy receptor.
possibly enough for first release. rez mesh receiver v0.1 (needs custom tool TBD) support same LOD matching lod matching always on apply scale always on Maya/3ds wrong units workaround option new options/settings tab tweak UI, log tab etc.master
parent
bd27448d7b
commit
2dec41c4c5
|
|
@ -1,168 +1,317 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
positioning="centered"
|
||||
legacy_header_height="18"
|
||||
can_resize="true"
|
||||
can_dock="false"
|
||||
can_close="true"
|
||||
height="300"
|
||||
width="505"
|
||||
min_width="505"
|
||||
min_height="300"
|
||||
layout="topleft"
|
||||
save_rect="true"
|
||||
save_visibility="true"
|
||||
single_instance="false"
|
||||
save_dock_state="false"
|
||||
title="Local Mesh">
|
||||
<floater name="Local Mesh"
|
||||
positioning="centered"
|
||||
legacy_header_height="18"
|
||||
can_resize="false"
|
||||
can_dock="false"
|
||||
can_close="true"
|
||||
height="300"
|
||||
width="505"
|
||||
min_width="505"
|
||||
min_height="300"
|
||||
layout="topleft"
|
||||
save_rect="true"
|
||||
save_visibility="true"
|
||||
single_instance="false"
|
||||
save_dock_state="false"
|
||||
title="Local Mesh">
|
||||
|
||||
<tab_container
|
||||
follows="top|left"
|
||||
top="20"
|
||||
left="0"
|
||||
height="223"
|
||||
width="500"
|
||||
name="local_mesh_tabs"
|
||||
tab_position="top"
|
||||
enable_tabs_flashing="true"
|
||||
tabs_flashing_color="MenuItemFlashBgColor">
|
||||
<last_tab
|
||||
tab_top_image_flash="TabTop_Right_Flashing"/>
|
||||
<panel
|
||||
<tab_container name="local_mesh_tabs"
|
||||
follows="top|left"
|
||||
top="20"
|
||||
left="0"
|
||||
height="223"
|
||||
width="500"
|
||||
tab_position="top"
|
||||
enable_tabs_flashing="true"
|
||||
tabs_flashing_color="MenuItemFlashBgColor">
|
||||
<last_tab tab_top_image_flash="TabTop_Right_Flashing" />
|
||||
<panel name="local_mesh_assets_panel"
|
||||
help_topic="add_local_mesh"
|
||||
label="Local Mesh Assets"
|
||||
layout="topleft"
|
||||
name="local_mesh_assets_panel"
|
||||
title="Local Mesh Assets">
|
||||
<fs_scroll_list
|
||||
name="l_name_list"
|
||||
left_delta="5"
|
||||
top_pad="5"
|
||||
width="495"
|
||||
height="220"
|
||||
content_type="Objects"
|
||||
follows="left|top|right|bottom"
|
||||
column_padding="0"
|
||||
draw_heading="true"
|
||||
multi_select="true"
|
||||
search_column="1"
|
||||
visible="true">
|
||||
<column name="unit_status" label="Status" width="55" />
|
||||
<column name="unit_name" label="Name" dynamicwidth="true" />
|
||||
<column name="unit_lods" label="LODs" width="55" />
|
||||
<column name="unit_objects" label="Objects" width="55" />
|
||||
<column name="unit_id_HIDDEN" label="ID" width="0" />
|
||||
</fs_scroll_list>
|
||||
</panel>
|
||||
<panel
|
||||
label="Log"
|
||||
title="Local Mesh Assets">
|
||||
<fs_scroll_list name="l_name_list"
|
||||
left_delta="5"
|
||||
top_pad="5"
|
||||
width="495"
|
||||
height="220"
|
||||
content_type="Objects"
|
||||
follows="left|top|right|bottom"
|
||||
column_padding="0"
|
||||
draw_heading="true"
|
||||
multi_select="true"
|
||||
search_column="1"
|
||||
visible="true">
|
||||
<column name="unit_status"
|
||||
label="Status"
|
||||
width="55" />
|
||||
<column name="unit_name"
|
||||
label="Name"
|
||||
dynamicwidth="true" />
|
||||
<column name="unit_lods"
|
||||
label="LODs"
|
||||
width="55" />
|
||||
<column name="unit_objects"
|
||||
label="Objects"
|
||||
width="55" />
|
||||
<column name="unit_id_HIDDEN"
|
||||
label="ID"
|
||||
width="0" />
|
||||
</fs_scroll_list>
|
||||
</panel>
|
||||
<panel name="logs_panel"
|
||||
label="Log"
|
||||
layout="topleft"
|
||||
help_topic="text_log">
|
||||
<view_border name="local_mesh_log_tab_border"
|
||||
bevel_style="none"
|
||||
follows="top|left"
|
||||
height="200"
|
||||
layout="topleft"
|
||||
name="logs_panel"
|
||||
help_topic="text_log">
|
||||
<text_editor
|
||||
name="local_mesh_log"
|
||||
max_length="65536"
|
||||
left_delta="5"
|
||||
top_pad="5"
|
||||
width="500"
|
||||
height="220"
|
||||
follows="left|top|right|bottom"
|
||||
type="string"
|
||||
embedded_items="false"
|
||||
font="SansSerif"
|
||||
ignore_tab="false"
|
||||
layout="topleft"
|
||||
parse_urls="false"
|
||||
spellcheck="false"
|
||||
read_only="true"
|
||||
word_wrap="false">
|
||||
</text_editor>
|
||||
</panel>
|
||||
left="3"
|
||||
ignore_tab="false"
|
||||
right="-2"
|
||||
top_pad="0"/>
|
||||
<text_editor name="local_mesh_log"
|
||||
max_length="65536"
|
||||
left_delta="0"
|
||||
top_delta="0"
|
||||
right="-2"
|
||||
height="195"
|
||||
follows="left|top|right|bottom"
|
||||
type="string"
|
||||
embedded_items="false"
|
||||
font="SansSerif"
|
||||
ignore_tab="false"
|
||||
layout="topleft"
|
||||
parse_urls="false"
|
||||
spellcheck="false"
|
||||
read_only="true"
|
||||
word_wrap="true">
|
||||
</text_editor>
|
||||
</panel>
|
||||
<panel name="local_mesh_settings_panel"
|
||||
layout="topleft"
|
||||
label="Settings"
|
||||
help_topic="local_mesh_settings_prefs">
|
||||
<view_border name="local_mesh_settings_tab_border"
|
||||
bevel_style="none"
|
||||
follows="top|left"
|
||||
height="200"
|
||||
layout="topleft"
|
||||
left="3"
|
||||
ignore_tab="false"
|
||||
right="-2"
|
||||
top_pad="0"
|
||||
width="619" />
|
||||
<check_box name="local_mesh_scale_use_meters"
|
||||
height="15"
|
||||
control_name="FSLocalMeshScaleAlwaysMeters"
|
||||
follows="top|left"
|
||||
top="8"
|
||||
left="8"
|
||||
width="300"
|
||||
label="Assume scale is in meters."
|
||||
tool_tip="Ignore the cm scale units used by tools such as Maya" />
|
||||
<text name="lod_suffix_label"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
left="8"
|
||||
height="12"
|
||||
top_pad="5"
|
||||
width="110">
|
||||
LOD Suffixes:
|
||||
</text>
|
||||
<combo_box name="lod_suffix_combo"
|
||||
height="18"
|
||||
follows="left|top"
|
||||
width="180"
|
||||
top_pad="5"
|
||||
tool_tip="Choose a standard or manually edit...
|
||||
SL default - (Lowest is LOD0, High has no suffix).
|
||||
Game Engine - Unity/UE5, etc. (Lowest=LOD3, High=LOD0).
|
||||
LOD Names - English LOD names, (Lowest='LOWEST', High='HIGH').">
|
||||
<combo_item name="choose_one">Current</combo_item>
|
||||
<combo_item name="suff_sl">SL Standard</combo_item>
|
||||
<combo_item name="suff_unity">Games Engine Standard</combo_item>
|
||||
<combo_item name="suff_descriptive">LOD Names</combo_item>
|
||||
</combo_box>
|
||||
<text name="suf_lowest_lab"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
left="8"
|
||||
height="12"
|
||||
top_pad="10"
|
||||
halign="right"
|
||||
width="60">
|
||||
Lowest:
|
||||
</text>
|
||||
<line_editor name="suf_lowest"
|
||||
control_name="FSMeshLowestLodSuffix"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="23"
|
||||
top_delta="-5"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
max_length_chars="10"
|
||||
tool_tip="The Suffix used to identify the Lowest LOD file on disk and models within a file."
|
||||
width="60" />
|
||||
<text name="suf_low_lab"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
halign="right"
|
||||
height="12"
|
||||
left="8"
|
||||
top_pad="5"
|
||||
width="60">
|
||||
Low:
|
||||
</text>
|
||||
<line_editor name="suf_low"
|
||||
control_name="FSMeshLowLodSuffix"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="23"
|
||||
top_delta="-5"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
max_length_chars="10"
|
||||
tool_tip="The Suffix used to identify the Low LOD file on disk and models within a file."
|
||||
width="60" />
|
||||
<text name="suf_medium_lab"
|
||||
follows="left|top"
|
||||
top_pad="5"
|
||||
left="8"
|
||||
layout="topleft"
|
||||
height="12"
|
||||
halign="right"
|
||||
width="60">
|
||||
Medium:
|
||||
</text>
|
||||
<line_editor name="suf_medium"
|
||||
control_name="FSMeshMediumLodSuffix"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="23"
|
||||
top_delta="-5"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
max_length_chars="10"
|
||||
tool_tip="The Suffix used to identify the Medium LOD file on disk and models within a file."
|
||||
width="60" />
|
||||
<text name="suf_high_lab"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
height="12"
|
||||
halign="right"
|
||||
top_pad="5"
|
||||
left="8"
|
||||
width="60">
|
||||
High:
|
||||
</text>
|
||||
<line_editor name="suf_high"
|
||||
control_name="FSMeshHighLodSuffix"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="23"
|
||||
top_delta="-5"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
max_length_chars="10"
|
||||
tool_tip="The Suffix used to identify the High LOD file on disk and models within a file."
|
||||
width="60" />
|
||||
<text name="suf_physics_lab"
|
||||
follows="left|top"
|
||||
left="8"
|
||||
layout="topleft"
|
||||
height="12"
|
||||
halign="right"
|
||||
top_pad="5"
|
||||
width="60">
|
||||
Physics:
|
||||
</text>
|
||||
<line_editor name="suf_physics"
|
||||
control_name="FSMeshPhysicsSuffix"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="23"
|
||||
top_delta="-5"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
max_length_chars="10"
|
||||
tool_tip="The Suffix used to identify the Physics file on disk and models within a file."
|
||||
width="60" />
|
||||
</panel>
|
||||
</tab_container>
|
||||
<button
|
||||
<button name="btn_apply"
|
||||
height="18"
|
||||
label="Apply"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top="253"
|
||||
name="btn_apply"
|
||||
width="75"
|
||||
visible="true"/>
|
||||
<check_box
|
||||
width="90"
|
||||
visible="true" />
|
||||
<combo_box name="object_apply_list"
|
||||
height="18"
|
||||
label="Apply Scale"
|
||||
layout="topleft"
|
||||
left="90"
|
||||
follows="left|top|bottom"
|
||||
left="105"
|
||||
top="253"
|
||||
name="chkbox_use_scale"
|
||||
width="75"
|
||||
visible="true"
|
||||
follows="bottom"/>
|
||||
<combo_box
|
||||
height="18"
|
||||
layout="topleft"
|
||||
follows="left|top|bottom"
|
||||
name="object_apply_list"
|
||||
left="180"
|
||||
top="253"
|
||||
width="315"
|
||||
visible="true">
|
||||
width="315"
|
||||
visible="true">
|
||||
/>
|
||||
</combo_box>
|
||||
|
||||
<button
|
||||
height="18"
|
||||
label="Add"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top="275"
|
||||
name="btn_add"
|
||||
width="75"
|
||||
visible="true"/>
|
||||
<check_box
|
||||
height="18"
|
||||
label="Use LODs"
|
||||
layout="topleft"
|
||||
left="90"
|
||||
top="275"
|
||||
name="chkbox_use_lods"
|
||||
width="75"
|
||||
visible="true"
|
||||
follows="bottom"/>
|
||||
<button
|
||||
height="18"
|
||||
label="Remove"
|
||||
layout="topleft"
|
||||
left="180"
|
||||
top="275"
|
||||
name="btn_remove"
|
||||
width="75"
|
||||
visible="true"/>
|
||||
<button
|
||||
height="18"
|
||||
label="Reload"
|
||||
layout="topleft"
|
||||
left="260"
|
||||
top="275"
|
||||
name="btn_reload"
|
||||
width="75"
|
||||
visible="true"/>
|
||||
<button
|
||||
height="18"
|
||||
label="Clear"
|
||||
layout="topleft"
|
||||
left="340"
|
||||
top="275"
|
||||
name="btn_clear"
|
||||
width="75"
|
||||
visible="true"/>
|
||||
<button
|
||||
height="18"
|
||||
label="Rez Donor"
|
||||
layout="topleft"
|
||||
left="420"
|
||||
top="275"
|
||||
name="btn_rez"
|
||||
width="75"
|
||||
visible="true"/>
|
||||
</floater>
|
||||
|
||||
<button name="btn_add"
|
||||
height="18"
|
||||
label="Add"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top="275"
|
||||
width="90"
|
||||
visible="true" />
|
||||
<button name="btn_remove"
|
||||
height="18"
|
||||
label="Remove"
|
||||
layout="topleft"
|
||||
left="105"
|
||||
top="275"
|
||||
width="90"
|
||||
visible="true" />
|
||||
<button name="btn_reload"
|
||||
height="18"
|
||||
label="Reload"
|
||||
layout="topleft"
|
||||
left="200"
|
||||
top="275"
|
||||
width="90"
|
||||
visible="true" />
|
||||
<button name="btn_clear"
|
||||
height="18"
|
||||
label="Clear"
|
||||
layout="topleft"
|
||||
left="295"
|
||||
top="275"
|
||||
width="90"
|
||||
visible="true" />
|
||||
<button name="btn_rez"
|
||||
height="18"
|
||||
label="Rez Selected"
|
||||
tool_tip="Create a donor mesh inworld and populate with selected local mesh. This creates an empty object in-world."
|
||||
layout="topleft"
|
||||
left="390"
|
||||
top="275"
|
||||
width="90"
|
||||
visible="true" />
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "llfilepicker.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewermenufile.h"
|
||||
#include "fsscrolllistctrl.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
|
|
@ -37,6 +38,7 @@
|
|||
#include "llselectmgr.h"
|
||||
#include "lltoolmgr.h"
|
||||
#include "lltoolcomp.h"
|
||||
#include "llmodelpreview.h"
|
||||
|
||||
#include "llviewerobjectlist.h"
|
||||
|
||||
|
|
@ -125,8 +127,6 @@ BOOL LLFloaterLocalMesh::postBuild()
|
|||
childSetAction("btn_clear", LLFloaterLocalMesh::onBtnClear, this);
|
||||
childSetAction("btn_rez", LLFloaterLocalMesh::onBtnRez, this);
|
||||
|
||||
|
||||
|
||||
mTabContainer = findChild<LLTabContainer>("local_mesh_tabs");
|
||||
if(mTabContainer)
|
||||
{
|
||||
|
|
@ -136,6 +136,7 @@ BOOL LLFloaterLocalMesh::postBuild()
|
|||
// mTabContainer->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onTabChange, this));
|
||||
}
|
||||
|
||||
getChild<LLComboBox>("lod_suffix_combo")->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onSuffixStandardSelected, this, (LLUICtrl*)this));
|
||||
|
||||
reloadLowerUI();
|
||||
return TRUE;
|
||||
|
|
@ -173,14 +174,10 @@ void LLFloaterLocalMesh::onBtnAdd(void* userdata)
|
|||
|
||||
void LLFloaterLocalMesh::onBtnAddCallback(std::string filename)
|
||||
{
|
||||
bool try_lods = false;
|
||||
auto checkbox_use_lods = getChild<LLCheckBoxCtrl>("chkbox_use_lods");
|
||||
if (checkbox_use_lods)
|
||||
{
|
||||
try_lods = checkbox_use_lods->get();
|
||||
}
|
||||
static const bool try_lods {true};
|
||||
|
||||
LLLocalMeshSystem::getInstance()->addFile(filename, try_lods);
|
||||
showLog();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -261,14 +258,6 @@ void LLFloaterLocalMesh::onBtnApply(void* userdata)
|
|||
return;
|
||||
}
|
||||
|
||||
// checkbox pointer
|
||||
bool use_scale = false;
|
||||
auto checkbox_use_scale = self->getChild<LLCheckBoxCtrl>("chkbox_use_scale");
|
||||
if (checkbox_use_scale)
|
||||
{
|
||||
use_scale = checkbox_use_scale->get();
|
||||
}
|
||||
|
||||
// make sure the selection is still valid, and if so - get id.
|
||||
LLUUID selected_object_id = self->getCurrentSelectionIfValid();
|
||||
if (selected_object_id.isNull())
|
||||
|
|
@ -281,7 +270,75 @@ void LLFloaterLocalMesh::onBtnApply(void* userdata)
|
|||
int object_idx = objectlist_combo_box->getFirstSelectedIndex();
|
||||
|
||||
// finally tell local mesh system to apply
|
||||
LLLocalMeshSystem::getInstance()->applyVObject(selected_object_id, file_id, object_idx, use_scale);
|
||||
LLLocalMeshSystem::getInstance()->applyVObject(selected_object_id, file_id, object_idx, true);
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
S32 which{0};
|
||||
// SL standard LODs are the reverse of every other game engine (LOD0 least detail)
|
||||
// SL has no suffix for the HIGH LOD
|
||||
static const std::array<std::string,5> sl_suffixes = {
|
||||
"LOD0",
|
||||
"LOD1",
|
||||
"LOD2",
|
||||
"",
|
||||
"PHYS"
|
||||
};
|
||||
// Game engines (UE, Unity, CryEngine, Godot, etc.) all use LOD0 as highest.
|
||||
// They typically also label the high with a suffix too
|
||||
static const std::array<std::string,5> std_suffixes = {
|
||||
"LOD3",
|
||||
"LOD2",
|
||||
"LOD1",
|
||||
"LOD0",
|
||||
"PHYS"
|
||||
};
|
||||
// Human friendly. When making things manually people naturally use names.
|
||||
static const std::array<std::string,5> desc_suffixes = {
|
||||
"LOWEST",
|
||||
"LOW",
|
||||
"MED",
|
||||
"HIGH",
|
||||
"PHYS"
|
||||
};
|
||||
auto * self = (LLFloaterLocalMesh *)ctrl;
|
||||
|
||||
if (LLCtrlSelectionInterface* iface = self->childGetSelectionInterface("lod_suffix_combo"))
|
||||
{
|
||||
which = iface->getFirstSelectedIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "no UI element found! nothing changed" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
gSavedSettings.setS32("FSMeshLodSuffixScheme",which);
|
||||
switch (which)
|
||||
{
|
||||
case 1: // SL
|
||||
for (int i = 0; i < LLModel::NUM_LODS; i++)
|
||||
{
|
||||
gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], sl_suffixes[i]);
|
||||
}
|
||||
break;
|
||||
case 2: // standard
|
||||
for (int i = 0; i < LLModel::NUM_LODS; i++)
|
||||
{
|
||||
gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], std_suffixes[i]);
|
||||
}
|
||||
break;
|
||||
case 3: // descriptive english
|
||||
for (int i = 0; i < LLModel::NUM_LODS; i++)
|
||||
{
|
||||
gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], desc_suffixes[i]);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LL_WARNS() << "no standard selected, nothing changed" << LL_ENDL;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
void LLFloaterLocalMesh::onBtnClear(void* userdata)
|
||||
|
|
@ -303,11 +360,6 @@ void LLFloaterLocalMesh::onBtnClear(void* userdata)
|
|||
|
||||
bool LLFloaterLocalMesh::processPrimCreated(LLViewerObject* object)
|
||||
{
|
||||
// Make sure we are expecting this.
|
||||
// if (!mRezPending)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
if(!object)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -357,25 +409,21 @@ bool LLFloaterLocalMesh::processPrimCreated(LLViewerObject* object)
|
|||
{
|
||||
local_id = scroll_ctrl_selected_column->getValue().asUUID();
|
||||
// fill it up with local goodness
|
||||
bool use_scale = false;
|
||||
auto checkbox_use_scale = this->getChild<LLCheckBoxCtrl>("chkbox_use_scale");
|
||||
if (checkbox_use_scale)
|
||||
{
|
||||
use_scale = checkbox_use_scale->get();
|
||||
}
|
||||
static const bool use_scale {true};
|
||||
|
||||
// // make sure the selection is still valid, and if so - get id.
|
||||
|
||||
// get selected local file id, object idx and use_scale boolean
|
||||
int object_idx = objectlist_combo_box->getFirstSelectedIndex();
|
||||
LLLocalMeshSystem::getInstance()->applyVObject(object->getID(), local_id, object_idx, use_scale);
|
||||
auto* volp = object->getVolume();
|
||||
volp = object->getVolume();
|
||||
if(!volp)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
volume_params = volp->getParams();
|
||||
object->updateVolume(volume_params);
|
||||
object->markForUpdate(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -481,9 +529,6 @@ void LLFloaterLocalMesh::reloadFileList(bool keep_selection)
|
|||
LLAssetType::AT_OBJECT,
|
||||
LLInventoryType::IT_OBJECT);
|
||||
LLSD element;
|
||||
element["columns"][0]["column"] = "drag to rez";
|
||||
element["columns"][0]["type"] = "icon";
|
||||
element["columns"][0]["value"] = icon_name;
|
||||
|
||||
element["columns"][0]["column"] = "unit_status";
|
||||
element["columns"][0]["type"] = "text";
|
||||
|
|
@ -514,11 +559,11 @@ void LLFloaterLocalMesh::reloadFileList(bool keep_selection)
|
|||
mScrollCtrl->selectNthItem(selected_num);
|
||||
reloadLowerUI();
|
||||
}
|
||||
else if (mScrollCtrl->getItemCount() == 1)
|
||||
else if (mScrollCtrl->getItemCount() > 0)
|
||||
{
|
||||
// if we've just got the one item, select it.
|
||||
// this prevents the need to explicitly select a list item when first adding a file.
|
||||
mScrollCtrl->selectNthItem(0);
|
||||
// select the last item in the list
|
||||
mScrollCtrl->selectNthItem( mScrollCtrl->getItemCount()-1 );
|
||||
reloadLowerUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ class LLFloaterLocalMesh : public LLFloater
|
|||
static void onBtnApply(void* userdata);
|
||||
static void onBtnClear(void* userdata);
|
||||
static void onBtnRez(void* userdata);
|
||||
static void onSuffixStandardSelected(LLUICtrl* ctrl, void *userdata);
|
||||
|
||||
bool processPrimCreated(LLViewerObject* object);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "llvolumemgr.h"
|
||||
#include "pipeline.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llmodelpreview.h"
|
||||
|
||||
// STL headers
|
||||
#include <chrono>
|
||||
|
|
@ -359,8 +360,10 @@ LLLocalMeshFile::LLLocalMeshFile(const std::string& filename, bool try_lods)
|
|||
mLocalMeshFileNeedsUIUpdate = false;
|
||||
mLoadedObjectList.clear();
|
||||
mSavedObjectSculptIDs.clear();
|
||||
|
||||
pushLog("LLLocalMeshFile", "Initializing with filename: " + filename);
|
||||
|
||||
mShortName = std::string(boost::filesystem::path(filename).stem().string());
|
||||
auto base_lod_filename {stripSuffix(mShortName)};
|
||||
pushLog("LLLocalMeshFile", "Initializing with base filename: " + base_lod_filename);
|
||||
|
||||
// check if main filename exists, just in case
|
||||
if (!boost::filesystem::exists(filename))
|
||||
|
|
@ -371,8 +374,8 @@ LLLocalMeshFile::LLLocalMeshFile(const std::string& filename, bool try_lods)
|
|||
return;
|
||||
}
|
||||
|
||||
mFilenames[3] = filename;
|
||||
mShortName = boost::filesystem::path(filename).filename().generic_string();
|
||||
// for the high lod we just store the filename fromthe file picker
|
||||
mFilenames[LOCAL_LOD_HIGH] = filename;
|
||||
|
||||
// check if we have a valid extension, can't switch with string can we?
|
||||
if (std::string exten_str = boost::filesystem::extension(filename); exten_str == ".dae")
|
||||
|
|
@ -442,38 +445,32 @@ void LLLocalMeshFile::reloadLocalMeshObjects(bool initial_load)
|
|||
// check for lod filenames
|
||||
if (mTryLODFiles)
|
||||
{
|
||||
size_t dot_position = mFilenames[LOCAL_LOD_HIGH].find_last_of(".");
|
||||
if (dot_position == mFilenames[LOCAL_LOD_HIGH].npos)
|
||||
{
|
||||
// should theoretically never happen, we did check extension before,
|
||||
// but "should never happen" doesn't mean we shouldn't check.
|
||||
pushLog("LLLocalMeshFile", "Filename extension error, loading stopped.", true);
|
||||
mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
pushLog("LLLocalMeshFile", "Seeking LOD files...");
|
||||
// up to LOD2, LOD3 being the highest is always done by this point.
|
||||
for (size_t lodfile_iter = LOCAL_LOD_LOWEST; lodfile_iter < LOCAL_LOD_HIGH; ++lodfile_iter)
|
||||
for (S32 lodfile_iter = LOCAL_LOD_LOWEST; lodfile_iter < LOCAL_LOD_HIGH; ++lodfile_iter)
|
||||
{
|
||||
std::string current_lod_filename = mFilenames[LOCAL_LOD_HIGH];
|
||||
std::string lod_string = "_LOD" + std::to_string(lodfile_iter);
|
||||
|
||||
current_lod_filename.insert(dot_position, lod_string);
|
||||
if (boost::filesystem::exists(current_lod_filename))
|
||||
// lod filenames may be empty because this is first time through or because the lod didn't exist before.
|
||||
if( mFilenames[lodfile_iter].empty() )
|
||||
{
|
||||
pushLog("LLLocalMeshFile", "LOD filename " + current_lod_filename + " found, adding.");
|
||||
mFilenames[lodfile_iter] = current_lod_filename;
|
||||
}
|
||||
auto filepath { boost::filesystem::path(mFilenames[LOCAL_LOD_HIGH]).parent_path() };
|
||||
auto lod_suffix { getLodSuffix(lodfile_iter) };
|
||||
auto extension { boost::filesystem::path(mFilenames[LOCAL_LOD_HIGH]).extension() };
|
||||
|
||||
else
|
||||
{
|
||||
pushLog("LLLocalMeshFile", "LOD filename " + current_lod_filename + " not found, skipping.");
|
||||
mFilenames[lodfile_iter].clear();
|
||||
boost::filesystem::path current_lod_filename = filepath / (mShortName + lod_suffix + extension.string());
|
||||
if ( boost::filesystem::exists( current_lod_filename ) )
|
||||
{
|
||||
pushLog("LLLocalMeshFile", "LOD filename " + current_lod_filename.string() + " found, adding.");
|
||||
mFilenames[lodfile_iter] = current_lod_filename.string();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
pushLog("LLLocalMeshFile", "LOD filename " + current_lod_filename.string() + " not found, skipping.");
|
||||
mFilenames[lodfile_iter].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
pushLog("LLLocalMeshFile", "Skipping LOD 2-0 files, as specified.");
|
||||
|
|
@ -759,7 +756,6 @@ void LLLocalMeshFile::applyToVObject(LLUUID viewer_object_id, int object_index,
|
|||
if ((!target_object->isAttachment()) && use_scale)
|
||||
{
|
||||
auto scale = mLoadedObjectList[object_index]->getObjectSize();
|
||||
// scale *= 0.01; /* NOTE: magic number */
|
||||
target_object->setScale(LLVector3(scale), false);
|
||||
}
|
||||
|
||||
|
|
@ -803,7 +799,7 @@ void LLLocalMeshSystem::addFile(const std::string& filename, bool try_lods)
|
|||
{
|
||||
auto loaded_file = std::make_unique<LLLocalMeshFile>(filename, try_lods);
|
||||
mLoadedFileList.push_back(std::move(loaded_file));
|
||||
triggerFloaterRefresh();
|
||||
triggerFloaterRefresh(false);
|
||||
|
||||
triggerCheckFileAsyncStatus();
|
||||
}
|
||||
|
|
@ -970,11 +966,11 @@ void LLLocalMeshSystem::registerFloaterPointer(LLFloaterLocalMesh* floater_ptr)
|
|||
mFloaterPtr = floater_ptr;
|
||||
}
|
||||
|
||||
void LLLocalMeshSystem::triggerFloaterRefresh()
|
||||
void LLLocalMeshSystem::triggerFloaterRefresh(bool keep_selection)
|
||||
{
|
||||
if (mFloaterPtr)
|
||||
{
|
||||
mFloaterPtr->reloadFileList(true);
|
||||
mFloaterPtr->reloadFileList(keep_selection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ class LLLocalMeshSystem : public LLSingleton<LLLocalMeshSystem>
|
|||
|
||||
// floater two-way communication
|
||||
void registerFloaterPointer(LLFloaterLocalMesh* floater_ptr);
|
||||
void triggerFloaterRefresh();
|
||||
void triggerFloaterRefresh( bool keep_selection=true );
|
||||
std::vector<LLLocalMeshFile::LLLocalMeshFileInfo> getFileInfoVector() const;
|
||||
std::vector<std::string> getFileLog(LLUUID local_file_id) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -99,16 +99,24 @@ LLLocalMeshImportDAE::loadFile_return LLLocalMeshImportDAE::loadFile(LLLocalMesh
|
|||
|
||||
LLMatrix4 scene_transform_base;
|
||||
|
||||
domAsset::domUnit* unit = daeSafeCast<domAsset::domUnit>(collada_document_root->getDescendant(daeElement::matchType(domAsset::domUnit::ID())));
|
||||
scene_transform_base.setIdentity();
|
||||
if (unit)
|
||||
{
|
||||
F32 meter = unit->getMeter();
|
||||
scene_transform_base.mMatrix[0][0] = meter;
|
||||
scene_transform_base.mMatrix[1][1] = meter;
|
||||
scene_transform_base.mMatrix[2][2] = meter;
|
||||
}
|
||||
static auto always_use_meter_scale = LLUICachedControl<bool>("FSLocalMeshScaleAlwaysMeters", false);
|
||||
|
||||
if(!always_use_meter_scale)
|
||||
{
|
||||
domAsset::domUnit* unit = daeSafeCast<domAsset::domUnit>(collada_document_root->getDescendant(daeElement::matchType(domAsset::domUnit::ID())));
|
||||
scene_transform_base.setIdentity();
|
||||
if (unit)
|
||||
{
|
||||
F32 meter = unit->getMeter();
|
||||
scene_transform_base.mMatrix[0][0] = meter;
|
||||
scene_transform_base.mMatrix[1][1] = meter;
|
||||
scene_transform_base.mMatrix[2][2] = meter;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
scene_transform_base.setIdentity();
|
||||
}
|
||||
//get up axis rotation
|
||||
LLMatrix4 rotation;
|
||||
|
||||
|
|
@ -468,7 +476,8 @@ bool LLLocalMeshImportDAE::processSkin(daeDatabase* collada_db, daeElement* coll
|
|||
auto& skininfo = current_object->getObjectMeshSkinInfo();
|
||||
|
||||
// basically copy-pasted from linden magic
|
||||
LLMatrix4 normalized_transformation, mesh_scale;
|
||||
LLMatrix4 normalized_transformation;
|
||||
LLMatrix4 mesh_scale;
|
||||
normalized_transformation.setTranslation(LLVector3(inverse_translation));
|
||||
mesh_scale.initScale(LLVector3(objct_size));
|
||||
mesh_scale *= normalized_transformation;
|
||||
|
|
|
|||
Loading…
Reference in New Issue