From ec6be3fdb91ed5f4fb0e50977a7b0814a678af0a Mon Sep 17 00:00:00 2001 From: prep linden Date: Fri, 17 Jun 2011 10:47:33 -0400 Subject: Fix for sh-1586 & sh-1654 # Alt-zooming camera flipping --- indra/newview/llagentcamera.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c30d3b9aa3..f195c985c0 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -393,8 +393,6 @@ LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 origi LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation LLVector3 object_extents = object->getScale(); - const LLVector4a* oe4 = object->mDrawable->getSpatialExtents(); - object_extents.set( oe4[1][0], oe4[1][1], oe4[1][2] ); // make sure they object extents are non-zero object_extents.clamp(0.001f, F32_MAX); -- cgit v1.2.3 From fe022adfa637d4f4f08d48576c75b5148573c8ed Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 17 Jun 2011 09:59:37 -0600 Subject: fix for SH-1783: [PUBLIC] Crash when adding a physics shape. --- indra/newview/llfloatermodelpreview.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ab6753b4be..75728fdeeb 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3107,18 +3107,20 @@ void LLModelPreview::rebuildUploadData() } } - for (U32 i = 0; i < LLModel::NUM_LODS; i++) - { //fill LOD slots based on reference model index - if (!mModel[i].empty()) - { - instance.mLOD[i] = mModel[i][idx]; - } - else - { - instance.mLOD[i] = NULL; + if(idx < mBaseModel.size()) + { + for (U32 i = 0; i < LLModel::NUM_LODS; i++) + { //fill LOD slots based on reference model index + if (mModel[i].size() > idx) + { + instance.mLOD[i] = mModel[i][idx]; + } + else + { + instance.mLOD[i] = NULL; + } } } - instance.mTransform = mat; mUploadData.push_back(instance); } -- cgit v1.2.3 From 1b01476dad70a01246df3456e40557bc0512d2d4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 18 Jun 2011 01:00:14 -0500 Subject: Fix for annoying assert that gets triggered when your first login attempt fails. --- indra/newview/llvoavatar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1b53348b43..4a9756bb88 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1123,7 +1123,10 @@ void LLVOAvatar::initClass() // Process XML data // avatar_skeleton.xml - llassert(!sAvatarSkeletonInfo); + if (sAvatarSkeletonInfo) + { //this can happen if a login attempt failed + delete sAvatarSkeletonInfo; + } sAvatarSkeletonInfo = new LLVOAvatarSkeletonInfo; if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot())) { -- cgit v1.2.3 From 15235061e8a8f64dd94640d27eadfce23ccb76f6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 18 Jun 2011 01:02:03 -0500 Subject: SH-828 Fix for using uninitialized data when normals or texture coordinates are absent from collada file (can now upload meshes without normals or texture coordinates). --- indra/llmath/llvolume.cpp | 141 ++++++++++--- indra/llprimitive/llmodel.cpp | 355 +++++++++++++++----------------- indra/newview/llfloatermodelpreview.cpp | 56 +++-- 3 files changed, 318 insertions(+), 234 deletions(-) (limited to 'indra') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 8c81f27784..7c7c4306da 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2379,11 +2379,16 @@ bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)co bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs, F32 angle_cutoff) const { bool retval = false; - if (rhs.mData[POSITION].equals3(mData[POSITION]) && rhs.mTexCoord == mTexCoord) + + const F32 epsilon = 0.00001f; + + if (rhs.mData[POSITION].equals3(mData[POSITION], epsilon) && + abs(rhs.mTexCoord[0]-mTexCoord[0]) < epsilon && + abs(rhs.mTexCoord[1]-mTexCoord[1]) < epsilon) { if (angle_cutoff > 1.f) { - retval = (mData[NORMAL].equals3(rhs.mData[NORMAL])); + retval = (mData[NORMAL].equals3(rhs.mData[NORMAL], epsilon)); } else { @@ -2499,38 +2504,52 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } { - U16* n = (U16*) &(norm[0]); - for (U32 j = 0; j < num_verts; ++j) + if (!norm.empty()) + { + U16* n = (U16*) &(norm[0]); + for (U32 j = 0; j < num_verts; ++j) + { + norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]); + norm_out->div(65535.f); + norm_out->mul(2.f); + norm_out->sub(1.f); + norm_out++; + n += 3; + } + } + else { - norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]); - norm_out->div(65535.f); - norm_out->mul(2.f); - norm_out->sub(1.f); - norm_out++; - n += 3; + memset(norm_out, 0, sizeof(LLVector4a)*num_verts); } } { - U16* t = (U16*) &(tc[0]); - for (U32 j = 0; j < num_verts; j+=2) + if (!tc.empty()) { - if (j < num_verts-1) - { - tc_out->set((F32) t[0], (F32) t[1], (F32) t[2], (F32) t[3]); - } - else + U16* t = (U16*) &(tc[0]); + for (U32 j = 0; j < num_verts; j+=2) { - tc_out->set((F32) t[0], (F32) t[1], 0.f, 0.f); - } + if (j < num_verts-1) + { + tc_out->set((F32) t[0], (F32) t[1], (F32) t[2], (F32) t[3]); + } + else + { + tc_out->set((F32) t[0], (F32) t[1], 0.f, 0.f); + } - t += 4; + t += 4; - tc_out->div(65535.f); - tc_out->mul(tc_range); - tc_out->add(min_tc4); + tc_out->div(65535.f); + tc_out->mul(tc_range); + tc_out->add(min_tc4); - tc_out++; + tc_out++; + } + } + else + { + memset(tc_out, 0, sizeof(LLVector2)*num_verts); } } @@ -2656,6 +2675,25 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) min.setMin(min, face.mPositions[i]); max.setMax(max, face.mPositions[i]); } + + if (face.mTexCoords) + { + LLVector2& min_tc = face.mTexCoordExtents[0]; + LLVector2& max_tc = face.mTexCoordExtents[1]; + + min_tc = face.mTexCoords[0]; + max_tc = face.mTexCoords[0]; + + for (U32 j = 1; j < face.mNumVertices; ++j) + { + update_min_max(min_tc, max_tc, face.mTexCoords[j]); + } + } + else + { + face.mTexCoordExtents[0].set(0,0); + face.mTexCoordExtents[1].set(1,1); + } } } } @@ -5696,8 +5734,23 @@ BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) void LLVolumeFace::getVertexData(U16 index, LLVolumeFace::VertexData& cv) { cv.setPosition(mPositions[index]); - cv.setNormal(mNormals[index]); - cv.mTexCoord = mTexCoords[index]; + if (mNormals) + { + cv.setNormal(mNormals[index]); + } + else + { + cv.getNormal().clear(); + } + + if (mTexCoords) + { + cv.mTexCoord = mTexCoords[index]; + } + else + { + cv.mTexCoord.clear(); + } } bool LLVolumeFace::VertexMapData::operator==(const LLVolumeFace::VertexData& rhs) const @@ -5727,7 +5780,10 @@ void LLVolumeFace::optimize(F32 angle_cutoff) LLVolumeFace new_face; //map of points to vector of vertices at that point - VertexMapData::PointMap point_map; + std::map > point_map; + + LLVector4a range; + range.setSub(mExtents[1],mExtents[0]); //remove redundant vertices for (U32 i = 0; i < mNumIndices; ++i) @@ -5738,7 +5794,19 @@ void LLVolumeFace::optimize(F32 angle_cutoff) getVertexData(index, cv); BOOL found = FALSE; - VertexMapData::PointMap::iterator point_iter = point_map.find(LLVector3(cv.getPosition().getF32ptr())); + + LLVector4a pos; + pos.setSub(mPositions[index], mExtents[0]); + pos.div(range); + + U64 pos64 = 0; + + pos64 = (U16) (pos[0]*65535); + pos64 = pos64 | (((U64) (pos[1]*65535)) << 16); + pos64 = pos64 | (((U64) (pos[2]*65535)) << 32); + + std::map >::iterator point_iter = point_map.find(pos64); + if (point_iter != point_map.end()) { //duplicate point might exist for (U32 j = 0; j < point_iter->second.size(); ++j) @@ -5770,11 +5838,26 @@ void LLVolumeFace::optimize(F32 angle_cutoff) } else { - point_map[LLVector3(d.getPosition().getF32ptr())].push_back(d); + point_map[pos64].push_back(d); } } } + llassert(new_face.mNumIndices == mNumIndices); + llassert(new_face.mNumVertices <= mNumVertices); + + if (angle_cutoff > 1.f && !mNormals) + { + ll_aligned_free_16(new_face.mNormals); + new_face.mNormals = NULL; + } + + if (!mTexCoords) + { + ll_aligned_free_16(new_face.mTexCoords); + new_face.mTexCoords = NULL; + } + swapData(new_face); } diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index e0cfa07614..7c9dba9597 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "llmodel.h" +#include "llmemory.h" #include "llconvexdecomposition.h" #include "llsdserialize.h" #include "llvector4a.h" @@ -71,88 +72,10 @@ LLModel::~LLModel() } } -void load_face_from_dom_inputs(LLVolumeFace& face, const domInputLocalOffset_Array& inputs, U32 min_idx, U32 max_idx) -{ - for (U32 j = 0; j < inputs.getCount(); ++j) - { - if (strcmp(COMMON_PROFILE_INPUT_VERTEX, inputs[j]->getSemantic()) == 0) - { //found vertex array - const domURIFragmentType& uri = inputs[j]->getSource(); - daeElementRef elem = uri.getElement(); - domVertices* vertices = (domVertices*) elem.cast(); - - domInputLocal_Array& v_inp = vertices->getInput_array(); - if (inputs[j]->getOffset() != 0) - { - llerrs << "Vertex array offset MUST be zero." << llendl; - } - - for (U32 k = 0; k < v_inp.getCount(); ++k) - { - if (strcmp(COMMON_PROFILE_INPUT_POSITION, v_inp[k]->getSemantic()) == 0) - { - const domURIFragmentType& uri = v_inp[k]->getSource(); - - daeElementRef elem = uri.getElement(); - domSource* src = (domSource*) elem.cast(); - - if (src->getTechnique_common()->getAccessor()->getStride() != 3) - { - llerrs << "Vertex array stride MUST be three." << llendl; - } - - domListOfFloats& v = src->getFloat_array()->getValue(); - - LLVector4a min; - min.set(v[min_idx], v[min_idx+1], v[min_idx+2]); - LLVector4a max = min; - - for (U32 j = min_idx; j <= max_idx; ++j) - { //copy vertex array - face.mPositions[j-min_idx].set(v[j*3+0], v[j*3+1], v[j*3+2]); - update_min_max(min, max, face.mPositions[j-min_idx]); - } - - face.mExtents[0] = min; - face.mExtents[1] = max; - } - } - } - - if (strcmp(COMMON_PROFILE_INPUT_NORMAL, inputs[j]->getSemantic()) == 0) - { - //found normal array for this triangle list - const domURIFragmentType& uri = inputs[j]->getSource(); - daeElementRef elem = uri.getElement(); - domSource* src = (domSource*) elem.cast(); - domListOfFloats& n = src->getFloat_array()->getValue(); - - for (U32 j = min_idx; j <= max_idx; ++j) - { - LLVector4a* norm = (LLVector4a*) face.mNormals + (j-min_idx); - norm->set(n[j*3+0], n[j*3+1], n[j*3+2]); - norm->normalize3(); - } - } - else if (strcmp(COMMON_PROFILE_INPUT_TEXCOORD, inputs[j]->getSemantic()) == 0) - { //found texCoords - const domURIFragmentType& uri = inputs[j]->getSource(); - daeElementRef elem = uri.getElement(); - domSource* src = (domSource*) elem.cast(); - domListOfFloats& u = src->getFloat_array()->getValue(); - - for (U32 j = min_idx; j <= max_idx; ++j) - { - face.mTexCoords[j-min_idx].setVec(u[j*2+0], u[j*2+1]); - } - } - } -} bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S32& tc_offset, S32& norm_offset, S32 &idx_stride, domSource* &pos_source, domSource* &tc_source, domSource* &norm_source) { - idx_stride = 0; for (U32 j = 0; j < inputs.getCount(); ++j) @@ -271,14 +194,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa cv.mTexCoord.setVec(tc[idx[i+tc_offset]*2+0], tc[idx[i+tc_offset]*2+1]); } - + if (norm_source) { cv.setNormal(LLVector4a(n[idx[i+norm_offset]*3+0], n[idx[i+norm_offset]*3+1], n[idx[i+norm_offset]*3+2])); } - BOOL found = FALSE; @@ -329,10 +251,22 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa { face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(verts, indices); + LLVolumeFace& new_face = *face_list.rbegin(); + if (!norm_source) + { + ll_aligned_free_16(new_face.mNormals); + new_face.mNormals = NULL; + } + + if (!tc_source) + { + ll_aligned_free_16(face.mTexCoords); + new_face.mTexCoords = NULL; + } + face = LLVolumeFace(); point_map.clear(); } - } if (!verts.empty()) @@ -348,6 +282,18 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(verts, indices); + LLVolumeFace& new_face = *face_list.rbegin(); + if (!norm_source) + { + ll_aligned_free_16(new_face.mNormals); + new_face.mNormals = NULL; + } + + if (!tc_source) + { + ll_aligned_free_16(face.mTexCoords); + new_face.mTexCoords = NULL; + } } return LLModel::NO_ERRORS ; @@ -433,14 +379,14 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac cv.mTexCoord.setVec(tc[idx[cur_idx+tc_offset]*2+0], tc[idx[cur_idx+tc_offset]*2+1]); } - + if (norm_source) { cv.getNormal().set(n[idx[cur_idx+norm_offset]*3+0], n[idx[cur_idx+norm_offset]*3+1], n[idx[cur_idx+norm_offset]*3+2]); } - + cur_idx += idx_stride; BOOL found = FALSE; @@ -524,6 +470,19 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac { face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(verts, indices); + LLVolumeFace& new_face = *face_list.rbegin(); + if (!norm_source) + { + ll_aligned_free_16(new_face.mNormals); + new_face.mNormals = NULL; + } + + if (!tc_source) + { + ll_aligned_free_16(face.mTexCoords); + new_face.mTexCoords = NULL; + } + face = LLVolumeFace(); verts.clear(); indices.clear(); @@ -540,10 +499,23 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac { material = std::string(poly->getMaterial()); } - + materials.push_back(material); face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(verts, indices); + + LLVolumeFace& new_face = *face_list.rbegin(); + if (!norm_source) + { + ll_aligned_free_16(new_face.mNormals); + new_face.mNormals = NULL; + } + + if (!tc_source) + { + ll_aligned_free_16(face.mTexCoords); + new_face.mTexCoords = NULL; + } } return LLModel::NO_ERRORS ; @@ -557,7 +529,6 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac const domInputLocalOffset_Array& inputs = poly->getInput_array(); - S32 v_offset = -1; S32 n_offset = -1; S32 t_offset = -1; @@ -662,15 +633,14 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac n->get(n_idx+1), n->get(n_idx+2)); } - + if (t) { U32 t_idx = idx[j*stride+t_offset]*2; vert.mTexCoord.setVec(t->get(t_idx), t->get(t_idx+1)); } - - + verts.push_back(vert); } } @@ -733,6 +703,19 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac materials.push_back(material); face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(new_verts, indices); + + LLVolumeFace& new_face = *face_list.rbegin(); + if (!n) + { + ll_aligned_free_16(new_face.mNormals); + new_face.mNormals = NULL; + } + + if (!t) + { + ll_aligned_free_16(face.mTexCoords); + new_face.mTexCoords = NULL; + } } return LLModel::NO_ERRORS ; @@ -817,9 +800,9 @@ BOOL LLModel::createVolumeFacesFromDomMesh(domMesh* mesh) if (getNumVolumeFaces() > 0) { - optimizeVolumeFaces(); normalizeVolumeFaces(); - + optimizeVolumeFaces(); + if (getNumVolumeFaces() > 0) { return TRUE; @@ -853,81 +836,10 @@ void LLModel::offsetMesh( const LLVector3& pivotPoint ) void LLModel::optimizeVolumeFaces() { -#if 0 //VECTORIZE ? - for (std::vector::iterator iter = mVolumeFaces.begin(); iter != mVolumeFaces.end(); ) - { - std::vector::iterator cur_iter = iter++; - LLVolumeFace& face = *cur_iter; - - for (S32 i = 0; i < (S32) face.mNumIndices; i += 3) - { //remove zero area triangles - U16 i0 = face.mIndices[i+0]; - U16 i1 = face.mIndices[i+1]; - U16 i2 = face.mIndices[i+2]; - - if (i0 == i1 || - i1 == i2 || - i0 == i2) - { //duplicate index in triangle, remove triangle - face.mIndices.erase(face.mIndices.begin()+i, face.mIndices.begin()+i+3); - i -= 3; - } - else - { - LLVolumeFace::VertexData& v0 = face.mVertices[i0]; - LLVolumeFace::VertexData& v1 = face.mVertices[i1]; - LLVolumeFace::VertexData& v2 = face.mVertices[i2]; - - if (v0.mPosition == v1.mPosition || - v1.mPosition == v2.mPosition || - v2.mPosition == v0.mPosition) - { //zero area triangle, delete - face.mIndices.erase(face.mIndices.begin()+i, face.mIndices.begin()+i+3); - i-=3; - } - } - } - - //remove unreference vertices - std::vector ref; - ref.resize(face.mNumVertices); - - for (U32 i = 0; i < ref.size(); ++i) - { - ref[i] = false; - } - - for (U32 i = 0; i < face.mNumIndices; ++i) - { - ref[face.mIndices[i]] = true; - } - - U32 unref_count = 0; - for (U32 i = 0; i < ref.size(); ++i) - { - if (!ref[i]) - { - //vertex is unreferenced - face.mVertices.erase(face.mVertices.begin()+(i-unref_count)); - U16 idx = (U16) (i-unref_count); - - for (U32 j = 0; j < face.mNumIndices; ++j) - { //decrement every index array value greater than idx - if (face.mIndices[j] > idx) - { - --face.mIndices[j]; - } - } - ++unref_count; - } - } - - if (face.mVertices.empty() || face.mIndices.empty()) - { //face is empty, remove it - iter = mVolumeFaces.erase(cur_iter); - } + for (U32 i = 0; i < getNumVolumeFaces(); ++i) + { + mVolumeFaces[i].optimize(); } -#endif } // Shrink the model to fit @@ -962,6 +874,25 @@ void LLModel::normalizeVolumeFaces() update_min_max(min, max, face.mExtents[0]); update_min_max(min, max, face.mExtents[1]); + + if (face.mTexCoords) + { + LLVector2& min_tc = face.mTexCoordExtents[0]; + LLVector2& max_tc = face.mTexCoordExtents[1]; + + min_tc = face.mTexCoords[0]; + max_tc = face.mTexCoords[0]; + + for (U32 j = 1; j < face.mNumVertices; ++j) + { + update_min_max(min_tc, max_tc, face.mTexCoords[j]); + } + } + else + { + face.mTexCoordExtents[0].set(0,0); + face.mTexCoordExtents[1].set(1,1); + } } // Now that we have the extents of the model @@ -1029,8 +960,11 @@ void LLModel::normalizeVolumeFaces() { pos[j].add(trans); pos[j].mul(scale); - norm[j].mul(inv_scale); - norm[j].normalize3(); + if (norm && !norm[j].equals3(LLVector4a::getZero())) + { + norm[j].mul(inv_scale); + norm[j].normalize3(); + } } } @@ -1073,8 +1007,26 @@ void LLModel::setVolumeFaceData( face.resizeIndices(num_indices); LLVector4a::memcpyNonAliased16((F32*) face.mPositions, (F32*) pos.get(), num_verts*4*sizeof(F32)); - LLVector4a::memcpyNonAliased16((F32*) face.mNormals, (F32*) norm.get(), num_verts*4*sizeof(F32)); - LLVector4a::memcpyNonAliased16((F32*) face.mTexCoords, (F32*) tc.get(), num_verts*2*sizeof(F32)); + if (norm.get()) + { + LLVector4a::memcpyNonAliased16((F32*) face.mNormals, (F32*) norm.get(), num_verts*4*sizeof(F32)); + } + else + { + ll_aligned_free_16(face.mNormals); + face.mNormals = NULL; + } + + if (tc.get()) + { + LLVector4a::memcpyNonAliased16((F32*) face.mTexCoords, (F32*) tc.get(), num_verts*2*sizeof(F32)); + } + else + { + ll_aligned_free_16(face.mTexCoords); + face.mTexCoords = NULL; + } + U32 size = (num_indices*2+0xF)&~0xF; LLVector4a::memcpyNonAliased16((F32*) face.mIndices, (F32*) ind.get(), size); } @@ -1477,9 +1429,8 @@ LLSD LLModel::writeModel( { //for each vert F32* pos = face.mPositions[j].getF32ptr(); - F32* norm = face.mNormals[j].getF32ptr(); - - //position + normal + + //position for (U32 k = 0; k < 3; ++k) { //for each component //convert to 16-bit normalized across domain @@ -1489,29 +1440,41 @@ LLSD LLModel::writeModel( //write to binary buffer verts[vert_idx++] = buff[0]; verts[vert_idx++] = buff[1]; - - //convert to 16-bit normalized - val = (U16) ((norm[k]+1.f)*0.5f*65535); + } - //write to binary buffer - normals[norm_idx++] = buff[0]; - normals[norm_idx++] = buff[1]; + if (face.mNormals) + { //normals + F32* norm = face.mNormals[j].getF32ptr(); + + for (U32 k = 0; k < 3; ++k) + { //for each component + //convert to 16-bit normalized + U16 val = (U16) ((norm[k]+1.f)*0.5f*65535); + U8* buff = (U8*) &val; + + //write to binary buffer + normals[norm_idx++] = buff[0]; + normals[norm_idx++] = buff[1]; + } } + F32* src_tc = (F32*) face.mTexCoords[j].mV; //texcoord - for (U32 k = 0; k < 2; ++k) - { //for each component - //convert to 16-bit normalized - U16 val = (U16) ((src_tc[k]-min_tc.mV[k])/tc_range.mV[k]*65535); - - U8* buff = (U8*) &val; - //write to binary buffer - tc[tc_idx++] = buff[0]; - tc[tc_idx++] = buff[1]; + if (face.mTexCoords) + { + for (U32 k = 0; k < 2; ++k) + { //for each component + //convert to 16-bit normalized + U16 val = (U16) ((src_tc[k]-min_tc.mV[k])/tc_range.mV[k]*65535); + + U8* buff = (U8*) &val; + //write to binary buffer + tc[tc_idx++] = buff[0]; + tc[tc_idx++] = buff[1]; + } } - } U32 idx_idx = 0; @@ -1525,12 +1488,20 @@ LLSD LLModel::writeModel( //write out face data mdl[model_names[idx]][i]["PositionDomain"]["Min"] = min_pos.getValue(); mdl[model_names[idx]][i]["PositionDomain"]["Max"] = max_pos.getValue(); - mdl[model_names[idx]][i]["TexCoord0Domain"]["Min"] = min_tc.getValue(); - mdl[model_names[idx]][i]["TexCoord0Domain"]["Max"] = max_tc.getValue(); - mdl[model_names[idx]][i]["Position"] = verts; - mdl[model_names[idx]][i]["Normal"] = normals; - mdl[model_names[idx]][i]["TexCoord0"] = tc; + + if (face.mNormals) + { + mdl[model_names[idx]][i]["Normal"] = normals; + } + + if (face.mTexCoords) + { + mdl[model_names[idx]][i]["TexCoord0Domain"]["Min"] = min_tc.getValue(); + mdl[model_names[idx]][i]["TexCoord0Domain"]["Max"] = max_tc.getValue(); + mdl[model_names[idx]][i]["TexCoord0"] = tc; + } + mdl[model_names[idx]][i]["TriangleList"] = indices; if (skinning) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 866cc39eec..a4683b4874 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3719,7 +3719,9 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 tri_count = 0; for (U32 i = 0; i < mVertexBuffer[5][mdl].size(); ++i) { - mVertexBuffer[5][mdl][i]->setBuffer(type_mask); + LLVertexBuffer* buff = mVertexBuffer[5][mdl][i]; + buff->setBuffer(type_mask & buff->getTypeMask()); + U32 num_indices = mVertexBuffer[5][mdl][i]->getNumIndices(); if (num_indices > 2) { @@ -3841,6 +3843,8 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim for (GLint i = 0; i < patch_count; ++i) { + type_mask = mVertexBuffer[5][base][i]->getTypeMask(); + LLPointer buff = new LLVertexBuffer(type_mask, 0); if (sizes[i*2+1] > 0 && sizes[i*2] > 0) @@ -3865,8 +3869,15 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim LLStrider index; buff->getVertexStrider(pos); - buff->getNormalStrider(norm); - buff->getTexCoord0Strider(tc); + if (type_mask & LLVertexBuffer::MAP_NORMAL) + { + buff->getNormalStrider(norm); + } + if (type_mask & LLVertexBuffer::MAP_TEXCOORD0) + { + buff->getTexCoord0Strider(tc); + } + buff->getIndexStrider(index); target_model->setVolumeFaceData(names[i], pos, norm, tc, index, buff->getNumVerts(), buff->getNumIndices()); @@ -4462,7 +4473,16 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) bool skinned = include_skin_weights && !mdl->mSkinWeights.empty(); - U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; + U32 mask = LLVertexBuffer::MAP_VERTEX; + + if (vf.mNormals) + { + mask |= LLVertexBuffer::MAP_NORMAL; + } + if (vf.mTexCoords) + { + mask |= LLVertexBuffer::MAP_TEXCOORD0; + } if (skinned) { @@ -4480,8 +4500,6 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) LLStrider weights_strider; vb->getVertexStrider(vertex_strider); - vb->getNormalStrider(normal_strider); - vb->getTexCoord0Strider(tc_strider); vb->getIndexStrider(index_strider); if (skinned) @@ -4490,8 +4508,18 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) } LLVector4a::memcpyNonAliased16((F32*) vertex_strider.get(), (F32*) vf.mPositions, num_vertices*4*sizeof(F32)); - LLVector4a::memcpyNonAliased16((F32*) tc_strider.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32)); - LLVector4a::memcpyNonAliased16((F32*) normal_strider.get(), (F32*) vf.mNormals, num_vertices*4*sizeof(F32)); + + if (vf.mTexCoords) + { + vb->getTexCoord0Strider(tc_strider); + LLVector4a::memcpyNonAliased16((F32*) tc_strider.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32)); + } + + if (vf.mNormals) + { + vb->getNormalStrider(normal_strider); + LLVector4a::memcpyNonAliased16((F32*) normal_strider.get(), (F32*) vf.mNormals, num_vertices*4*sizeof(F32)); + } if (skinned) { @@ -4750,6 +4778,8 @@ BOOL LLModelPreview::render() const F32 BRIGHTNESS = 0.9f; gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); + const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; + LLGLEnable normalize(GL_NORMALIZE); if (!mBaseModel.empty() && mVertexBuffer[5].empty()) @@ -4798,8 +4828,8 @@ BOOL LLModelPreview::render() for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i) { LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i]; - - buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); + + buffer->setBuffer(type_mask & buffer->getTypeMask()); if (textures) { @@ -4918,7 +4948,7 @@ BOOL LLModelPreview::render() { LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; - buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); + buffer->setBuffer(type_mask & buffer->getTypeMask()); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -4984,7 +5014,7 @@ BOOL LLModelPreview::render() { LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; - buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); + buffer->setBuffer(type_mask & buffer->getTypeMask()); LLStrider pos_strider; buffer->getVertexStrider(pos_strider, 0); @@ -5109,7 +5139,7 @@ BOOL LLModelPreview::render() position[j] = v; } - buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); + buffer->setBuffer(type_mask & buffer->getTypeMask()); glColor4fv(instance.mMaterial[i].mDiffuseColor.mV); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); -- cgit v1.2.3 From aba4f7ddc89c9d28bdd4b02735134101f40634ed Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 20 Jun 2011 14:01:32 -0600 Subject: fix for SH-1870: can not upload book_collection_1.dae when include textures --- indra/llmessage/llcurl.cpp | 14 +++++++------- indra/llmessage/llcurl.h | 4 ++-- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llmeshrepository.cpp | 10 ++++++---- indra/newview/llmeshrepository.h | 3 +++ 5 files changed, 29 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 7c8b7e3584..44330cf8ff 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -244,7 +244,7 @@ public: U32 report(CURLcode); void getTransferInfo(LLCurl::TransferInfo* info); - void prepRequest(const std::string& url, const std::vector& headers, ResponderPtr, bool post = false); + void prepRequest(const std::string& url, const std::vector& headers, ResponderPtr, S32 time_out = 0, bool post = false); const char* getErrorBuffer(); @@ -525,7 +525,7 @@ size_t curlHeaderCallback(void* data, size_t size, size_t nmemb, void* user_data void LLCurl::Easy::prepRequest(const std::string& url, const std::vector& headers, - ResponderPtr responder, bool post) + ResponderPtr responder, S32 time_out, bool post) { resetState(); @@ -558,7 +558,7 @@ void LLCurl::Easy::prepRequest(const std::string& url, //don't verify host name so urls with scrubbed host names will work (improves DNS performance) setopt(CURLOPT_SSL_VERIFYHOST, 0); - setopt(CURLOPT_TIMEOUT, CURL_REQUEST_TIMEOUT); + setopt(CURLOPT_TIMEOUT, llmax(time_out, CURL_REQUEST_TIMEOUT)); setoptString(CURLOPT_URL, url); @@ -855,14 +855,14 @@ bool LLCurlRequest::getByteRange(const std::string& url, bool LLCurlRequest::post(const std::string& url, const headers_t& headers, const LLSD& data, - LLCurl::ResponderPtr responder) + LLCurl::ResponderPtr responder, S32 time_out) { LLCurl::Easy* easy = allocEasy(); if (!easy) { return false; } - easy->prepRequest(url, headers, responder); + easy->prepRequest(url, headers, responder, time_out); LLSDSerialize::toXML(data, easy->getInput()); S32 bytes = easy->getInput().str().length(); @@ -882,14 +882,14 @@ bool LLCurlRequest::post(const std::string& url, bool LLCurlRequest::post(const std::string& url, const headers_t& headers, const std::string& data, - LLCurl::ResponderPtr responder) + LLCurl::ResponderPtr responder, S32 time_out) { LLCurl::Easy* easy = allocEasy(); if (!easy) { return false; } - easy->prepRequest(url, headers, responder); + easy->prepRequest(url, headers, responder, time_out); easy->getInput().write(data.data(), data.size()); S32 bytes = easy->getInput().str().length(); diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 4ce3fa1078..5833a27b84 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -201,8 +201,8 @@ public: void get(const std::string& url, LLCurl::ResponderPtr responder); bool getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, LLCurl::ResponderPtr responder); - bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder); - bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder); + bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder, S32 time_out = 0); + bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder, S32 time_out = 0); S32 process(); S32 getQueued(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 76fecdf05e..52064c96f2 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5611,6 +5611,17 @@ Value 0 + MeshUploadTimeOut + + Comment + Maximum time in seconds for llcurl to execute a mesh uoloading request + Persist + 1 + Type + S32 + Value + 600 + MigrateCacheDirectory Comment diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 6e0722bcf9..2b340fc54d 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1383,6 +1383,8 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); mOrigin += gAgent.getAtAxis() * scale.magVec(); + + mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ; } LLMeshUploadThread::~LLMeshUploadThread() @@ -1686,7 +1688,7 @@ void LLMeshUploadThread::doWholeModelUpload() mPendingUploads++; LLCurlRequest::headers_t headers; mCurlRequest->post(mWholeModelFeeCapability, headers, model_data, - new LLWholeModelFeeResponder(this,model_data)); + new LLWholeModelFeeResponder(this,model_data), mMeshUploadTimeOut); do { @@ -1705,7 +1707,7 @@ void LLMeshUploadThread::doWholeModelUpload() LLSD body = full_model_data["asset_resources"]; dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num)); mCurlRequest->post(mWholeModelUploadURL, headers, body, - new LLWholeModelUploadResponder(this, model_data)); + new LLWholeModelUploadResponder(this, model_data), mMeshUploadTimeOut); do { mCurlRequest->process(); @@ -2874,7 +2876,7 @@ void LLMeshUploadThread::doUploadModel(LLMeshUploadData& data) LLCurlRequest::headers_t headers; mPendingUploads++; - mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLMeshUploadResponder(data, this)); + mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLMeshUploadResponder(data, this), mMeshUploadTimeOut); } } @@ -2906,7 +2908,7 @@ void LLMeshUploadThread::doUploadTexture(LLTextureUploadData& data) LLCurlRequest::headers_t headers; mPendingUploads++; - mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLTextureUploadResponder(data, this)); + mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLTextureUploadResponder(data, this), mMeshUploadTimeOut); } } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index f237c3a60e..f56734a7de 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -356,6 +356,9 @@ public: class LLMeshUploadThread : public LLThread { +private: + S32 mMeshUploadTimeOut ; //maximum time in seconds to execute an uploading request. + public: class DecompRequest : public LLPhysicsDecomp::Request { -- cgit v1.2.3 From 7201d55396be92b18074ac926698688f9067f222 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 20 Jun 2011 17:18:43 -0400 Subject: BUILDFIX: linux build broken - abs() used instead of fabs() linux caught the fact that we're using an integer absolute value function when we should be using a floating-point version. --- indra/llmath/llvolume.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7c7c4306da..d401ce7de7 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -32,6 +32,7 @@ #if !LL_WINDOWS #include #endif +#include #include "llerror.h" #include "llmemtype.h" @@ -2383,8 +2384,8 @@ bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs const F32 epsilon = 0.00001f; if (rhs.mData[POSITION].equals3(mData[POSITION], epsilon) && - abs(rhs.mTexCoord[0]-mTexCoord[0]) < epsilon && - abs(rhs.mTexCoord[1]-mTexCoord[1]) < epsilon) + fabs(rhs.mTexCoord[0]-mTexCoord[0]) < epsilon && + fabs(rhs.mTexCoord[1]-mTexCoord[1]) < epsilon) { if (angle_cutoff > 1.f) { -- cgit v1.2.3 From ce02ed3118a8a84df9bcbf39b4a5531e5c698561 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 20 Jun 2011 18:55:30 -0500 Subject: SH-1880 partial fix for crashing on daes without UVs. --- indra/llprimitive/llmodel.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 859dcbd489..8f2f24b747 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1414,13 +1414,19 @@ LLSD LLModel::writeModel( U32 tc_idx = 0; LLVector2* ftc = (LLVector2*) face.mTexCoords; - LLVector2 min_tc = ftc[0]; - LLVector2 max_tc = min_tc; - - //get texture coordinate domain - for (U32 j = 0; j < face.mNumVertices; ++j) + LLVector2 min_tc; + LLVector2 max_tc; + + if (ftc) { - update_min_max(min_tc, max_tc, ftc[j]); + min_tc = ftc[0]; + max_tc = min_tc; + + //get texture coordinate domain + for (U32 j = 0; j < face.mNumVertices; ++j) + { + update_min_max(min_tc, max_tc, ftc[j]); + } } LLVector2 tc_range = max_tc - min_tc; @@ -1457,8 +1463,7 @@ LLSD LLModel::writeModel( normals[norm_idx++] = buff[1]; } } - - + F32* src_tc = (F32*) face.mTexCoords[j].mV; //texcoord -- cgit v1.2.3 From 9afc77ba0affee16d9dbee312417aaef541eabba Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 21 Jun 2011 21:00:06 +0300 Subject: SH-1719 FIXED Viewer side cleanup of presentation of accounting data in build tools - Moved grid mode combo box to the grid options floater - Updated UI of the build floater according to the spec - Fixed "conflict" between LLFloaterOpenHandler and LLFloaterHandler command handlers --- indra/newview/app_settings/settings.xml | 11 ++ indra/newview/llfloaterbuildoptions.cpp | 68 ++++++- indra/newview/llfloaterbuildoptions.h | 23 ++- indra/newview/llfloatertools.cpp | 142 +++++--------- indra/newview/llfloatertools.h | 4 +- indra/newview/llviewerfloaterreg.cpp | 4 +- indra/newview/llviewermenu.cpp | 7 +- indra/newview/llviewerwindow.cpp | 6 + .../skins/default/xui/en/floater_build_options.xml | 73 +++++++- .../skins/default/xui/en/floater_model_wizard.xml | 2 +- .../newview/skins/default/xui/en/floater_tools.xml | 203 +++++++-------------- 11 files changed, 296 insertions(+), 247 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 52064c96f2..cf07350d85 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9398,6 +9398,17 @@ Value 0 + ShowAdvancedBuilderOptions + + Comment + Shows physics and display weight + Persist + 1 + Type + Boolean + Value + 0 + ShowAdvancedGraphicsSettings Comment diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp index 4b6fe4a115..86c1bf0534 100644 --- a/indra/newview/llfloaterbuildoptions.cpp +++ b/indra/newview/llfloaterbuildoptions.cpp @@ -34,15 +34,81 @@ #include "llfloaterbuildoptions.h" #include "lluictrlfactory.h" +#include "llcombobox.h" +#include "llselectmgr.h" + // // Methods // + +void commit_grid_mode(LLUICtrl *); + LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key) - : LLFloater(key) + : LLFloater(key), + mComboGridMode(NULL) { + mCommitCallbackRegistrar.add("GridOptions.gridMode", boost::bind(&commit_grid_mode,_1)); } LLFloaterBuildOptions::~LLFloaterBuildOptions() +{} + +BOOL LLFloaterBuildOptions::postBuild() +{ + mComboGridMode = getChild("combobox grid mode"); + + return TRUE; +} + +void LLFloaterBuildOptions::setGridMode(EGridMode mode) +{ + mComboGridMode->setCurrentByIndex((S32)mode); +} + +void LLFloaterBuildOptions::updateGridMode() { + if (mComboGridMode) + { + S32 index = mComboGridMode->getCurrentIndex(); + mComboGridMode->removeall(); + + switch (mObjectSelection->getSelectType()) + { + case SELECT_TYPE_HUD: + mComboGridMode->add(getString("grid_screen_text")); + mComboGridMode->add(getString("grid_local_text")); + break; + case SELECT_TYPE_WORLD: + mComboGridMode->add(getString("grid_world_text")); + mComboGridMode->add(getString("grid_local_text")); + mComboGridMode->add(getString("grid_reference_text")); + break; + case SELECT_TYPE_ATTACHMENT: + mComboGridMode->add(getString("grid_attachment_text")); + mComboGridMode->add(getString("grid_local_text")); + mComboGridMode->add(getString("grid_reference_text")); + break; + } + + mComboGridMode->setCurrentByIndex(index); + } +} + +// virtual +void LLFloaterBuildOptions::onOpen(const LLSD& key) +{ + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); } +// virtual +void LLFloaterBuildOptions::onClose(bool app_quitting) +{ + mObjectSelection = NULL; +} + +void commit_grid_mode(LLUICtrl *ctrl) +{ + LLComboBox* combo = (LLComboBox*)ctrl; + + LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex()); +} diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h index 164944d7bc..7f3811bf1c 100644 --- a/indra/newview/llfloaterbuildoptions.h +++ b/indra/newview/llfloaterbuildoptions.h @@ -33,15 +33,34 @@ #define LL_LLFLOATERBUILDOPTIONS_H #include "llfloater.h" +#include "llselectmgr.h" +class LLComboBox; +class LLObjectSelection; + +typedef LLSafeHandle LLObjectSelectionHandle; class LLFloaterBuildOptions : public LLFloater { - friend class LLFloaterReg; +public: + + virtual BOOL postBuild(); + + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + + void setGridMode(EGridMode mode); + void updateGridMode(); + private: + + friend class LLFloaterReg; + LLFloaterBuildOptions(const LLSD& key); ~LLFloaterBuildOptions(); -}; + LLComboBox* mComboGridMode; + LLObjectSelectionHandle mObjectSelection; +}; #endif diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 0d798afdcc..3e98cff9e6 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -36,7 +36,6 @@ #include "llagentcamera.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llcombobox.h" #include "lldraghandle.h" #include "llerror.h" #include "llfloaterbuildoptions.h" @@ -101,6 +100,7 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] = std::string("Content"), // PANEL_CONTENTS, }; + // Local prototypes void commit_select_component(void *data); void click_show_more(void*); @@ -116,7 +116,6 @@ void commit_radio_group_focus(LLUICtrl* ctrl); void commit_radio_group_move(LLUICtrl* ctrl); void commit_radio_group_edit(LLUICtrl* ctrl); void commit_radio_group_land(LLUICtrl* ctrl); -void commit_grid_mode(LLUICtrl *); void commit_slider_zoom(LLUICtrl *ctrl); @@ -234,7 +233,6 @@ BOOL LLFloaterTools::postBuild() getChild("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform")); mCheckStretchTexture = getChild("checkbox stretch textures"); getChild("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); - mComboGridMode = getChild("combobox grid mode"); mCheckStretchUniformLabel = getChild("checkbox uniform label"); // @@ -269,6 +267,8 @@ BOOL LLFloaterTools::postBuild() // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here getChild("slider force")->setValue(log10(gSavedSettings.getF32("LandBrushForce"))); + mCostTextBorder = getChild("cost_text_border"); + mTab = getChild("Object Info Tabs"); if(mTab) { @@ -311,7 +311,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCheckSnapToGrid(NULL), mBtnGridOptions(NULL), mTitleMedia(NULL), - mComboGridMode(NULL), mCheckStretchUniform(NULL), mCheckStretchTexture(NULL), mCheckStretchUniformLabel(NULL), @@ -344,6 +343,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mPanelFace(NULL), mPanelLandInfo(NULL), + mCostTextBorder(NULL), mTabLand(NULL), mDirty(TRUE), mNeedMediaTitle(TRUE) @@ -367,7 +367,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCommitCallbackRegistrar.add("BuildTool.selectComponent", boost::bind(&commit_select_component, this)); mCommitCallbackRegistrar.add("BuildTool.gridOptions", boost::bind(&LLFloaterTools::onClickGridOptions,this)); mCommitCallbackRegistrar.add("BuildTool.applyToSelection", boost::bind(&click_apply_to_selection, this)); - mCommitCallbackRegistrar.add("BuildTool.gridMode", boost::bind(&commit_grid_mode,_1)); mCommitCallbackRegistrar.add("BuildTool.commitRadioLand", boost::bind(&commit_radio_group_land,_1)); mCommitCallbackRegistrar.add("BuildTool.LandBrushForce", boost::bind(&commit_slider_dozer_force,_1)); mCommitCallbackRegistrar.add("BuildTool.AddMedia", boost::bind(&LLFloaterTools::onClickBtnAddMedia,this)); @@ -429,10 +428,10 @@ void LLFloaterTools::refresh() { std::string obj_count_string; LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - getChild("obj_count")->setTextArg("[COUNT]", obj_count_string); + getChild("selection_count")->setTextArg("[OBJ_COUNT]", obj_count_string); std::string prim_count_string; LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); - getChild("prim_count")->setTextArg("[COUNT]", prim_count_string); + getChild("selection_count")->setTextArg("[PRIM_COUNT]", prim_count_string); // calculate selection rendering cost if (sShowObjectCost) @@ -451,55 +450,46 @@ void LLFloaterTools::refresh() else #endif { - // Get the number of objects selected - std::string root_object_count_string; - std::string object_count_string; - - LLResMgr::getInstance()->getIntegerString( - root_object_count_string, - LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - LLResMgr::getInstance()->getIntegerString( - object_count_string, - LLSelectMgr::getInstance()->getSelection()->getObjectCount()); - - F32 obj_cost = - LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost(); - F32 link_cost = - LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost(); - F32 obj_physics_cost = - LLSelectMgr::getInstance()->getSelection()->getSelectedPhysicsCost(); - F32 link_physics_cost = - LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost(); - - // Update the text for the counts - childSetTextArg( - "linked_set_count", - "[COUNT]", - root_object_count_string); - childSetTextArg("object_count", "[COUNT]", object_count_string); - - // Update the text for the resource costs - childSetTextArg("linked_set_cost","[COST]",llformat("%.1f", link_cost)); - childSetTextArg("object_cost", "[COST]", llformat("%.1f", obj_cost)); - childSetTextArg("linked_set_cost","[PHYSICS]",llformat("%.1f", link_physics_cost)); - childSetTextArg("object_cost", "[PHYSICS]", llformat("%.1f", obj_physics_cost)); - - // Display rendering cost if needed - if (sShowObjectCost) + F32 link_phys_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost(); + F32 link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost(); + S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); + + LLStringUtil::format_map_t args; + args["OBJ_COUNT"] = llformat("%.1d", link_count); + args["PRIM_COUNT"] = llformat("%.1d", prim_count); + + std::ostringstream selection_info; + selection_info << getString("status_selectcount", args); + + bool show_prim_equiv = (link_cost != prim_count) && link_cost; + bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions"); + bool show_mesh_cost = gMeshRepo.meshRezEnabled(); + + if (show_prim_equiv && show_mesh_cost) { - std::string prim_cost_string; - LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); - getChild("RenderingCost")->setTextArg("[COUNT]", prim_cost_string); + selection_info << ": "; + args["SEL_WEIGHT"] = llformat("%.1f", link_cost); + selection_info << getString("status_selectprimequiv", args); } + if (show_adv_weight) + { + show_prim_equiv ? (selection_info << ",") : (selection_info << "."); - // disable the object and prim counts if nothing selected - bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); - childSetEnabled("linked_set_count", have_selection); - childSetEnabled("object_count", have_selection); - childSetEnabled("linked_set_cost", have_selection); - childSetEnabled("object_cost", have_selection); - getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); + childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost)); + childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost())); + } + else + { + selection_info<<"."; + } + getChild("selection_count")->setText(selection_info.str()); + + bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty(); + childSetVisible("selection_count", have_selection); + childSetVisible("selection_weight", have_selection && show_adv_weight); + childSetVisible("selection_empty", !have_selection); } @@ -664,33 +654,6 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mRadioGroupEdit->setValue("radio select face"); } - if (mComboGridMode) - { - mComboGridMode->setVisible( edit_visible ); - S32 index = mComboGridMode->getCurrentIndex(); - mComboGridMode->removeall(); - - switch (mObjectSelection->getSelectType()) - { - case SELECT_TYPE_HUD: - mComboGridMode->add(getString("grid_screen_text")); - mComboGridMode->add(getString("grid_local_text")); - //mComboGridMode->add(getString("grid_reference_text")); - break; - case SELECT_TYPE_WORLD: - mComboGridMode->add(getString("grid_world_text")); - mComboGridMode->add(getString("grid_local_text")); - mComboGridMode->add(getString("grid_reference_text")); - break; - case SELECT_TYPE_ATTACHMENT: - mComboGridMode->add(getString("grid_attachment_text")); - mComboGridMode->add(getString("grid_local_text")); - mComboGridMode->add(getString("grid_reference_text")); - break; - } - - mComboGridMode->setCurrentByIndex(index); - } // Snap to grid disabled for grab tool - very confusing if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ ); if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ ); @@ -739,6 +702,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) // Land buttons BOOL land_visible = (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance() ); + mCostTextBorder->setVisible(!land_visible); + if (mBtnLand) mBtnLand ->setToggleState( land_visible ); mRadioGroupLand->setVisible( land_visible ); @@ -791,15 +756,11 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) getChildView("Strength:")->setVisible( land_visible); } - bool show_mesh_cost = gMeshRepo.meshRezEnabled(); + bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty(); - getChildView("obj_count")->setVisible( !land_visible && !show_mesh_cost); - getChildView("prim_count")->setVisible( !land_visible && !show_mesh_cost); - getChildView("linked_set_count")->setVisible( !land_visible && show_mesh_cost); - getChildView("linked_set_cost")->setVisible( !land_visible && show_mesh_cost); - getChildView("object_count")->setVisible( !land_visible && show_mesh_cost); - getChildView("object_cost")->setVisible( !land_visible && show_mesh_cost); - getChildView("RenderingCost")->setVisible( !land_visible && sShowObjectCost); + getChildView("selection_count")->setVisible(!land_visible && have_selection); + getChildView("selection_weight")->setVisible(!land_visible && have_selection && gSavedSettings.getBOOL("ShowAdvancedBuilderOptions")); + getChildView("selection_empty")->setVisible(!land_visible && !have_selection); mTab->setVisible(!land_visible); mPanelLandInfo->setVisible(land_visible); @@ -1032,13 +993,6 @@ void commit_select_component(void *data) } } -void commit_grid_mode(LLUICtrl *ctrl) -{ - LLComboBox* combo = (LLComboBox*)ctrl; - - LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex()); -} - // static void LLFloaterTools::setObjectType( LLPCode pcode ) { diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index fd81a75397..69636190fc 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -32,7 +32,6 @@ #include "llparcelselection.h" class LLButton; -class LLComboBox; class LLCheckBoxCtrl; class LLPanelPermissions; class LLPanelObject; @@ -140,7 +139,6 @@ public: LLCheckBoxCtrl* mCheckSnapToGrid; LLButton* mBtnGridOptions; - LLComboBox* mComboGridMode; LLCheckBoxCtrl* mCheckStretchUniform; LLCheckBoxCtrl* mCheckStretchTexture; @@ -179,6 +177,8 @@ public: LLPanelFace *mPanelFace; LLPanelLandInfo *mPanelLandInfo; + LLViewBorder* mCostTextBorder; + LLTabContainer* mTabLand; LLParcelSelectionHandle mParcelSelection; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index a1c2c926af..f3b22eab40 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -129,12 +129,12 @@ // *NOTE: Please add files in alphabetical order to keep merges easy. -// handle secondlife:///app/floater/{NAME} URLs +// handle secondlife:///app/openfloater/{NAME} URLs class LLFloaterOpenHandler : public LLCommandHandler { public: // requires trusted browser to trigger - LLFloaterOpenHandler() : LLCommandHandler("floater", UNTRUSTED_THROTTLE) { } + LLFloaterOpenHandler() : LLCommandHandler("openfloater", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 41d8b57f36..4bf5454905 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -60,6 +60,7 @@ #include "llfloatersnapshot.h" #include "llfloatertools.h" #include "llfloaterworldmap.h" +#include "llfloaterbuildoptions.h" #include "llavataractions.h" #include "lllandmarkactions.h" #include "llgroupmgr.h" @@ -7159,9 +7160,11 @@ class LLToolsUseSelectionForGrid : public view_listener_t } func; LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func); LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT); - if (gFloaterTools) + + LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance("build_options"); + if (build_options_floater && build_options_floater->getVisible()) { - gFloaterTools->mComboGridMode->setCurrentByIndex((S32)GRID_MODE_REF_OBJECT); + build_options_floater->setGridMode(GRID_MODE_REF_OBJECT); } return true; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b1441cc281..1dffb9e5e3 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3142,6 +3142,12 @@ void LLViewerWindow::updateLayout() //gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible()); } + LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance("build_options"); + if (build_options_floater && build_options_floater->getVisible()) + { + build_options_floater->updateGridMode(); + } + // Always update console if(gConsole) { diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml index 56230e912c..c247a12e7a 100644 --- a/indra/newview/skins/default/xui/en/floater_build_options.xml +++ b/indra/newview/skins/default/xui/en/floater_build_options.xml @@ -2,27 +2,84 @@ + + Screen + + + Local + + + World + + + Reference + + + Attachment + + + Mode + + + + + + + + top_pad="4" + width="200" /> + width="200" /> -Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/floater/upload_model Advanced Mesh Import Window] . +Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/openfloater/upload_model Advanced Mesh Import Window] . diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 7441b2cd9c..aad94f5b47 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -47,24 +47,12 @@ Click and drag to select land - Screen + name="status_selectcount"> + [OBJ_COUNT] objects ( [PRIM_COUNT] prims ) selected - Local - - - World - - - Reference - - - Attachment + name="status_selectprimequiv"> + PE weight [SEL_WEIGHT] @@ -385,7 +349,7 @@ left="10" name="ToolCube" tool_tip="Cube" - top="51" + top="58" width="20" /> + + Nothing selected. + - Objects: [COUNT] + left="10" + name="selection_count" + top_delta="0" + visible="false" + width="280"> - Prims: [COUNT] + text_color="LtGray_50" + type="string" + length="1" + height="16" + follows="left|top" + font="SansSerifSmall" + layout="topleft" + left="10" + name="selection_weight" + top_pad="0" + visible="false" + width="280"> + Physics weight [PHYS_WEIGHT], Display weight [DISP_WEIGHT]. - - Linked Sets: [COUNT] - - - Cost: [COST] / [PHYSICS] - - - Objects: [COUNT] - - - Cost: [COST] / [PHYSICS] - @@ -858,6 +782,15 @@ + Date: Tue, 21 Jun 2011 12:00:38 -0600 Subject: debug code for SH-692: Viewer Crash when enabling Render Metadata > Physics Shapes on Mesh Sandbox 25 on Windows XP --- indra/llrender/llvertexbuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 4a0b964e61..d5a7159ee3 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -240,7 +240,8 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) void LLVertexBuffer::drawArrays(U32 mode, const std::vector& pos, const std::vector& norm) { U32 count = pos.size(); - llassert(norm.size() >= pos.size()); + llassert_always(norm.size() >= pos.size()); + llassert_always(count > 0) ; unbind(); -- cgit v1.2.3 From 969a6f9be2eadcdc93fec3ace3be06a8cdbc509d Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 21 Jun 2011 15:02:34 -0700 Subject: Fix for memory leak & extra inventory observers in start_new_inventory_observer. Reviewed by Richard --- indra/newview/llviewermessage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7ab335314a..b840991bbc 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -936,7 +936,6 @@ protected: //one global instance to bind them LLOpenTaskOffer* gNewInventoryObserver=NULL; - class LLNewInventoryHintObserver : public LLInventoryAddedObserver { protected: @@ -946,6 +945,8 @@ protected: } }; +LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL; + void start_new_inventory_observer() { if (!gNewInventoryObserver) //task offer observer @@ -962,7 +963,12 @@ void start_new_inventory_observer() gInventory.addObserver(gInventoryMoveObserver); } - gInventory.addObserver(new LLNewInventoryHintObserver()); + if (!gNewInventoryHintObserver) + { + // Observer is deleted by gInventory + gNewInventoryHintObserver = new LLNewInventoryHintObserver(); + gInventory.addObserver(gNewInventoryHintObserver); + } } class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver -- cgit v1.2.3 From d625706d84cbb69d99497d3ee328105907867181 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 22 Jun 2011 19:31:03 +0300 Subject: SH-1725 WIP Floater upload model wizard update: - XUI changed according to latest mockups - Added switching to advanced upload floater - Added "Recalculate geometry" and "Recalculate physics" buttons --- indra/newview/llfloatermodelpreview.cpp | 7 + indra/newview/llfloatermodelpreview.h | 1 + indra/newview/llfloatermodelwizard.cpp | 146 ++-- indra/newview/llfloatermodelwizard.h | 12 +- .../skins/default/xui/en/floater_model_wizard.xml | 771 ++++++++------------- 5 files changed, 390 insertions(+), 547 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 9721fc9224..06a1225905 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -544,6 +544,13 @@ void LLFloaterModelPreview::loadModel(S32 lod) (new LLMeshFilePicker(mModelPreview, lod))->getFile(); } +void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name) +{ + mModelPreview->mLoading = true; + + mModelPreview->loadModel(file_name, lod); +} + //static void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata) { diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index ccd6fef953..d78135779e 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -185,6 +185,7 @@ public: void updateResourceCost(); void loadModel(S32 lod); + void loadModel(S32 lod, const std::string& file_name); void onViewOptionChecked(const LLSD& userdata); bool isViewOptionChecked(const LLSD& userdata); diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index 707c8288df..61b8032625 100644 --- a/indra/newview/llfloatermodelwizard.cpp +++ b/indra/newview/llfloatermodelwizard.cpp @@ -46,12 +46,18 @@ static const std::string stateNames[]={ "choose_file", "optimize", "physics", - "physics2", "review", "upload"}; +static void swap_controls(LLUICtrl* first_ctrl, LLUICtrl* second_ctrl, bool first_ctr_visible); + LLFloaterModelWizard::LLFloaterModelWizard(const LLSD& key) : LLFloater(key) + ,mRecalculateGeometryBtn(NULL) + ,mRecalculatePhysicsBtn(NULL) + ,mRecalculatingPhysicsBtn(NULL) + ,mCalculateWeightsBtn(NULL) + ,mCalculatingWeightsBtn(NULL) { mLastEnabledState = CHOOSE_FILE; sInstance = this; @@ -59,7 +65,6 @@ LLFloaterModelWizard::LLFloaterModelWizard(const LLSD& key) mCommitCallbackRegistrar.add("Wizard.Choose", boost::bind(&LLFloaterModelWizard::setState, this, CHOOSE_FILE)); mCommitCallbackRegistrar.add("Wizard.Optimize", boost::bind(&LLFloaterModelWizard::setState, this, OPTIMIZE)); mCommitCallbackRegistrar.add("Wizard.Physics", boost::bind(&LLFloaterModelWizard::setState, this, PHYSICS)); - mCommitCallbackRegistrar.add("Wizard.Physics2", boost::bind(&LLFloaterModelWizard::setState, this, PHYSICS2)); mCommitCallbackRegistrar.add("Wizard.Review", boost::bind(&LLFloaterModelWizard::setState, this, REVIEW)); mCommitCallbackRegistrar.add("Wizard.Upload", boost::bind(&LLFloaterModelWizard::setState, this, UPLOAD)); } @@ -91,6 +96,8 @@ void LLFloaterModelWizard::setState(int state) getChildView("next")->setVisible(true); getChildView("upload")->setVisible(false); getChildView("cancel")->setVisible(true); + mCalculateWeightsBtn->setVisible(false); + mCalculatingWeightsBtn->setVisible(false); } if (state == OPTIMIZE) @@ -108,6 +115,8 @@ void LLFloaterModelWizard::setState(int state) getChildView("next")->setVisible(true); getChildView("upload")->setVisible(false); getChildView("cancel")->setVisible(true); + mCalculateWeightsBtn->setVisible(false); + mCalculatingWeightsBtn->setVisible(false); } if (state == PHYSICS) @@ -119,30 +128,14 @@ void LLFloaterModelWizard::setState(int state) mModelPreview->mViewOption["show_physics"] = true; - getChildView("next")->setVisible(true); - getChildView("upload")->setVisible(false); - getChildView("close")->setVisible(false); - getChildView("back")->setVisible(true); - getChildView("back")->setEnabled(true); - getChildView("cancel")->setVisible(true); - } - - if (state == PHYSICS2) - { - if (mLastEnabledState < state) - { - executePhysicsStage("Decompose"); - } - - mModelPreview->mViewOption["show_physics"] = true; - - getChildView("next")->setVisible(true); - getChildView("next")->setEnabled(true); + getChildView("next")->setVisible(false); getChildView("upload")->setVisible(false); getChildView("close")->setVisible(false); getChildView("back")->setVisible(true); getChildView("back")->setEnabled(true); getChildView("cancel")->setVisible(true); + mCalculateWeightsBtn->setVisible(true); + mCalculatingWeightsBtn->setVisible(false); } if (state == REVIEW) @@ -156,6 +149,8 @@ void LLFloaterModelWizard::setState(int state) getChildView("back")->setEnabled(true); getChildView("upload")->setVisible(true); getChildView("cancel")->setVisible(true); + mCalculateWeightsBtn->setVisible(false); + mCalculatingWeightsBtn->setVisible(false); } if (state == UPLOAD) @@ -165,6 +160,8 @@ void LLFloaterModelWizard::setState(int state) getChildView("back")->setVisible(false); getChildView("upload")->setVisible(false); getChildView("cancel")->setVisible(false); + mCalculateWeightsBtn->setVisible(false); + mCalculatingWeightsBtn->setVisible(false); } updateButtons(); @@ -198,18 +195,48 @@ void LLFloaterModelWizard::updateButtons() button->setEnabled(FALSE); } } +} - LLButton *physics_button = getChild(stateNames[PHYSICS]+"_btn"); - - if (mState == PHYSICS2) +void LLFloaterModelWizard::onClickSwitchToAdvanced() +{ + LLFloaterModelPreview* floater_preview = LLFloaterReg::getTypedInstance("upload_model"); + if (!floater_preview) { - physics_button->setVisible(false); + llwarns << "FLoater model preview not found." << llendl; + return; } - else + + // Open floater model preview + floater_preview->openFloater(); + + // Close the wizard + closeFloater(); + + std::string filename = getChild("lod_file")->getValue().asString(); + if (!filename.empty()) { - physics_button->setVisible(true); + // Re-load the model to the floater model preview if it has been loaded + // into the wizard. + floater_preview->loadModel(3, filename); } +} + +void LLFloaterModelWizard::onClickRecalculateGeometry() +{ + S32 val = getChild("accuracy_slider")->getValue().asInteger(); + + mModelPreview->genLODs(-1, NUM_LOD - val); + mModelPreview->refresh(); +} + +void LLFloaterModelWizard::onClickRecalculatePhysics() +{ + // Hide the "Recalculate physics" button and show the "Recalculating..." + // button instead. + swap_controls(mRecalculatePhysicsBtn, mRecalculatingPhysicsBtn, false); + + executePhysicsStage("Decompose"); } void LLFloaterModelWizard::loadModel() @@ -471,6 +498,11 @@ void LLFloaterModelWizard::DecompRequest::completed() { executePhysicsStage("Simplify"); } + else + { + // Decomp request is complete so we can enable the "Recalculate physics" button again. + swap_controls(sInstance->mRecalculatePhysicsBtn, sInstance->mRecalculatingPhysicsBtn, true); + } } @@ -488,10 +520,22 @@ BOOL LLFloaterModelWizard::postBuild() getChild("next")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickNext, this)); getChild("preview_lod_combo")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPreviewLODCommit, this, _1)); getChild("preview_lod_combo2")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPreviewLODCommit, this, _1)); - getChild("preview_lod_combo3")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPreviewLODCommit, this, _1)); - getChild("accuracy_slider")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onAccuracyPerformance, this, _2)); getChild("upload")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onUpload, this)); - getChild("physics_slider")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPhysicsChanged, this)); + getChild("switch_to_advanced")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickSwitchToAdvanced, this)); + + mRecalculateGeometryBtn = getChild("recalculate_geometry_btn"); + mRecalculateGeometryBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickRecalculateGeometry, this)); + + mRecalculatePhysicsBtn = getChild("recalculate_physics_btn"); + mRecalculatePhysicsBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickRecalculatePhysics, this)); + + mRecalculatingPhysicsBtn = getChild("recalculating_physics_btn"); + + mCalculateWeightsBtn = getChild("calculate"); + // *TODO: Change the callback to upload fee request. + mCalculateWeightsBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickNext, this)); + + mCalculatingWeightsBtn = getChild("calculating"); LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -532,22 +576,19 @@ void LLFloaterModelWizard::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F panel->childSetText("dimension_x", llformat("%.1f", x)); panel->childSetText("dimension_y", llformat("%.1f", y)); panel->childSetText("dimension_z", llformat("%.1f", z)); - panel->childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost)); - panel->childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost)); } } + + childSetTextArg("review_prim_equiv", "[EQUIV]", llformat("%d", mModelPreview->mResourceCost)); + + // *TODO: Get the actual upload fee. + childSetTextArg("review_fee", "[FEE]", llformat("%d", 0)); + childSetTextArg("charged_fee", "[FEE]", llformat("%d", 0)); } void LLFloaterModelWizard::modelLoadedCallback() { mLastEnabledState = CHOOSE_FILE; - getChild("confirm_checkbox")->set(FALSE); - updateButtons(); -} - -void LLFloaterModelWizard::onPhysicsChanged() -{ - mLastEnabledState = PHYSICS; updateButtons(); } @@ -562,16 +603,6 @@ void LLFloaterModelWizard::onUpload() } -void LLFloaterModelWizard::onAccuracyPerformance(const LLSD& data) -{ - int val = (int) data.asInteger(); - - mModelPreview->genLODs(-1, NUM_LOD-val); - - mModelPreview->refresh(); -} - - void LLFloaterModelWizard::onPreviewLODCommit(LLUICtrl* ctrl) { if (!mModelPreview) @@ -601,11 +632,6 @@ void LLFloaterModelWizard::refresh() getChildView("next")->setEnabled(model_loaded); } - if (mState == REVIEW) - { - getChildView("upload")->setEnabled(getChild("confirm_checkbox")->getValue().asBoolean()); - } - } void LLFloaterModelWizard::draw() @@ -613,12 +639,11 @@ void LLFloaterModelWizard::draw() refresh(); LLFloater::draw(); - LLRect r = getRect(); - - mModelPreview->update(); if (mModelPreview) { + mModelPreview->update(); + gGL.color3f(1.f, 1.f, 1.f); gGL.getTexUnit(0)->bind(mModelPreview); @@ -652,3 +677,10 @@ void LLFloaterModelWizard::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } } + +// static +void swap_controls(LLUICtrl* first_ctrl, LLUICtrl* second_ctrl, bool first_ctr_visible) +{ + first_ctrl->setVisible(first_ctr_visible); + second_ctrl->setVisible(!first_ctr_visible); +} diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h index b166d26295..c32977f4b0 100644 --- a/indra/newview/llfloatermodelwizard.h +++ b/indra/newview/llfloatermodelwizard.h @@ -66,7 +66,6 @@ public: void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); void modelLoadedCallback(); - void onPhysicsChanged(); void initDecompControls(); LLPhysicsDecomp::decomp_params mDecompParams; @@ -80,13 +79,15 @@ private: CHOOSE_FILE = 0, OPTIMIZE, PHYSICS, - PHYSICS2, REVIEW, UPLOAD }; void setState(int state); void updateButtons(); + void onClickSwitchToAdvanced(); + void onClickRecalculateGeometry(); + void onClickRecalculatePhysics(); void onClickCancel(); void onClickBack(); void onClickNext(); @@ -94,7 +95,6 @@ private: bool onEnableBack(); void loadModel(); void onPreviewLODCommit(LLUICtrl*); - void onAccuracyPerformance(const LLSD& data); void onUpload(); LLModelPreview* mModelPreview; @@ -106,7 +106,11 @@ private: U32 mLastEnabledState; - + LLButton* mRecalculateGeometryBtn; + LLButton* mRecalculatePhysicsBtn; + LLButton* mRecalculatingPhysicsBtn; + LLButton* mCalculateWeightsBtn; + LLButton* mCalculatingWeightsBtn; }; diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml index c3f7b70ca7..1d6ded5391 100644 --- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml @@ -45,24 +45,6 @@ - - Filename: + width="320"> + Choose model file to upload + width="230" /> - Model Preview: + left="10" + name="Cache location" + width="320"> + Second Life supports COLLADA (.dae) files @@ -225,7 +220,7 @@ top_pad="10" width="130" height="14" - left="340" + left_delta="0" text_color="White" word_wrap="true"> Dimensions (meters): @@ -238,15 +233,7 @@ text_color="White" name="dimensions" left_delta="0"> - X: Y: Z: - - - | | + X Y Z - - Note: - - -Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/openfloater/upload_model Advanced Mesh Import Window] . - + + WARNING: + + + You will not be able to complete the final step of uploading this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to set up y + @@ -291,7 +281,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se height="388" top_delta="0" name="optimize_panel" - visible="false" + visible="true" width="535" left="0"> - Optimize + Optimize model - This wizard has optimized your model to improve performance. You may adjust the results of the optimization process bellow or click Next to continue. + We have optimized the model for performance. Adjust it further if you wish. - - Model Preview: - - - - High - - - Medium - - - Low - - - Lowest - - - - - Higher Performance - Faster rendering but less detailed; lowers Resource (prim) cost. - Higher Accuracy - More detailed model but slower; increases Resource (prim) cost. + Performance + Faster rendering +Less detail +Lower prim weight + Accuracy + Slower rendering +More detail +Higher prim weight - - ' - - - - - - Resource Cost: [COST] - - Dimensions (meters): - - - X: Y: Z: - - - | | + + ' + + ' + + + + Geometry preview - - - + + + + + High detail + + + Medium detail + + + Low detail + + + Lowest detail + + @@ -549,7 +512,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se font="SansSerifBig" text_color="White" layout="topleft"> - Physics + Adjust physics - The wizard will create a physical shape, which determines how the object interacts with other objects and avatars. Set the slider to the detail level most appropriate for how your object will be used: + We will create a shape for the outer hull of the model. Adjust the shape's detail level as needed for the intended purpose of your model. - Higher Performance - Faster rendering but less detailed; lowers Resource (prim) cost. - Higher Accuracy - More detailed model but slower; increases Resource (prim) cost. + Performance + Faster rendering +Less detail +Lower prim weight + Accuracy + Slower rendering +More detail +Higher prim weight - ' ' ' ' ' ' ' ' ' ' ' - Recommended for solid objects - Recommended for buildings - Recommended for vehicles - - - - - Resource Cost: [COST] - - - - - - - - Physics - - - - Preview the physics shape below then click Next to continue. To modify the physics shape, click the Back button. - - - - Model Preview: + top="25" + width="22" /> + Examples: +Moving objects +Flying objects +Vehicles + Examples: +Small static objects +Less detailed objects +Simple furniture + Examples: +Static objects +Detailed objects +Buildings + + + + Physics preview - + + + - High + High detail - Medium + Medium detail - Low + Low detail - Lowest + Lowest detail - - - - Dimensions (meters): - - - X: Y: Z: - - - | | - - - - - Resource Cost: [COST] - + - - Review the details below then click. Upload to upload your model. Your L$ balance will be charged when you click Upload. - - - - - Model Preview: - - - - High - - - Medium - - - Low - - - Lowest - - - - - - Dimensions (meters): - - - X: Y: Z: - - - | | - - - - + name="content" + bg_opaque_color="DkGray2" + background_visible="true" + background_opaque="true"> + Impact to parcel/region: [EQUIV] prim equivalents + + Your account will be charged an upload fee of L$ [FEE]. + + By clicking the upload button, you confirm that you have the appropriate rights to the material contained in the model. + - Resource Cost: [COST] - This is the cost to your Region's prim/object limit, at default scale - Physics Cost: [COST] - This is the cost to your Region's prim/object limit, at default scale - Upload Fee: - This is the amount the upload will cost. - - I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more] @@ -954,44 +721,76 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se height="10" font="SansSerifBig" layout="topleft"> - Upload Complete! + Upload complete - Congratulations! Your model has been sucessfully uploaded. You will find the model in the Objects folder in your inventory. + left="25"> + Your model has been uploaded. + + + You will find it in the Objects folder in your inventory. + + Your account has been charged L$ [FEE]. - - - þ: [COUNT] - - Physics weight [PHYS_WEIGHT], Display weight [DISP_WEIGHT]. + Physics weight [PHYS_WEIGHT], Render Cost [DISP_WEIGHT]. -- cgit v1.2.3 From fc6f0f31be53d6adbc8e364ffdd4119943312578 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Wed, 29 Jun 2011 17:22:18 +0300 Subject: SH-1726 FIXED (Viewer modifications to advanced model upload to accommodate upload fee & prim equivalency) - Changed XUI according to the spec - Added requesting upload permission, physics weight and fee weight - Split requesting fee and uploading model steps in mesh repository --- indra/newview/CMakeLists.txt | 4 + indra/newview/llfloatermodelpreview.cpp | 118 ++++++++++++--- indra/newview/llfloatermodelpreview.h | 22 ++- indra/newview/llfloatermodeluploadbase.cpp | 56 +++++++ indra/newview/llfloatermodeluploadbase.h | 57 ++++++++ indra/newview/llfloatermodelwizard.cpp | 20 ++- indra/newview/llfloatermodelwizard.h | 13 +- indra/newview/llmeshrepository.cpp | 161 +++++++++++++-------- indra/newview/llmeshrepository.h | 15 +- indra/newview/lluploadfloaterobservers.cpp | 56 +++++++ indra/newview/lluploadfloaterobservers.h | 79 ++++++++++ .../skins/default/xui/en/floater_model_preview.xml | 75 +++++----- .../newview/skins/default/xui/en/notifications.xml | 14 ++ 13 files changed, 570 insertions(+), 120 deletions(-) create mode 100644 indra/newview/llfloatermodeluploadbase.cpp create mode 100644 indra/newview/llfloatermodeluploadbase.h create mode 100644 indra/newview/lluploadfloaterobservers.cpp create mode 100644 indra/newview/lluploadfloaterobservers.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 523ea8a394..c4018cd79c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -204,6 +204,7 @@ set(viewer_SOURCE_FILES llfloatermediasettings.cpp llfloatermemleak.cpp llfloatermodelpreview.cpp + llfloatermodeluploadbase.cpp llfloatermodelwizard.cpp llfloaternamedesc.cpp llfloaternotificationsconsole.cpp @@ -496,6 +497,7 @@ set(viewer_SOURCE_FILES lltranslate.cpp lluilistener.cpp lluploaddialog.cpp + lluploadfloaterobservers.cpp llurl.cpp llurldispatcher.cpp llurldispatcherlistener.cpp @@ -758,6 +760,7 @@ set(viewer_HEADER_FILES llfloatermediasettings.h llfloatermemleak.h llfloatermodelpreview.h + llfloatermodeluploadbase.h llfloatermodelwizard.h llfloaternamedesc.h llfloaternotificationsconsole.h @@ -1047,6 +1050,7 @@ set(viewer_HEADER_FILES lluiconstants.h lluilistener.h lluploaddialog.h + lluploadfloaterobservers.h llurl.h llurldispatcher.h llurldispatcherlistener.h diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index d000248e8e..ea85dc0052 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -71,6 +71,7 @@ #include "llmatrix4a.h" #include "llmenubutton.h" #include "llmeshrepository.h" +#include "llnotificationsutil.h" #include "llsdutil_math.h" #include "lltextbox.h" #include "lltoolmgr.h" @@ -353,7 +354,9 @@ void LLMeshFilePicker::notify(const std::string& filename) // LLFloaterModelPreview() //----------------------------------------------------------------------------- LLFloaterModelPreview::LLFloaterModelPreview(const LLSD& key) : -LLFloater(key) +LLFloaterModelUploadBase(key), +mUploadBtn(NULL), +mCalculateBtn(NULL) { sInstance = this; mLastMouseX = 0; @@ -422,8 +425,6 @@ BOOL LLFloaterModelPreview::postBuild() childDisable("ok_btn"); - childSetCommitCallback("confirm_checkbox", refresh, this); - mViewOptionMenuButton = getChild("options_gear_btn"); mCommitCallbackRegistrar.add("ModelImport.ViewOption.Action", boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _2)); @@ -473,6 +474,13 @@ BOOL LLFloaterModelPreview::postBuild() } } + mUploadBtn = getChild("ok_btn"); + mCalculateBtn = getChild("calculate_btn"); + + mCalculateBtn->setClickedCallback(boost::bind(&LLFloaterModelPreview::onClickCalculateBtn, this)); + + toggleCalculateButton(true); + return TRUE; } @@ -551,6 +559,26 @@ void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name) mModelPreview->loadModel(file_name, lod); } +void LLFloaterModelPreview::onClickCalculateBtn() +{ + childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost)); + + mModelPreview->rebuildUploadData(); + + bool upload_skinweights = childGetValue("upload_skin").asBoolean(); + bool upload_joint_positions = childGetValue("upload_joints").asBoolean(); + + mUploadModelUrl.clear(); + LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale, + childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false); + + thread->setObserverHandle(getWholeModelFeeObserverHandle()); + + gMeshRepo.mUploadWaitList.push_back(thread); + + toggleCalculateButton(false); +} + //static void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata) { @@ -561,7 +589,8 @@ void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata) return; } - fp->mModelPreview->calcResourceCost(); + fp->toggleCalculateButton(true); + fp->mModelPreview->refresh(); } //static @@ -573,7 +602,9 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata ) { return; } - fp->mModelPreview->calcResourceCost(); + + fp->toggleCalculateButton(true); + fp->mModelPreview->refresh(); } @@ -623,7 +654,8 @@ void LLFloaterModelPreview::onUploadSkinCommit(LLUICtrl*,void* userdata) return; } - fp->mModelPreview->calcResourceCost(); + fp->toggleCalculateButton(true); + fp->mModelPreview->refresh(); fp->mModelPreview->resetPreviewTarget(); fp->mModelPreview->clearBuffers(); @@ -653,6 +685,7 @@ void LLFloaterModelPreview::onGenerateNormalsCommit(LLUICtrl* ctrl, void* userda { LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; + fp->toggleCalculateButton(true); fp->mModelPreview->generateNormals(); } @@ -676,6 +709,8 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata) void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata) { LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; + + fp->toggleCalculateButton(true); fp->mModelPreview->onLODParamCommit(false); } @@ -683,6 +718,7 @@ void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata) void LLFloaterModelPreview::onLODParamCommitTriangleLimit(LLUICtrl* ctrl, void* userdata) { LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; + fp->toggleCalculateButton(true); fp->mModelPreview->onLODParamCommit(true); } @@ -714,6 +750,8 @@ void LLFloaterModelPreview::draw() } } + childSetEnabled("ok_btn", mHasUploadPerm); + childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost)); childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size())); @@ -871,6 +909,12 @@ BOOL LLFloaterModelPreview::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } +/*virtual*/ +void LLFloaterModelPreview::onOpen(const LLSD& key) +{ + requestAgentUploadPermissions(); +} + //static void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data) { @@ -2926,8 +2970,7 @@ U32 LLModelPreview::calcResourceCost() if (mFMP && mModelLoader) { - const BOOL confirmed_checkbox = mFMP->getChild("confirm_checkbox")->getValue().asBoolean(); - if ( getLoadState() < LLModelLoader::ERROR_PARSING && confirmed_checkbox ) + if ( getLoadState() < LLModelLoader::ERROR_PARSING) { mFMP->childEnable("ok_btn"); } @@ -3038,8 +3081,6 @@ void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, childSetTextArg("import_dimensions", "[X]", llformat("%.3f", x)); childSetTextArg("import_dimensions", "[Y]", llformat("%.3f", y)); childSetTextArg("import_dimensions", "[Z]", llformat("%.3f", z)); - childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost)); - childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost)); } @@ -3069,8 +3110,7 @@ void LLModelPreview::rebuildUploadData() F32 max_scale = 0.f; - const BOOL confirmed_checkbox = mFMP->getChild("confirm_checkbox")->getValue().asBoolean(); - if ( mBaseScene.size() > 0 && confirmed_checkbox ) + if ( mBaseScene.size() > 0) { mFMP->childEnable("ok_btn"); } @@ -3476,8 +3516,7 @@ void LLModelPreview::loadModelCallback(S32 lod) } mLoading = false; - if (mFMP) - mFMP->getChild("confirm_checkbox")->set(FALSE); + refresh(); mModelLoadedSignal(); @@ -4185,8 +4224,7 @@ void LLModelPreview::updateStatusMessages() } } - const BOOL confirmed_checkbox = mFMP->getChild("confirm_checkbox")->getValue().asBoolean(); - if ( upload_ok && !errorStateFromLoader && skinAndRigOk && !has_degenerate && confirmed_checkbox) + if ( upload_ok && !errorStateFromLoader && skinAndRigOk && !has_degenerate) { mFMP->childEnable("ok_btn"); } @@ -5314,7 +5352,7 @@ void LLFloaterModelPreview::onUpload(void* user_data) mp->mModelPreview->saveUploadData(upload_skinweights, upload_joint_positions); gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale, - mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions); + mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mp->mUploadModelUrl); mp->closeFloater(false); } @@ -5330,6 +5368,7 @@ void LLFloaterModelPreview::onClearMaterials(void* user_data) //static void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data) { + sInstance->toggleCalculateButton(true); sInstance->mModelPreview->mDirty = true; } @@ -5382,6 +5421,34 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg) mStatusMessage = msg; } +void LLFloaterModelPreview::toggleCalculateButton(bool visible) +{ + mCalculateBtn->setVisible(visible); + mUploadBtn->setVisible(!visible); + mUploadBtn->setEnabled(mHasUploadPerm); + + if (visible) + { + std::string tbd = getString("tbd"); + childSetTextArg("weights", "[EQ]", tbd); + childSetTextArg("weights", "[PH]", tbd); + childSetTextArg("weights", "[FEE]", tbd); + } +} + +void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) +{ + mUploadModelUrl = upload_url; + childSetTextArg("weights", "[PH]", llformat("%.3f", physics)); + childSetTextArg("weights", "[FEE]", llformat("%d", fee)); + childSetVisible("weights", true); +} + +void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) +{ + llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl; +} + S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2) { if (mContinue) @@ -5421,3 +5488,20 @@ void LLFloaterModelPreview::DecompRequest::completed() llassert(sInstance->mCurRequest.find(this) == sInstance->mCurRequest.end()); } } + +void LLFloaterModelPreview::onPermReceived(const LLSD& result) +{ + std::string upload_status = result["mesh_upload_status"].asString(); + mHasUploadPerm = "valid" == upload_status; + + mUploadBtn->setEnabled(mHasUploadPerm); + getChild("warning_title")->setVisible(mHasUploadPerm); + getChild("warning_message")->setVisible(mHasUploadPerm); +} + +void LLFloaterModelPreview::setPermErrorStatus(U32 status, const std::string& reason) +{ + llwarns << "LLFloaterModelPreview::setPermErrors(" << status << " : " << reason << ")" << llendl; + + LLNotificationsUtil::add("MeshUploadPermError"); +} diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index ab50890fb9..62878812c3 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -140,7 +140,7 @@ private: static bool isAlive(LLModelLoader* loader) ; }; -class LLFloaterModelPreview : public LLFloater +class LLFloaterModelPreview : public LLFloaterModelUploadBase { public: @@ -167,6 +167,8 @@ public: BOOL handleHover(S32 x, S32 y, MASK mask); BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + /*virtual*/ void onOpen(const LLSD& key); + static void onMouseCaptureLostModelPreview(LLMouseHandler*); static void setUploadAmount(S32 amount) { sUploadAmount = amount; } @@ -194,6 +196,16 @@ public: void enableViewOption(const std::string& option); void disableViewOption(const std::string& option); + // shows warning message if agent has no permissions to upload model + /*virtual*/ void onPermReceived(const LLSD& result); + + // called when error occurs during permissions request + /*virtual*/ void setPermErrorStatus(U32 status, const std::string& reason); + + /*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url); + + /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); + protected: friend class LLModelPreview; friend class LLMeshFilePicker; @@ -259,6 +271,14 @@ protected: LLToggleableMenu* mViewOptionMenu; LLMutex* mStatusLock; +private: + void onClickCalculateBtn(); + + // Toggles between "Calculate weights & fee" and "Upload" buttons. + void toggleCalculateButton(bool visible); + + LLButton* mUploadBtn; + LLButton* mCalculateBtn; }; class LLMeshFilePicker : public LLFilePickerThread diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp new file mode 100644 index 0000000000..56c6447792 --- /dev/null +++ b/indra/newview/llfloatermodeluploadbase.cpp @@ -0,0 +1,56 @@ +/** + * @file llfloatermodeluploadbase.cpp + * @brief LLFloaterUploadModelBase class definition + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, 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 "llviewerprecompiledheaders.h" + +#include "llfloatermodeluploadbase.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "llnotificationsutil.h" + +LLFloaterModelUploadBase::LLFloaterModelUploadBase(const LLSD& key) +:LLFloater(key), + mHasUploadPerm(false) +{ +} + +void LLFloaterModelUploadBase::requestAgentUploadPermissions() +{ + std::string capability = "MeshUploadFlag"; + std::string url = gAgent.getRegion()->getCapability(capability); + + if (!url.empty()) + { + llinfos<< typeid(*this).name() <<"::requestAgentUploadPermissions() requesting for upload model permissions from: "<< url <rebuildUploadData(); gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, - true, false, false); + true, false, false, mUploadModelUrl, true); setState(UPLOAD); diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h index 409451e1b6..9930e0c4e6 100644 --- a/indra/newview/llfloatermodelwizard.h +++ b/indra/newview/llfloatermodelwizard.h @@ -30,12 +30,13 @@ #include "llmeshrepository.h" #include "llmodel.h" #include "llthread.h" +#include "llfloatermodeluploadbase.h" class LLModelPreview; -class LLFloaterModelWizard : public LLFloater +class LLFloaterModelWizard : public LLFloaterModelUploadBase { public: @@ -62,12 +63,20 @@ public: BOOL handleMouseDown(S32 x, S32 y, MASK mask); BOOL handleMouseUp(S32 x, S32 y, MASK mask); BOOL handleHover(S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + + /*virtual*/ void onOpen(const LLSD& key); void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); void modelLoadedCallback(); void initDecompControls(); + // shows warning message if agent has no permissions to upload model + void onPermReceived(const LLSD& result); + + // called when error occurs during permissions request + void setPermErrorStatus(U32 status, const std::string& reason); + const LLRect& getPreviewRect() const { return mPreviewRect; } LLPhysicsDecomp::decomp_params mDecompParams; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4da5da9493..49bcbf860a 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -62,6 +62,7 @@ #include "llinventorymodel.h" #include "llfoldertype.h" #include "llviewerparcelmgr.h" +#include "lluploadfloaterobservers.h" #include "boost/lexical_cast.hpp" @@ -554,10 +555,12 @@ class LLWholeModelFeeResponder: public LLCurl::Responder { LLMeshUploadThread* mThread; LLSD mModelData; + LLHandle mObserverHandle; public: - LLWholeModelFeeResponder(LLMeshUploadThread* thread, LLSD& model_data): + LLWholeModelFeeResponder(LLMeshUploadThread* thread, LLSD& model_data, LLHandle observer_handle): mThread(thread), - mModelData(model_data) + mModelData(model_data), + mObserverHandle(observer_handle) { } virtual void completed(U32 status, @@ -573,11 +576,21 @@ public: llinfos << "completed" << llendl; mThread->mPendingUploads--; dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num)); + if (isGoodStatus(status) && cc["state"].asString() == "upload") { llinfos << "fee request succeeded" << llendl; - mThread->mWholeModelUploadURL = cc["uploader"].asString(); + mThread->mWholeModelUploadURL = cc["uploader"].asString(); + + LLWholeModelFeeObserver* observer = mObserverHandle.get(); + if (observer) + { + S32 fee = cc["upload_price"].asInteger(); + F64 phys = cc["data"]["physics_cost"].asReal(); + + observer->onModelPhysicsFeeReceived(phys, fee, mThread->mWholeModelUploadURL); + } } else { @@ -1376,9 +1389,11 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 } LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints) + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload) : LLThread("mesh upload"), - mDiscarded(FALSE) + mDiscarded(FALSE), + mDoUpload(do_upload), + mWholeModelUploadURL(upload_url) { mInstanceList = data; mUploadTextures = upload_textures; @@ -1456,7 +1471,14 @@ BOOL LLMeshUploadThread::isDiscarded() void LLMeshUploadThread::run() { - doWholeModelUpload(); + if (mDoUpload) + { + doWholeModelUpload(); + } + else + { + requestWholeModelFee(); + } } void dump_llsd_to_file(const LLSD& content, std::string filename) @@ -1650,69 +1672,54 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) dest = result; } -void LLMeshUploadThread::doWholeModelUpload() +void LLMeshUploadThread::queueUpModels() { - dump_num++; - - mCurlRequest = new LLCurlRequest(); - - // Queue up models for hull generation (viewer-side) for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter) - { - LLMeshUploadData data; - data.mBaseModel = iter->first; - - LLModelInstance& instance = *(iter->second.begin()); - - for (S32 i = 0; i < 5; i++) { - data.mModel[i] = instance.mLOD[i]; - } + LLMeshUploadData data; + data.mBaseModel = iter->first; - //queue up models for hull generation - LLModel* physics = NULL; + LLModelInstance& instance = *(iter->second.begin()); - if (data.mModel[LLModel::LOD_PHYSICS].notNull()) - { - physics = data.mModel[LLModel::LOD_PHYSICS]; - } - else if (data.mModel[LLModel::LOD_MEDIUM].notNull()) - { - physics = data.mModel[LLModel::LOD_MEDIUM]; - } - else - { - physics = data.mModel[LLModel::LOD_HIGH]; - } + for (S32 i = 0; i < 5; i++) + { + data.mModel[i] = instance.mLOD[i]; + } - llassert(physics != NULL); - - DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this); - if(request->isValid()) - { - gMeshRepo.mDecompThread->submitRequest(request); - } - } + //queue up models for hull generation + LLModel* physics = NULL; - while (!mPhysicsComplete) - { - apr_sleep(100); - } + if (data.mModel[LLModel::LOD_PHYSICS].notNull()) + { + physics = data.mModel[LLModel::LOD_PHYSICS]; + } + else if (data.mModel[LLModel::LOD_MEDIUM].notNull()) + { + physics = data.mModel[LLModel::LOD_MEDIUM]; + } + else + { + physics = data.mModel[LLModel::LOD_HIGH]; + } - LLSD model_data; - wholeModelToLLSD(model_data,false); - dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num)); + llassert(physics != NULL); - mPendingUploads++; - LLCurlRequest::headers_t headers; - mCurlRequest->post(mWholeModelFeeCapability, headers, model_data, - new LLWholeModelFeeResponder(this,model_data), mMeshUploadTimeOut); + DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this); + if(request->isValid()) + { + gMeshRepo.mDecompThread->submitRequest(request); + } + } - do - { - mCurlRequest->process(); - } while (mCurlRequest->getQueued() > 0); + while (!mPhysicsComplete) + { + apr_sleep(100); + } +} +void LLMeshUploadThread::doWholeModelUpload() +{ + mCurlRequest = new LLCurlRequest(); if (mWholeModelUploadURL.empty()) { @@ -1720,12 +1727,15 @@ void LLMeshUploadThread::doWholeModelUpload() } else { + queueUpModels(); + LLSD full_model_data; wholeModelToLLSD(full_model_data, true); LLSD body = full_model_data["asset_resources"]; dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num)); + LLCurlRequest::headers_t headers; mCurlRequest->post(mWholeModelUploadURL, headers, body, - new LLWholeModelUploadResponder(this, model_data), mMeshUploadTimeOut); + new LLWholeModelUploadResponder(this, full_model_data), mMeshUploadTimeOut); do { mCurlRequest->process(); @@ -1739,6 +1749,35 @@ void LLMeshUploadThread::doWholeModelUpload() mFinished = true; } +void LLMeshUploadThread::requestWholeModelFee() +{ + dump_num++; + + mCurlRequest = new LLCurlRequest(); + + queueUpModels(); + + LLSD model_data; + wholeModelToLLSD(model_data,false); + dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num)); + + mPendingUploads++; + LLCurlRequest::headers_t headers; + mCurlRequest->post(mWholeModelFeeCapability, headers, model_data, + new LLWholeModelFeeResponder(this,model_data, mObserverHandle), mMeshUploadTimeOut); + + do + { + mCurlRequest->process(); + } while (mCurlRequest->getQueued() > 0); + + delete mCurlRequest; + mCurlRequest = NULL; + + // Currently a no-op. + mFinished = true; +} + void LLMeshUploadThread::uploadModel(LLMeshUploadData& data) { //called from arbitrary thread { @@ -2836,9 +2875,9 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) void LLMeshRepository::uploadModel(std::vector& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints) + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload) { - LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints); + LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url, do_upload); mUploadWaitList.push_back(thread); } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index f56734a7de..03993c6f2c 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -36,6 +36,7 @@ #define LLCONVEXDECOMPINTER_STATIC 1 #include "llconvexdecomposition.h" +#include "lluploadfloaterobservers.h" class LLVOVolume; class LLMeshResponder; @@ -412,7 +413,7 @@ public: std::map mTextureMap; LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints); + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true); ~LLMeshUploadThread(); void uploadTexture(LLTextureUploadData& data); @@ -433,7 +434,11 @@ public: void discard() ; BOOL isDiscarded(); + // Queue up models for hull generation (viewer-side) + void queueUpModels(); + void doWholeModelUpload(); + void requestWholeModelFee(); void wholeModelToLLSD(LLSD& dest, bool include_textures); @@ -441,6 +446,12 @@ public: LLVector3& result_pos, LLQuaternion& result_rot, LLVector3& result_scale); + + void setObserverHandle(LLHandle observer_handle) { mObserverHandle = observer_handle; } + +private: + LLHandle mObserverHandle; + bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded }; class LLMeshRepository @@ -491,7 +502,7 @@ public: LLSD& getMeshHeader(const LLUUID& mesh_id); void uploadModel(std::vector& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints); + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true); S32 getMeshSize(const LLUUID& mesh_id, S32 lod); diff --git a/indra/newview/lluploadfloaterobservers.cpp b/indra/newview/lluploadfloaterobservers.cpp new file mode 100644 index 0000000000..2d418ee00d --- /dev/null +++ b/indra/newview/lluploadfloaterobservers.cpp @@ -0,0 +1,56 @@ +/** + * @file lluploadfloaterobservers.cpp + * @brief LLUploadModelPremissionsResponder definition + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, 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 "llviewerprecompiledheaders.h" + +#include "lluploadfloaterobservers.h" + +LLUploadModelPremissionsResponder::LLUploadModelPremissionsResponder(const LLHandle& observer) +:mObserverHandle(observer) +{ +} + +void LLUploadModelPremissionsResponder::error(U32 status, const std::string& reason) +{ + llwarns << "LLUploadModelPremissionsResponder::error("<< status << ": " << reason << ")" << llendl; + + LLUploadPermissionsObserver* observer = mObserverHandle.get(); + + if (observer) + { + observer->setPermErrorStatus(status, reason); + } +} + +void LLUploadModelPremissionsResponder::result(const LLSD& content) +{ + LLUploadPermissionsObserver* observer = mObserverHandle.get(); + + if (observer) + { + observer->onPermReceived(content); + } +} diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h new file mode 100644 index 0000000000..f27687e12e --- /dev/null +++ b/indra/newview/lluploadfloaterobservers.h @@ -0,0 +1,79 @@ +/** + * @file lluploadfloaterobservers.h + * @brief LLUploadModelPremissionsResponder declaration + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, 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 LLUPLOADFLOATEROBSERVERS_H_ +#define LLUPLOADFLOATEROBSERVERS_H_ + +#include "llfloater.h" +#include "llhttpclient.h" +#include "llhandle.h" + +class LLUploadPermissionsObserver +{ +public: + + LLUploadPermissionsObserver(){mUploadPermObserverHandle.bind(this);} + virtual ~LLUploadPermissionsObserver() {} + + virtual void onPermReceived(const LLSD& result) = 0; + virtual void setPermErrorStatus(U32 status, const std::string& reason) = 0; + + LLHandle getPermObserverHandle() const {return mUploadPermObserverHandle;} + +protected: + LLRootHandle mUploadPermObserverHandle; +}; + +class LLWholeModelFeeObserver +{ +public: + LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); } + virtual ~LLWholeModelFeeObserver() {} + + virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0; + virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; + + LLHandle getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; } + +protected: + LLRootHandle mWholeModelFeeObserverHandle; +}; + +class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder +{ +public: + + LLUploadModelPremissionsResponder(const LLHandle& observer); + + void error(U32 status, const std::string& reason); + + void result(const LLSD& content); + +private: + LLHandle mObserverHandle; +}; + +#endif /* LLUPLOADFLOATEROBSERVERS_H_ */ diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index f58595b3c5..ab46a13098 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -23,6 +23,7 @@ All Analyzing... Simplifying... + TBD @@ -70,43 +71,29 @@ width="290" height="290" follows="all"/> - - Upload Details - - - Resource Cost: [COST] - - - Physics Cost: [COST] + + + WARNING: - - Upload Fee: N/A + + You will not be able to complete the final upload of this model to the Second Life servers. Find out how to get certifed for mesh model uploads. - - - - - I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more] - [STATUS] - - -