Coverage Report

Created: 2025-06-22 07:30

/src/assimp/code/AssetLib/FBX/FBXImportSettings.h
Line
Count
Source
1
/*
2
Open Asset Import Library (assimp)
3
----------------------------------------------------------------------
4
5
Copyright (c) 2006-2025, assimp team
6
7
All rights reserved.
8
9
Redistribution and use of this software in source and binary forms,
10
with or without modification, are permitted provided that the
11
following conditions are met:
12
13
* Redistributions of source code must retain the above
14
  copyright notice, this list of conditions and the
15
  following disclaimer.
16
17
* Redistributions in binary form must reproduce the above
18
  copyright notice, this list of conditions and the
19
  following disclaimer in the documentation and/or other
20
  materials provided with the distribution.
21
22
* Neither the name of the assimp team, nor the names of its
23
  contributors may be used to endorse or promote products
24
  derived from this software without specific prior
25
  written permission of the assimp team.
26
27
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
39
----------------------------------------------------------------------
40
*/
41
42
/** @file  FBXImportSettings.h
43
 *  @brief FBX importer runtime configuration
44
 */
45
#ifndef INCLUDED_AI_FBX_IMPORTSETTINGS_H
46
#define INCLUDED_AI_FBX_IMPORTSETTINGS_H
47
48
namespace Assimp {
49
namespace FBX {
50
51
/** FBX import settings, parts of which are publicly accessible via their corresponding AI_CONFIG constants */
52
struct ImportSettings {
53
    ImportSettings() :
54
1.50k
            strictMode(true),
55
1.50k
            readAllLayers(true),
56
1.50k
            readAllMaterials(false),
57
1.50k
            readMaterials(true),
58
1.50k
            readTextures(true),
59
1.50k
            readCameras(true),
60
1.50k
            readLights(true),
61
1.50k
            readAnimations(true),
62
1.50k
            readWeights(true),
63
1.50k
            useSkeleton(false),
64
1.50k
            preservePivots(true),
65
1.50k
            optimizeEmptyAnimationCurves(true),
66
1.50k
            useLegacyEmbeddedTextureNaming(false),
67
1.50k
            removeEmptyBones(true),
68
1.50k
            convertToMeters(false) {
69
        // empty
70
1.50k
    }
71
72
    /** enable strict mode:
73
     *   - only accept fbx 2012, 2013 files
74
     *   - on the slightest error, give up.
75
     *
76
     *  Basically, strict mode means that the fbx file will actually
77
     *  be validated. Strict mode is off by default. */
78
    bool strictMode;
79
80
    /** specifies whether all geometry layers are read and scanned for
81
      * usable data channels. The FBX spec indicates that many readers
82
      * will only read the first channel and that this is in some way
83
      * the recommended way- in reality, however, it happens a lot that
84
      * vertex data is spread among multiple layers. The default
85
      * value for this option is true.*/
86
    bool readAllLayers;
87
88
    /** specifies whether all materials are read, or only those that
89
     *  are referenced by at least one mesh. Reading all materials
90
     *  may make FBX reading a lot slower since all objects
91
     *  need to be processed .
92
     *  This bit is ignored unless readMaterials=true*/
93
    bool readAllMaterials;
94
95
    /** import materials (true) or skip them and assign a default
96
     *  material. The default value is true.*/
97
    bool readMaterials;
98
99
    /** import embedded textures? Default value is true.*/
100
    bool readTextures;
101
102
    /** import cameras? Default value is true.*/
103
    bool readCameras;
104
105
    /** import light sources? Default value is true.*/
106
    bool readLights;
107
108
    /** import animations (i.e. animation curves, the node
109
     *  skeleton is always imported). Default value is true. */
110
    bool readAnimations;
111
112
    /** read bones (vertex weights and deform info).
113
     *  Default value is true. */
114
    bool readWeights;
115
116
    /** will convert all animation data into a skeleton (experimental)
117
     *  Default value is false.
118
     */
119
    bool useSkeleton;
120
121
    /** preserve transformation pivots and offsets. Since these can
122
     *  not directly be represented in assimp, additional dummy
123
     *  nodes will be generated. Note that settings this to false
124
     *  can make animation import a lot slower. The default value
125
     *  is true.
126
     *
127
     *  The naming scheme for the generated nodes is:
128
     *    <OriginalName>_$AssimpFbx$_<TransformName>
129
     *
130
     *  where <TransformName> is one of
131
     *    RotationPivot
132
     *    RotationOffset
133
     *    PreRotation
134
     *    PostRotation
135
     *    ScalingPivot
136
     *    ScalingOffset
137
     *    Translation
138
     *    Scaling
139
     *    Rotation
140
     **/
141
    bool preservePivots;
142
143
    /** do not import animation curves that specify a constant
144
     *  values matching the corresponding node transformation.
145
     *  The default value is true. */
146
    bool optimizeEmptyAnimationCurves;
147
148
    /** use legacy naming for embedded textures eg: (*0, *1, *2)
149
    */
150
    bool useLegacyEmbeddedTextureNaming;
151
152
    /** Empty bones shall be removed
153
    */
154
    bool removeEmptyBones;
155
156
    /** Set to true to perform a conversion from cm to meter after the import
157
    */
158
    bool convertToMeters;
159
160
    // Set to true to ignore the axis configuration in the file
161
    bool ignoreUpDirection = false;
162
};
163
164
} // namespace FBX
165
} // namespace Assimp
166
167
#endif