ARCore Sceneform SDK链接材料错误?

问题描述 投票:0回答:1

我只是有一个简单的表模型,该模型具有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"

这是出现的日志错误。

kotlin textures assets arcore sceneform
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.