"""GLB material defaults through the real writer, importer, and assembly CLI. Synthetic fixtures only. Literal expectations follow the pinned Khronos schema: https://github.com/KhronosGroup/glTF/blob/5b00b913b74c8f0260c64578b98a09ef2dde0b41/specification/2.0/schema/material.pbrMetallicRoughness.schema.json The same revision's Specification.adoc#default-material applies these defaults when a primitive does not reference a material. """ import copy import json from pathlib import Path import struct import subprocess import sys import tempfile import unittest ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT / "tools")) import ped_assemble as pa DEFAULTS = {"baseColorFactor": [1.0, 1.0, 1.0, 1.0], "metallicFactor": 1.0, "roughnessFactor": 1.0} CLAY = {"baseColorFactor": [0.8, 0.8, 0.8, 1.0], "metallicFactor": 0.0, "roughnessFactor": 0.85} OMISSIONS = ("baseColorFactor", "metallicFactor", "roughnessFactor", "pbrMetallicRoughness", "empty_pbr", "empty_material", "no_reference", "no_materials") def split_glb(data): length = struct.unpack_from("