Commit Graph

40 Commits

Author SHA1 Message Date
K. S. Ernest (iFire) Lee 395dbe2b4f Apply the rotation pivots. 2022-04-04 09:11:31 -07:00
K. S. Ernest (iFire) Lee 1ea8be3782 Remove unused variables. 2022-04-04 08:17:43 -07:00
K. S. Ernest (iFire) Lee 6e649b4c62 Remove unused code. Add pivots! 2022-04-04 08:14:06 -07:00
K. S. Ernest (iFire) Lee e05b214adc Clamp to float min and max. 2022-04-03 19:59:34 -07:00
K. S. Ernest (iFire) Lee 0c40c08662 Be strict about non representable translation, rotation and scale values. 2022-04-03 19:46:12 -07:00
K. S. Ernest (iFire) Lee c8eb9b2f55 Fix geometric pivots. 2022-04-03 16:04:53 -07:00
K. S. Ernest (iFire) Lee 669985c64c Code style format. 2021-11-28 12:06:46 -08:00
SeanLin a48ab1e377 Support Double Sided Material
The material has the "isDoubleSided" bool parameter. Because some models have double-sided texture settings, the new bool parameter is added to determine whether glTF2 'doubleSided' is enabled. The default value of this parameter is false.
2021-11-28 12:04:15 -08:00
Gareth Morgan 4cf9f4fd5d Look for filenames using alternative slash characters 2021-11-28 11:59:55 -08:00
K. S. Ernest (iFire) Lee 1bcdf9271e Format everything. 2021-11-28 11:45:31 -08:00
K. S. Ernest (iFire) Lee f9670e4964 Don't optimize. 2021-06-06 19:33:43 -07:00
Henrik Halen 4f63da8e5f Allow arbitrary number of skinning weights.
Controlled through command line parameter. Defaults to 4 skinning weights.
2019-12-25 15:04:25 -08:00
Pär Winzell 24092a80bb Use the correct camera property.
Looks like FieldOfViewX/FieldOfViewY are only well-defined when
aperture mode is eHorizAndVert. Use FieldOfView instead.

Fixes #209.
2019-08-06 17:48:45 -07:00
Pär Winzell 31e3665862 Minor cleanup. 2019-08-06 17:22:30 -07:00
Leslie Leigh 648fdfb944 Add option "--fbx-tmp-dir" (#219)
Merge code from @shrinktofit that allows control over where temporary files are created.

(Most commonly the .fbm directory where the SDK extracts embedded resources.)
2019-08-06 08:39:59 -07:00
Par Winzell 9853625ba1 Fix logic error.
Thanks @C0lumbo. This fixes #202.
2019-06-04 22:48:25 -07:00
Par Winzell 8e5ded122e Argh. This is the actual commit intended. 2019-05-05 01:21:25 -07:00
Par Winzell df00e0538d Ignore animation 'takes', calculate frame intervals ourselves.
Lifted from comment in source:

Individual animations are often concatenated on the timeline, and the
only certain way to identify precisely what interval they occupy is to
depth-traverse the entire animation stack, and examine the actual keys.

There is a deprecated concept of an "animation take" which is meant to
provide precisely this time interval information, but the data is not
actually derived by the SDK from source-of-truth data structures, but
rather provided directly by the FBX exporter, and not sanity checked.

Some exporters calculate it correctly. Others do not. In any case, we
now ignore it completely.
2019-05-05 01:00:53 -07:00
Pär Winzell 4b501431fe
License -> BSD (#186)
Relicense FBX2glTF as BSD.
2019-05-03 16:13:18 -07:00
Pär Winzell 7dd8438c78
Embrace Conan, use it to grab boost::filesystem. (#180)
With this, we are able to get rid of all the increasingly broken file
system utility code, and trust boost::filesystem to handle all the
cross-platform complexity.

The first version of this PR centred around C++17 & std::filesystem,
but support remains too elusive; it seems works out of the box in
Visual Studio (especially 2019), but is entirely missing from the Mac
dclang, and even with GCC 8.0 it requires an explicit '-l c++fs'.

Luckily the std:: version is almost exactly the boost:: version (not
surprising) so when the world's caught up, we can ditch Boost and go
all stdlib.

Setting up Conan requires a bit of work; we'll want to document the
details in the README.
2019-04-19 23:54:11 -07:00
Simon 4bb4bdbac1 animation framerate option 2019-04-18 09:24:38 -07:00
Par Winzell a596073f04 Identify materials by unique ID, not name.
At the end of the various material/mesh transformations we do, we were still using a ridiculously simplistic method of mapping RawMaterial to glTF MaterialData.

This switches to using FBX's GetUniqueID(), which should be the law of the land in general. Other model entities may need further investigation as well.
2019-02-24 19:32:13 -08:00
Par Winzell 70c3823eb7 Fix 'spot' light export. 2019-02-21 12:45:02 -08:00
Par Winzell ce2a9f8d85 Handle 'inverse roughness' flag. 2019-01-25 14:33:53 -08:00
Par Winzell d451aa73f3 Delete obsolete classes, poke at Physical Material support.
Looks like I never did the required cleanup after my accidental commit back in August.
This deletes the materials classes that were obsoleted back then, and comments out the
large swathes of PhysicalMaterial code that's not currently doing anything (i.e. all the
materials properties that glTF can't currently represent.)
2019-01-16 13:52:33 -08:00
Par Winzell 1145defda3 Use case-insensitive matching on old shader types. 2018-12-19 14:22:58 -08:00
Pär Winzell 5730d1c301
Apply clang-format to all our source. (#149)
Apply clang-format to all our source.
2018-12-18 23:30:29 -08:00
Par Winzell 5389d848e2 Implement KHR_lights_punctual. 2018-12-17 10:21:43 -08:00
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
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
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