Commit Graph

194 Commits

Author SHA1 Message Date
Par Winzell 49892c5e83 Abstract out user property serialisation. 2018-12-14 00:05:43 -08:00
Graham Wihlidal f2cb6a1010 Fix various tabs vs spaces formatting inconsistencies 2018-12-13 23:00:05 -08:00
Graham Wihlidal 8b081a5fc3 Implemented support for exporting user properties assigned to materials 2018-12-13 23:00:05 -08:00
Par Winzell 7374bcf34f No default argument in implementation. 2018-12-12 12:46:45 -08:00
Par Winzell f71be404f4 Remaining fixes for 2019.2. 2018-12-07 09:52:38 -08:00
Pär Winzell 62bb8710c0 Fix cross-platform path handling.
This is a recreation of the PR @robertlong submitted long ago here:
https://github.com/facebookincubator/FBX2glTF/pull/97

Refactors and whitespace conflicts made this easier.

There is still a substantial rewrite of the texture-loading and
file-path handling pending, for sometime soon.
2018-12-07 09:40:21 -08:00
Par Winzell c1faf6b822 I'm going to stab someone. 2018-12-04 10:01:07 -08:00
Par Winzell 90e5bef116 Better iconv handling. Jeez, CMake... 2018-12-04 09:54:08 -08:00
Par Winzell 3e0aa3565c Don't require iConv; it can be builtin. 2018-12-04 09:29:39 -08:00
Par Winzell 073f06aa13 Do the right thing with ICONV. Needed for Mac now. 2018-12-04 08:56:05 -08:00
Par Winzell e990432ecf Require 2019.2 henceforth. 2018-12-03 22:19:25 -08:00
Par Winzell fe2aa11516 Mark third-party headers as such.
This avoids spammy compiler warnings in code we don't care about.
2018-12-02 19:03:02 -08:00
Par Winzell 2029fa7277 Delete unused variable. 2018-12-02 19:02:24 -08:00
Par Winzell a65628f56f Specify that we want std::isnan().
Depending on platform, multiple versions of isnan() can easily be floating around, causing compilation headaches. Luckily we can always rely on the standard library implementation.
2018-12-02 19:00:42 -08:00
Pär Winzell c34f861f69 Don't force RTTI for one measly cast. 2018-10-28 16:03:52 -07:00
Michael Ranieri d38ccd935f fix fov computation from fbxsdk (#133)
* fix fov computation from fbxsdk
2018-10-22 18:32:20 -07:00
Michael Ranieri efd404764d Fix camera rotation from FBX, fix illegal memory access of binary data 2018-10-19 01:05:48 -07:00
Par Winzell 6e527563cd Add more Copyright boilerplate. 2018-10-15 15:24:07 -07:00
Par Winzell 0c94cb5706 Add Facebook's generic Code of Conduct file. 2018-10-15 15:19:36 -07:00
Pär Winzell 319c0fe460 Wrap user properties in a command line option. 2018-10-14 21:46:49 -07:00
Pär Winzell bbbba646de Massive reorganisation.
This finishes the first phase of the FBX2glTF refactor, breaking utility classes out where things were getting too monolithic.

There is an equally important cleanup phase coming where we wrench all the various parts of this code, including the historical ones that we've rarely touched as yet, into a single C++ style paradigm, and modernise everything to C++11 at least.

But for now, we're just picking the pieces back on the floor so we can push 0.9.6 out. It's been far too long since a release.
2018-10-13 20:15:12 -07:00
Par Winzell 2a4da70de0 Make the JSON library ambiently available. 2018-10-13 19:25:18 -07:00
Michael Ranieri 2e03a3cdea Transcribe FBX Custom Properties 2018-10-13 19:23:48 -07:00
Par Winzell f646be2e47 Both DIFFUSE and ALBEDO can dictate transparency. 2018-10-02 16:59:41 -07:00
Artem Titoulenko 5282f693f9 Blend shape keys to accessor names (#122)
Map blendshape keys to accessor names
2018-09-25 16:09:18 -07:00
Pär Winzell 52de0d20d8
Typo fix on Fbx2Raw.cpp
Thanks @fire for the report. Fixes #128.
2018-09-24 20:24:30 -07:00
Par Winzell f988cb7aa7 Missing bits, oops.
Did not mean to commit/push the current state of master. But rather than
mess up source control history with a force push, I'll just try to hurry
to a stable point.
2018-09-13 17:21:57 -07:00
Par Winzell 7d36e7f4d7 Rearrange, extract, clean up.
Hopefully without unintentional changes to functionality. This renames header
files to .hpp, imposes a gltf/raw/fbx directory structure, extracts standalone
chunks of Fbx2Raw into distinct files, and undoes some particularly egregious
mistakes from when I knew even less C++ than I do now.

This is in anticipation of implementing 3ds Max's "Physical Material".
2018-09-13 16:55:24 -07:00
Par Winzell b475fbead4 Accept multiple SDK versions as valid. 2018-09-13 12:30:06 -07:00
Par Winzell 891cf668b9 Fix order of linked libraries. 2018-09-13 10:39:21 -07:00
Pär Winzell 2fc254ed79
Update example command-line switch 2018-09-08 11:35:10 -07:00
Matt Brown 9c84e14ddc fixed typo in Describe function for specular 2018-08-19 18:24:52 -07:00
Pär Winzell bdcf16f042
Trivial typo fix.
Thanks to @ale64bit for pointing this out.
2018-08-19 18:24:16 -07:00
Pär Winzell 7995f7b341 Resolve _WIN32 isnan() fiasco completely. 2018-05-27 13:28:49 -07:00
Par Winzell d3f9a269ba Customisable Draco encoding options. 2018-05-08 09:01:58 -07:00
Par Winzell 5788eea8ad Don't tell me you did nothing. 2018-05-03 18:58:58 -07:00
Par Winzell e178a75be3 Start tracking and using FBX2glTF version. 2018-05-03 18:51:35 -07:00
Par Winzell 3c8cad4730 Fix crash from dangling surface reference.
The condense operation recreates the vectors of surfaces, materials,
textures and vertices so as to exclude anything that isn't referenced
explicitly by a triangle. In the process, we must take care that
references from other properties are cleared out.

This fixes the case when a node references a mesh by id, and then the
mesh is deleted because no triangle references. TODO: go through other
properties and make sure the same problem doesn't exist there.

It is also possible that these vectors should be replaced by maps, at
least for the elements that (now) have unique IDs.
2018-05-03 14:44:43 -07:00
Par Winzell f530af8bf4 Use std:: whenever possible. 2018-05-03 08:21:42 -07:00
Darío Hereñú 447333a16a Typo on string #239, #241, #244 2018-04-26 07:21:02 -07:00
Par Winzell 68983ad0d0 Fix skinning edge case.
A mesh with a single (skinning) deformer which had zero clusters would
erroneously register as skinned, leading GetRoodNode() to an assertion
failure. Fixed.
2018-04-08 17:54:42 -07:00
Par Winzell cb76a49b82 List all sources in CMakeLists.txt.
If nothing else, it helps IDEs do the right thing.
2018-04-08 15:47:27 -07:00
Par Winzell 3bfe56b71f Minor Windows fixes. 2018-03-29 06:46:19 -07:00
Par Winzell 542550192c Bump NPM version, 2018-03-29 06:24:46 -07:00
Par Winzell 9174fe2f50 Fixes and improvements to shininess -> roughness. 2018-03-29 05:49:40 -07:00
Par Winzell b3492194cf Slightly better Blinn/Phong -> PBR.
We're still gunshy from our previous attempts at coming up with metalilc
and roughness values from diffuse/specular/shininess, but this should be
safe: a high shininess means a low roughness, and vice versa.
2018-03-28 10:44:51 -07:00
Par Winzell 3f1590a26b Don't be tricksy if we're already done.
The FBX SDK looks for our textures and often finds them. It helpfully
tells us exactly where they are. Let's not throw that information away
and demand that the textures only exist in precisely the folders we are
aware of.
2018-03-27 20:00:48 -07:00
Par Winzell e992aac1d9 Mark glTF materials with FBX origins.
Because we make a best-effort attempt to convert materials on the old
form -- like :ambert and Phong -- to PBR materials, it can be beneficial
to the consumer of the asset to know if the asset was intentionally
authored as PBR, or if it was a conversion.

The precise details of this information is specific to the intersection
of FBX and glTF, so we're not going to bother proposing extensions; we
just drop something into the extras field, e.g.

    "materials": [
        {
            "name": "Troll_Water",
            "alphaMode": "OPAQUE",
            "extras": {
                "fromFBX": {
                    "shadingModel": "Metallic/Roughness",
                    "isTruePBR": true
                }
            },
        // ... and so on.

The possible values for shadingModel are:
    "<unknown>"
    "Constant"
    "Lambert"
    "Blinn"
    "Phong"
    "Metallic/Roughness"

Currently isTruePBR is true for the final entry, false for the other.
However, we may well add more PBR shading models in the future, so if
you intend to use this feature to look for true PBR, use the derived
property.
2018-03-27 19:31:01 -07:00
Par Winzell ca12a38afe Always eliminate the 0.01 factor. 2018-03-27 14:54:36 -07:00
PLAINCONCEPTS\davila 4ec8c8e34d Change the way that unit conversion affects the scene. 2018-03-27 14:17:33 -07:00