2016-09-17 78 views
0

將材質導入到AssImp中時,屬性會縮減爲小的子集(漫射,發射等)。有什麼方法可以訪問不屬於該子集的材料屬性?例如在下面的例子中,我可以得到refl_samples嗎?任何方式從AssImp中檢索所有材質屬性?

例如

這種材料在FBX文件

Material: 1821000800, "Material::MRTest", "" { 
    Version: 102 
    ShadingModel: "unknown" 
    MultiLayer: 0 
    Properties70: { 
     P: "ShadingModel", "KString", "", "", "unknown" 
     P: "AmbientColor", "ColorRGB", "Color", "",0.847058892250061,0.501960813999176,0.898039281368256 
     P: "DiffuseColor", "ColorRGB", "Color", "",0.847058892250061,0.501960813999176,0.898039281368256 
     P: "SpecularColor", "ColorRGB", "Color", "",0.600000023841858,0.600000023841858,0.600000023841858 
     P: "SpecularFactor", "double", "Number", "",2 
     P: "ShininessExponent", "double", "Number", "",1024 
     P: "TransparencyFactor", "double", "Number", "",0 
     P: "EmissiveColor", "ColorRGB", "Color", "",0,0,0 
     P: "EmissiveFactor", "double", "Number", "",0 
     P: "3dsMax", "Compound", "", "" 
     P: "3dsMax|ClassIDa", "int", "Integer", "",1890604853 
     P: "3dsMax|ClassIDb", "int", "Integer", "",1242969684 
     P: "3dsMax|SuperClassID", "int", "Integer", "",3072 
     P: "3dsMax|Parameters", "Compound", "", "" 
     P: "3dsMax|Parameters|diff_color", "ColorAndAlpha", "", "A",0.847058892250061,0.501960813999176,0.898039281368256,1 
     P: "3dsMax|Parameters|diff_rough", "Float", "", "A",0 
     P: "3dsMax|Parameters|diff_weight", "Float", "", "A",1 
     P: "3dsMax|Parameters|refl_color", "ColorAndAlpha", "", "A",1,1,1,1 
     P: "3dsMax|Parameters|refl_gloss", "Float", "", "A",1 
     P: "3dsMax|Parameters|refl_samples", "Integer", "", "A",8 
. 
. 
. 

將得到簡化爲:

<MatPropertyList num="12"> 
    <MatProperty key="?mat.name" 
    type="string" tex_usage="n/a" tex_index="0"> 
     "GreenTeapot" 
    </MatProperty> 
    <MatProperty key="$clr.diffuse" 
    type="float" tex_usage="n/a" tex_index="0" size="3"> 
     0.133333 0.796079 0.172549 
    </MatProperty> 
    <MatProperty key="$clr.emissive" 
    type="float" tex_usage="n/a" tex_index="0" size="3"> 
     0.000000 0.000000 0.000000 
    </MatProperty> 
    <MatProperty key="$clr.ambient" 
    type="float" tex_usage="n/a" tex_index="0" size="3"> 
     0.133333 0.796079 0.172549 
    </MatProperty> 
    <MatProperty key="$clr.specular" 
    type="float" tex_usage="n/a" tex_index="0" size="3"> 
     0.000000 0.000000 0.000000 
    </MatProperty> 
    <MatProperty key="$mat.opacity" 
    type="float" tex_usage="n/a" tex_index="0" size="1"> 
     1.000000 
    </MatProperty> 
    <MatProperty key="$mat.reflectivity" 
    type="float" tex_usage="n/a" tex_index="0" size="1"> 
     0.000000 
    </MatProperty> 
    <MatProperty key="$mat.shinpercent" 
    type="float" tex_usage="n/a" tex_index="0" size="1"> 
     2.000000 
    </MatProperty> 
    <MatProperty key="$mat.shininess" 
    type="float" tex_usage="n/a" tex_index="0" size="1"> 
     2.000000 
    </MatProperty> 

回答

0

可能的後處理方法可能會刪除這些屬性。在旗幟中嘗試不使用aiProcess_RemoveRedundantMaterials。如果你想刪除其他材料,只保留幾個,那麼這是可配置使用AI_CONFIG_PP_RRM_EXCLUDE_LIST

+1

謝謝。雖然我實際上看過源代碼,而且這些屬性永遠不會被讀取。我實際上黑了我的本地版本的代碼\ FBXConverter.cpp,以便一切都被添加。 – griffin2000

相關問題