Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
aa8921e
UfbxImporter: Initial plugin skeleton
bqqbarbhg Nov 18, 2022
490b618
UfbxImporter: Build UfbxImporter on CI
bqqbarbhg Nov 19, 2022
e17ca8a
UfbxImporter: Provide generic FbxImporter instead of UfbxImporter
bqqbarbhg Nov 19, 2022
a496934
UfbxImporter: Advertise .obj file format support
bqqbarbhg Nov 19, 2022
64a2559
UfbxImporter: Add dummy test case
bqqbarbhg Nov 19, 2022
0c844dc
UfbxImporter: Restore "unnecessary" headers from StlImporterTest
bqqbarbhg Nov 19, 2022
95aa9fa
UfbxImporter: Directly import the missing header
bqqbarbhg Nov 19, 2022
2250688
UfbxImporter: Fix header ordering
bqqbarbhg Nov 19, 2022
ff508dd
UfbxImporter: Embed ufbx
bqqbarbhg Nov 20, 2022
478df90
UfbxImporter: Initial draft (untested, but at least it compiles)
bqqbarbhg Nov 20, 2022
876a515
UfbxImporter: Various fixes
bqqbarbhg Nov 20, 2022
369faf9
UfbxImporter: Fix trying to read factors from `_COLOR`
bqqbarbhg Nov 20, 2022
a3d4f56
UfbxImporter: Fix reading from local meshChunkBase
bqqbarbhg Nov 20, 2022
9557a9c
UfbxImporter: Fix marking attrib instead of texture as seen
bqqbarbhg Nov 20, 2022
0f39126
UfbxImporter: Fix MaterialData layers
bqqbarbhg Nov 20, 2022
ae8c224
UfbxImporter: Fix mesh chunk assignment
bqqbarbhg Nov 20, 2022
db29826
UfbxImporter: Remove unnecessary local variable
bqqbarbhg Nov 20, 2022
9f15db2
UfbxImporer: Cleanup: Use conversion utilities instead of asType()
bqqbarbhg Nov 20, 2022
622ced7
UfbxImporter: Add dependency to AnyImageImporter
bqqbarbhg Nov 20, 2022
aa87123
UfbxImporter: Cleanup: Remove default constructor
bqqbarbhg Nov 20, 2022
8aabdc7
UfbxImporter: Cleanup: Remove unnecessary scene name functions
bqqbarbhg Nov 20, 2022
68c03a5
UfbxImporter: Disable unnecessary features + fix C casts
bqqbarbhg Nov 21, 2022
ccf54ce
UfbxImporter: Potential GCC 4.8 compile fix
bqqbarbhg Nov 21, 2022
734d10c
UfbxImporter: Test setup fixes (thanks @mosra !)
bqqbarbhg Nov 21, 2022
244299f
UfbxImporter: Remove importer state references
bqqbarbhg Nov 21, 2022
4500ffc
UfbxImporter: Update ufbx
bqqbarbhg Nov 21, 2022
a9dacdb
UfbxImporter: Add configuration defaults and docs
bqqbarbhg Nov 21, 2022
86eecf8
UfbxImporter: Cleaner MeshData generation
bqqbarbhg Nov 21, 2022
5a907d3
UfbxImporter: Fix typo in unboundedIfNegative()
bqqbarbhg Nov 21, 2022
43dcc19
UfbxImporter: More defaults/documentation
bqqbarbhg Nov 21, 2022
ce2cfc2
UfbxImporter: Convert doOpenState() to openInternal()
bqqbarbhg Nov 21, 2022
78d7851
UfbxImporter: CI warning fixes
bqqbarbhg Nov 21, 2022
9f6940c
UfbxImporter: Can't NRVO into Optional<>
bqqbarbhg Nov 21, 2022
22259a1
UfbxImporter: Stricter [[nodiscard]] criteria for MSVC
bqqbarbhg Nov 22, 2022
4a08993
UfbxImporter: Cleanup: Remove duplicate configuration entry
bqqbarbhg Nov 25, 2022
2bd45a0
UfbxImporter: Show error stacks on debug if `ImporterFlag::Verbose` i…
bqqbarbhg Nov 25, 2022
29ffb10
UfbxImporter: Fix version 6100 texture assignment
bqqbarbhg Nov 25, 2022
f64bd53
UfbxImporter: Add option for normalizing units
bqqbarbhg Nov 25, 2022
cbfa133
UfbxImporter: Prefer per-instance materials
bqqbarbhg Nov 25, 2022
7f268f9
UfbxImporter: Fix colorMap being set to zero
bqqbarbhg Nov 25, 2022
858a1fd
UfbxImporter: Miscellaneous fixes from stress testing
bqqbarbhg Nov 25, 2022
55fedf1
UfbxImporter: Fix 3x3 matrix last diagonal value
bqqbarbhg Nov 25, 2022
f914376
UfbxImporter: Get rid of standard headers
bqqbarbhg Nov 25, 2022
68a5e9a
UfbxImporter: Use fileCallback() if provided
bqqbarbhg Nov 26, 2022
1d332f9
UfbxImporter: Un-advertise ImporterFeature::OpenState
bqqbarbhg Nov 26, 2022
5d36a76
UfbxImporter: Load external files by default
bqqbarbhg Nov 26, 2022
89b70b7
UfbxImporter: Explicitly include FileCallback
bqqbarbhg Nov 26, 2022
241c85e
UfbxImporter: Help MSVC 2015 out with templates
bqqbarbhg Nov 26, 2022
c956f4e
UfbxImporter: Help MSVC 2015 even more
bqqbarbhg Nov 26, 2022
1596fa9
UfbxImporter: Fix missing local_user
bqqbarbhg Nov 26, 2022
b7184a7
UfbxImporter: Use Vector3 helper in Color3
bqqbarbhg Nov 26, 2022
ee6d078
UfbxImporter: GCC 4.8 workaround
bqqbarbhg Nov 26, 2022
93f494a
UfbxImporter: Use T{} for zero valued (invalid) enums
bqqbarbhg Nov 26, 2022
d44b3bc
UfbxImporter: Allow missing external files
bqqbarbhg Nov 26, 2022
86517d4
UfbxImporter: Remove unnecessary transforms from scene
bqqbarbhg Nov 26, 2022
ea7117d
UfbxImporter: Initial tests + relevant fixes
bqqbarbhg Nov 26, 2022
3973642
UfbxImporter: Explicit StringStl.h to compare strings
bqqbarbhg Nov 26, 2022
34ec065
UfbxImporter: Add mesh() test
bqqbarbhg Nov 26, 2022
e184b0e
UfbxImporter: Add Visibility field
bqqbarbhg Nov 26, 2022
340b8de
UfbxImporter: Declare used test cases in CMakeLists.txt
bqqbarbhg Nov 26, 2022
70c6ac2
UfbxImporter: static_cast<>, old habits die hard..
bqqbarbhg Nov 26, 2022
a2c13bd
UfbxImporter: Handle doSceneFieldForName() that is not found
bqqbarbhg Nov 26, 2022
a0afcdf
UfbxImporter: Add test light() + fixes
bqqbarbhg Nov 26, 2022
d0ad1df
UfbxImporter: Add simple PBR detection to ufbx
bqqbarbhg Nov 26, 2022
1ae4c17
UfbxImporter: Sketch of new doMaterial()
bqqbarbhg Nov 26, 2022
44915cc
UfbxImporter: Update ufbx
bqqbarbhg Dec 3, 2022
ba60cf5
UfbxImporter: Include ufbx.c as static
bqqbarbhg Dec 3, 2022
480799d
UfbxImporter: Pass updated defines to ufbx.c
bqqbarbhg Dec 3, 2022
0d9f295
UfbxImporter: Move material mappings to UfbxMaterials.h
bqqbarbhg Dec 3, 2022
5235321
UfbxImporter: Add ufbx include directories to test
bqqbarbhg Dec 3, 2022
af4119d
UfbxImporter: Update ufbx
bqqbarbhg Dec 3, 2022
a9c2a45
UfbxImporter: Report deduplicated images
bqqbarbhg Dec 3, 2022
8a842e2
UfbxImporter: Tests for materials
bqqbarbhg Dec 3, 2022
e344fdb
UfbxImporter: Fix old-style cast warnings
bqqbarbhg Dec 3, 2022
01849e8
UfbxImporter: Don't use implicit constructor lists in UfbxMaterials.h
bqqbarbhg Dec 3, 2022
c34b7b8
UfbxImporter: Update ufbx
bqqbarbhg Dec 3, 2022
85d2109
UfbxImporter: Add explicit constructor for MaterialMapping
bqqbarbhg Dec 3, 2022
401fe10
UfbxImporter: Fix ufbx warnings
bqqbarbhg Dec 3, 2022
fd39116
UfbxImporter: Ignore null pointer constant warning instead
bqqbarbhg Dec 3, 2022
929229e
UfbxImporter: Fix warnings in ufbx header
bqqbarbhg Dec 3, 2022
999efde
UfbxImporter: Fix DebugStl.h casing
bqqbarbhg Dec 3, 2022
0a648e2
UfbxImporter: Fix ufbx_inline on MSVC
bqqbarbhg Dec 3, 2022
fda4567
UfbxImporter: Add lightName test
bqqbarbhg Dec 3, 2022
14a091c
UfbxImporter: List `blender-materials.fbx` in CMake
bqqbarbhg Dec 3, 2022
b6b4d48
UfbxImporter: Add scene() test
bqqbarbhg Dec 3, 2022
22fc4cd
UfbxImporter: Add Arnold material test
bqqbarbhg Dec 3, 2022
ae1debd
UfbxImporter: Oops, typo fix
bqqbarbhg Dec 3, 2022
3738071
UfbxImporter: Update ufbx
bqqbarbhg Dec 3, 2022
6adf8b0
UfbxImporter: Update ufbx
bqqbarbhg Dec 4, 2022
ea9b665
UfbxImporter: Add maxMaterialPhysical() test
bqqbarbhg Dec 4, 2022
6fba60f
UfbxImporter: Layered texture test + fixes
bqqbarbhg Dec 4, 2022
91aa811
UfbxImporter: Add image deduplication test
bqqbarbhg Dec 4, 2022
83a913a
UfbxImporter: Add imageExternal() test
bqqbarbhg Dec 4, 2022
eae0510
UfbxImporter: Add file callback loading test + fix
bqqbarbhg Dec 4, 2022
fc38a95
UfbxImporter: File callback failure case tests
bqqbarbhg Dec 4, 2022
afb5205
UfbxImporter: Image callback tests
bqqbarbhg Dec 4, 2022
4d0f376
UfbxImporter: Remove unused policy parameter from tests
bqqbarbhg Dec 4, 2022
3121b87
UfbxImporter: Remove dependency on std::regex
bqqbarbhg Dec 4, 2022
d698409
UfbxImporter: Don't expect stack trace on non-debug
bqqbarbhg Dec 4, 2022
72d7687
UfbxImporter: Testing for minor coverage improvements
bqqbarbhg Dec 4, 2022
ad62198
UfbxImporter: Specular/glossiness material test + fixes
bqqbarbhg Dec 4, 2022
9af5313
UfbxImporter: Add configuration for maximum memory
bqqbarbhg Dec 4, 2022
eb65c5d
UfbxImporter: Attempt to fix linker error
bqqbarbhg Dec 4, 2022
9191260
UfbxImporter: Add tests for geometric transforms
bqqbarbhg Dec 4, 2022
80b80f8
UfbxImporter: Add texture transform test
bqqbarbhg Dec 4, 2022
1daa4fb
UfbxImporter: Update ufbx
bqqbarbhg Dec 4, 2022
8207a5e
UfbxImporter: Add .obj file tests
bqqbarbhg Dec 4, 2022
158cc6b
UfbxImporter: Remove unused factor lambdas from tests
bqqbarbhg Dec 4, 2022
c7f0c43
UfbxImporter: Fix missing-mtl.obj filename
bqqbarbhg Dec 4, 2022
fffd864
UfbxImporter: Exclude switch names from coverage
bqqbarbhg Dec 4, 2022
62dac1c
UfbxImporter: Re-add accidentally removed factor() lambdas
bqqbarbhg Dec 4, 2022
6ad99a3
UfbxImporter: Add test for bad light decay + fix
bqqbarbhg Dec 4, 2022
65753be
UfbxImporter: Add image fail case tests + fix
bqqbarbhg Dec 4, 2022
385150f
UfbxImporter: Add camera test + fix
bqqbarbhg Dec 4, 2022
b0ff74b
UfbxImporter: Add test for camera name
bqqbarbhg Dec 4, 2022
1dd599a
UfbxImporter: Exclude invalid projection mode
bqqbarbhg Dec 4, 2022
57e19c7
UfbxImporter: Proper support for unit normalization
bqqbarbhg Dec 4, 2022
b3e9e63
UfbxImporter: Add missing newline to warning message
bqqbarbhg Dec 4, 2022
ccc3a4a
UfbxImporter: Add wrap mode test
bqqbarbhg Dec 4, 2022
6af964d
UfbxImporter: Add test file with geometry cache
bqqbarbhg Dec 4, 2022
f4617c8
UfbxImporter: Add non-2D image test
bqqbarbhg Dec 4, 2022
ab94ca9
UfbxImporter: Add test with a skinned mesh
bqqbarbhg Dec 4, 2022
c63f5c8
UfbxImporter: Oops, add static-skin.fbx to CMakeLists.txt
bqqbarbhg Dec 4, 2022
c5cf063
UfbxImporter: Remove unnecessary file callback switch
bqqbarbhg Dec 4, 2022
c78f975
UfbxImporter: Add missing texture-wrap-modes.fbx to CMakeLists.txt
bqqbarbhg Dec 4, 2022
9ba46ed
UfbxImporter: Add tests with broken images
bqqbarbhg Dec 4, 2022
cdabf33
UfbxImporter: Update ufbx
bqqbarbhg Dec 8, 2022
3296975
UfbxImporter: Use ufbx internal scene normalization
bqqbarbhg Dec 8, 2022
f8cfb59
UfbxImporter: Add test for camera/light orientation + fix
bqqbarbhg Dec 8, 2022
a8f33f6
UfbxImporter: Add support for retaining material factors
bqqbarbhg Dec 10, 2022
450d35f
UfbxImporter: First draft of documentation
bqqbarbhg Dec 10, 2022
04f7128
UfbxImporter: Add test for instancing
bqqbarbhg Dec 10, 2022
3760e8e
UfbxImporter: Cleanup pass
bqqbarbhg Dec 10, 2022
210c19a
UfbxImporter: Oops, fix out of bounds indexing
bqqbarbhg Dec 10, 2022
8569b2a
UfbxImporter: doObjectName() doesn't need to handle out of bounds
bqqbarbhg Dec 10, 2022
917a90d
UfbxImporter: Update ufbx
bqqbarbhg Dec 12, 2022
39ad0b7
UfbxImporter: Add support for points/lines in mesh
bqqbarbhg Dec 12, 2022
ac829c9
UfbxImporter: Add GeometricTransformHelper scene field
bqqbarbhg Dec 12, 2022
6150c6b
UfbxImporter: Update documentation about scene fields
bqqbarbhg Dec 12, 2022
42b0bbd
UfbxImporter: Typo/whitespace fixes
bqqbarbhg Dec 17, 2022
bafc8db
UfbxImporter: Update ufbx
bqqbarbhg Dec 17, 2022
e5cfe47
UfbxImporter: Add tests for warnings
bqqbarbhg Dec 17, 2022
c5cb18a
UfbxImporter: Oops, add warning-cube.fbx to CMakeLists.txt
bqqbarbhg Dec 17, 2022
f357025
UfbxImporter: Support for various geometry transform handlings
bqqbarbhg Dec 17, 2022
0360718
UfbxImporter: Proper setting for unit normalization
bqqbarbhg Dec 17, 2022
aa60384
UfbxImporter: Configuration file doc fixes
bqqbarbhg Dec 17, 2022
694cda0
UfbxImporter: Remove overkill error stack validation
bqqbarbhg Dec 17, 2022
0f5ac03
UfbxImporter: Remove done @todo
bqqbarbhg Dec 17, 2022
2f62dc3
UfbxImporter: Use Color4 constructor instead of factor()
bqqbarbhg Dec 17, 2022
304832f
UfbxImporter: Remove perInstanceMaterials
bqqbarbhg Dec 17, 2022
204892e
UfbxImporter: Fix copypaste Assimp remnant
bqqbarbhg Dec 17, 2022
96a6607
UfbxImporter: Check for actual image2D() error message
bqqbarbhg Dec 17, 2022
5a5c5bb
UfbxImporter: Enum switch improvements
bqqbarbhg Dec 17, 2022
b0e2c66
UfbxImporter: Prefer nullptr
bqqbarbhg Dec 17, 2022
991031a
UfbxImporter: Move helper functions nearer to use
bqqbarbhg Dec 17, 2022
322d5e5
UfbxImporter: Add tex-broken.png to CMakeLists.txt
bqqbarbhg Dec 17, 2022
9acfc05
UfbxImporter: attribFactor -> attribColorFactor
bqqbarbhg Dec 17, 2022
8762296
UfbxImporter: Fix .conf BaseColorFactor attribute casing
bqqbarbhg Dec 17, 2022
4f24b7a
UfbxImporter: `const constexpr` -> `constexpr`
bqqbarbhg Dec 17, 2022
268f437
UfbxImporter: Attempt to load absolute paths
bqqbarbhg Dec 17, 2022
d2261ed
UfbxImporter: Skip imageAbsolutePath() if PngImporter is not present
bqqbarbhg Dec 17, 2022
db67ff5
UfbxImporter: Exclude unreachable line from coverage
bqqbarbhg Dec 17, 2022
4fb5c75
UfbxImporter: Clean up `toSamplerWrapping()`
bqqbarbhg Dec 17, 2022
3367687
UfbxImporter: Change fail of image-broken-embedded.fbx
bqqbarbhg Dec 17, 2022
360d3b1
UfbxImporter: Improve documentation
bqqbarbhg Dec 18, 2022
b850a93
UfbxImporter: Move `unboundedIfNegative()` nearer use
bqqbarbhg Dec 18, 2022
6d9fd90
UfbxImporter: Minor style fixes
bqqbarbhg Dec 18, 2022
793164b
UfbxImporter: Fail on invalid configuration enum values
bqqbarbhg Dec 18, 2022
8681c39
UfbxImporter: Update ufbx to 0.2.1
bqqbarbhg Dec 27, 2022
0a7a60d
UfbxImporter: Update ufbx url
bqqbarbhg Dec 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ option(MAGNUM_WITH_STLIMPORTER "Build StlImporter plugin" OFF)
if(MAGNUM_BUILD_DEPRECATED)
option(MAGNUM_WITH_TINYGLTFIMPORTER "Build TinyGltfImporter plugin" OFF)
endif()
option(MAGNUM_WITH_UFBXIMPORTER "Build UfbxImporter plugin" OFF)
option(MAGNUM_WITH_WEBPIMPORTER "Build WebPImporter plugin" OFF)

option(MAGNUM_BUILD_TESTS "Build unit tests" OFF)
Expand Down
2 changes: 2 additions & 0 deletions doc/building-plugins.dox
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ By default no plugins are built and you need to select them manually:
@ref Audio::StbVorbisImporter "StbVorbisAudioImporter" plugin.
- `MAGNUM_WITH_TINYGLTFIMPORTER` @m_class{m-label m-danger} **deprecated**
--- Build the @ref Trade::TinyGltfImporter "TinyGltfImporter" plugin.
- `MAGNUM_WITH_UFBXIMPORTER` --- Build the
@ref Trade::UfbxImporter "UfbxImporter" plugin.
- `MAGNUM_WITH_WEBPIMPORTER` --- Build the @relativeref{Trade,WebPImporter}
plugin.

Expand Down
1 change: 1 addition & 0 deletions package/ci/android-x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ cmake .. \
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=OFF \
-DMAGNUM_WITH_STLIMPORTER=ON \
-DMAGNUM_WITH_TINYGLTFIMPORTER=ON \
-DMAGNUM_WITH_UFBXIMPORTER=ON \
-DMAGNUM_WITH_WEBPIMPORTER=OFF \
-DMAGNUM_BUILD_TESTS=ON \
-DMAGNUM_BUILD_GL_TESTS=ON \
Expand Down
1 change: 1 addition & 0 deletions package/ci/appveyor-desktop-mingw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ cmake .. ^
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=ON ^
-DMAGNUM_WITH_STLIMPORTER=ON ^
-DMAGNUM_WITH_TINYGLTFIMPORTER=ON ^
-DMAGNUM_WITH_UFBXIMPORTER=ON ^
-DMAGNUM_WITH_WEBPIMPORTER=OFF ^
-DMAGNUM_BUILD_TESTS=ON ^
-DMAGNUM_BUILD_GL_TESTS=ON ^
Expand Down
1 change: 1 addition & 0 deletions package/ci/appveyor-desktop.bat
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ cmake .. ^
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=ON ^
-DMAGNUM_WITH_STLIMPORTER=ON ^
-DMAGNUM_WITH_TINYGLTFIMPORTER=ON ^
-DMAGNUM_WITH_UFBXIMPORTER=ON ^
-DMAGNUM_WITH_WEBPIMPORTER=ON ^
-DMAGNUM_BUILD_TESTS=ON ^
-DMAGNUM_BUILD_GL_TESTS=ON ^
Expand Down
1 change: 1 addition & 0 deletions package/ci/appveyor-rt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ cmake .. ^
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=OFF ^
-DMAGNUM_WITH_STLIMPORTER=ON ^
-DMAGNUM_WITH_TINYGLTFIMPORTER=ON ^
-DMAGNUM_WITH_UFBXIMPORTER=ON ^
-DMAGNUM_WITH_WEBPIMPORTER=OFF ^
-DMAGNUM_BUILD_STATIC=ON ^
-G "%GENERATOR%" -A x64 || exit /b
Expand Down
1 change: 1 addition & 0 deletions package/ci/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ cmake .. \
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=ON \
-DMAGNUM_WITH_STLIMPORTER=ON \
-DMAGNUM_WITH_TINYGLTFIMPORTER=ON \
-DMAGNUM_WITH_UFBXIMPORTER=ON \
-DMAGNUM_WITH_WEBPIMPORTER=OFF \
-DMAGNUM_BUILD_TESTS=ON \
-DMAGNUM_BUILD_GL_TESTS=ON \
Expand Down
1 change: 1 addition & 0 deletions package/ci/ios-simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ cmake .. \
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=ON \
-DMAGNUM_WITH_STLIMPORTER=ON \
-DMAGNUM_WITH_TINYGLTFIMPORTER=ON \
-DMAGNUM_WITH_UFBXIMPORTER=ON \
-DMAGNUM_WITH_WEBPIMPORTER=OFF \
-DMAGNUM_BUILD_STATIC=ON \
-DMAGNUM_BUILD_TESTS=ON \
Expand Down
1 change: 1 addition & 0 deletions package/ci/unix-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ cmake .. \
-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=ON \
-DMAGNUM_WITH_STLIMPORTER=ON \
-DMAGNUM_WITH_TINYGLTFIMPORTER=$BUILD_DEPRECATED \
-DMAGNUM_WITH_UFBXIMPORTER=ON \
-DMAGNUM_WITH_WEBPIMPORTER=ON \
-DMAGNUM_BUILD_TESTS=ON \
-DMAGNUM_BUILD_GL_TESTS=ON \
Expand Down
4 changes: 4 additions & 0 deletions src/MagnumPlugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ if(MAGNUM_BUILD_DEPRECATED AND MAGNUM_WITH_TINYGLTFIMPORTER)
add_subdirectory(TinyGltfImporter)
endif()

if(MAGNUM_WITH_UFBXIMPORTER)
add_subdirectory(UfbxImporter)
endif()

if(MAGNUM_WITH_WEBPIMPORTER)
add_subdirectory(WebPImporter)
endif()
74 changes: 74 additions & 0 deletions src/MagnumPlugins/UfbxImporter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2022 Samuli Raivio <bqqbarbhg@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

find_package(Magnum REQUIRED Trade MeshTools AnyImageImporter)

if(MAGNUM_BUILD_PLUGINS_STATIC AND NOT DEFINED MAGNUM_UFBXIMPORTER_BUILD_STATIC)
set(MAGNUM_UFBXIMPORTER_BUILD_STATIC 1)
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)

# UfbxImporter plugin
add_plugin(UfbxImporter
importers
"${MAGNUM_PLUGINS_IMPORTER_DEBUG_BINARY_INSTALL_DIR};${MAGNUM_PLUGINS_IMPORTER_DEBUG_LIBRARY_INSTALL_DIR}"
"${MAGNUM_PLUGINS_IMPORTER_RELEASE_BINARY_INSTALL_DIR};${MAGNUM_PLUGINS_IMPORTER_RELEASE_LIBRARY_INSTALL_DIR}"
UfbxImporter.conf
UfbxImporter.cpp
UfbxImporter.h)
if(MAGNUM_UFBXIMPORTER_BUILD_STATIC AND MAGNUM_BUILD_STATIC_PIC)
set_target_properties(UfbxImporter PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
target_include_directories(UfbxImporter PUBLIC
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src)

# Include the ufbx files as a system directory to supress warnings
target_include_directories(UfbxImporter PRIVATE ${PROJECT_SOURCE_DIR}/src/external/ufbx)
target_link_libraries(UfbxImporter PUBLIC Magnum::Trade Magnum::MeshTools)
if(CORRADE_TARGET_WINDOWS)
target_link_libraries(UfbxImporter PUBLIC Magnum::AnyImageImporter)
elseif(MAGNUM_UFBXIMPORTER_BUILD_STATIC)
target_link_libraries(UfbxImporter INTERFACE Magnum::AnyImageImporter)
endif()

install(FILES UfbxImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/UfbxImporter)

# Automatic static plugin import
if(MAGNUM_UFBXIMPORTER_BUILD_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/UfbxImporter)
target_sources(UfbxImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()

if(MAGNUM_BUILD_TESTS)
add_subdirectory(Test ${EXCLUDE_FROM_ALL_IF_TEST_TARGET})
endif()

# MagnumPlugins UfbxImporter target alias for superprojects
add_library(MagnumPlugins::UfbxImporter ALIAS UfbxImporter)
12 changes: 12 additions & 0 deletions src/MagnumPlugins/UfbxImporter/Test/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# You have to add the following to your .git/config or global
# ~/.gitconfig to make the binary diffs work (without the comment
# character, of course):
#
# [diff "hex"]
# textconv = hexdump -v -C
# binary = true
#

*.fbx binary diff=hex
*.png binary diff=hex
*.dds binary diff=hex
130 changes: 130 additions & 0 deletions src/MagnumPlugins/UfbxImporter/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2022 Samuli Raivio <bqqbarbhg@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

# IDE folder in VS, Xcode etc. CMake 3.12+, older versions have only the FOLDER
# property that would have to be set on each target separately.
set(CMAKE_FOLDER "MagnumPlugins/UfbxImporter/Test")

if(CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID)
set(UFBXIMPORTER_TEST_DIR ".")
else()
set(UFBXIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()

find_package(Magnum REQUIRED DebugTools)

if(NOT MAGNUM_UFBXIMPORTER_BUILD_STATIC)
if(MAGNUM_WITH_DDSIMPORTER)
set(DDSIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:DdsImporter>)
endif()
if(MAGNUM_WITH_STBIMAGEIMPORTER)
set(STBIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:StbImageImporter>)
endif()
endif()

if(NOT MAGNUM_UFBXIMPORTER_BUILD_STATIC)
set(UFBXIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:UfbxImporter>)
endif()

# First replace ${} variables, then $<> generator expressions
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h.in)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/configure.h
INPUT ${CMAKE_CURRENT_BINARY_DIR}/configure.h.in)

corrade_add_test(UfbxImporterTest UfbxImporterTest.cpp
LIBRARIES
Magnum::DebugTools
Magnum::Trade
FILES
blender-default.fbx
blender-materials.fbx
instanced-material.fbx
maya-material-arnold.fbx
maya-material-phong.fbx
max-material-physical.fbx
max-material-spec-gloss.fbx
layered-pbr-textures.fbx
geometric-transform.fbx
texture-transform.fbx
texture-wrap-modes.fbx
mesh-point-line.fbx
triangle.fbx
cameras.fbx
lights.fbx
bad-decay-lights.fbx
image-absolute-path.fbx
image-broken-external.fbx
image-broken-embedded.fbx
units-cm-z-up.fbx
maya-camera-light-orientation.fbx
geometry-cache.fbx
static-skin.fbx
warning-cube.fbx
cube.obj
cube.mtl
missing-mtl.obj
image-3d.obj
image-3d.mtl
image-3d.dds
tex-black.png
tex-blue.png
tex-cyan.png
tex-green.png
tex-pink.png
tex-red.png
tex-white.png
tex-yellow.png
tex-broken.png)


target_include_directories(UfbxImporterTest PRIVATE ${PROJECT_SOURCE_DIR}/src/external/ufbx)
target_include_directories(UfbxImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
if(MAGNUM_UFBXIMPORTER_BUILD_STATIC)
target_link_libraries(UfbxImporterTest PRIVATE UfbxImporter)
if(MAGNUM_WITH_DDSIMPORTER)
target_link_libraries(UfbxImporterTest PRIVATE DdsImporter)
endif()
if(MAGNUM_WITH_STBIMAGEIMPORTER)
target_link_libraries(UfbxImporterTest PRIVATE StbImageImporter)
endif()
else()
# So the plugins get properly built when building the test
add_dependencies(UfbxImporterTest UfbxImporter)
if(MAGNUM_WITH_DDSIMPORTER)
add_dependencies(UfbxImporterTest DdsImporter)
endif()
if(MAGNUM_WITH_STBIMAGEIMPORTER)
add_dependencies(UfbxImporterTest StbImageImporter)
endif()
endif()
if(CORRADE_BUILD_STATIC AND NOT MAGNUM_UFBXIMPORTER_BUILD_STATIC)
# CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065).
# That's generally okay, *except if* the build is static, the executable
# uses a plugin manager and needs to share globals with the plugins (such
# as output redirection and so on).
set_target_properties(UfbxImporterTest PROPERTIES ENABLE_EXPORTS ON)
endif()
Loading