mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-05 20:36:09 +08:00
Add C++ string of glTF Schema.
This commit is contained in:
parent
cf8b7cc0a4
commit
2673d1d3ef
@ -1,5 +1,6 @@
|
||||
import json
|
||||
from ref_resolver import RefResolver
|
||||
import base64
|
||||
|
||||
f = open("glTF.schema.json")
|
||||
j = json.loads(f.read())
|
||||
@ -7,5 +8,7 @@ j = json.loads(f.read())
|
||||
# call to API resolve method
|
||||
RefResolver("glTF.schema.json").resolve(j)
|
||||
|
||||
outfile = open("glTF.schema.resolved.json")
|
||||
outfile.write(json.dumps(j, indent=2))
|
||||
j_str = json.dumps(j, indent=2)
|
||||
|
||||
# Run json.dumps twice to get escaped string
|
||||
print("const char *kglTFSchemaString = " + json.dumps(j_str) + ";\n")
|
||||
|
2
tools/schema_ref_resolver/glTF.schema.resolved.inc
Normal file
2
tools/schema_ref_resolver/glTF.schema.resolved.inc
Normal file
File diff suppressed because one or more lines are too long
@ -31,8 +31,6 @@ class RefResolver:
|
||||
if key == "$ref":
|
||||
ref_frag = urlparse(value)
|
||||
ref_file = ref_frag.netloc + ref_frag.path
|
||||
print(ref_file)
|
||||
print(self.url_fragments.scheme)
|
||||
json_dump = {}
|
||||
if ref_file in cache:
|
||||
json_dump = cache[ref_file]
|
||||
@ -52,7 +50,6 @@ class RefResolver:
|
||||
#elif self.url_fragments.scheme == 'file':
|
||||
else:
|
||||
if isfile(ref_file):
|
||||
print(ref_file)
|
||||
# if the ref is another file -> go there and get it
|
||||
json_dump = json.load(open(ref_file))
|
||||
ref_id = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user