HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FBX_Common.h
Go to the documentation of this file.
1 /*
2 * PROPRIETARY INFORMATION. This software is proprietary to
3 * Side Effects Software Inc., and is not to be reproduced,
4 * transmitted, or disclosed in any way without written permission.
5 *
6 * NAME: FBX_Common.h (FBX Library, C++)
7 *
8 * COMMENTS:
9 *
10 */
11 
12 #ifndef __FBX_Common_h__
13 #define __FBX_Common_h__
14 
15 #include "FBX_API.h"
16 #include <UT/UT_StringHolder.h>
17 
18 namespace FBX_Names
19 {
21 }
22 
23 /********************************************************************************************************/
25 {
28 };
30 {
34 };
36 {
39 };
40 /********************************************************************************************************/
42 {
43 public:
44 
46 
47  /// If true, triangulates all patches and imports them as meshes.
48  bool getTriangulatePatches() const;
49  /// If true, triangulates all NURBs objects and imports them as meshes.
50  bool getTriangulateNurbs() const;
51  /// If true, animation will be resample into a linearly interpolated
52  /// keys at every integer key frame.
53  bool getResampleAnimation() const;
54  /// Animation resampling interval, in frames, between each sample. Defaults to 1.0.
55  double getResampleInterval() const;
56  /// If true, forces the normalization of vertex weights on import.
57  bool getForceNormalizeVertexWeights() const;
58  /// This is a workaround around a bug in FBX SDK. If a vertex cache is created
59  /// as a float type, the SDK cannot recognize any difference between that and
60  /// the double type. If this option is true, the importer will assume any
61  /// vertex caches are actually float type caches. If not, it assumes they are
62  /// double. False by default.
63  bool getTreatVertexCachesAsFloats() const;
64  /// If true, objects with Blend deforms on them will be imported as Blend SOPs. If false,
65  /// they'll be imported as channels.
66  bool getImportBlendingAsSOPs() const;
67  /// If true, no nodes will be generated for the "Segment Scale Compensate" feature in Maya.
68  /// Maya's FBX plugin changed its behaviour between the 2009 and 2010 versions to bake
69  /// out the segment scale compensation explicitly, so for newer files, we shouldn't
70  /// do it ourselves. If we try to do it, we'll end up only compensating for the compensation,
71  /// and thus undoing it. (Bug #57022)
72  bool getIgnoreSegScaleComp() const;
73  /// Determines whether uv coordinates are named Houdini-style or with native FBX names.
74  FBX_TextureCoordinatesNamingType getUVNamingStyle() const;
75  /// If true, and if importing UVs with original FBX names, this
76  /// will create one set of UVs with standard Houdini names for OGL display.
77  bool getCreateOGLDummyCoords() const;
78  /// This will try to adjust the importer to specific file sources (Maya, Max, etc.) and
79  /// their specific bugs.
80  FBX_CompatibilityModeType getCompatibilityMode() const;
81  /// Determines whether materials are imported as VOP Networks or as FBX Shaders.
82  FBX_MaterialImportType getMaterialImportMode() const;
83  /// The framerate to use to overwrite FBX's own rate. Defaults to -1 (meaning no override).
84  double getOverrideFramerate() const;
85  /// If true, joints attached to skins will have their display disabled.
86  /// @{
87  void setHideSkinJoints(bool value);
88  bool getHideSkinJoints() const;
89  /// @}
90  /// If true, joints will have their rotation order converted to ZYX
91  /// @{
92  void setConvertJointsToZYXRotOrder(bool value);
93  bool getConvertJointsToZYXRotOrder() const;
94  /// @}
95  /// If true, bones will be created inline with the joints.
96  /// @note Support is not currently exposed because export code needs to be
97  /// able to disambiguate the pretransforms set into bones that need to be
98  /// ignored on export.
99  /// @{
100  void setInlineBones(bool value);
101  bool getInlineBones() const;
102  /// @}
103  /// If false, additional bones will not be created alongside the joints.
104  /// @{
105  void setVisualizerBones(bool value);
106  bool getVisualizerBones() const;
107  /// @}
108  /// If true, null nodes will be created as subnets (except for joints). The children will then be
109  /// placed within these subnets, instead of parented to them.
110  bool getCreateNullsAsSubnets() const;
111  /// If true, null nodes will be created as subnets (except for joints). The children will then be
112  /// placed within these subnets, instead of parented to them.
113  void setCreateNullsAsSubnets(bool value);
114  /// If true, all geometry File SOPs will be left unlocked, which means on load, an original
115  /// FBX file will be required (at the same location).
116  void setUnlockGeometry(bool value);
117  /// If true, all deformation File CHOPs will be left unlocked, which means on load, an original
118  /// FBX file will be required (at the same location).
119  void setUnlockDeformations(bool value);
120  /// If true, all geometry File SOPs will be left unlocked, which means on load, an original
121  /// FBX file will be required (at the same location).
122  bool getUnlockGeometry() const;
123  /// If true, all deformation File CHOPs will be left unlocked, which means on load, an original
124  /// FBX file will be required (at the same location).
125  bool getUnlockDeformations() const;
126  /// If true, the importer will attempt to make all paths, including textures and .fbx files, relative
127  /// (starting with $HIP). If false, paths will be absolute. The trick is that if paths are relative, the
128  /// user *must* save the .hip file into the same directory as the .fbx file, otherwise all references
129  /// will be lost.
130  bool getMakePathsRelative() const;
131  /// If true, objects are imported directly into /obj network, instead of a new subnet for each FBX
132  /// file.
133  bool getImportIntoObj() const;
134  /// If true, the FBX scene will be converted to Y-up on import. If false, the scene will be imported
135  /// as-is. True by default.
136  bool getConvertToYUp() const;
137 
138  /// If true, the FBX scene will be converted to Y-up on import. If false, the scene will be imported
139  /// as-is. True by default.
140  void setConvertToYUp(bool value);
141  /// If true, objects are imported directly into /obj network, instead of a new subnet for each FBX
142  /// file.
143  void setImportIntoObj(bool value);
144  /// If true, the importer will attempt to make all paths, including textures and .fbx files, relative
145  /// (starting with $HIP). If false, paths will be absolute. The trick is that if paths are relative, the
146  /// user *must* save the .hip file into the same directory as the .fbx file, otherwise all references
147  /// will be lost.
148  void setMakePathsRelative(bool value);
149  /// The framerate to use to overwrite FBX's own rate. Defaults to -1 (meaning no override).
150  void setOverrideFramerate(double frate);
151  /// If True, the importer will change the scene's timerange and framerange
152  void setOverrideFrameRange(bool value);
153  bool getOverrideFrameRange() const;
154  /// Determines whether materials are imported as VOP Networks or as FBX Shaders.
155  void setMaterialImportMode(FBX_MaterialImportType value);
156  /// This will try to adjust the importer to specific file sources (Maya, Max, etc.) and
157  /// their specific bugs.
158  void setCompatibilityMode(FBX_CompatibilityModeType value);
159  /// If true, and if importing UVs with original FBX names, this
160  /// will create one set of UVs with standard Houdini names for OGL display.
161  void setCreateOGLDummyCoords(bool value);
162  /// Determines whether uv coordinates are named Houdini-style or with native FBX names.
163  void setUVNamingStyle(FBX_TextureCoordinatesNamingType uv_style);
164  /// If true, objects with Blend deforms on them will be imported as Blend SOPs. If false,
165  /// they'll be imported as channels.
166  void setImportBlendingAsSOPs(bool value);
167  /// If true, no nodes will be generated for the "Segment Scale Compensate" feature in Maya.
168  /// Maya's FBX plugin changed its behaviour between the 2009 and 2010 versions to bake
169  /// out the segment scale compensation explicitly, so for newer files, we shouldn't
170  /// do it ourselves. If we try to do it, we'll end up only compensating for the compensation,
171  /// and thus undoing it. (Bug #57022)
172  void setIgnoreSegScaleComp(bool value);
173  /// This is a workaround around a bug in FBX SDK. If a vertex cache is created
174  /// as a float type, the SDK cannot recognize any difference between that and
175  /// the double type. If this option is true, the importer will assume any
176  /// vertex caches are actually float type caches. If not, it assumes they are
177  /// double. False by default.
178  void setTreatVertexCachesAsFloats(bool value);
179  /// If true, forces the normalization of vertex weights on import.
180  void setForceNormalizeVertexWeights(bool value);
181  /// Animation resampling interval, in frames, between each sample. Defaults to 1.0.
182  void setResampleInterval(double frames);
183  /// If true, triangulates all patches and imports them as meshes.
184  void setTriangulatePatches(bool value);
185  /// If true, triangulates all NURBs objects and imports them as meshes.
186  void setTriangulateNurbs(bool value);
187  /// If true, animation will be resample into a linearly interpolated
188  /// keys at every integer key frame.
189  void setResampleAnimation(bool value);
190 
191  /// Convert units to system preference on import (default false)
192  /// @{
193  void setConvertUnits(bool v) { myConvertUnits = v; }
194  bool getConvertUnits() const { return myConvertUnits; }
195  /// @}
196 
197 private:
198 
199  /// Triangulates all NURBs objects and imports them as meshes.
200  bool myTriangulateNurbs;
201 
202  /// Triangulates all patches and imports them as meshes.
203  bool myTriangulatePatches;
204 
205  /// If true, animation will be resample into a linearly interpolated
206  /// keys.
207  bool myResampleAnimation;
208 
209  /// Animation resampling interval, in frames, between each sample.
210  double myResampleInterval;
211 
212  /// This is a workaround around a bug in FBX SDK. If a vertex cache is created
213  /// as float type, FBX doesn't convert individual values from float to double; instead,
214  /// it justs casts the entire pointer to the double* from float*. It's wrong, but we can cast
215  /// it back. This option does that. Off by default.
216  bool myTreatVertexCachesAsFloats;
217 
218  /// Force the normalization of vertex weights
219  bool myForceNormalizeVertexWeights;
220 
221  /// If true, objects with Blend deforms on them will be imported as Blend SOPs. If false,
222  /// they'll be imported as channels.
223  bool myImportBlendingAsSOPs;
224 
225  /// If true, no nodes will be generated for the "Segment Scale Compensate" feature in Maya.
226  /// Maya's FBX plugin changed its behaviour between the 2009 and 2010 versions to bake
227  /// out the segment scale compensation explicitly, so for newer files, we shouldn't
228  /// do it ourselves. If we try to do it, we'll end up only compensating for the compensation,
229  /// and thus undoing it. (Bug #57022)
230  bool myIgnoreSegScaleComp;
231 
232  /// Determines whether uv coordinates are named Houdini-style or with native FBX names.
233  FBX_TextureCoordinatesNamingType myUVNamingStyle;
234 
235  /// If true, and if importing UVs with original FBX names, this
236  /// will create one set of UVs with standard Houdini names for OGL display.
237  bool myCreateOGLDummyCoords;
238 
239  /// This will try to adjust the importer to specific file sources (Maya, Max, etc.) and
240  /// their specific bugs.
241  FBX_CompatibilityModeType myCompatibilityMode;
242 
243  /// Determines whether materials are imported as VOP Networks or as FBX Shaders.
244  FBX_MaterialImportType myMaterialImportMode;
245 
246  /// The framerate to use to overwrite FBX's own rate. Defaults to -1 (meaning no override).
247  double myOverrideFramerate;
248 
249  bool myOverrideFrameRange;
250 
251  /// If true, all geometry File SOPs will be left unlocked, which means on load, an original
252  /// FBX file will be required (at the same location).
253  bool myUnlockGeometry;
254 
255  /// If true, all deformation File CHOPs will be left unlocked, which means on load, an original
256  /// FBX file will be required (at the same location).
257  bool myUnlockDeformations;
258 
259  /// If true, the importer will attempt to make all paths, including textures and .fbx files, relative
260  /// (starting with $HIP). If false, paths will be absolute. The trick is that if paths are relative, the
261  /// user *must* save the .hip file into the same directory as the .fbx file, otherwise all references
262  /// will be lost.
263  bool myMakePathsRelative;
264 
265  /// If true, joints attached to skins will have their display disabled.
266  bool myHideSkinJoints;
267 
268  /// If true, joints will import with the ZYX rotation order
269  bool myConvertJointsToZYXRotOrder;
270 
271  /// If true, bones will be created inline with the joints.
272  /// @note Support is not currently exposed because export code needs work
273  bool myInlineBones;
274 
275  /// If true, bones will be created with the joints.
276  bool myVisualizerBones;
277 
278  /// If true, null nodes will be created as subnets (except for joints). The children will then be
279  /// placed within these subnets, instead of parented to them.
280  bool myCreateNullsAsSubnets;
281 
282  /// If true, objects are imported directly into /obj network, instead of a new subnet for each FBX
283  /// file.
284  bool myImportIntoObj;
285 
286  /// If true, the FBX scene will be converted to Y-up on import. If false, the scene will be imported
287  /// as-is. True by default.
288  bool myConvertToYUp;
289 
290  /// Option to scale root nodes on import
291  bool myConvertUnits;
292 };
293 /********************************************************************************************************/
295 {
296 public:
298 
299  void setDoGeometry(bool bValue);
300  void setDoLights(bool bValue);
301  void setDoCameras(bool bValue);
302  void setDoBones(bool value);
303  void setDoAnimation(bool value);
304  void setDoMaterials(bool value);
305  void setImportGlobalAmbientLight(bool value);
306 
307  bool getImportGlobalAmbientLight() const;
308  bool getDoMaterials() const;
309  bool getDoAnimation() const;
310  bool getDoBones() const;
311  bool getDoGeometry() const;
312  bool getDoLights() const;
313  bool getDoCameras() const;
314 
315 private:
316 
317  bool myImportGlobalAmbientLight;
318 
319  bool myDoMaterials;
320  bool myDoBones;
321  bool myDoGeometry;
322  bool myDoLights;
323  bool myDoCameras;
324  bool myDoAnimation;
325 };
326 /********************************************************************************************************/
327 #endif // __FBX_Common_h__
FBX_API const UT_StringHolder fbx_skinblendweight
FBX_MaterialImportType
Definition: FBX_Common.h:29
const GLdouble * v
Definition: glew.h:1391
void setConvertUnits(bool v)
Definition: FBX_Common.h:193
FBX_TextureCoordinatesNamingType
Definition: FBX_Common.h:24
#define FBX_API
Definition: FBX_API.h:10
FBX_CompatibilityModeType
Definition: FBX_Common.h:35
GLsizei const GLfloat * value
Definition: glew.h:1849
bool getConvertUnits() const
Definition: FBX_Common.h:194