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