Commit Graph

87 Commits

Author SHA1 Message Date
haroonq
69abac59d2 Update glTF2Exporter.cpp 2018-11-01 08:49:06 -07:00
haroonq
04c6d8347b Update glTF2Exporter.cpp 2018-10-29 15:23:26 -07:00
haroonq
bc80652ae9 Update glTF2Exporter.cpp 2018-10-29 15:04:48 -07:00
haroonq
7b9f4a66de Update glTF2Exporter.cpp 2018-10-29 14:52:41 -07:00
Haroon Qureshi
bfe1dc2914 Merge branch 'glt2anim' of https://github.com/haroonq/assimp into glt2anim 2018-10-29 14:46:52 -07:00
Haroon Qureshi
acad9a06e9 Add support for importing GLTF2 animations.
Refactors the glTF2 internal classes to more closely reflect the structure
of the actual GLTF2 file format. Adds implementations for reading skins
and animations from GLTF2 files into those structures.

Also provides implementations for converting skins and animations from GLTF
into assimp data structures.  Special handling is required for bone weights
since assimp stores vertex-weights-per-bone whereas GLTF2 stores
bone-weights-per-vertex.  Only supports keyframed LINEAR animation data;
STEP and CUBICSPLINE is not currently supported.
2018-10-29 14:44:29 -07:00
Haroon Qureshi
57d3d71b6e Add support for importing GLTF2 animations.
Refactors the glTF2 internal classes to more closely reflect the structure
of the actual GLTF2 file format. Adds implementations for reading skins
and animations from GLTF2 files into those structures.

Also provides implementations for converting skins and animations from GLTF
into assimp data structures.  Special handling is required for bone weights
since assimp stores vertex-weights-per-bone whereas GLTF2 stores
bone-weights-per-vertex.  Only supports keyframed LINEAR animation data;
STEP and CUBICSPLINE is not currently supported.
2018-10-26 15:39:28 -07:00
Kim Kulling
cc0b3e1249 Merge branch 'master' into fix_gltf2_export_componentType_error 2018-09-22 07:54:10 +02:00
FRICOTEAUX
a69e95bdc1 Add support of 32-bit indices for the glTF2 export 2018-07-19 11:29:04 +02:00
smalcom
02d2b6e0d8 [F] Get return "like true" when error occured. 2018-05-25 21:30:59 +03:00
Alexander Gessler
caecd385b5 Merge branch 'master' into fix_gltf2_export_componentType_error 2018-05-19 03:05:29 +02:00
Stanlo Slasinski
a1a17c1dda Read and write the KHR_materials_unlit glTF/2.0 extension. 2018-05-18 14:52:02 -07:00
Kim Kulling
950496c351 some minor refactorings. 2018-05-12 08:39:22 +02:00
Kim Kulling
f93ee9dace closes https://github.com/assimp/assimp/issues/1780: check against nullptr before accessing normal data in aiMesh instance. 2018-05-12 08:10:26 +02:00
wuxq
ea2c90ae79 Merge branch 'master' into fix_gltf2_export_componentType_error 2018-05-08 18:35:57 +08:00
wuxq
cc1bde0514 change the length of bufferView byteLength
chang the joint  attribute bufferView byteLength
2018-05-08 18:31:27 +08:00
Kim Kulling
327a43c26f Merge branch 'master' into fix_gltf2_export_componentType_error 2018-05-06 19:39:37 +02:00
Nicholas Woodfield
458a7ae801 Silencing compile warnings during build, all little stuff like uint to size_t or BOOL to bool. 2018-05-03 15:03:14 -04:00
Alexis Breust
4aaf7ad547 Added name to nodes 2018-05-03 11:07:39 +02:00
wuxq
814b56e5e2 multi joint has bug with ReplaceData
multi joint has  a bug  in ReplaceData_joint with "bin" change
2018-04-28 15:05:21 +08:00
Kim Kulling
972fffe70b Merge branch 'master' into fix_gltf2_export_componentType_error 2018-04-26 13:40:49 +02:00
wuxiaoqian
f6af6ded1f fixed the bug of export gltf2, the JOINTS_0 componentType is Incorrect 2018-04-26 11:03:50 +08:00
wuxiaoqian
6b4caa0f12 fix export gltf2, The JOINTS_0 componentType is incorrect 2018-04-26 10:56:56 +08:00
Loïc Fricoteaux
a8077baed5 Add vertex color support to glTF2 export 2018-04-25 11:37:56 +02:00
Alexis Breust
26ac2ffb6c Not duplicating textures for embedded ones 2018-03-29 15:52:05 +02:00
Kim Kulling
b049933d2f update license dates. 2018-01-28 19:42:05 +01:00
Kim Kulling
8b9b770f9f Merge branch 'master' into gltf2-fixes 2018-01-16 21:50:48 +01:00
Alexis Breust
5e6cae3094 Force normalized normals 2018-01-16 09:56:44 +01:00
Kim Kulling
6bbdb669e1 Merge branch 'master' into master 2018-01-06 09:30:13 +01:00
BuildTools
66171de915 Successful lib build, unit testing still WIP 2018-01-05 16:18:33 -08:00
Alexis Breust
9b5df71150 Not using external bin file for glb2 2018-01-05 10:28:12 +01:00
Alexis Breust
32e5e3a576 Forgot to uncomment isBinary 2017-12-15 15:40:31 +01:00
Alexis Breust
31a4ccaebb Added support for generating glb2 (binary glTF 2) 2017-12-14 16:11:12 +01:00
Alexandre Avenel
eb452b28a2 Fix warning on MSVC14 2017-11-25 11:38:12 +01:00
Patrick Dähne
a05d74a281 [glTF2] Moved byteStride from accessor to bufferView 2017-11-20 19:01:28 +01:00
Kim Kulling
7db10022e9 closes https://github.com/assimp/assimp/issues/1513: fix assimp for cross compile for android 2017-11-15 21:26:25 +01:00
Kim Kulling
de1ec4ee5d Merge branch 'master' into gltf2-mesh-export-fix 2017-11-10 19:07:46 +01:00
Unknown
12dbbd4ce9 Misc. typos
Some are doxy comments, some are just trivial source comment typos. 
Found using `codespell -q 3 --skip="./contrib" -I ../assimp-whitelist.txt`
whereby whitelist contained:
```
childs
iff
lod
nto
ot
whitespaces
```
2017-11-09 17:19:26 -05: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
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
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
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
Jared Mulconry
326158633b Fixed warnings on MSVC caused by implicit conversions from double to float. 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
Jared Mulconry
3803a5181c Fixed warnings on MSVC caused by implicit conversions from double to float. 2017-10-06 20:32:33 +11:00