ARCore Sceneform SDK 链接素材出错?

ARCore Sceneform SDK linking materials Error?

我只有一个简单的 table 模型有 3 个部分 Top、Brick、Bottom。我将法线贴图应用到底部并且成功了,但是当我尝试为砖块和顶部应用法线贴图时它说,重复字段名称。我可以弄清楚它说的是什么错误。我正在按照本文档中的说明进行操作。 https://developers.google.com/sceneform/develop/sfa

{
  animations: [
    {
      path: 'sampledata/models/sculpting-table/source/SculptingTable.fbx',
    },
  ],
  materials: [
    {
      name: 'TableTop',
      parameters: [
        {
          baseColor: [
            1,
            1,
            1,
            1,
          ],
        },
        {
          baseColorMap: 'SculptingTable_TableTop_AlbedoTransparency',
        },
        {
          normalMap: null,
        },
        {
          interpolatedColor: null,
        },
        {
          metallic: 0,
        },
        {
          metallicMap: null,
        },
        {
          roughness: 1,
        },
        {
          roughnessMap: null,
        },
        {
          opacity: null,
        },
      ],
      source: 'build/sceneform_sdk/default_materials/fbx_material.sfm',
    },
    {
      name: 'TableBottom',
      parameters: [
        {
          baseColor: [
            1,
            1,
            1,
            1,
          ],
        },
        {
          baseColorMap: 'SculptingTable_TableBottom_AlbedoTranspare',
        },
        {
          normalMap: 'bumps',
        },
        {
          interpolatedColor: null,
        },
        {
          metallic: 0,
        },
        {
          metallicMap: null,
        },
        {
          roughness: 1,
        },
        {
          roughnessMap: null,
        },
        {
          opacity: null,
        },
      ],
      source: 'build/sceneform_sdk/default_materials/fbx_material.sfm',
    },
    {
      name: 'TableBricks',
      parameters: [
        {
          baseColor: [
            1,
            1,
            1,
            1,
          ],
        },
        {
          baseColorMap: 'SculptingTable_TableBricks_AlbedoTranspare',
        },
        {
          normalMap: null,
        },
        {
          interpolatedColor: null,
        },
        {
          metallic: 0,
        },
        {
          metallicMap: null,
        },
        {
          roughness: 1,
        },
        {
          roughnessMap: null,
        },
        {
          opacity: null,
        },
      ],
      source: 'build/sceneform_sdk/default_materials/fbx_material.sfm',
    },
  ],
  model: {
    attributes: [
      'Position',
      'TexCoord',
      'Orientation',
      'BoneIndices',
      'BoneWeights',
    ],
    collision: {},
    file: 'sampledata/models/sculpting-table/source/SculptingTable.fbx',
    name: 'SculptingTable',
    recenter: 'root',
  },
  samplers: [
    {
      file: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBricks_AlbedoTranspare.png',
      name: 'SculptingTable_TableBricks_AlbedoTranspare',
      pipeline_name: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBricks_AlbedoTranspare.png',
    },
    {
      file: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBottom_AlbedoTranspare.png',
      name: 'SculptingTable_TableBottom_AlbedoTranspare',
      pipeline_name: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBottom_AlbedoTranspare.png',
    },
    {
      file: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableTop_AlbedoTransparency.png',
      name: 'SculptingTable_TableTop_AlbedoTransparency',
      pipeline_name: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableTop_AlbedoTransparency.png',
    },
    {
    file: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBottom_Normal.png',
    name: 'bumps',
    injections: [
           {usage: "Normal",},
         ],
    },

    {
        file: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBricks_Normal.png',
        name: 'bumpsBrick',
        injections: [
               {usage: "Normal",},
             ],
        },


  ],
  version: '0.54:2',
}

关于是模型的SFA文件。

Validating Materials: Validating material: Jsonnet Error: [1]: RUNTIME ERROR: duplicate field name: "Normal"

这是出现的日志错误。

我得到了我们需要在注入块中添加 material_name 属性的答案。这将消除 "Normal" 关键字的重复。

{
    file: '/Users/vishweshwaran/Downloads/sculpting-table/textures/SculptingTable_TableBottom_Normal.png',
    name: 'bumps',
    injections: [
           {
              material_name:"name_of_your_material",
              usage: "Normal",},
         ],
    },