diff options
author | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-07 16:15:54 +0300 |
---|---|---|
committer | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-07 16:15:54 +0300 |
commit | bb085a45db845a9bfe8aae83ecc7938f618e9ddc (patch) | |
tree | c899b00ec7fec2d91f9443de4a93eb21b4a38170 /indra/newview/llfloatermodelpreview.cpp | |
parent | aaee960dd3a2d3da51db6b8ba7a6f5b1f414aef5 (diff) | |
parent | d63b72fb538d4a9dc977eae91d99263355fadef3 (diff) |
Merge from seth_mesh_dev to paul_mesh_dev
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index c2872e7651..9f2d97d1fa 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -2280,7 +2280,15 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode ) //Determine if the're any children wrt to this failed node. //This occurs when an armature is exported and ends up being what essentially amounts to //as the root for the visual_scene - processChildJoints( pNode ); + if ( pNode ) + { + processChildJoints( pNode ); + } + else + { + llinfos<<"Node is NULL"<<llendl; + } + } } //----------------------------------------------------------------------------- @@ -3262,8 +3270,14 @@ void LLModelPreview::rebuildUploadData() { for (U32 j = 0; j < mBaseModel.size(); ++j) { - mModel[i][j]->matchMaterialOrder(mBaseModel[j]); - llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList); + + int refFaceCnt = 0; + int modelFaceCnt = 0; + + if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) ) + { + mFMP->childDisable( "calculate_btn" ); + } } } } @@ -4740,6 +4754,42 @@ void LLModelPreview::createPreviewAvatar( void ) } } +void LLModelPreview::addEmptyFace( LLModel* pTarget ) +{ + U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; + + LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(type_mask, 0); + + buff->allocateBuffer(1, 3, true); + memset( buff->getMappedData(), 0, buff->getSize() ); + memset( buff->getIndicesPointer(), 0, buff->getIndicesSize() ); + + buff->validateRange( 0, buff->getNumVerts()-1, buff->getNumIndices(), 0 ); + + LLStrider<LLVector3> pos; + LLStrider<LLVector3> norm; + LLStrider<LLVector2> tc; + LLStrider<U16> index; + + buff->getVertexStrider(pos); + + if ( type_mask & LLVertexBuffer::MAP_NORMAL ) + { + buff->getNormalStrider(norm); + } + if ( type_mask & LLVertexBuffer::MAP_TEXCOORD0 ) + { + buff->getTexCoord0Strider(tc); + } + + buff->getIndexStrider(index); + + //resize face array + int faceCnt = pTarget->getNumVolumeFaces(); + pTarget->setNumVolumeFaces( faceCnt+1 ); + pTarget->setVolumeFaceData( faceCnt+1, pos, norm, tc, index, buff->getNumVerts(), buff->getNumIndices() ); + +} //----------------------------------------------------------------------------- // render() //----------------------------------------------------------------------------- @@ -4951,8 +5001,13 @@ BOOL LLModelPreview::render() { for (U32 j = 0; j < mBaseModel.size(); ++j) { - mModel[i][j]->matchMaterialOrder(mBaseModel[j]); - llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList); + int refFaceCnt = 0; + int modelFaceCnt = 0; + + if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) ) + { + mFMP->childDisable( "calculate_btn" ); + } } } } @@ -4994,8 +5049,6 @@ BOOL LLModelPreview::render() const std::string& binding = instance.mModel->mMaterialList[i]; const LLImportMaterial& material = instance.mMaterial[binding]; - llassert(binding == model->mMaterialList[i]); - glColor4fv(material.mDiffuseColor.mV); if (material.mDiffuseMap.notNull()) { |