00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Oleg Samus 00008 * Side Effects 00009 * 123 Front Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: ROP library (C++) 00015 * 00016 * COMMENTS: FBX output 00017 * 00018 */ 00019 00020 #ifndef __ROP_FBXCommon_h__ 00021 #define __ROP_FBXCommon_h__ 00022 00023 #include <string> 00024 #include <vector> 00025 #include <map> 00026 #include <set> 00027 00028 #include "ROP_API.h" 00029 00030 #ifdef FBXFILESDK_NAMESPACE_USE 00031 #define FBX_FILMBOX_NAMESPACE FBXFILESDK_NAMESPACE 00032 using namespace FBX_FILMBOX_NAMESPACE; 00033 #else 00034 #define FBX_FILMBOX_NAMESPACE 00035 #endif 00036 00037 using namespace std; 00038 00039 typedef std::vector < std::string > TStringVector; 00040 /********************************************************************************************************/ 00041 const int ROP_FBX_DUMMY_PARTICLE_GEOM_VERTEX_COUNT = 4; 00042 00043 // Determines which network types the visitor dives into 00044 const char* const ROP_FBXnetworkTypesToIgnore[] = { "geo", "bone", "null", "cam", "instance", "hlight", 00045 "ambient", "dopnet", "ropnet", "chopnet", "popnet", "vopnet", "shopnet", 0 }; 00046 00047 // These declare any node that does not modify the mesh, its vertices or points. 00048 const char* const ROP_FBXallowed_inbetween_node_types[] = {"null", "switch", "subnet", "attribcomposite", 00049 "attribcopy", "attribcreate", "attribmirror", "attribpromote", "attribreorient", 00050 "attribpromote", "attribstringedit", "attribute", 0}; 00051 /********************************************************************************************************/ 00052 enum ROP_FBXVertexCacheExportFormatType 00053 { 00054 ROP_FBXVertexCacheExportFormatMaya = 0, 00055 ROP_FBXVertexCacheExportFormat3DStudio 00056 }; 00057 enum ROP_FBXVertexCacheMethodType 00058 { 00059 ROP_FBXVertexCacheMethodNone = 0, 00060 ROP_FBXVertexCacheMethodGeometry, // Any kind of geometry, including variable num points objects. 00061 ROP_FBXVertexCacheMethodGeometryConstant, // Geometry with constant number of points (i.g. skinning, RBD, cloth). 00062 ROP_FBXVertexCacheMethodParticles // Pure particle systems with no instance geometry 00063 }; 00064 00065 enum ROP_FBXInvisibleNodeExportType 00066 { 00067 ROP_FBXInvisibleNodeExportAsNulls = 0, 00068 ROP_FBXInvisibleNodeExportFull 00069 }; 00070 /********************************************************************************************************/ 00071 class ROP_API ROP_FBXExportOptions 00072 { 00073 public: 00074 ROP_FBXExportOptions(); 00075 ~ROP_FBXExportOptions(); 00076 void reset(void); 00077 00078 /// If true, all animation curves will be resampled on export. If false, 00079 /// only the unsupported types will be. 00080 bool getResampleAllAnimation(void); 00081 /// If true, all animation curves will be resampled on export. If false, 00082 /// only the unsupported types will be. 00083 void setResampleAllAnimation(bool value); 00084 00085 /// Resampling frequency, in frames. A linear key frame will be exported 00086 /// every N frames. 00087 float getResampleIntervalInFrames(void); 00088 /// Resampling frequency, in frames. A linear key frame will be exported 00089 /// every N frames. 00090 void setResampleIntervalInFrames(float frames); 00091 00092 /// Specified the format to use for exporting vertex caches, whether compatbile 00093 /// with Maya's or 3DS MAX. 00094 void setVertexCacheFormat(ROP_FBXVertexCacheExportFormatType format_type); 00095 /// Specified the format to use for exporting vertex caches, whether compatbile 00096 /// with Maya's or 3DS MAX. 00097 ROP_FBXVertexCacheExportFormatType getVertexCacheFormat(void); 00098 00099 /// If true, the exported file will be in the human-readable ASCII FBX format. 00100 /// Otherwise, it will be in binary. 00101 bool getExportInAscii(void); 00102 /// If true, the exported file will be in the human-readable ASCII FBX format. 00103 /// Otherwise, it will be in binary. 00104 void setExportInAscii(bool value); 00105 00106 /// The first network the to start exporting from. Everything (recursively) in this 00107 /// network will be exported to the FBX file. Defaults to "/obj". 00108 void setStartNodePath(const char* node_path, bool autohandle_bundles = true); 00109 /// The first network the to start exporting from. Everything (recursively) in this 00110 /// network will be exported to the FBX file. Defaults to "/obj". 00111 const char* getStartNodePath(void); 00112 00113 /// If true, the code will attempt to find those vertex cacheable objects which 00114 /// have a constant point count throughout the exported animation, and export them 00115 /// as "normal" vertex caches, without breaking them up and triangulating them. 00116 /// NOTE: This can fail when an object will happen to have a constant vertex count 00117 /// while changing point connectivity. This is why this is a UI option 00118 bool getDetectConstantPointCountObjects(void); 00119 /// If true, the code will attempt to find those vertex cacheable objects which 00120 /// have a constant point count throughout the exported animation, and export them 00121 /// as "normal" vertex caches, without breaking them up and triangulating them. 00122 /// NOTE: This can fail when an object will happen to have a constant vertex count 00123 /// while changing point connectivity. This is why this is a UI option 00124 void setDetectConstantPointCountObjects(bool value); 00125 00126 /// Level of detail to use when converting various primitives to polygons. 00127 void setPolyConvertLOD(float lod); 00128 /// Level of detail to use when converting various primitives to polygons. 00129 float getPolyConvertLOD(void); 00130 00131 /// If true, geometry with Deform SOPs will be exported as vertex caches. False by default. 00132 bool getExportDeformsAsVC(void); 00133 /// If true, geometry with Deform SOPs will be exported as vertex caches. False by default. 00134 void setExportDeformsAsVC(bool value); 00135 00136 /// The name of the take to export. If empty, export the current take (default). 00137 void setExportTakeName(const char* pcsName); 00138 /// The name of the take to export. If empty, export the current take (default). 00139 const char* getExportTakeName(void); 00140 00141 /// Determines how invisible objects are to be exported. 00142 ROP_FBXInvisibleNodeExportType getInvisibleNodeExportMethod(void); 00143 /// Determines how invisible objects are to be exported. 00144 void setInvisibleNodeExportMethod(ROP_FBXInvisibleNodeExportType exp_type); 00145 00146 /// If true, NURBS and Bezier surfaces will be converted to polygons on export. 00147 void setConvertSurfaces(bool value); 00148 /// If true, NURBS and Bezier surfaces will be converted to polygons on export. 00149 bool getConvertSurfaces(void); 00150 00151 /// Specifies which version of the SDK to use for export. Defaults to an empty string, 00152 /// meaning the most current version. 00153 void setVersion(const char* sdk_version); 00154 /// Specifies which version of the SDK to use for export. Defaults to an empty string, 00155 /// meaning the most current version. 00156 const char* getVersion(void); 00157 00158 /// Optionally contains the names of the bundles we're exporting. Empty by default. 00159 /// If not empty, only the bundles specified will be exported. 00160 void setBundlesString(const char* bundles); 00161 /// Optionally contains the names of the bundles we're exporting. Empty by default. 00162 /// If not empty, only the bundles specified will be exported. 00163 const char* getBundlesString(void); 00164 /// Returns true if we are restricted to exporting certain bundles, false if 00165 /// everything is to be exported. 00166 bool isExportingBundles(void); 00167 00168 /// If true, vertex cache frame snapshots will not be stored in memory, resulting in 00169 /// less memory usage, but slower performance. 00170 void setSaveMemory(bool value); 00171 /// If true, vertex cache frame snapshots will not be stored in memory, resulting in 00172 /// less memory usage, but slower performance. 00173 bool getSaveMemory(void); 00174 00175 private: 00176 00177 /// Resampling frequency, in frames. A linear key frame will be exported 00178 /// every N frames. 00179 float myResampleIntervalInFrames; 00180 00181 /// If true, all animation curves will be resampled on export. If false, 00182 /// only the unsupported types will be. 00183 bool myResampleAllAnimation; 00184 00185 /// Specified the format to use for exporting vertex caches, whether compatbile 00186 /// with Maya's or 3DS MAX. 00187 ROP_FBXVertexCacheExportFormatType myVertexCacheFormat; 00188 00189 /// If true, the exported file will be in the human-readable ASCII FBX format. 00190 /// Otherwise, it will be in binary. 00191 bool myExportInAscii; 00192 00193 /// If true, the code will attempt to find those vertex cacheable objects which 00194 /// have a constant point count throughout the exported animation, and export them 00195 /// as "normal" vertex caches, without breaking them up and triangulating them. 00196 /// NOTE: This can fail when an object will happen to have a constant vertex count 00197 /// while changing point connectivity. This is why this is a UI option 00198 bool myDetectConstantPointCountObjects; 00199 00200 /// The first network the to start exporting from. Everything (recursively) in this 00201 /// network will be exported to the FBX file. Defaults to "/obj". 00202 string myStartNodePath; 00203 00204 /// Level of detail to use when converting various primitives to polygons. 00205 float myPolyConvertLOD; 00206 00207 /// If true, geometry with Deform SOPs will be exported as vertex caches. False by default. 00208 bool myExportDeformsAsVC; 00209 00210 /// The name of the take to export. If empty, export the current take (default). 00211 string myExportTakeName; 00212 00213 /// Determines how invisible objects are to be exported. 00214 ROP_FBXInvisibleNodeExportType myInvisibleObjectsExportType; 00215 00216 /// If true, NURBS and Bezier surfaces will be converted to polygons on export. 00217 bool myConvertSurfaces; 00218 00219 /// Specifies which version of the SDK to use for export. Defaults to an empty string, 00220 /// meaning the most current version. 00221 string mySdkVersion; 00222 00223 /// Optionally contains the names of the bundles we're exporting. Empty by default. 00224 /// If not empty, only the bundles specified will be exported. 00225 string myBundleNames; 00226 00227 /// If true, vertex cache frame snapshots will not be stored in memory, resulting in 00228 /// less memory usage, but slower performance. 00229 bool mySaveMemory; 00230 }; 00231 /********************************************************************************************************/ 00232 #endif
1.5.9