Commit Graph

173 Commits

Author SHA1 Message Date
K. S. Ernest (iFire) Lee 9eb3423ca2 Force embed resources. 2021-11-28 13:33:12 -08:00
K. S. Ernest (iFire) Lee 64f4e6515c Simplify. 2021-11-28 13:20:36 -08:00
K. S. Ernest (iFire) Lee eef1a8f153 Sync conan versions and Texturebuilder work. 2021-11-28 13:17:14 -08:00
K. S. Ernest (iFire) Lee 7b1000e1cb CI error. 2021-11-28 12:15:08 -08:00
SeanLin 2b6d95b3b3 Revert "Revert "Fix image file close issue""
This reverts commit 6dd7ba25c8.
2021-11-28 12:09:52 -08:00
SeanLin 6dd7ba25c8 Revert "Fix image file close issue"
This reverts commit d2648c74c7.
2021-11-28 12:09:39 -08: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
SeanLin d2648c74c7 Fix image file close issue
After file is opened, add fclose to avoid saving buffer data in memory
2021-11-28 12:03:17 -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 3d3cf1ae27 Remove commented transparent png. 2021-11-28 11:50:08 -08:00
K. S. Ernest (iFire) Lee a3dfcda66e Add separate textures flag.
Don't convert tga to png/jpg if the texture is already converted
2021-11-28 11:48:54 -08:00
Jason Schutz 762a183b6b Do not copy texture file on itself 2021-11-28 11:45:45 -08:00
K. S. Ernest (iFire) Lee 1bcdf9271e Format everything. 2021-11-28 11:45:31 -08:00
K. S. Ernest (iFire) Lee b89d4cd0e0 Fix for converted texture output folder creation and empty filepath 2021-11-28 11:41:51 -08:00
Jason Schutz 661c99c9cb Make getFolder return '.' instead of empty string 2021-11-28 11:41:07 -08:00
Mayank Nagpal 2fe07994d1 Add Sparse Accessor Support 2021-11-28 11:40:53 -08:00
Mayank Nagpal 1bfd930402 Removed Yellow texture used when texture file missing 2021-11-28 11:40:53 -08:00
Chris Subagio ef974a5e1a Add support for prebuilt ORM textures
Before this change, the texture assignments for Occlusion, Roughness, and Metalness in the Stingray PBR material path were assumed to be single channel images where the R should be used to build a merged ORM texture. This precluded the use of prebuilt ORM textures.

This commit proposes a few changes:
* if the same texture is detected in all 3 channels, assume it already is ORM and just pass through.
* when combining textures, read R/G/B for O/R/M rather than R/R/R. This allows merging of prebuild ORM textures.
2021-11-28 11:34:57 -08:00
K. S. Ernest (iFire) Lee cb9952f5ec Revert "First draft of Standard material support."
This reverts commit c77d625257.
2021-11-28 11:21:16 -08:00
K. S. Ernest (iFire) Lee 04c8673fe5 Revert "Default to assume fbx isn't PBR."
This reverts commit 73ffff33d0.
2021-11-28 11:18:45 -08:00
K. S. Ernest (iFire) Lee 7418fc0671 Increment the version after a few years of work. 2021-11-17 12:08:43 -08:00
K. S. Ernest (iFire) Lee c77d625257 First draft of Standard material support. 2021-06-07 08:41:17 -07:00
K. S. Ernest (iFire) Lee 73ffff33d0 Default to assume fbx isn't PBR. 2021-06-07 00:29:00 -07:00
K. S. Ernest (iFire) Lee 6efbfbe379 Freeze V-Sekai settings. 2021-06-07 00:17:57 -07:00
K. S. Ernest (iFire) Lee f9670e4964 Don't optimize. 2021-06-06 19:33:43 -07:00
K. S. Ernest (iFire) Lee 0d05af2861 Don't optimize. 2021-06-06 19:30:26 -07:00
K. S. Ernest (iFire) Lee 1ef0916f01 Restore building for Linux. 2021-06-06 16:18:01 -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
Jordy van Dortmont 94f3a6783b Fixed morph target names 2019-12-25 06:12:12 -08:00
vfxgordon 1d735698ba Morph target names output to mesh.extras.targetNames (#231) 2019-10-07 16:46:38 -07:00
Pär Winzell 3c08169510 Prepare patch release 0.9.7. 2019-08-10 09:33:02 -07:00
Jesse Vander Does 44d2d5bf97 Write `.gltf` to parent directory & infer binary from `.glb` (#193)
If the output extension is gltf then set the output directory to the parent. The binary and any associated textures will be written to this directory.
2019-08-07 09:35:17 -07: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
Pär Winzell 7b39358f46 Be explicit in our list-initialisation.
This caused https://github.com/facebookincubator/FBX2glTF/issues/218
in ways that I honestly don't fully understand, and I believe only under
Windows, with Release-level optimisation turned on.

It's possible we should drop all these initializer lists, and replace
them with simple and explicit initialising constructors.

Fixes #218.
2019-08-06 16:36:19 -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
“Brandon 3daf2b712a Fix issue where code segfaults when surface material is missing
Ignores missing material and warns user of bad FBX

Only edge case is handled while previously working models should operate as before
2019-07-18 09:35:44 -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
Par Winzell a07cabd1ec eTotalOne is strictly a subset of aNormalize. 2019-05-03 21:48:51 -07:00
Pär Winzell 4b501431fe
License -> BSD (#186)
Relicense FBX2glTF as BSD.
2019-05-03 16:13:18 -07:00
Pär Winzell 7970914dd0 Delete spurious (and utterly broken) log line. 2019-04-20 22:08:24 -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
hhalen 13f463d336 Fix skinning weight normalization. Previous code would call Normalized() on a Vec4f containing the weights. This normalizes the vector, i.e. makes the length of the vector equal to 1.0. For skinning weights what we want is the sum of the weights to be 1.0, which is a different. This commit fixes that. 2019-04-09 10:12:11 -07:00
Pär Winzell 769454e964 This all needs rewriting, but at least let's make it not crash on Windows. 2019-04-07 15:18:13 -07:00
Par Winzell 11398f6acb This is an expected case and shouldn't be logged. 2019-04-03 11:57:20 -07:00
Par Winzell 910a8bfdd0 Left-over debug line. 2019-04-03 10:37:13 -07:00