meow-7.2.2
Dave Parks 2010-11-19 17:12:38 -06:00
commit 0bb387a030
7 changed files with 1034 additions and 814 deletions

View File

@ -145,7 +145,7 @@ void LLThread::shutdown()
// First, set the flag that indicates that we're ready to die
setQuitting();
llinfos << "LLThread::~LLThread() Killing thread " << mName << " Status: " << mStatus << llendl;
//llinfos << "LLThread::~LLThread() Killing thread " << mName << " Status: " << mStatus << llendl;
// Now wait a bit for the thread to exit
// It's unclear whether I should even bother doing this - this destructor
// should netver get called unless we're already stopped, really...
@ -167,7 +167,7 @@ void LLThread::shutdown()
if (!isStopped())
{
// This thread just wouldn't stop, even though we gave it time
llwarns << "LLThread::~LLThread() exiting thread before clean exit!" << llendl;
//llwarns << "LLThread::~LLThread() exiting thread before clean exit!" << llendl;
return;
}
mAPRThreadp = NULL;

View File

@ -1056,9 +1056,9 @@ void LLModel::addFace(const LLVolumeFace& face)
}
void LLModel::smoothNormals(F32 angle_cutoff)
void LLModel::generateNormals(F32 angle_cutoff)
{
//smooth normals for all faces by:
//generate normals for all faces by:
// 1 - Create faceted copy of face with no texture coordinates
// 2 - Weld vertices in faceted copy that are shared between triangles with less than "angle_cutoff" difference between normals
// 3 - Generate smoothed set of normals based on welding results

View File

@ -114,7 +114,7 @@ public:
U32 num_verts,
U32 num_indices);
void smoothNormals(F32 angle_cutoff);
void generateNormals(F32 angle_cutoff);
void addFace(const LLVolumeFace& face);

File diff suppressed because it is too large Load Diff

View File

@ -49,14 +49,6 @@ class domInstance_geometry;
class domNode;
class domTranslate;
class LLPhysicsDecompFloater : public LLFloater
{
public:
LLPhysicsDecompFloater(LLSD& key);
~LLPhysicsDecompFloater();
};
class LLModelLoader : public LLThread
{
public:
@ -145,16 +137,12 @@ public:
static void onMouseCaptureLostModelPreview(LLMouseHandler*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void onBrowseHighLOD(void* data);
static void onBrowseMediumLOD(void* data);
static void onBrowseLowLOD(void* data);
static void onBrowseLowestLOD(void* data);
static void onBrowseLOD(void* data);
static void onUpload(void* data);
static void onConsolidate(void* data);
static void onScrubMaterials(void* data);
static void onDecompose(void* data);
static void onClearMaterials(void* data);
static void onModelDecompositionComplete(LLModel* model, std::vector<LLPointer<LLVertexBuffer> >& physics_mesh);
static void refresh(LLUICtrl* ctrl, void* data);
@ -167,27 +155,16 @@ protected:
friend class LLModelPreview;
friend class LLMeshFilePicker;
friend class LLPhysicsDecomp;
friend class LLPhysicsDecompFloater;
static void onDebugScaleCommit(LLUICtrl*, void*);
static void onImportScaleCommit(LLUICtrl*, void*);
static void onUploadJointsCommit(LLUICtrl*,void*);
static void onUploadSkinCommit(LLUICtrl*,void*);
static void onPreviewLODCommit(LLUICtrl*,void*);
static void onHighLODCommit(LLUICtrl*,void*);
static void onMediumLODCommit(LLUICtrl*,void*);
static void onLowLODCommit(LLUICtrl*,void*);
static void onLowestLODCommit(LLUICtrl*,void*);
static void onPhysicsLODCommit(LLUICtrl*,void*);
static void onTriangleLimitCommit(LLUICtrl*,void*);
static void onHighLimitCommit(LLUICtrl*,void*);
static void onMediumLimitCommit(LLUICtrl*,void*);
static void onLowLimitCommit(LLUICtrl*,void*);
static void onLowestLimitCommit(LLUICtrl*,void*);
static void onPhysicsLimitCommit(LLUICtrl*,void*);
static void onSmoothNormalsCommit(LLUICtrl*,void*);
static void onGenerateNormalsCommit(LLUICtrl*,void*);
static void onAutoFillCommit(LLUICtrl*,void*);
static void onShowEdgesCommit(LLUICtrl*,void*);
@ -197,20 +174,24 @@ protected:
static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata);
static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata);
static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata);
static void onClosePhysicsFloater(LLUICtrl* ctrl, void* userdata);
static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata);
static void onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata);
static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata);
static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata);
static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata);
void draw();
static void setLODMode(S32 lod, void* userdata);
void setLODMode(S32 lod, S32 which_mode);
static void setLimit(S32 lod, void* userdata);
void setLimit(S32 lod, S32 limit);
void showDecompFloater();
void initDecompControls();
LLModelPreview* mModelPreview;
LLFloater* mDecompFloater;
LLPhysicsDecomp::decomp_params mDecompParams;
S32 mLastMouseX;
@ -236,6 +217,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
void setPreviewTarget(F32 distance);
void setTexture(U32 name) { mTextureName = name; }
void setPhysicsFromLOD(S32 lod);
BOOL render();
void update();
void genBuffers(S32 lod, bool skinned);
@ -250,9 +232,9 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
void loadModel(std::string filename, S32 lod);
void loadModelCallback(S32 lod);
void genLODs(S32 which_lod = -1);
void smoothNormals();
void generateNormals();
void consolidate();
void scrubMaterials();
void clearMaterials();
U32 calcResourceCost();
void rebuildUploadData();
void clearIncompatible(S32 lod);
@ -280,9 +262,9 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
LLVector3 mPreviewScale;
S32 mPreviewLOD;
U32 mResourceCost;
S32 mLODMode[LLModel::NUM_LODS];
S32 mLimit[LLModel::NUM_LODS];
std::string mLODFile[LLModel::NUM_LODS];
LLModelLoader* mModelLoader;

View File

@ -778,4 +778,10 @@
<color
name="MenuBarProjectBgColor"
reference="MdBlue" />
<color
name="MeshImportTableNormalColor"
value="1 1 1 1"/>
<color
name="MeshImportTableHighlightColor"
value="0.2 0.8 1 1"/>
</colors>

View File

@ -1,49 +1,358 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="false"
can_resize="false" height="656" min_height="656" min_width="856"
name="Model Preview" title="Import Model" width="856">
<text bottom_delta="20" left="10" name="status" height="15" follows="top|left">
Status: [STATUS]
</text>
can_resize="true" height="520" min_height="520" min_width="630"
name="Model Preview" title="Upload Model" width="630">
<string name="status_idle">Idle</string>
<string name="status_reading_file">Loading...</string>
<string name="status_generating_meshes">Generating Meshes...</string>
<string name="missing_lod">Cannot upload, missing required level of detail.</string>
<string name="bad_lod">Cannot upload, supplied levels of detail invalid.</string>"
<string name="too_heavy">Too many vertices.</string>
<string name="required">Required</string>
<string name="good">Good</string>
<string name="mesh_mismatch">Submesh count mismatch.</string>
<string name="model_mismatch">Model count mismatch.</string>
<combo_box bottom_delta="20" follows="right|top" height="18" label="Preview"
left="450" name="preview_lod_combo" width="120" tool_tip="LOD to view in preview render">
<combo_item name="preview_lowest">
<string name="high">High</string>
<string name="medium">Medium</string>
<string name="low">Low</string>
<string name="lowest">Lowest</string>
<string name="mesh_status_good">Good</string>
<string name="mesh_status_bad">Bad</string>"
<string name="mesh_status_na">N/A</string>
<string name="mesh_status_none">None</string>
<string name="layer_all">All</string> <!-- Text to display in physics layer combo box for "all layers" -->
<text left="15" bottom="25" follows="top|left" height="15" name="name_label">
Name:
</text>
<line_editor bottom_delta="20" follows="top|left|right" height="19" max_length="254"
name="description_form" width="310" />
<text bottom_delta="24" follows="top|left" height="15" name="preview_label">
Preview:
</text>
<!-- Placeholder panel for 3D preview render -->
<panel
name="preview_panel"
left="15"
width="310"
height="310"
follows="all"/>
<text bottom_delta="25" left="15" width="100" follows="bottom|left" height="15" name="streaming cost">
Prim Cost: [COST]
</text>
<text right="320" width="100" height="15" bottom_delta="0" follows="bottom|right" name="status">[STATUS]</text>
<text bottom_delta="20" left="15" follows="left|bottom" height="15" name="lod_label">
Level of Detail:
</text>
<combo_box bottom_delta="20" follows="left|bottom" height="18"
name="preview_lod_combo" width="90" tool_tip="LOD to view in preview render">
<combo_item name="lowest">
Lowest
</combo_item>
<combo_item name="preview_low">
<combo_item name="low">
Low
</combo_item>
<combo_item name="preview_medium">
<combo_item name="medium">
Medium
</combo_item>
<combo_item name="preview_high">
<combo_item name="high">
High
</combo_item>
<combo_item name="preview_high">
Physics
</combo_item>
</combo_box>
<check_box bottom="450" left="125" follows="left|bottom" label="Show Edges" name="show edges" width="120" height="16" tool_tip="Render wireframe in preview window"/>
<check_box bottom_delta="15" left="125" follows="left|bottom" label="Show Physics" name="show physics" width="120" height="16" tool_tip="Show physics shape."/>
<button bottom="510" follows="bottom|left" height="20" label="Upload"
left="15" width="80" name="ok_btn" tool_tip="Upload to simulator"/>
<button left_pad="10" follows="left|bottom" height="20" width="80" label="Cancel" name="cancel_btn"/>
<tab_container
follows="right|top|bottom"
top="15"
left="330"
height="475"
width="280"
name="import_tab"
border="true"
tab_position="top">
<!-- MODIFIERS PANEL -->
<panel
border="true"
label="Modifiers"
name="modifiers_panel"
left="330"
width="280"
height="450">
<text left="10" width="90" bottom="30" follows="top|left" height="15">
Scale:
</text>
<text left_pad="5" width="140" follows="top|left" height="15">
Dimensions:
</text>
<spinner left="10" height="20" follows="top|left" width="80" top_pad="5" value="1.0" min_val="0.01" max_val="64.0" name="import_scale"/>
<text left_pad="20" height="15" name="import_dimensions" follows="top|left">
[X] x [Y] x [Z] m
</text>
<text left="10" top_pad="20" follows="top_left" height="15">
Include:
</text>
<check_box top_pad="5" name="upload_textures" height="15" follows="top|left" label="Textures"/>
<check_box top_pad="5" name="upload_skin" height="15" follows="top|left" label="Skin weight"/>
<check_box top_pad="5" left="20" name="upload_joints" height="15" follows="top|left" label="Joint positions"/>
</panel>
<!-- LOD PANEL -->
<panel
border="true"
label="Level of Detail"
name="lod_panel">
<text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header">
Select Level of Detail:
</text>
<text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" width="65" height="18" follows="left|top" value="Triangles"/>
<text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" height="18" follows="left|top" value="Vertices"/>
<text valign="center" halign="center" left_pad="0" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
<text valign="center" halign="center" bg_visible="true" name="high_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="High"/>
<text valign="center" halign="center" bg_visible="true" name="high_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="high_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="high_status" left_pad="0" width="65" height="18" follows="left|top" value="Good"/>
<text valign="center" halign="center" bg_visible="true" name="medium_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Medium"/>
<text valign="center" halign="center" bg_visible="true" name="medium_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="medium_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="medium_status" left_pad="0" width="65" height="18" follows="left|top" value="Good"/>
<text valign="center" halign="center" bg_visible="true" name="low_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Low"/>
<text valign="center" halign="center" bg_visible="true" name="low_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="low_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="low_status" left_pad="0" width="65" height="18" follows="left|top" value="Good"/>
<text valign="center" halign="center" bg_visible="true" name="lowest_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Lowest"/>
<text valign="center" halign="center" bg_visible="true" name="lowest_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="lowest_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
<text valign="center" halign="center" bg_visible="true" name="lowest_status" left_pad="0" width="65" height="18" follows="left|top" value="Good"/>
<text left="10" width="240" height="15" top_pad="15" follows="left|top" name="lod_tabel_footer">
Level of Detail: [DETAIL]
</text>
<text top_pad="10" height="15" follows="left|top">
Mesh
</text>
<radio_group follows="top|left" height="100" left="30" name="lod_file_or_limit" width="240" value="lod_from_file">
<radio_item bottom="85" label="Load from file" name="lod_from_file"/>
<radio_item bottom="40" label="Auto generate" name="lod_auuto_generate"/>
</radio_group>
<line_editor follows="left|top" bottom_delta="-60" width="140" left="45" value="" name="lod_file" height="20"/>
<button bottom_delta="3" name="lod_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/>
<text follows="top|left" top_pad="22" width="140" left="45" height="15">
Triangle Limit:
</text>
<spinner follows="top|left" name="lod_triangle_limit" top_pad="5" height="20" width="60" decimal_digits="0" enabled="true"/>
<button bottom_delta="3" left_pad="5" name="lod_generate" label="Generate" height="25" width="70" follows="left|top"/>
<text name="submeshes_info" follows="left|top" left="10" top_pad="7" height="15 width=240">
Layers: [SUBMESHES]
</text>
<button left="30" follows="top|left" top_pad="5" name="clear_materials" label="Clear Materials" width="100" height="25"/>
<button left="30" follows="top|left" top_pad="5" name="consolidate" label="Consolidate" width="100" height="25"/>
<text left="10" top_pad="10" follows="top|left" width="240" height="15">
Normals
</text>
<text left="35" top_pad="5" follows="top|left" width="100" height="15">
Crease Angle:
</text>
<spinner follows="top|left" top_pad="5" min_val="0" max_val="180" value="75" width="60" height="20" name="crease_angle"/>
<button follows="top|left" bottom_delta="3" left_pad="5" width="140" height="25" label="Generate Normals" name="generate_normals"/>
</panel>
<!-- PANEL -->
<panel
border="true"
label="Physics"
name="physics_panel">
<!-- PHYSICS STEP ONE-->
<panel
follows="top|left"
name="physics step 1"
left="0"
top="0"
width="260"
height="450"
visible="true">
<text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
Step 1: Geometry
</text>
<radio_group follows="top|left" top_pad="5" width="240" height="70" name="physics_load_radio" value="physics_load_from_file">
<radio_item bottom="50" name="physics_load_from_file" label="Load from file"/>
<radio_item bottom="0" name="physics_use_lod" label="Use Level of Detail"/>
</radio_group>
<line_editor follows="left|top" bottom_delta="-25" width="140" left="30" value="" name="physics_file" height="20"/>
<button bottom_delta="3" name="physics_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/>
<combo_box left="30" bottom_delta="40" follows="left|top" height="18"
name="physics_lod_combo" width="90" tool_tip="LOD to use for physics shape">
<combo_item name="physics_lowest">
Lowest
</combo_item>
<combo_item name="physics_low">
Low
</combo_item>
<combo_item name="physics_medium">
Medium
</combo_item>
<combo_item name="physics_high">
High
</combo_item>
</combo_box>
<!--
<text follows="top|left" name="physics_triangles" top_pad="15" height="15" left="10">
Triangles: [TRIANGLES]
</text>
<text follows="top|left" name="physics_hulls" top_pad="5" height="15">
Hulls: [HULLS]
</text>
<text follows="top|left" name="physics_points" top_pad="5" height="15">
Points: [POINTS]
</text>
<text follows="top|left" left="140" width="100" bottom_delta="-40" height="15">
Layer:
</text>
<combo_box name="physics_layer" follows="top|left" width="100" height="20" top_pad="5"/>
-->
<button bottom="440" left="180" width="80" follows="bottom|right" label="Optimize" name="physics_optimize" height="20"/>
</panel>
<!-- PHYSICS STEP 2-->
<panel
follows="top|left"
name="physics step 2"
left="0"
top="0"
width="260"
height="450"
visible="false">
<text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
Step 2: Decompose
</text>
<text top_pad="100" follows="top|left" height="15">
Decompose Method:
</text>
<combo_box name="Method" follows="top|left" top_pad="5" height="20" width="100"/>
<text top_pad="10" follows="top|left" height="15">
Quality:
</text>
<combo_box name="Decompose Quality" follows="top|left" top_pad="5" height="20" width="100"/>
<check_box name="Simplify Coplanar" follows="top|left" top_pad="10" height="15" label="Simplify Coplaner"/>
<check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/>
<slider name="Cosine%" width="240" follows="top|left" top_pad="10" height="20" label="Cosine %"/>
<text follows="top|left" top_pad="20" height="30" width="260">
"Note: Only models that have been Decomposed"
"can be made Physical or used as Vehicles."
</text>
<button bottom="440" left="90" width="80" follows="bottom|right" label="&lt;&lt; Back" name="decompose_back" height="20"/>
<button left_pad="5" width="90" follows="bottom|right" label="Decompose" name="Decompose" height="20"/>
</panel>
<!-- PHYSICS STEP 3 -->
<panel
follows="top|left"
name="physics step 3"
left="0"
top="0"
width="260"
height="450"
visible="false">
<text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
Step 3: Simplify
</text>
<text left="10" top_pad="100" height="15" width="240" follows="top|left">
Simplify Method:
</text>
<combo_box top_pad="5" height="20" width="100" follows="top|left" name="Simplify Method"/>
<slider name="Combine Quality" label="Combine Quality:" label_width="100" width="260" follows="top|left" top_pad="10" height="20"/>
<slider name="Detail Scale" label="Detail Scale:" label_width="100" width="260" follows="top|left" top_pad="10" height="20"/>
<slider name="Retain%" label="Retain %:" label_width="100" width="260" follows="top|left" top_pad="10" height="20"/>
<button bottom="440" left="90" width="80" follows="bottom|right" label="&lt;&lt; Back" name="simplify_back" height="20"/>
<button left_pad="5" width="90" follows="bottom|right" label="Simplify" name="Simplify" height="20"/>
</panel>
<!-- INFO PANEL -->
<panel
left="0"
top="35"
width="260"
height="100"
follows="left|top"
name="physics info"
visible="false">
<text follows="top|left" name="physics_triangles" top_pad="15" height="15" left="10">
Triangles: [TRIANGLES]
</text>
<text follows="top|left" name="physics_hulls" top_pad="5" height="15">
Hulls: [HULLS]
</text>
<text follows="top|left" name="physics_points" top_pad="5" height="15">
Points: [POINTS]
</text>
<text follows="top|left" left="140" width="100" bottom_delta="-40" height="15">
Layer:
</text>
<combo_box name="physics_layer" follows="top|left" width="100" height="20" top_pad="5"/>
<slider name="physics_explode" follows="top|left" top_pad="25" left="10" label="Explode" min_val="0.0" max_val="3.0" height="20" width="240"/>
</panel>
</panel>
</tab_container>
<!--
<button bottom_delta="0" left="10" width="120" name="auto fill" label="Generate LOD" tool_tip="Automatically generate levels of detail"/>
<button bottom_delta="0" left="140" width="120" name="smooth normals" label="Generate Normals" tool_tip="Regenerate normals based on mesh shape"/>
<button bottom_delta="0" left="260" width="120" name="consolidate" label="Consolidate" tool_tip="Combine similar submeshes (reduces number of submeshes)"/>
<button bottom_delta="30" left="260" width="120" name="scrub materials" label="Scrub Materials" tool_tip="Remove all material information (clear textures, set all colors to white)."/>
<spinner bottom_delta="0" left="140" width="120" height="16" initial_value="75" label_width="60" name="edge threshold" decimal_digits="0" min_val="0" max_val="180" increment="5" label="Hard Angle" tool_tip="Maximum angle that will be smoothed between triangles when using Generate Normals"/>
<check_box bottom_delta="0" left="450" label="Show Edges" name="show edges" width="120" height="16" tool_tip="Render wireframe in preview window"/>
<text bottom_delta="30" follows="top|left" height="15" left="10" name="high_lod_label">
High LOD:
</text>
@ -163,12 +472,7 @@
<check_box bottom_delta="20" follow="bottom|left" height="20" label="Joint Positions"
left="15" width="125" name="upload_joints" tool_tip="Upload joint position information (will override avatar joint positions when mesh is worn)."/>
<text bottom_delta="35" follows="top|left" height="15" name="description_label">
Description:
<!-- Info: [PRIM_COST] prim equivalents, [TEXTURES] textures. -->
</text>
<line_editor bottom_delta="24" follows="top|left|right" height="19" max_length="254"
name="description_form" width="280" />
<button bottom_delta="25" follows="bottom|left" height="20" label="Upload"
left="15" name="ok_btn" width="125" tool_tip="Upload to simulator"/>
@ -178,11 +482,10 @@
<text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="upload_message">
[MESSAGE]
</text>
<text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="streaming cost">
Estimated Streaming Cost: [COST]
</text>
<spinner bottom_delta="20" label="Scale" left="15" width="120" name="debug scale" decimal_digits="3" increment="0.1" min_val="0" max_val="64" initial_value="1" tool_tip="Multiplier for incoming object scale. If incoming dimensions are very small or very large, modify this value to get dimensions into an acceptable range."/>
<text bottom_delta="30" left="15" width="280" follows="top|left" height="15" name="dimensions">
Model Dimensions: [X]m x [Y]m x [Z]m
</text>
-->
</floater>