Merge branch 'master' of git://github.com/assimp/assimp
This commit is contained in:
@@ -599,7 +599,7 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
|
||||
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
|
||||
{
|
||||
// Input channels for weight data. Two possible semantics: "JOINT" and "WEIGHT"
|
||||
if( IsElement( "input"))
|
||||
if( IsElement( "input") && vertexCount > 0 )
|
||||
{
|
||||
InputChannel channel;
|
||||
|
||||
@@ -628,7 +628,7 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
|
||||
if( !mReader->isEmptyElement())
|
||||
SkipElement();
|
||||
}
|
||||
else if( IsElement( "vcount"))
|
||||
else if( IsElement( "vcount") && vertexCount > 0 )
|
||||
{
|
||||
// read weight count per vertex
|
||||
const char* text = GetTextContent();
|
||||
@@ -648,7 +648,7 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
|
||||
// reserve weight count
|
||||
pController.mWeights.resize( numWeights);
|
||||
}
|
||||
else if( IsElement( "v"))
|
||||
else if( IsElement( "v") && vertexCount > 0 )
|
||||
{
|
||||
// read JointIndex - WeightIndex pairs
|
||||
const char* text = GetTextContent();
|
||||
@@ -1656,6 +1656,7 @@ void ColladaParser::ReadDataArray()
|
||||
std::string id = mReader->getAttributeValue( indexID);
|
||||
int indexCount = GetAttribute( "count");
|
||||
unsigned int count = (unsigned int) mReader->getAttributeValueAsInt( indexCount);
|
||||
if (count == 0) { return; } // some exporters write empty data arrays with count="0"
|
||||
const char* content = TestTextContent();
|
||||
|
||||
// read values and store inside an array in the data library
|
||||
|
||||
@@ -159,6 +159,7 @@ struct Material
|
||||
aiString textureBump;
|
||||
aiString textureSpecularity;
|
||||
aiString textureOpacity;
|
||||
aiString textureDisp;
|
||||
|
||||
//! Ambient color
|
||||
aiColor3D ambient;
|
||||
|
||||
@@ -556,6 +556,9 @@ void ObjFileImporter::createMaterials(const ObjFile::Model* pModel, aiScene* pSc
|
||||
if ( 0 != pCurrentMaterial->textureBump.length )
|
||||
mat->AddProperty( &pCurrentMaterial->textureBump, AI_MATKEY_TEXTURE_HEIGHT(0));
|
||||
|
||||
if ( 0 != pCurrentMaterial->textureDisp.length )
|
||||
mat->AddProperty( &pCurrentMaterial->textureDisp, AI_MATKEY_TEXTURE_DISPLACEMENT(0) );
|
||||
|
||||
if ( 0 != pCurrentMaterial->textureOpacity.length )
|
||||
mat->AddProperty( &pCurrentMaterial->textureOpacity, AI_MATKEY_TEXTURE_OPACITY(0));
|
||||
|
||||
|
||||
@@ -279,6 +279,10 @@ void ObjFileMtlImporter::getTexture()
|
||||
else if (!ASSIMP_strincmp(&(*m_DataIt),"map_bump",8) || !ASSIMP_strincmp(&(*m_DataIt),"bump",4))
|
||||
out = & m_pModel->m_pCurrentMaterial->textureBump;
|
||||
|
||||
// Displacement texture
|
||||
else if (!ASSIMP_strincmp(&(*m_DataIt),"disp",4))
|
||||
out = &m_pModel->m_pCurrentMaterial->textureDisp;
|
||||
|
||||
// Specularity scaling (glossiness)
|
||||
else if (!ASSIMP_strincmp(&(*m_DataIt),"map_ns",6))
|
||||
out = & m_pModel->m_pCurrentMaterial->textureSpecularity;
|
||||
|
||||
Reference in New Issue
Block a user