FBXImportSettings.h 5.6 KB

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