Skip to content

sampler2D triggers schema validation errors in Collada 1.5 #648

@jeanbmar

Description

@jeanbmar

Using instance_image on sampler2D triggers validation errors. Something feels off with the schema.
Keeping sampler2D empty validates the schema.

Error:

xmllint --noout --schema http://www.khronos.org/files/collada_schema_1_5 issue.dae
element sampler2D: Schemas validity error : Element '{http://www.collada.org/2008/03/COLLADASchema}sampler2D': Character content is not allowed, because the content type is empty.

Test Case:

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2008/03/COLLADASchema" version="1.5.0">
  <asset>
    <contributor>
      <author>issue</author>
      <authoring_tool>issue</authoring_tool>
    </contributor>
    <created>2021-03-24T13:32:13.351Z</created>
    <modified>2021-03-24T13:32:13.351Z</modified>
    <up_axis>Y_UP</up_axis>
  </asset>
  <library_images>
    <image id="sc-3-d-shelly-v-2-01-ktx">
      <init_from>
        <ref>sc3d/shelly_v2_01.ktx</ref>
      </init_from>
    </image>
  </library_images>
  <library_effects>
    <effect id="character_mat-effect">
      <profile_COMMON>
        <newparam sid="sc-3-d-shelly-v-2-01-ktx-sampler">
          <sampler2D>
            <instance_image url="#sc-3-d-shelly-v-2-01-ktx"/>
          </sampler2D>
        </newparam>
        <technique sid="common">
          <phong>
            <emission>
              <color>0 0 0 1</color>
            </emission>
            <ambient>
              <color>0 0 0 1</color>
            </ambient>
            <diffuse>
              <texture texture="sc-3-d-shelly-v-2-01-ktx-sampler" texcoord="UVMap"/>
            </diffuse>
            <index_of_refraction>
              <float>4</float>
            </index_of_refraction>
          </phong>
        </technique>
      </profile_COMMON>
    </effect>
  </library_effects>
  <library_materials>
    <material id="character_mat">
      <instance_effect url="#character_mat-effect"/>
    </material>
  </library_materials>
  <library_visual_scenes>
    <visual_scene id="default-scene">
      <node id="CHARACTER" sid="CHARACTER" type="NODE"></node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#default-scene"/>
  </scene>
</COLLADA>

People mentioning this problem:

  1. https://community.khronos.org/t/load-textures-in-collada-1-5/104653
  2. https://community.khronos.org/t/schema-problem-with-sampler2d/6329

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions