FBXImportSettings.h 7.1 KB

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