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