From 50b9c63382121df879680cf43f5be6fc09686607 Mon Sep 17 00:00:00 2001 From: seth_productengine Date: Fri, 22 Jul 2011 22:40:18 +0300 Subject: SH-1868 WIP Added user-supplied metric data for uploading a model. The mesh category string selected by user within the model data and sent to the server during calculating the upload fee and upload requests. The accounting info and the upload permissions warning in the bottom left corner of the floater are temporarily made mutually exclusive. --- indra/newview/llfloatermodelpreview.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e045cf6729..6c01f0c09a 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3098,6 +3098,7 @@ void LLModelPreview::rebuildUploadData() std::string requested_name = mFMP->getChild("description_form")->getValue().asString(); + std::string metric = mFMP->getChild("model_category_combo")->getValue().asString(); LLSpinCtrl* scale_spinner = mFMP->getChild("import_scale"); @@ -3159,6 +3160,7 @@ void LLModelPreview::rebuildUploadData() if (base_model) { base_model->mRequestedLabel = requested_name; + base_model->mMetric = metric; } S32 idx = 0; @@ -5593,6 +5595,10 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result) mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); getChild("warning_title")->setVisible(!mHasUploadPerm); getChild("warning_message")->setVisible(!mHasUploadPerm); + + // Hide the accounting info if upload is not permitted. + getChild("weights_text")->setVisible(mHasUploadPerm); + getChild("weights")->setVisible(mHasUploadPerm); } void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason) -- cgit v1.2.3 From 715d9f20a7b64f5b9f52b4c363f32078f7f5e2fd Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 26 Jul 2011 18:01:31 -0500 Subject: SH-1086 Make physics shape display transparent and fix some z-fighting issues. --- indra/newview/llfloatermodelpreview.cpp | 255 +++++++++++++++++--------------- 1 file changed, 135 insertions(+), 120 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 62b8d03281..7844afb456 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -4891,6 +4891,8 @@ BOOL LLModelPreview::render() target_pos); // point of interest + z_near = llclamp(z_far * 0.001f, 0.001f, 0.1f); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, width, height, FALSE, z_near, z_far); stop_glerror(); @@ -5010,184 +5012,197 @@ BOOL LLModelPreview::render() if (physics) { glClear(GL_DEPTH_BUFFER_BIT); - LLGLEnable blend(GL_BLEND); - gGL.blendFunc(LLRender::BF_ONE, LLRender::BF_ZERO); - - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) + + for (U32 i = 0; i < 2; i++) { - LLModelInstance& instance = *iter; + if (i == 0) + { //depth only pass + gGL.setColorMask(false, false); + } + else + { + gGL.setColorMask(true, true); + } - LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS]; + //enable alpha blending on second pass but not first pass + LLGLState blend(GL_BLEND, i); + + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); - if (!model) + for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { - continue; - } + LLModelInstance& instance = *iter; - gGL.pushMatrix(); - LLMatrix4 mat = instance.mTransform; + LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS]; - glMultMatrixf((GLfloat*) mat.mMatrix); + if (!model) + { + continue; + } + gGL.pushMatrix(); + LLMatrix4 mat = instance.mTransform; - bool render_mesh = true; + glMultMatrixf((GLfloat*) mat.mMatrix); - LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; - if (decomp) - { - LLMutexLock(decomp->mMutex); - LLModel::Decomposition& physics = model->mPhysics; + bool render_mesh = true; - if (!physics.mHull.empty()) + LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; + if (decomp) { - render_mesh = false; + LLMutexLock(decomp->mMutex); - if (physics.mMesh.empty()) - { //build vertex buffer for physics mesh - gMeshRepo.buildPhysicsMesh(physics); - } + LLModel::Decomposition& physics = model->mPhysics; + + if (!physics.mHull.empty()) + { + render_mesh = false; + + if (physics.mMesh.empty()) + { //build vertex buffer for physics mesh + gMeshRepo.buildPhysicsMesh(physics); + } - if (!physics.mMesh.empty()) - { //render hull instead of mesh - for (U32 i = 0; i < physics.mMesh.size(); ++i) - { - if (explode > 0.f) + if (!physics.mMesh.empty()) + { //render hull instead of mesh + for (U32 i = 0; i < physics.mMesh.size(); ++i) { - gGL.pushMatrix(); + if (explode > 0.f) + { + gGL.pushMatrix(); - LLVector3 offset = model->mHullCenter[i]-model->mCenterOfHullCenters; - offset *= explode; + LLVector3 offset = model->mHullCenter[i]-model->mCenterOfHullCenters; + offset *= explode; - gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); - } + gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); + } - static std::vector hull_colors; + static std::vector hull_colors; - if (i+1 >= hull_colors.size()) - { - hull_colors.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 255)); - } + if (i+1 >= hull_colors.size()) + { + hull_colors.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 128)); + } glColor4ubv(hull_colors[i].mV); - LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions, physics.mMesh[i].mNormals); + LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions, physics.mMesh[i].mNormals); - if (explode > 0.f) - { - gGL.popMatrix(); + if (explode > 0.f) + { + gGL.popMatrix(); + } } } } } - } - if (render_mesh) - { - if (mVertexBuffer[LLModel::LOD_PHYSICS].empty()) - { - genBuffers(LLModel::LOD_PHYSICS, false); - } - for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i) + if (render_mesh) { - LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; - - buffer->setBuffer(type_mask & buffer->getTypeMask()); + if (mVertexBuffer[LLModel::LOD_PHYSICS].empty()) + { + genBuffers(LLModel::LOD_PHYSICS, false); + } + for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i) + { + LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; - buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glColor4f(0.4f, 0.4f, 0.0f, 0.4f); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + glColor4f(0.4f, 0.4f, 0.0f, 0.4f); - buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); + buffer->setBuffer(type_mask & buffer->getTypeMask()); + buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); - glColor3f(1.f, 1.f, 0.f); + glColor3f(1.f, 1.f, 0.f); - glLineWidth(2.f); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); + glLineWidth(2.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glLineWidth(1.f); + } } - } - gGL.popMatrix(); - } - - glLineWidth(3.f); - glPointSize(8.f); - gPipeline.enableLightsFullbright(LLColor4::white); - //show degenerate triangles - LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); - LLGLDisable cull(GL_CULL_FACE); - glColor4f(1.f,0.f,0.f,1.f); - const LLVector4a scale(0.5f); - - for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) - { - LLModelInstance& instance = *iter; + gGL.popMatrix(); + } - LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS]; + glLineWidth(3.f); + glPointSize(8.f); + gPipeline.enableLightsFullbright(LLColor4::white); + //show degenerate triangles + LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); + LLGLDisable cull(GL_CULL_FACE); + glColor4f(1.f,0.f,0.f,1.f); + const LLVector4a scale(0.5f); - if (!model) + for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) { - continue; - } + LLModelInstance& instance = *iter; - gGL.pushMatrix(); - LLMatrix4 mat = instance.mTransform; + LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS]; - glMultMatrixf((GLfloat*) mat.mMatrix); + if (!model) + { + continue; + } + gGL.pushMatrix(); + LLMatrix4 mat = instance.mTransform; - LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; - if (decomp) - { - LLMutexLock(decomp->mMutex); + glMultMatrixf((GLfloat*) mat.mMatrix); - LLModel::Decomposition& physics = model->mPhysics; - if (physics.mHull.empty()) + LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; + if (decomp) { - if (mVertexBuffer[LLModel::LOD_PHYSICS].empty()) + LLMutexLock(decomp->mMutex); + + LLModel::Decomposition& physics = model->mPhysics; + + if (physics.mHull.empty()) { - genBuffers(LLModel::LOD_PHYSICS, false); - } + if (mVertexBuffer[LLModel::LOD_PHYSICS].empty()) + { + genBuffers(LLModel::LOD_PHYSICS, false); + } - for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i) - { - LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; + for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i) + { + LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; - buffer->setBuffer(type_mask & buffer->getTypeMask()); + buffer->setBuffer(type_mask & buffer->getTypeMask()); - LLStrider pos_strider; - buffer->getVertexStrider(pos_strider, 0); - LLVector4a* pos = (LLVector4a*) pos_strider.get(); + LLStrider pos_strider; + buffer->getVertexStrider(pos_strider, 0); + LLVector4a* pos = (LLVector4a*) pos_strider.get(); - LLStrider idx; - buffer->getIndexStrider(idx, 0); + LLStrider idx; + buffer->getIndexStrider(idx, 0); - for (U32 i = 0; i < buffer->getNumIndices(); i += 3) - { - LLVector4a v1; v1.setMul(pos[*idx++], scale); - LLVector4a v2; v2.setMul(pos[*idx++], scale); - LLVector4a v3; v3.setMul(pos[*idx++], scale); - - if (ll_is_degenerate(v1,v2,v3)) + for (U32 i = 0; i < buffer->getNumIndices(); i += 3) { - buffer->draw(LLRender::LINE_LOOP, 3, i); - buffer->draw(LLRender::POINTS, 3, i); + LLVector4a v1; v1.setMul(pos[*idx++], scale); + LLVector4a v2; v2.setMul(pos[*idx++], scale); + LLVector4a v3; v3.setMul(pos[*idx++], scale); + + if (ll_is_degenerate(v1,v2,v3)) + { + buffer->draw(LLRender::LINE_LOOP, 3, i); + buffer->draw(LLRender::POINTS, 3, i); + } } } } } - } - gGL.popMatrix(); + gGL.popMatrix(); + } + glLineWidth(1.f); + glPointSize(1.f); + gPipeline.enableLightsPreview(); + gGL.setSceneBlendType(LLRender::BT_ALPHA); } - glLineWidth(1.f); - glPointSize(1.f); - gPipeline.enableLightsPreview(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); } } else -- cgit v1.2.3 From ea3d58b3141a7277870b66262ee0afb9c23c3423 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 27 Jul 2011 21:20:04 +0300 Subject: SH-1868 FIXED Rearranged the accounting info to leave enough room for the upload permissions warning. Removed hiding the accounting info when warning is displayed. --- indra/newview/llfloatermodelpreview.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6c01f0c09a..e68a8cc84a 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -5482,10 +5482,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) if (visible) { std::string tbd = getString("tbd"); - childSetTextArg("weights", "[EQ]", tbd); - childSetTextArg("weights", "[ST]", tbd); - childSetTextArg("weights", "[SIM]", tbd); - childSetTextArg("weights", "[PH]", tbd); + childSetTextArg("weights_right", "[EQ]", tbd); + childSetTextArg("weights_left", "[ST]", tbd); + childSetTextArg("weights_right", "[SIM]", tbd); + childSetTextArg("weights_left", "[PH]", tbd); childSetTextArg("upload_fee", "[FEE]", tbd); childSetTextArg("price_breakdown", "[STREAMING]", tbd); childSetTextArg("price_breakdown", "[PHYSICS]", tbd); @@ -5508,17 +5508,16 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived() const LLSD& result = mModelPhysicsFee; mUploadModelUrl = result["url"].asString(); - childSetTextArg("weights", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal())); - childSetTextArg("weights", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal())); - childSetTextArg("weights", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal())); - childSetTextArg("weights", "[PH]", llformat("%0.3f", result["physics_cost"].asReal())); + childSetTextArg("weights_right", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal())); + childSetTextArg("weights_left", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal())); + childSetTextArg("weights_right", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal())); + childSetTextArg("weights_left", "[PH]", llformat("%0.3f", result["physics_cost"].asReal())); childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger())); childSetTextArg("price_breakdown", "[STREAMING]", llformat("%d", result["upload_price_breakdown"]["mesh_streaming"].asInteger())); childSetTextArg("price_breakdown", "[PHYSICS]", llformat("%d", result["upload_price_breakdown"]["mesh_physics"].asInteger())); childSetTextArg("price_breakdown", "[INSTANCES]", llformat("%d", result["upload_price_breakdown"]["mesh_instance"].asInteger())); childSetTextArg("price_breakdown", "[TEXTURES]", llformat("%d", result["upload_price_breakdown"]["texture"].asInteger())); childSetTextArg("price_breakdown", "[MODEL]", llformat("%d", result["upload_price_breakdown"]["model"].asInteger())); - childSetVisible("weights", true); childSetVisible("upload_fee", true); childSetVisible("price_breakdown", true); mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); @@ -5595,10 +5594,6 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result) mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); getChild("warning_title")->setVisible(!mHasUploadPerm); getChild("warning_message")->setVisible(!mHasUploadPerm); - - // Hide the accounting info if upload is not permitted. - getChild("weights_text")->setVisible(mHasUploadPerm); - getChild("weights")->setVisible(mHasUploadPerm); } void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason) -- cgit v1.2.3 From 7633b3f1f1191443ae153c02d71dd968b46a2334 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 4 Aug 2011 23:42:41 -0500 Subject: SH-2201 Fix for crash when getting mesh estimates. --- indra/newview/llfloatermodelpreview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6e3008049f..95dcf8ba1e 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3106,6 +3106,7 @@ U32 LLModelPreview::calcResourceCost() void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost) { + assert_main_thread(); childSetTextArg("import_dimensions", "[X]", llformat("%.3f", x)); childSetTextArg("import_dimensions", "[Y]", llformat("%.3f", y)); childSetTextArg("import_dimensions", "[Z]", llformat("%.3f", z)); @@ -5569,19 +5570,21 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived() void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) { - toggleCalculateButton(true); llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl; + doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true)); } /*virtual*/ void LLFloaterModelPreview::onModelUploadSuccess() { + assert_main_thread(); closeFloater(false); } /*virtual*/ void LLFloaterModelPreview::onModelUploadFailure() { + assert_main_thread(); toggleCalculateButton(true); } -- cgit v1.2.3 From e384ccb5dacc8208506f8849553af66d87950f5c Mon Sep 17 00:00:00 2001 From: prep linden Date: Tue, 9 Aug 2011 16:31:36 -0400 Subject: Temporarily disallow the upload of non 1.4 dae files --- indra/newview/llfloatermodelpreview.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 95dcf8ba1e..333c0c0000 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -768,6 +768,7 @@ void LLFloaterModelPreview::draw() if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_PARSING ) { childSetTextArg("status", "[STATUS]", getString("status_parse_error")); + toggleCalculateButton(false); } else { @@ -776,7 +777,7 @@ void LLFloaterModelPreview::draw() } childSetEnabled("ok_btn", mHasUploadPerm && !mUploadModelUrl.empty()); - + childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost)); childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size())); @@ -1395,6 +1396,18 @@ bool LLModelLoader::doLoadModel() return false; } + //determine if this dae is a valid version. + domVersionType docVersion = dom->getVersion(); + + if ( docVersion != VERSIONTYPE_1_4_0 ) + { + llinfos<<" Error with dae - unsupported dae version "<getElementCount(NULL, COLLADA_TYPE_MESH); -- cgit v1.2.3 From 0405e91df31b7fed5d994a6d2526a1c5a5bc8c5c Mon Sep 17 00:00:00 2001 From: prep linden Date: Tue, 9 Aug 2011 17:10:17 -0400 Subject: Reports error of a non compatible dae to the log if not 1.4 --- indra/newview/llfloatermodelpreview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 333c0c0000..3aca0f7119 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1402,8 +1402,8 @@ bool LLModelLoader::doLoadModel() if ( docVersion != VERSIONTYPE_1_4_0 ) { llinfos<<" Error with dae - unsupported dae version "< Date: Wed, 10 Aug 2011 12:27:29 -0400 Subject: Joint resolver now constructed from key name (cts-660) --- indra/newview/llfloatermodelpreview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 3aca0f7119..7d34754214 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1629,7 +1629,7 @@ bool LLModelLoader::doLoadModel() { //Build a joint for the resolver to work with char str[64]={0}; - sprintf(str,"./%s",(*jointIt).second.c_str() ); + sprintf(str,"./%s",(*jointIt).first.c_str() ); //llwarns<<"Joint "<< str < Date: Thu, 11 Aug 2011 13:19:58 -0400 Subject: Added support for parsing of collada 1.4.1 location sids --- indra/newview/llfloatermodelpreview.cpp | 60 +++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 195c70c5a6..737fdd4919 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -184,6 +184,13 @@ std::string lod_label_name[NUM_LOD+1] = "I went off the end of the lod_label_name array. Me so smart." }; +std::string colladaVersion[VERSIONTYPE_COUNT+1] = +{ + "1.4.0", + "1.4.1", + "Unsupported" +}; + #define LL_DEGENERACY_TOLERANCE 1e-7f @@ -1395,17 +1402,20 @@ bool LLModelLoader::doLoadModel() setLoadState( ERROR_PARSING ); return false; } - - //determine if this dae is a valid version. + //Dom version + daeString domVersion = dae.getDomVersion(); + std::string sldom(domVersion); + llinfos<<"Collada Importer Version: "<getVersion(); - - if ( docVersion != VERSIONTYPE_1_4_0 ) - { - llinfos<<" Error with dae - unsupported dae version "< 1 ) + { + docVersion = VERSIONTYPE_COUNT; + } + llinfos<<"Dae version "<( jointResolver.getElement() ); + daeSIDResolver jointResolverA( pJoint, "./translate" ); + domTranslate* pTranslateA = daeSafeCast( jointResolverA.getElement() ); + daeSIDResolver jointResolverB( pJoint, "./location" ); + domTranslate* pTranslateB = daeSafeCast( jointResolverB.getElement() ); LLMatrix4 workingTransform; //Translation via SID - if ( pTranslate ) + if ( pTranslateA ) + { + extractTranslation( pTranslateA, workingTransform ); + } + else + if ( pTranslateB ) { - extractTranslation( pTranslate, workingTransform ); + extractTranslation( pTranslateB, workingTransform ); } else { @@ -2525,13 +2542,20 @@ void LLModelLoader::processJointNode( domNode* pNode, JointTransformMap& jointTr LLMatrix4 workingTransform; //Pull out the translate id and store it in the jointTranslations map - daeSIDResolver jointResolver( pNode, "./translate" ); - domTranslate* pTranslate = daeSafeCast( jointResolver.getElement() ); + daeSIDResolver jointResolverA( pNode, "./translate" ); + domTranslate* pTranslateA = daeSafeCast( jointResolverA.getElement() ); + daeSIDResolver jointResolverB( pNode, "./location" ); + domTranslate* pTranslateB = daeSafeCast( jointResolverB.getElement() ); //Translation via SID was successful - if ( pTranslate ) + if ( pTranslateA ) + { + extractTranslation( pTranslateA, workingTransform ); + } + else + if ( pTranslateB ) { - extractTranslation( pTranslate, workingTransform ); + extractTranslation( pTranslateB, workingTransform ); } else { -- cgit v1.2.3