【问题标题】:ARCore Sceneform SDK linking materials Error?ARCore Sceneform SDK 链接素材错误?
【发布时间】:2020-05-14 18:04:56
【问题描述】:

我只有一个简单的表格模型,它有 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',
}

About是模型的SFA文件。

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

这是出现的日志错误。

【问题讨论】:

    标签: kotlin textures assets arcore sceneform


    【解决方案1】:

    我得到了我们需要在注入块中添加 material_name 属性的答案。这将摆脱“普通”关键字的重复。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-27
      • 2019-07-21
      • 1970-01-01
      • 2019-06-21
      • 1970-01-01
      • 1970-01-01
      • 2019-01-24
      • 2018-12-13
      相关资源
      最近更新 更多