有什么办法从AssImp中检索所有材料属性?

时间:2016-09-17 21:42:18

标签: assimp

当材料导入AssImp时,属性会减少到一个小的子集(漫反射,发射等)。有没有办法访问不属于该子集的材料属性?例如在下面的示例中,我可以获得refl_samples吗?

e.g。

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>

1 个答案:

答案 0 :(得分:0)

后期处理方法可能会删除这些属性。在标志中尝试不使用aiProcess_RemoveRedundantMaterials。如果您想删除其他材料并只保留一些材料,则可以使用AI_CONFIG_PP_RRM_EXCLUDE_LIST

进行配置
相关问题