Changeset 550

Show
Ignore:
Timestamp:
03/27/08 18:58:24 (9 months ago)
Author:
phill
Message:

o Color dump stuff.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/maya2q3/bsp-colordump.cpp

    r549 r550  
    193193        check_status( stat ); 
    194194 
    195         bool hasSourceVerts = 
    196                 mesh.hasBlindData( MFn::kMeshFaceVertComponent, BdSourceVertexId, &stat ); 
    197         check_status( stat ); 
    198  
    199         if( !hasSourceVerts ) 
    200                 return; 
    201  
    202195        MString colorSet( McVertexLightSet ); 
    203196 
     
    253246                check_status( stat ); 
    254247 
    255                 int blindIdx; 
    256                 stat = mesh.getFaceVertexBlindDataIndex( faceId, vertId, blindIdx ); 
     248                int blindIndex; 
     249                stat = mesh.getFaceVertexBlindDataIndex( faceId, vertId, blindIndex ); 
    257250                check_status( stat ); 
    258251 
    259252                int sourceVert; 
    260                 stat = mesh.getIntBlindData( blindIdx, MFn::kMeshFaceVertComponent, 
     253                stat = mesh.getIntBlindData( blindIndex, MFn::kMeshFaceVertComponent, 
    261254                        BdSourceVertexId, attrName, sourceVert ); 
    262                 check_status( stat ); 
    263  
    264                 if( sourceVert < 0 ) 
     255                 
     256                if( !stat || sourceVert < 0 ) 
    265257                        continue; 
    266258 
    267259                int colorIdx; 
    268260                stat = mesh.getColorIndex( faceId, faceVertId, colorIdx, &colorSet ); 
    269                 check_status( stat ); 
    270                  
     261                 
     262                if( !stat ) 
     263                        continue; 
     264 
    271265                MColor cl = colors[colorIdx]; 
    272266                 
  • trunk/maya2q3/bsp.cpp

    r549 r550  
    151151        MFnMesh mesh; 
    152152 
    153         MStringArray longNames, shortNames, formatNames; 
    154  
    155         longNames.append( BdSourceVertexAttr ); 
    156         shortNames.append( "svi" ); 
    157         formatNames.append( "int" ); 
    158  
    159         stat = mesh.createBlindDataType( BdSourceVertexId, longNames, shortNames, formatNames ); 
    160         check_status( stat ); 
     153        bool hasBlindType = mesh.isBlindDataTypeUsed( BdSourceVertexId, &stat ); 
     154        check_status( stat ); 
     155 
     156        if( !hasBlindType ) 
     157        { 
     158                MStringArray longNames, shortNames, formatNames; 
     159 
     160                longNames.append( BdSourceVertexAttr ); 
     161                shortNames.append( "svi" ); 
     162                formatNames.append( "int" ); 
     163 
     164                stat = mesh.createBlindDataType( BdSourceVertexId, longNames, shortNames, formatNames ); 
     165                check_status( stat ); 
     166        } 
    161167} 
    162168 
     
    365371        for( int i = 0; i < numTris; i++ ) 
    366372        { 
    367                 int index; 
    368  
    369                 index = baseVert + indices[firstIndex + i * 3 + 0]; 
     373                int rawIdx, index; 
     374 
     375                rawIdx = indices[firstIndex + i * 3 + 0]; 
     376                index = baseVert + rawIdx; 
    370377                m_faceVertIndices.append( index ); 
    371378                m_textureUVIDs.append( index ); 
    372379                m_lightmapUVIDs.append( index ); 
    373380                m_vertexLightIDs.append( index ); 
    374                 m_sourceVertices.append( generateSourceIDs ? index : -1 ); 
     381                m_sourceVertices.append( generateSourceIDs ? firstVert + rawIdx : -1 ); 
    375382                 
    376                 index = baseVert + indices[firstIndex + i * 3 + 2]; 
     383                rawIdx = indices[firstIndex + i * 3 + 2]; 
     384                index = baseVert + rawIdx; 
    377385                m_faceVertIndices.append( index ); 
    378386                m_textureUVIDs.append( index ); 
    379387                m_lightmapUVIDs.append( index ); 
    380388                m_vertexLightIDs.append( index ); 
    381                 m_sourceVertices.append( generateSourceIDs ? index : -1 ); 
    382  
    383                 index = baseVert + indices[firstIndex + i * 3 + 1]; 
     389                m_sourceVertices.append( generateSourceIDs ? firstVert + rawIdx : -1 ); 
     390 
     391                rawIdx = indices[firstIndex + i * 3 + 1]; 
     392                index = baseVert + rawIdx; 
    384393                m_faceVertIndices.append( index ); 
    385394                m_textureUVIDs.append( index ); 
    386395                m_lightmapUVIDs.append( index ); 
    387396                m_vertexLightIDs.append( index ); 
    388                 m_sourceVertices.append( generateSourceIDs ? index : -1 ); 
     397                m_sourceVertices.append( generateSourceIDs ? firstVert + rawIdx : -1 ); 
    389398 
    390399                if( shaderBin != -1 ) 
     
    561570        check_status( stat ); 
    562571 
     572        MDagPath parentPath( objPath ); 
     573        stat = parentPath.pop(); 
     574        check_status( stat ); 
     575 
     576        MFnDagNode fnParent( parentPath, &stat ); 
     577        check_status( stat ); 
     578 
     579        fnParent.setName( MString( "bspSurface" ), &stat ); 
     580        check_status( stat ); 
     581 
    563582        for( uint i = 0; i < m_shaderFaceNums.size(); i++ ) 
    564583        { 
  • trunk/maya2q3/maya_entry.cpp

    r549 r550  
    2626 
    2727static const char *g_vendor = "HermitWorks"; 
    28 static const char *g_version = "3.3.4"; 
     28static const char *g_version = "3.3.5"; 
    2929static const char *g_reqVer = "Any"; 
    3030