@@ -13,6 +13,32 @@ class ExtStructuralMetadataExtension : SchemaProcessor
1313 private static string RootSchemaUri => Constants . CustomExtensionsPath ( "EXT_structural_metadata" , "glTF.EXT_structural_metadata.schema.json" ) ;
1414 private static string MeshPrimitiveSchemaUri => Constants . CustomExtensionsPath ( "EXT_structural_metadata" , "mesh.primitive.EXT_structural_metadata.schema.json" ) ;
1515
16+ public override IEnumerable < ( string TargetFileName , SchemaType . Context Schema ) > ReadSchema ( )
17+ {
18+ yield return ( "Ext.CESIUM_ext_structural_metadata_root.g" , ProcessRoot ( ) ) ;
19+ yield return ( "Ext.CESIUM_ext_structural_metadata_primitive.g" , ProcessMeshPrimitive ( ) ) ;
20+ }
21+
22+ private static SchemaType . Context ProcessRoot ( )
23+ {
24+ var ctx = SchemaProcessing . LoadExtensionSchemaContext ( RootSchemaUri ) ;
25+
26+ // for now we simply remove the default value, it can be set
27+ // in the constructor or on demand when the APIs are Called.
28+ var fld = ctx . FindClass ( ExtensionPropertyTexturePropertyName ) . GetField ( "channels" ) ;
29+ fld . RemoveDefaultValue ( ) ;
30+
31+ return ctx ;
32+ }
33+
34+ private static SchemaType . Context ProcessMeshPrimitive ( )
35+ {
36+ var ctx = SchemaProcessing . LoadExtensionSchemaContext ( MeshPrimitiveSchemaUri ) ;
37+ return ctx ;
38+ }
39+
40+
41+
1642 public override void PrepareTypes ( CSharpEmitter newEmitter , SchemaType . Context ctx )
1743 {
1844 newEmitter . SetRuntimeName ( "EXT_structural_metadata glTF Mesh Primitive extension" , "ExtStructuralMetadataMeshPrimitive" , Constants . CesiumNameSpace ) ;
@@ -50,35 +76,7 @@ public override void PrepareTypes(CSharpEmitter newEmitter, SchemaType.Context c
5076 newEmitter . SetFieldToChildrenDictionary ( ctx , "Schema in EXT_structural_metadata" , "enums" ) ;
5177 }
5278
53- public override IEnumerable < ( string TargetFileName , SchemaType . Context Schema ) > Process ( )
54- {
55- yield return ( "Ext.CESIUM_ext_structural_metadata_root.g" , ProcessRoot ( ) ) ;
56- yield return ( "Ext.CESIUM_ext_structural_metadata_primitive.g" , ProcessMeshPrimitive ( ) ) ;
57- }
58-
59- private static SchemaType . Context ProcessRoot ( )
60- {
61- var ctx = SchemaProcessing . LoadSchemaContext ( RootSchemaUri ) ;
62- ctx . IgnoredByCodeEmitter ( "glTF Property" ) ;
63- ctx . IgnoredByCodeEmitter ( "glTF Child of Root Property" ) ;
64- ctx . IgnoredByCodeEmitter ( "Texture Info" ) ;
65- var fld = ctx . FindClass ( ExtensionPropertyTexturePropertyName ) . GetField ( "channels" ) ;
66-
67- // for now we simply remove the default value, it can be set
68- // in the constructor or on demand when the APIs are Called.
69- fld . RemoveDefaultValue ( ) ;
70-
71- return ctx ;
72- }
73-
74- private static SchemaType . Context ProcessMeshPrimitive ( )
75- {
76- var ctx = SchemaProcessing . LoadSchemaContext ( MeshPrimitiveSchemaUri ) ;
77- ctx . IgnoredByCodeEmitter ( "glTF Property" ) ;
78- ctx . IgnoredByCodeEmitter ( "glTF Child of Root Property" ) ;
79- ctx . IgnoredByCodeEmitter ( "Texture Info" ) ;
80- return ctx ;
81- }
79+
8280
8381
8482 }
0 commit comments