changed getNumMaterials to getNumUsedMaterials, because iterating over indices is only valid for the used materials.
changed getNumMaterials to getNumUsedMaterials, because iterating over indices is only valid for the used materials.

Jojendersie/Bim