Commit Graph

280 Commits

Author SHA1 Message Date
Syoyo Fujita
4f9dd612b8 Remove sampler.wrapR parameter(unused tinygltf extension). Fixes #287
Suppress clang `-Wdocumentation-unknown-command` warning.
2020-12-04 00:50:46 +09:00
Syoyo Fujita
eeef0ec9e5 Add SetPreserveImageChannels feature(preserve image channels in stored image file. Only effective when using builtin ImageLoad function(STB image load)). 2020-10-31 19:35:55 +09:00
Syoyo Fujita
85962aee8a Serialize empty JSON object when material has all default parameters. Fixes #294 . 2020-10-22 22:27:12 +09:00
Syoyo Fujita
3f1d5ccbed Fix inequality. Should allow 0 for bufferView. 2020-07-15 13:52:39 +09:00
Rahul Sheth
9c894f2d89 Fix sparse morph targets 2020-07-13 13:56:50 -04:00
Rahul Sheth
4909d0be84 Run clang-format 2020-07-10 14:27:46 -04:00
Rahul Sheth
17fc862965 Use std::string instead of const char* for GetKey function 2020-07-10 14:27:37 -04:00
daemyung jang
d417d3c2d3 Initialize member variables 2020-07-03 13:27:39 +09:00
Syoyo Fujita
b275837d50 Add comment on tinygltf::ExpandFilePath() 2020-06-06 18:13:15 +09:00
Syoyo Fujita
e05f9ca781 Use nullptr instead of NULL. 2020-06-06 17:11:50 +09:00
cwbhhjl
e1fd746d21 fix an error occurred while expanding utf8 path 2020-06-04 10:40:38 +08:00
Ivo van Dongen
be5639536d cast size_t to uint_64_t for rapidjson serialization 2020-05-29 11:24:11 +03:00
Syoyo Fujita
66938e0ea5 Support llvm-mingw(clang + libcxx) to open UTF-8 path in ifstream. 2020-05-18 20:50:45 +09:00
Syoyo Fujita
67c27aa091 Fix existing "extensions" were overwritten in serialization when the scene contains lights(serialized as "KHR_light_punctual")
Append "KHR_light_punctual" to `extensionsUsed` if not exist in serialization.
Apply clang-format.
Fixes #261
2020-05-15 21:32:06 +09:00
Syoyo Fujita
e306c0fc7f Only serialize light.range when range > 0. Fixes #260 2020-05-13 21:22:23 +09:00
Syoyo Fujita
3639a23222 Return type must be int for GetNumberAsInt(). Fixes #258 2020-05-11 19:07:00 +09:00
Syoyo
4e803bdd96 Serialize extension and extras for Camera. Fixes #257 2020-05-09 02:41:07 +09:00
Syoyo Fujita
5d34059f06 Fix float and int comparison. 2020-04-29 19:16:35 +09:00
Syoyo Fujita
bd73fe76f1 Include cmath for std::fabs 2020-04-29 17:33:48 +09:00
Syoyo Fujita
3ca5b278a1 Return false for zero-sized asset. Fixes #255 2020-04-28 01:06:34 +09:00
Luiz Henrique Laurini
8a127d5771 Fix write functions so they work with MinGW 2020-04-12 16:00:33 -03:00
Syoyo Fujita
c91003e7bd Merge pull request #250 from FsiGuy00015623/prevent-cloning-buffer-images
Prevent cloning of images in buffers
2020-03-10 14:53:13 +09:00
FsiGuy00015623
5d104f637a Prevent cloning of images in buffers
Now, in UpdateImageObject, if an image has no URI but had a valid bufferView, it will no longer change the image object or copy the buffer object to an outside file at baseDir. 
(When saving files from streams, this function would previously save textures in buffers as "#.png" in the program's working directory instead of the model file's directory, and create a broken link in the updated image object if the two locations were different.)
2020-03-09 16:57:21 -05:00
Sanjeet Suhag
164a84f090 Ensures only valid bufferViews are mentioned in accessor 2020-03-04 17:40:10 -05:00
Syoyo Fujita
70456ba892 Merge branch 'uri-decode' 2020-03-03 18:49:27 +09:00
Syoyo Fujita
027e39e8fb Update copyright year.
Add note on the result from fuzzer test.
2020-02-24 01:36:24 +09:00
Miguel Sousa
632810eeca Reading copyright field in ParseAsset() 2020-02-20 14:16:58 +01:00
Selmar Kok
694f27461d Merge remote-tracking branch 'origin/master' into some_empty_array_fixes 2020-01-28 13:46:22 +01:00
Selmar Kok
3c15e73a6b dont serialize a couple of empty arrays 2020-01-28 13:45:38 +01:00
Marcin Kacprzak
327d1da3ee Set target for bufferView used by MorphTargets 2020-01-22 13:13:35 +01:00
Selmar Kok
02da28450a Merge remote-tracking branch 'origin/master' into channel_target_extensions 2020-01-21 18:46:58 +01:00
Selmar Kok
2ded9adf42 add channel.target extensions 2020-01-21 18:45:24 +01:00
sammyKhan
b0b17ed287 Initialize defaultScene to -1
To prevent undefined behavior if the model is serialized without defaultScene being set explicitly.
2020-01-17 13:41:16 +01:00
Frank Galligan
d2cdff2070 Fix loading images with spaces on Linux
This change quotes the string before it is passed into wordexp.

This addresses issue https://github.com/syoyo/tinygltf/issues/236
2020-01-13 15:06:56 -08:00
Syoyo Fujita
fabe172bf0 Initial support of decoding percent-encoding URI. 2020-01-08 02:38:01 +09:00
Syoyo Fujita
e943dfccf8 Merge pull request #233 from 8i/fix-animation-sampler-serialization
Reserve space for animation samplers in serialization
2020-01-08 00:47:41 +09:00
Syoyo Fujita
c1d4f36bb1 Suppress clang warnings. Fixes #234 2020-01-08 00:40:41 +09:00
Jacek
7ddfe918c6 Reserve space for animation samplers in serialization 2020-01-06 15:15:21 -06:00
Syoyo Fujita
0c4d18ee99 Fill BufferView variables with initial/invalid values just in case. 2020-01-02 22:07:25 +09:00
Marcin Kacprzak
5cff80f10d Do not set target on bufferView pointing to animation data 2020-01-02 13:00:48 +01:00
Syoyo Fujita
741d8f4ba6 Allow empty buffer when serializing glTF buffer data. 2019-12-19 14:20:01 +09:00
zhaozhiquan
478c77d6f9 Fix the issue that the extension of primitive written as extension of mesh. 2019-12-18 11:28:57 +08:00
Eero Pajarre
f161e7c048 Added support for BIN chunk when saving in glb format
If saving in glb (binary) format the first buffer in
model is saved as gbl chunk number 1 in binary format.
This operation is not performed if the first buffer
as an url specified.
2019-11-18 14:15:48 +02:00
Eero Pajarre
29c307fef5 Only serialize Accessor.normalized if it is true 2019-11-18 13:09:25 +02:00
Eero Pajarre
fa9f361ab2 Added Accessor initializers
Added Accessor intializers
Now byteOffset and normalized are initialized to their default
values. componentType and Type are initialized to bad values
on purpose, they must be set when loading or creating the model.
2019-11-18 12:59:05 +02:00
Syoyo Fujita
4accacb877 not is alternative keyword and not recommended to use. Fixes #225 2019-11-17 02:11:59 +09:00
Syoyo Fujita
d6f17af683 Merge branch 'master' of github.com:syoyo/tinygltf 2019-11-16 17:00:42 +09:00
Syoyo Fujita
7eebbb6d68 Correct computation of padding size. Fixes #224. 2019-11-16 17:00:17 +09:00
Syoyo Fujita
634ab23649 Fix MinGW code path reused linux code path. 2019-11-10 15:31:17 +09:00
Syoyo Fujita
8c9ae15ca8 fopen_s -> fopen in linux(posix) code path. 2019-11-09 20:52:56 +09:00