Commit Graph

3108 Commits (dd3cb74b218c3227167c652c3155978cd2fd7d7f)

Author SHA1 Message Date
Kim Kulling ad2ff9fd71 check for area test if the face is a triangle. 2017-11-09 21:40:10 +01:00
Kim Kulling 30e06f7437 closes https://github.com/assimp/assimp/issues/216: check the area of a triangle to check if its degenerated or not. 2017-11-09 21:31:16 +01:00
Daniel Hritzkiv 9ec117d0bc
Fix export of deleted meshes; Add LazyDict::Remove method
When I was merging a node’s multiple meshes into that node’s first mesh’s primitives, I was deleting the merged meshes from the node.

However, I wasn’t deleting the merged meshes from the mAsset->meshes Dict, causing the gltf2 export to contain extra unreferenced meshes and duplicate primitives.

This new code adds a new method to LazyDict, which removes the object from it, taking care to update indexes of the subsequent objects. This change also requires that `Ref`s of `Mesh`es (stored in node->meshes) have their indexes updated.
2017-11-08 18:31:32 -05:00
Kim Kulling 5bc4e73727
Merge branch 'master' into issue_1292 2017-11-08 22:52:46 +01:00
Kim Kulling ab639a71ae
Merge branch 'master' into issue_1315 2017-11-08 21:09:02 +01:00
Kim Kulling 36475bf868 closes https://github.com/assimp/assimp/issues/1292: export class subdivision 2017-11-08 20:50:16 +01:00
Kim Kulling cdfd4b9702 closes https://github.com/assimp/assimp/issues/1315: check in exporting against out-of-bounds-access . 2017-11-08 20:44:53 +01:00
Kim Kulling 6954c7d75b
Merge branch 'master' into master 2017-11-08 18:34:25 +01:00
Kim Kulling fe55bc9996
Update ColladaExporter.cpp
fix build
2017-11-08 18:34:16 +01:00
Kim Kulling 6b826fecfd
Merge branch 'master' into issue_1251 2017-11-08 01:07:35 +01:00
Kim Kulling f41ed2f41f closes https://github.com/assimp/assimp/issues/1251: use correct lookup for utf32. 2017-11-08 01:07:04 +01:00
Kim Kulling 29cf414468
Merge branch 'master' into md2_fix 2017-11-07 22:03:02 +01:00
Kim Kulling 75fdd25b6b
Merge branch 'master' into issue_104 2017-11-07 11:27:06 +01:00
Kim Kulling da7ce89ff2
Update STLLoader.cpp
add missing const.
2017-11-07 10:47:27 +01:00
Kim Kulling b87e7643d2
Update STLLoader.cpp
Fix memory-alignment bug.
2017-11-07 10:42:51 +01:00
Kim Kulling 4ff2592747
Update STLLoader.h
Fixed a typo.
2017-11-07 00:31:09 +01:00
Kim Kulling 9a9f18bbed closes https://github.com/assimp/assimp/issues/104: deal with more solids in one STL file. 2017-11-06 22:30:07 +01:00
Kim Kulling 4a4f3fddc7 closes https://github.com/assimp/assimp/issues/213: log an error instead of letting the fbx-importer crash. 2017-11-05 22:52:07 +01:00
Kim Kulling ab3cf3687c
Merge branch 'master' into UnitTest_X3D 2017-11-05 18:10:10 +01:00
Kim Kulling 2929a27edc add unittest for x3d-importer. 2017-11-05 17:41:26 +01:00
Kim Kulling 02b042d78e closes https://github.com/assimp/assimp/issues/1351: use correct name for obj-meshname export for groups. 2017-11-05 16:35:22 +01:00
Kim Kulling a33e115fd1 fix mem-lead: face will be not released in case of an error. 2017-11-04 18:26:30 +01:00
Kim Kulling c9ada44ab5 Fix memory leak in case of an error. 2017-11-04 17:05:23 +01:00
Kim Kulling c700c08fa5
Merge branch 'master' into master 2017-11-04 10:45:57 +01:00
Kim Kulling b7bd006304
Merge branch 'master' into ObjExporter_nomtl 2017-11-04 09:32:50 +01:00
Kim Kulling 4587e63e2f
Merge branch 'master' into fix_trivial_warnings 2017-11-03 20:05:16 +01:00
Daniel Hritzkiv 2922753589
Return early when element is TextureFile
In cases where the TextureFile name would start with an integer, `strtoul10` would parse that number and incorrectly set `numOccur` to that number. This caused PLY parsing to fail for vertex positions.

Since TextureFile is a single line, and does not have any follow-up lines, it’s okay to return early
2017-11-03 11:50:28 -04:00
Kim Kulling d279a3cc02
Merge branch 'master' into fix_trivial_warnings 2017-11-03 10:35:02 +01:00
Thomas Lemaire 5b76a31485 fix trivial warnings
mainly unused parameter and unused function
some parameters are indeed used in a debug built, I used the
(void)(param) trick
warnings reported by clang 4
2017-11-02 11:13:52 +01:00
thomas-lemaire 931542bf3c
Merge branch 'master' into ObjExporter_nomtl 2017-11-02 10:46:57 +01:00
Daniel Hritzkiv e52e44ea07
Formatting 2017-10-31 15:18:08 -04:00
Daniel Hritzkiv cc4531459f
Set mNumUVComponents to 0 when deleting texture coordinate sets 2017-10-31 15:14:21 -04:00
Kim Kulling 8be196f77d closes https://github.com/assimp/assimp/issues/1490 : fix invalid access to mesh array when the array is empty. 2017-10-31 14:03:03 +01:00
Kim Kulling af4556d569 only scale the root node because this will rescale all children nodes as well. 2017-10-31 13:08:24 +01:00
Kim Kulling 64ee21024b Add missing file. 2017-10-31 13:07:07 +01:00
Kim Kulling ae020281e2 Add unittest 2017-10-31 12:24:32 +01:00
Lars Jørgen Solberg 711050de8a fix frame pointer arithmetic 2017-10-30 19:08:51 +01:00
thomas-lemaire 4d09e61b13
Merge branch 'master' into master 2017-10-30 11:41:25 +01:00
Victor NG 99b9ba4c11
Merge branch 'master' into master 2017-10-30 16:33:47 +08:00
Victor NG aca8f068d0
Update ColladaExporter.cpp 2017-10-30 16:29:57 +08:00
Kim Kulling bbeb9dd640 Use correct lookup if scaling is enabled. 2017-10-29 23:18:37 +01:00
Kim Kulling f49de6ecfe closes https://github.com/assimp/assimp/issues/1514: add postprocess step for scaling 2017-10-29 20:28:59 +01:00
Thomas 18cef9b391 [ObjExporter] add a "no mtl" version of the obj exporter 2017-10-27 10:14:38 +02:00
Daniel Hritzkiv 8b73ec7541
Fix shininess to roughness conversion; Add comments
Was accidentally flipping to value (1 - x) twice, thus negating the effect.
2017-10-26 11:33:33 -04:00
Kim Kulling bfa33b50ad Merge branch 'master' into gltf2-materials 2017-10-24 10:40:20 +02:00
Alexandre Avenel cc8374dd80 Return exception when obj file contains invalid face indice 2017-10-21 20:58:00 +02:00
Victor NG 90ba199ad4 Update ColladaExporter.cpp 2017-10-21 18:28:14 +08:00
Victor NG cd4ef0a2e9 Update ColladaExporter.h 2017-10-21 18:15:46 +08:00
ndotl 8cf61c3c89 Merge branch 'master' into adsk-contrib-fix-std-stream-overflow 2017-10-20 15:22:49 +02:00
Daniel Hritzkiv 6e88838602
powf -> pow
Fix build errors on linux
2017-10-19 16:21:29 -04:00
Daniel Hritzkiv 40147d253d
Prefer “BLEND” over “MASK” as an alphaMode default
“BLEND” is a much nicer alphaMode value (if the hardware supports it – not a steep requirement) than “MASK” as mask is either fully opaque or fully transparent, depending on the alphaCutoff. This matches many other converters’ alphaMode default.
2017-10-19 16:21:29 -04:00
Daniel Hritzkiv 89358458f0
Approximate specularity / glossiness in metallicRoughness materials
Before, models (of traditional lighting models) with specularity/glossiness would be completely flat when exported to metallicRoughness. These changes approximate glossiness (as an inverse of roughness, with specular intensity as a multiplier) both reading from gltf2 and writing to gltf2.
2017-10-19 16:21:29 -04:00
Daniel Hritzkiv a898c1f2d1
SpecularFactor import and export improvements
The changes here (which only apply to reading from or writing to pbrSpecularGlossiness) will:

- store and read specular color on `AI_MATKEY_COLOR_SPECULAR ` rather than `AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULAR_FACTOR`
- store and read specular texture from `aiTextureType_SPECULAR` rather than `AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULARGLOSSINESS_TEXTURE`. Even though pbrSG’s specularGlossiness texture uses the alpha channel for glossiness, it will still work well enough with just the RGB channels of the image
2017-10-19 16:21:29 -04:00
Daniel Hritzkiv c71790c78d
Diffuse color and diffuse texture import and export improvements
These changes do a better of importing and exporting baseColor colors and textures, as well as diffuse colors and textures (in the case of pbrSpecularGlossiness)

- baseColorFactor will be stored on both `$clr.diffuse` and `$mat.gltf.pbrMetallicRoughness.baseColorFactor`, and will be extracted from `$mat.gltf.pbrMetallicRoughness.baseColorFactor` first, and falling back to `$clr.diffuse`. The behaviour for baseColorTexture is similar
- pbrSG’s diffuseFactor will now only be store on `$clr.diffuse` (overwriting any previous assignments to `$clr.diffuse`, e.g. from metallicRoughness’ baseColorFactor, as diffuseFactor is more analogous to diffuse color than baseColor), and will only extract from `$clr.diffuse`
2017-10-19 16:21:16 -04:00
Daniel Hritzkiv 5eaf083fbd
Fix output of glTF 1 version string
Was writing out “\u0001” instead of “1.0” as the data types were incorrect
2017-10-19 12:43:52 -04:00
Kim Kulling b2eb599176 Update ColladaExporter.cpp
Retrigger travis.
2017-10-16 18:51:25 +02:00
Kim Kulling 44ad80201c Merge branch 'master' into adsk-contrib-fix-std-stream-overflow 2017-10-14 21:47:21 +02:00
Jared Mulconry f8c4002294 Fixed a divide by zero error in IFCBoolean that was latent, but nevertheless a bug 2017-10-14 18:46:19 +03:00
Turo Lamminen 9a6b141568 FBX: Replace bad pointer casting with memcpy 2017-10-14 18:46:19 +03:00
Turo Lamminen 7cbb5f4d3b B3DImporter: Replace bad pointer casting with memcpy 2017-10-14 18:46:19 +03:00
Kim Kulling e662f2dc6f Blender: fix short overflow. 2017-10-13 22:41:38 +02:00
Kim Kulling e79848ff79 Merge branch 'master' into adsk-contrib-fix-std-stream-overflow 2017-10-11 13:49:47 +02:00
Jared Mulconry 3e7dbb5dfb Merge branch 'master' of github.com:assimp/assimp into appveyor 2017-10-11 19:06:29 +11:00
Kim Kulling a1b79e23e6 Merge branch 'master' into adsk-contrib-fix-std-stream-overflow 2017-10-10 19:33:07 +02:00
Kim Kulling c128e7e56c Merge branch 'master' into issue_1453 2017-10-10 18:20:22 +02:00
Jared Mulconry fa91a0f64c Another minor source change, this time even more minor than the last. Let's see what the cache can do with this. 2017-10-10 22:45:45 +11:00
Jared Mulconry 1497cc27b2 Cleaned up the whitespace again. Let's see how the cache does. 2017-10-10 22:08:13 +11:00
Jared Mulconry b8ad03baa1 Because I have to change a file somewhere to properly test the cache on AppVeyor, I've made some whitespace a bit better. 2017-10-10 19:45:57 +11:00
ndotl 7c8e8e04fa Merge branch 'master' into adsk-contrib-fix-std-stream-overflow 2017-10-09 16:00:46 +02:00
Haik Lorenz 7353d25c13 Prevent failing stringstream to crash the export process
Text exporters are using string streams to hold the file content first and then write them to the file in a single pass. If for whatever reason the stream has the fail bit set, tellp() will return pos_type(-1), which in turn makes the subsequent write crash - at least on Windows systems. One reason for the stream being in fail state is when its size exceeds 2^31 bytes, even on 64-bit systems (i.e., when very large scenes get exported).

The fix is checking the fail() before even opening the file.
2017-10-09 15:47:17 +02:00
Kim Kulling d60fe38253 Merge branch 'master' into master 2017-10-09 00:07:43 +02:00
Turo Lamminen cd64eae590 GenericProperty: Remove useless const qualifier from return value 2017-10-08 12:45:48 +03:00
Turo Lamminen 7e033c6cef FBX: Remove useless const qualifier from return value
const qualifier on primitive return type does nothing.
2017-10-08 12:45:02 +03:00
Kim Kulling b57011552b Merge branch 'master' into issue_1453 2017-10-07 19:08:52 +02:00
Kim Kulling f925e2cf4e Reproduce issue and remove assertion when a nullptr makes more sence 2017-10-07 19:08:20 +02:00
Marco Di Benedetto 9a79d243f9 added additional displacement texture token. 2017-10-07 12:36:02 +02:00
Jared Mulconry 326158633b Fixed warnings on MSVC caused by implicit conversions from double to float. 2017-10-06 18:23:28 +03:00
Turo Lamminen 50b43f76e1 OpenGEXImporter: Copy materials to scene 2017-10-06 18:23:28 +03:00
Turo Lamminen b841ed194b OpenGEXImporter: Store RefInfo in unique_ptr so they get automatically cleaned up 2017-10-06 18:23:28 +03:00
Turo Lamminen 775f984d99 OpenGEXImporter: Fix IOStream leak 2017-10-06 18:23:28 +03:00
Turo Lamminen 22b55d01a2 OpenGEXImporter: Store ChildInfo in unique_ptr so they get automatically cleaned up 2017-10-06 18:23:28 +03:00
Turo Lamminen 61278aa408 AMFImporter: Fix memory leak 2017-10-06 18:23:28 +03:00
Turo Lamminen 1f16ed9fd0 UnrealLoader: Fix IOStream leak 2017-10-06 18:23:28 +03:00
Kim Kulling c1f93a69ae Revert "WIP: Enable Travis clang build" 2017-10-06 15:42:05 +02:00
Kim Kulling c9b9dab1ff Merge pull request #1475 from jaredmulconry/master
Fixed warning on clang 3.9 caused by static data member in class template
2017-10-06 15:37:33 +02:00
Jared Mulconry 3803a5181c Fixed warnings on MSVC caused by implicit conversions from double to float. 2017-10-06 20:32:33 +11:00
Jared Mulconry 341222697a Address warnings on Clang 3.9 caused by having a static data member in a class template. 2017-10-05 23:55:10 +11:00
Turo Lamminen 3f0bb9c634 OpenGEXImporter: Copy materials to scene 2017-10-05 12:51:08 +03:00
Turo Lamminen 568003a0d3 OpenGEXImporter: Store RefInfo in unique_ptr so they get automatically cleaned up 2017-10-05 12:43:49 +03:00
Turo Lamminen e7ff7b167f OpenGEXImporter: Fix IOStream leak 2017-10-05 12:38:44 +03:00
Turo Lamminen b6d2b91799 OpenGEXImporter: Store ChildInfo in unique_ptr so they get automatically cleaned up 2017-10-05 12:35:17 +03:00
Turo Lamminen 316046f748 AMFImporter: Fix memory leak 2017-10-05 12:15:28 +03:00
Turo Lamminen 34acf47acd UnrealLoader: Fix IOStream leak 2017-10-05 12:15:28 +03:00
Turo Lamminen afce984228 FBXImporter: Add explicit instantiation of log_prefix so other FBX source files can see it 2017-10-05 12:15:25 +03:00
Turo Lamminen bf1aaf98f9 IFCImporter: Add explicit instantiation of log_prefix so IFCMaterial.cpp can see it 2017-10-05 12:15:11 +03:00
Kim Kulling cbca8f574e Merge pull request #1432 from turol/asan
Asan
2017-10-04 16:12:44 +02:00
Kim Kulling c3e9d6132c Merge pull request #1468 from assimp/issue_1467
closes https://github.com/assimp/assimp/issues/1467.
2017-10-03 09:58:56 +02:00
Jared Mulconry 5804667dbb Addressed some mismatched news/deletes caused by the new glTF2 sources. 2017-10-02 11:04:15 +03:00
Jared Mulconry 1eb7eceddf Addressed a number of memory leaks identified in unit tests by asan 2017-10-02 11:03:24 +03:00
Turo Lamminen 1095ec454b Fix delete / delete[] mismatches in glTF2 importer 2017-10-02 10:55:26 +03:00
Turo Lamminen efd861253d Fix delete / delete[] mismatches in MakeVerboseFormat 2017-10-02 10:55:26 +03:00
Turo Lamminen 5ecab20bd0 Fix delete / delete[] mismatch in glTFAsset 2017-10-02 10:55:26 +03:00
Kim Kulling 6ec25be0a6 OpenGEX: improve logging to be able to detect error-prone situations. 2017-10-02 09:41:01 +02:00
Kim Kulling 3f4663e369 closes https://github.com/assimp/assimp/issues/1467. 2017-10-02 09:33:51 +02:00
Jared Mulconry 9088deeb1d Eliminated all warnings under clang with default settings. One remains in the included zlib contrib project. 2017-09-30 23:29:56 +10:00
Kim Kulling c4e91eb33f add some asserts. 2017-09-30 10:47:23 +02:00
Kim Kulling 1c76962c98 closes https://github.com/assimp/assimp/issues/1450: use correct name of exporter to gltf2 2017-09-30 09:38:13 +02:00
Kim Kulling 9033071237 Obj: rename attribute from exporter. 2017-09-30 09:37:34 +02:00
Kim Kulling 5adc029225 Merge branch 'master' of https://github.com/assimp/assimp 2017-09-29 21:59:11 +02:00
Kim Kulling c42589460d closes https://github.com/assimp/assimp/issues/1459: fix out-of-boundary access error 2017-09-29 21:58:58 +02:00
Josh Faust febd611d48 Fix glTF2::Asset::FindUniqueID() when the input string is >= 256 chars 2017-09-27 18:41:35 -07:00
Jared Mulconry 79a5165106 Fixed unused variable warning by replacing them with descriptive comments 2017-09-24 21:46:15 +10:00
Jared Mulconry 8dabd76e03 Fixed a warning caused by aiVector3D appearing in a packed struct, causing it to fail to pack as requested. 2017-09-24 21:19:03 +10:00
Jared Mulconry 059a32654e Addressed warnings generated on MSVC across x86 and x64. 2017-09-24 19:29:43 +10:00
Kim Kulling b5ac248703 Merge pull request #1444 from turol/warnings
Clean up some more GCC warnings
2017-09-20 22:18:21 +02:00
Kim Kulling 81b94a1dca Merge pull request #1445 from Matter-and-Form/gltf2-alphaMode-fix
Fix glTF2 alphaMode storage and reading
2017-09-19 15:40:53 +02:00
Kim Kulling 5c44776532 Merge pull request #1447 from Matter-and-Form/gltf1-color-import-fix
[gltf1] Don’t ignore rgba(1,1,1,1) color properties
2017-09-19 15:40:00 +02:00
Kim Kulling adec1b2175 Merge pull request #1446 from Matter-and-Form/feature/gltf2-primitives
glTF2 primitives fixes
2017-09-19 15:39:11 +02:00
Kim Kulling d27e667f1e Merge branch 'master' of https://github.com/assimp/assimp 2017-09-19 00:32:50 +02:00
Kim Kulling af9596674d FBX: add missing inversion of postrotation matrix for fbx. 2017-09-19 00:31:41 +02:00
Daniel Hritzkiv 3e8955faf5
Don’t ignore rgba(1,1,1,1) color properties
Do not ignore rgba(1,1,1,1) material properties when importing glTF1. While a white diffuse color may be the default value for a default assimp material, `1,1,1,1` is a very explicit color value for ambient/specular/emissive color properties.

Closes #1434
2017-09-18 18:16:48 -04:00
Daniel Hritzkiv 798542d7bd
Formatting 2017-09-18 14:48:07 -04:00
Daniel Hritzkiv de0bf2ea96
Fix alphaMode storage and reading
alphaMode is now converted from a std::string to an aiString and back to std::string, since aiString is easier to store and retrieve from aiMaterial properties than std::string

Fixes issues of alphaMode being written out as `\fOPAQUE\0\0\0\0\0\0…`
2017-09-18 12:19:55 -04:00
Daniel Hritzkiv 8743d28ec5
SImplify mesh merging code
My assumption that primitives of different types (modes) can’t be in the same mesh was incorrect.
2017-09-18 12:16:30 -04:00
Daniel Hritzkiv 2efd2cdef8
tweaks to primitive merging logic; comments + formatting 2017-09-18 11:16:05 -04:00
Daniel Hritzkiv 814e8b3f8e
Formatting 2017-09-18 11:16:05 -04:00
Daniel Hritzkiv 28523232cf
Merge multiple meshes in a node into one mesh with many primtives; write out only one mesh per node
To do:
- clean up MergeMeshes
- see if there’s a way to do this earlier in the flow
2017-09-18 11:16:05 -04:00
Daniel Hritzkiv 5147acfe65
Revert "store node mesh vs. meshes"
This reverts commit a0d97505e5.
2017-09-18 11:16:04 -04:00
Turo Lamminen 982430c3ce BlenderDNA: Silence warning about inline function which is declared but not defined
It's a templated method which is meant to be specialized. The base version
is never called. Just remove 'inline' to make GCC shut up.
2017-09-18 15:21:51 +03:00
Turo Lamminen 40c308af44 glTF: Silence uninitialized variable warning
This is a false positive. 'jointNamesIndex' is either set by the loop
or the following conditional is false which also sets it. The undefined value
is never seen by the following code.
2017-09-18 15:18:45 +03:00
Turo Lamminen b74fc9495a PlyLoader: Fix operator precedence issue in header check
The previous version might read past end of buffer
2017-09-18 15:16:21 +03:00
Turo Lamminen 4652be8f18 FIReader: Silence uninitialized variable warning
This is a false positive. First time through the loop 'imod3' is always 0
so c1 is not used. It's also set so further iterations have a valid 'c1'.
If 'value' is empty the switch doesn't look at 'c1' either since 'imod3'
is still 0.
2017-09-18 14:59:55 +03:00
Turo Lamminen 41724ace2d Collada: Silence uninitialized variable warning
This is a false positive. Value of 'method' is only used if 'targetMeshes'
contains something and all paths through the first loop which add stuff
to 'targetMeshes' also set 'method'.
2017-09-18 14:10:58 +03:00
Jeremy Cowles c207e74534 Fix glTF 2.0 multi-primitive support
Previously, only one primitive was supported, in fact memory was corrupted
when more than one primitive was found per glTF mesh.

In this change, each primitive is unrolled as a new Assimp Mesh, resulting
in multiple Assimp meshes per node when multiple primitives exist per
glTF mesh. This is required in the general case, since glTF primitives can
have different material bindings and primitive modes.
2017-09-17 10:08:49 -07:00
Kim Kulling 484f73b179 Merge pull request #1437 from rmitton/sib-version
Added support for SIB models from Silo 2.5
2017-09-16 16:27:38 +02:00
Richard Mitton f602055da5 Added Silo 2.5 support
Silo 2.5 bumps the version number of SIB files for no apparent reason. Doesn't appear to be any other changes to the file format.
2017-09-15 12:40:38 -07:00
Richard Mitton 234ffc0ad6 Fixed truncated material names
The previous Unicode library change accidentally trimmed off the last character of SIB material names.
2017-09-15 12:39:58 -07:00
Turo Lamminen 01c50394ce FBXParser: Silence uninitialized variable warnings 2017-09-15 12:42:17 +03:00
Turo Lamminen f1998d52dc Importer: Whitespace cleanup to fix GCC misleading indentation warning 2017-09-15 12:41:53 +03:00
Turo Lamminen 046c229e48 AssbinExporter: Fix strict aliasing violation 2017-09-15 12:41:40 +03:00
Turo Lamminen f4a0ab81b1 AssbinExporter: Add Write specialization for aiColor3D 2017-09-15 12:41:13 +03:00
Turo Lamminen b9efc234d0 DefaultLogger: Whitespace cleanup to fix GCC misleading indentation warning 2017-09-15 12:40:07 +03:00
Turo Lamminen 0b140db0a4 glTFExporter: Silence uninitialized variable warning
This is a false positive, idx_srcdata_begin is only used if comp_allow
is true and in that case it's also initialized.
2017-09-15 12:39:58 +03:00
vkovalev123 58213804ff Update 3DSLoader.cpp
Fixed reading of CHINK_RGBF. If reading performs on x32 platform then reading will execute right, but on x64 it`s wrong because it will read 8 bytes instead 4.
2017-09-14 14:55:02 +03:00
Kim Kulling afd6c4d57d Revert "Asan" 2017-09-13 21:40:44 +02:00
Kim Kulling d139b4d180 Merge pull request #1423 from Matter-and-Form/feature/gltf2
glTF 2 Importer + glTF 2 Spec Conformity
2017-09-13 20:01:38 +02:00
Kim Kulling d49f86f1e7 Merge pull request #1427 from turol/asan
Asan
2017-09-13 19:38:44 +02:00
Turo Lamminen b6f122ff2c Fix delete / delete[] mismatch in glTFAsset 2017-09-13 11:31:05 +03:00
Kim Kulling 6a3b030094 MDP: fix encoding issues. 2017-09-12 21:16:59 +02:00
Kim Kulling b5f770e456 Merge branch 'master' of https://github.com/assimp/assimp 2017-09-12 19:07:21 +02:00
Kim Kulling e3163ec15e FBX: fix some minor findings. 2017-09-12 19:07:17 +02:00
Kim Kulling cbedc448c6 closes https://github.com/assimp/assimp/issues/1426: add Defines.h to include folder for install. 2017-09-12 18:59:38 +02:00
John Senneker 933bbb4f1c Manually read alphaMode material property 2017-09-12 11:55:52 -04:00
John Senneker eca008d5ec Properly move string passed to JSON writer 2017-09-12 11:55:22 -04:00
Daniel Hritzkiv b0da0796c8
Fix Segfault caused by losing pointer to std::string
Keep std::string alive
2017-09-12 10:07:15 -04:00
Daniel Hritzkiv cde29c937c
Formatting 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv b1a5ca4516
Use `forceNumber` argument of `WriteAttrs` to write correct attribute names, instead 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv 990fe143a1
Fix mesh primitive’s attributes’ names
Per spec

TEXCOORD -> TEXCOORD_0
COLOR -> COLOR_0
JOINTS -> JOINTS_0
WEIGHTS -> WEIGHTS_0

Remove JOINTMATRIX since it’s not supported (and doesn’t seem to be output, anyway)

TANGENT should be added at a later date
2017-09-11 11:02:16 -04:00
Daniel Hritzkiv 816e6909ca
Remove KHR_binary_glTF code
Binary glTF is now part of the glTF2 spec. However, it’s implemented incorrectly, so will be temporarily removed
2017-09-11 11:02:16 -04:00
Daniel Hritzkiv b4f5033d89
Remove compresssed file format flag 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv d518289e72
more specific token search for Collada Loader
collada can appear in many files, such as glTFs via the “generator” field (in the form of collada2gltf)
2017-09-11 11:02:15 -04:00
Daniel Hritzkiv 5cb13aa4b3
Load gltf .bin files from correct directory 2017-09-11 11:02:15 -04:00
Daniel Hritzkiv a438ece655
Remove premultipliedAlpha from gltf2 2017-09-11 11:02:15 -04:00
John Senneker 140b903d7a
Fix parsing of glTF version
Handle version as int in gltf
Fix format specifiers in glTF version parser
2017-09-11 11:02:15 -04:00
John Senneker 19876e9822
Add support for importing both glTF and glTF2 files 2017-09-11 11:02:15 -04:00
John Senneker 2ee7991558
Restrict search for OFF header to first 3 bytes 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv a5e8e0b2bd
Remove commented out code 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 0a8183531e
Set alphaMode, baseColorFactor opacity when model’s opacity isn’t 1 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 37582131f4
Set the metallicFactor to 0 if source file doesn’t have metallicFactor
Otherwise, the models have full metallic materials and appear very dim
2017-09-11 11:02:14 -04:00
Daniel Hritzkiv da6a252efb
Fix METALLIC_FACTOR typo 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 3ba00ca421
Define gltf material property names as constants 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 54dd4804cd
Fix indentation 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 44757af34a
Implement pbrSpecularGlossiness property as Nullable 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 03cfa04ee4
Define default material values as static constants
for reuse
2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 1a5823700f
Remove need for Has by returning an empty Ref in Get 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 21259e0835
Use different form of index accessor 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 37527849b7
Export material names properly 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv a9c4fa84b5
Sampler improvements; Add new LazyDict method
Samplers are now imported into assimp internal format from textures;
Samplers have defaults as per spec;
Sampler enums are strongly typed with UNSET values;
Samplers are exported properly;
Sampler filters are exported as well;
Samplers are re-used across textures on export
Default sampler values are not written
2017-09-11 11:02:12 -04:00
Daniel Hritzkiv 7245cceead
Set default values on Sampler 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv 2abdbdb55e
Fix unused CopyValue 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv 63ef19d9ad
Export extensions 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv d277995a97
Formatting 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv 7f01e3f48f
Only export byteStride if not 0 2017-09-11 10:55:50 -04:00
Daniel Hritzkiv a0d97505e5
store node mesh vs. meshes
glTF nodes can only hold one mesh. this simply assigns to and check’s a Node’s Mesh
2017-09-11 10:55:50 -04:00
Daniel Hritzkiv ab08a7c3cb
reenable animation and skins exports
Currently incorrect, however. May need to be removed
2017-09-11 10:55:50 -04:00
Daniel Hritzkiv f09892ab63
Write specularGlossiness textures on the specularGlossiness object 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv feee7528d6
Make sure `on` flag for specularGlossiness is being persisted 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 8bef546b41
mention pbrSpecularGlossiness support 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 2d54019b8f
Remove OPEN3DGC and compression references 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 562920fbb8
Changes to GLTF2 materials
pbrMetallicRoughness and pbrSpecularGlossiness as structs; persist textureinfo properties from start to finish; persist pbrSpecularGlossiness (via extensionsUsed) usage from start to finish
2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 7532d6aac1
Remove Light, Technique references 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 863458cd4a
Start removing materials common, and adding pbrSpecularGlossiness 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 7615a97cd3
Remove redundant function 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 0cf69479c3
Use `!ObjectEmpty()` vs. `MemberCount() > 0` 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 11cb9ac139
Working read, import, export, and write of gltf2 (pbr) material 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv b42d785afe
Start managing and importing gltf2 pbr materials 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 67eb3b0608
temporarily disable gltf exporting of animations and skins 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 39172feb3e
Start reading pbr materials 2017-09-11 10:50:37 -04:00
Daniel Hritzkiv 4d59dee5ea
Cache retrieved items via an original index map 2017-09-11 10:50:37 -04:00
Daniel Hritzkiv 47c7c3cf50
Disambiguate Get methods 2017-09-11 10:50:37 -04:00