fbfbx.h

Go to the documentation of this file.
00001 #ifndef __FBFBX_H__
fbfbx.h
00002 #define __FBFBX_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00047 #include <kaydaradef.h>
00048 #ifndef FBSDK_DLL 
00049 
00052     #define FBSDK_DLL K_DLLIMPORT
00053 #endif
00054 
00055 #include <fbsdk/fbcomponent.h>
00056 #include <fbsdk/fbfbxoptions.h>
00057 
00058 #ifdef FBSDKUseNamespace
00059     namespace FBSDKNamespace {
00060 #endif
00061 
00063 // FBFbx
00065 FB_FORWARD( FBScene );
00066 FB_FORWARD( FBCharacter );
00067 FB_FORWARD( FBPlotOptions );
00068 FB_DEFINE_COMPONENT( FBSDK_DLL, Scene );
00069 
00070 __FB_FORWARD( FBFbxObject );
00071 __FB_FORWARD( FBModel );
00072 
00078 class FBSDK_DLL FBFbxObject : public FBComponent {
00079     __FBClassDeclare( FBFbxObject,FBComponent );
00080 public:
00087     FBFbxObject(HIObject pObject);
00088 
00092     void FieldWriteBegin(char *pFieldName);
00093 
00095     void FieldWriteEnd();
00096 
00101     bool FieldReadBegin(char *pFieldName);
00102     
00104     void FieldReadEnd();
00105 
00109     int  FieldReadGetCount();
00110 
00112 
00115     void    FieldWriteI( int pValue );
00116     void    FieldWriteC( char *pValue );
00117     void    FieldWriteD( double pValue );
00119 
00121 
00125     void    FieldWriteI( char *pFieldName, int pValue );
00126     void    FieldWriteC( char *pFieldName, char *pValue );
00127     void    FieldWriteD( char *pFieldName, double pValue );
00129 
00131 
00134     int     FieldReadI();
00135     char   *FieldReadC();
00136     double  FieldReadD();
00138 
00140 
00144     int     FieldReadI(char *pFieldName);
00145     char   *FieldReadC(char *pFieldName);
00146     double  FieldReadD(char *pFieldName);
00148 
00153     void   FieldWriteObjectReference (char *pFieldName,HFBComponent pObject);
00154 
00158     void   FieldWriteObjectReference (HFBComponent pObject);
00159 
00166     HIObject FieldReadObjectReference (char * pFieldName);
00167 
00173     HIObject FieldReadObjectReference ();
00174 
00180     void    FieldWriteBlockBegin ();
00181 
00188     void    FieldWriteBlockBegin (char *pFieldName);
00189 
00191     void    FieldWriteBlockEnd   ();
00192 
00196     bool    FieldReadIsBlock   ();
00197 
00201     bool    FieldReadBlockBegin();
00202 
00204     void    FieldReadBlockEnd  ();
00205 
00210     char   *GetFullFilePath(char *pFilename);
00211 };
00212 
00213 __FB_FORWARD( FBFbxTake );
00214 
00218 class FBSDK_DLL FBFbxTake : public FBComponent
00219 {
00220     __FBClassDeclare( FBFbxTake, FBComponent );
00221 public:
00222     FBFbxTake();
00223     
00224     FBPropertyBool      Import;         
00225     FBPropertyString    Name;           
00226     FBPropertyString    Description;    
00227     FBPropertyString    ImportName;     
00228 
00229     friend class FBFbxManager;
00230 private:
00231     void FBFbxTakeInitProperties();
00232 
00233 };
00234 FB_DEFINE_ARRAY( FBSDK_DLL, FbxTake );
00236 typedef class FBSDK_DLL FBArrayTemplate<HFBModel> FBModelList;
00237 
00241 enum FBFbxManagerState { kFBFbxManagerStateIdle   , 
00242                          kFBFbxManagerStateLoading, 
00243                          kFBFbxManagerStateMerging, 
00244                          kFBFbxManagerStateSaving , 
00245 };
00246 FB_DEFINE_ENUM( FBSDK_DLL, FbxManagerState ); // FBPropertyFbxManagerState
00247 
00248 
00251 enum FBFbxManagerLoadAnimationMethod { kFBFbxManagerLoadConnect       , 
00252                kFBFbxManagerLoadCopy          , 
00253                kFBFbxManagerLoadRetarget      , 
00254                kFBFbxManagerLoadPlotIfSampled , 
00255                kFBFbxManagerLoadPlot          , 
00256 };
00257 
00258 
00259 __FB_FORWARD( FBFbxManager  );
00270 class FBSDK_DLL FBFbxManager : public FBComponent 
00271 {
00272     //--- Open Reality Declaration
00273     __FBClassDeclare( FBFbxManager, FBComponent );
00274 public:
00276     FBFbxManager();
00277 
00278 
00279     //---------------------------------------
00280     // File Load.
00281     //---------------------------------------
00282 
00290     bool LoadBegin( void* pFileAddress, kULong pFileMemoryLength, bool pMerge = false );
00291 
00298     bool LoadBegin( char* pFilename, bool pMerge = false );
00299 
00305     bool Load();
00306 
00310     bool LoadIsCompleted();
00311 
00317     bool LoadEnd();
00318 
00319 
00320     //---------------------------------------
00321     // File Save.
00322     //---------------------------------------
00323 
00329     bool SaveBegin( char* pFilename );
00330 
00334     bool Save();
00335 
00339     bool SaveEnd();
00340 
00341 
00342 #if !defined(K_NO_CHARACTER)
00343     //---------------------------------------
00344     // Character Retargeting.
00345     //---------------------------------------
00346 
00354     bool SaveCharacterRigAndAnimation( char* pFileName, HFBCharacter pCharacter, bool pSaveCharacter, bool pSaveRig, bool pSaveExtensions );
00355 
00370     bool LoadAnimationOnCharacter( char* pFileName, HFBCharacter pCharacter, bool pReplaceRig, bool pCopyMissingExtensions, bool pUpdateLimits, bool pIgnoreConflicts,
00371         FBFbxManagerLoadAnimationMethod pTransferMethod, HFBPlotOptions pPlotOptions, bool pProcessAnimationOnExtensions, bool pRetargetOnBaseLayer, bool pResetHierarchy );
00372 
00373 #endif
00374     //---------------------------------------
00375     // Options related utilities.
00376     //---------------------------------------
00377 
00385     bool SetOptionsFromHistory( char* pHistoryFile = NULL );
00386 
00394     bool SetHistoryFromOptions( char* pHistoryFile = NULL );
00395 
00396     FBPropertyFbxManagerState   State;                  
00397 
00398 
00402     FBPropertyBool              Async;                  
00403 
00404 
00405 
00410     FBPropertyBool              ClearBeforeLoad;        
00411     FBPropertyTakeSpanOnLoad    TakeSpan;               
00412 
00413 
00414 
00420     FBPropertyBool              ConvertImageToTiff;     
00421     FBPropertyBool              EmbedMedia;             
00422     FBPropertyBool              SaveSelectedModelsOnly; 
00423     FBPropertyBool              UseASCIIFormat;         
00424 
00425 
00426 
00430     FBPropertyBool              BaseCameras;            
00431     FBPropertyBool              CameraSwitcherSettings; 
00432     FBPropertyBool              CurrentCameraSettings;  
00433     FBPropertyBool              GlobalLightingSettings; 
00434     FBPropertyBool              TransportSettings;      
00435 
00436 
00437     FBPropertyString            CustomImportNamespace;  
00438 
00442     FBPropertyElementAction     Actors;               
00443     FBPropertyElementAction     ActorFaces;           
00444     FBPropertyElementAction     Audio;                
00445     FBPropertyElementAction     Bones;                
00446     FBPropertyElementAction     Cameras;              
00447     FBPropertyElementAction     Characters;           
00448     FBPropertyElementAction     CharacterFaces;       
00449     FBPropertyElementAction     CharacterExtensions;  
00450     FBPropertyElementAction     Constraints;          
00451     FBPropertyElementAction     Devices;              
00452     FBPropertyElementAction     Groups;               
00453     FBPropertyElementAction     KeyingGroups;         
00454     FBPropertyElementAction     Lights;               
00455     FBPropertyElementAction     Materials;            
00456     FBPropertyElementAction     Models;               
00457     FBPropertyElementAction     Notes;                
00458     FBPropertyElementAction     OpticalData;          
00459     FBPropertyElementAction     PhysicalProperties;   
00460     FBPropertyElementAction     Poses;                
00461     FBPropertyElementAction     Scripts;              
00462     FBPropertyElementAction     Sets;                 
00463     FBPropertyElementAction     Shaders;              
00464     FBPropertyElementAction     Solvers;              
00465     FBPropertyElementAction     Story;                
00466     FBPropertyElementAction     Textures;             
00467     FBPropertyElementAction     Video;                
00468 
00469 
00470 
00475     FBPropertyBool   ActorFacesAnimation;        
00476     FBPropertyBool   BonesAnimation;             
00477     FBPropertyBool   CamerasAnimation;           
00478     FBPropertyBool   CharactersAnimation;        
00479     FBPropertyBool   CharacterFacesAnimation;    
00480     FBPropertyBool   ConstraintsAnimation;       
00481     FBPropertyBool   DevicesAnimation;           
00482     FBPropertyBool   LightsAnimation;            
00483     FBPropertyBool   MaterialsAnimation;         
00484     FBPropertyBool   ModelsAnimation;            
00485     FBPropertyBool   NotesAnimation;             
00486     FBPropertyBool   PhysicalPropertiesAnimation;   
00487     FBPropertyBool   ShadersAnimation;           
00488     FBPropertyBool   SolversAnimation;           
00489     FBPropertyBool   TexturesAnimation;          
00490 
00491 
00492 
00493     FBArrayFbxTake              Takes;                  
00494 
00495     FBPropertyScene             Scene;                  
00496 };
00497 
00498 #ifdef FBSDKUseNamespace
00499     }
00500 #endif
00501 
00502 #endif

Please send us your comments about this page.