fbsdk/fbapplication.h Source File

fbapplication.h
Go to the documentation of this file.
1 #ifndef __FBPAPPLICATION_H__
2 #define __FBPAPPLICATION_H__
3 /**************************************************************************
4 Copyright (c) 1994 - 2013 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6 
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12 
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16 
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25 
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
45 
48 #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 // Essential includes
52 #include <fbsdk/fbcomponent.h>
53 
54 #ifdef FBSDKUseNamespace
55 namespace FBSDKNamespace {;
56 #endif
57 
59 // FBBatchOptions
61 FB_FORWARD( FBBatchOptions );
62 
65 {
69 };
70 FB_DEFINE_ENUM( FBSDK_DLL, BatchProcessType );
71 
74 {
81 };
82 FB_DEFINE_ENUM( FBSDK_DLL, BatchFileFormat );
83 
86 {
89 };
90 FB_DEFINE_ENUM( FBSDK_DLL, BatchOnTakeExist );
91 
94 {
97 };
98 FB_DEFINE_ENUM( FBSDK_DLL, BatchOnContainsBatchTakes );
99 
102 {
118 };
119 
122 {
123 public:
124 
127  FBBatchOptions();
128 
131 
133 
137 
138 #if !defined(K_NO_CHARACTER)
140 #endif
141 
146  bool mWriteRate;
153 
156 };
157 
158 
160 // FBPlotOptions
163 
166 {
170 };
171 FB_DEFINE_ENUM( FBSDK_DLL, RotationFilter );
172 
175 {
181 };
182 FB_DEFINE_ENUM( FBSDK_DLL, RotationFilter );
183 
186 {
187 public:
188 
191  FBPlotOptions();
192 
205 };
206 
207 #if !defined(K_NO_AUDIO)
208 // FBAudioRenderOptions
212 
217 {
218 public:
219 
223 
229 };
230 #endif
231 
233 #if !defined(K_NO_CHARACTER)
235 #endif
236 #if !defined(K_NO_ACTOR)
238 #endif
239 #if !defined(K_NO_CHARACTER)
241 #endif
242 #if !defined(K_NO_ACTOR)
244 #endif
245 
253 };
254 
255 #if !defined(K_NO_ONECLICK)
258 {
263 };
264 #endif
265 
267 // FBEventOverrideFileOpen
271 {
272 public:
277 
280 };
281 
283 // FBPropertyEventOverrideFileOpen
287 {
288  public:
293  virtual void Add ( HICallback pOwner, kICallbackHandler pHandler );
294  virtual void Remove ( HICallback pOwner, kICallbackHandler pHandler );
295 };
296 
298 
307 {
309 public:
313  FBApplication(HIObject pObject=NULL);
314 
323 
325 
330  bool Minimize(bool pBlocking=true);
331 
335  bool Maximize();
336 
338  void UpdateAllWidgets();
339 
344  void FlushEventQueue();
345 
351  bool FileNew(bool pAskUser = false, bool pClearSceneName = true);
352 
361  bool FileOpen( const char* pFilename, bool pShowUIMsg = false, FBFbxOptions* pOptions = NULL );
362 
369  bool FileOpen( void* pBuffer, kULong pBufferLength );
370 
379  bool GetMaxFrameCount(void* pBuffer, kULong pBufferLength, kLong* pFrameCount, int pTimeScale);
380 
391  bool FileMerge( const char* pFilename, bool pShowUIMsg = false, FBFbxOptions* pOptions = NULL );
392 
403  bool FileMerge( FBStringList& pPathlist, bool pShowUIMsg = false, FBFbxOptions* pOptions = NULL );
404 
417  bool FileAppend( const char* pFilename, bool pShowUIMsg = false, FBFbxOptions* pOptions = NULL );
418 
425  bool FileSave( const char* pFilename = NULL, FBFbxOptions* pOptions = NULL );
426 
432  void FileExit( bool pSave = false, int pExitCode = 0);
433 
449  bool FileImport( FBString pFilename, bool pMatchModels = false, bool pCreateUnmatchedModels = true );
450 
459  bool FileImportWithOptions( FBMotionFileOptions* pOptions );
460 
472  bool FileExport( FBString pFilename );
473 
480  FBBatchStatus FileBatch( FBBatchOptions* pBatchOptions, FBPlotOptions* pPlotOptions = NULL );
481 
490  bool FileImportBatch( const char* pName, FBBatchOptions* pBatchOptions, FBModel* pReference );
491 
501  bool FileExportBatch( const char* pName, FBTake* pTake, FBBatchOptions* pBatchOptions, FBModelList &pExportModels );
502 
503 #if !defined(K_NO_CHARACTER)
504 
511  bool SaveCharacterRigAndAnimation( const char* pFileName, FBCharacter* pCharacter, FBFbxOptions* pFbxOptions);
512 
520  bool LoadAnimationOnCharacter( const char* pFileName, FBCharacter* pCharacter, FBFbxOptions* pFbxOptions, FBPlotOptions* pPlotOptions);
521 #endif
522 
527  bool IsValidBatchFile( const char* pFilename );
528 
529 #if !defined(K_NO_ONECLICK)
530 
534  bool OneClickSendAsNewScene( FBOneClickApplication pApplication );
535 
539  bool OneClickUpdateCurrentScene();
540 
544  bool OneClickAddToCurrentScene();
545 
548  void OneClickSelectPreviouslySentObject();
549 
553  FBOneClickApplication OneClickIsConnectedTo();
554 #endif
555 
563  bool FileRender( FBVideoGrabOptions* pRenderOptions = NULL );
564 
565 #if !defined(K_NO_AUDIO)
566 
571  bool AudioRender( FBAudioRenderOptions* pAudioRenderOptions = NULL);
572 #endif
573 
579  bool ExecuteScript(FBString pFilename);
580 
585  K_DEPRECATED_2016 void SwitchViewerCamera( FBCamera &pCamera );
586 
587 public:
589 #if !defined(K_NO_ACTOR)
591 #endif
592 #if !defined(K_NO_CHARACTER)
594 #endif
595 
598  static FBApplication& TheOne();
599 
602  const char* GetSceneTitle();
603 
607  void SetSceneTitle(const char* pTitle);
608 
611  const char* GetSceneSubject();
612 
616  void SetSceneSubject(const char* pSubject);
617 
620  const char* GetSceneAuthor();
621 
625  void SetSceneAuthor(const char* pAuthor);
626 
629  const char* GetSceneKeywords();
630 
634  void SetSceneKeywords(const char* pKeywords);
635 
638  const char* GetSceneRevisionNumber();
639 
643  void SetSceneRevisionNumber(const char* pRevNumber);
644 
647  const char* GetSceneComment();
648 
652  void SetSceneComment(const char* pComment);
653 };
654 
692 
696 
700 
708 
712 
716 
722 
726 
730 
735 #ifdef FBSDKUseNamespace
736 } // namespace FBSDKNamespace
737 #endif
738 
739 #endif
PropertyEvent: Base event class.
Definition: fbproperties.h:507
File format for Motion Analysis TRC.
Definition: fbapplication.h:75
FBBatchStatus
Different return values of the Batch process.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
Model class.
Definition: fbmodel.h:273
FBPropertyEvent OnFileNew
Event: A File New has been requested, nothing has been destroyed yet.
FBBatchFileFormat mInputFileFormat
File format of the input files.
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
Event that is called before a file open/merge.
Property class: const char * (String).
Time data structure.
Definition: fbtime.h:86
FBPropertyEvent OnFileMerge
Event: A File Merge has been requested, nothing has been loaded yet.
Basic string class.
Definition: fbstring.h:66
bool mStartAnimationAtZero
Set the time of all loaded files to 0.
FBAudioRateMode
Enum FBAudioRateMode.
Definition: fbaudiofmt.h:77
bool mPlotOnFrame
Should we plot on frame?
FBTimeSpan TimeSpan
Property: Start and stop selection time to render.
FBPropertyEventOverrideFileOpen OnOverrideFileOpen
Event: Called when a file is about to be opened/merged.
FBPlotTangentMode
The tangent mode for plotted curve.
bool FBMergeTransactionIsOn()
Call to tell if system is during Merge transaction.
FBAudioChannelMode ChannelMode
Property: Audio render channel number, 1 for Mono(left channel right channel render mixed to one chan...
bool mOverwriteScaling
Set the scaling to a default setting of 1.0.
void FBPreventUIUpdateEnd()
Call to end blocking the UI updates.
A take is a container for animation in a scene.
Definition: fbdata.h:1692
Customize file loading and saving.
Definition: fbfbxoptions.h:122
File format for Vicon C3D.
Definition: fbapplication.h:76
#define NULL
Definition: kaydara.h:179
bool mPlotTranslationOnRootOnly
Should we plot the translation on root only?
bool mFrameAnimation
Set timeline start and end time to corespond with the start and end of animation. ...
File format for Motion Analysis HTR.
Definition: fbapplication.h:79
class FBPropertyBaseComponent< FBCharacter * > FBPropertyCharacter
Save the takes in different files.
Definition: fbapplication.h:67
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbapplication.h:48
FBCharacter * mCharacter
The character to receive the animation.
FBViewerMode
Different viewer modes for the 3D viewer.
Creates custom cameras and manages system cameras.
Definition: fbcamera.h:206
FBTime mPlotPeriod
The plot period (1/fps).
FBBatchFileFormat
Different file formats for the batch.
Definition: fbapplication.h:73
FBString mInputDirectory
The directory containning the input files.
bool mPlotToCharacter
To plot the animation on the character.
FBPropertyBool WillOverride
Read Write Property: Set to true for handling the file load, false by default.
FBBatchProcessType mProcessType
What process should be done? Load, Save or Both.
Base Event class.
Definition: fbcomponent.h:955
Load the files and plot the character with every take.
Definition: fbapplication.h:66
FBRotationFilter
Rotation filters.
FBBatchProcessType
Different process type for the batch.
Definition: fbapplication.h:64
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
bool mPlotAuxEffectors
Should we plot aux effectors?
bool mPreciseTimeDiscontinuities
Should we use precise time discontinuities?
FBBatchOnTakeExist mOnTakeExistAction
Action to perform when a take already exist while in a batch process.
bool FBMergeTransactionFileRefEditIsOn()
Call to tell if system is during File Reference Edit Merge transaction.
File format for Acclaim AMC.
Definition: fbapplication.h:77
FBAudioBitDepthMode
Enum FBAudioBitDepthMode.
Definition: fbaudiofmt.h:70
bool mConstantKeyReducerKeepOneKey
Should the constant key reducer keep at least one key?
FBBatchOnContainsBatchTakes
Different actions to perform when a scene already contains batch takes while in a batch process...
Definition: fbapplication.h:93
FBString OutputFileName
Property: Audio Render destination file.
FBBatchOnTakeExist
Different actions to perform when a take already exist while in a batch process.
Definition: fbapplication.h:85
FBRotationFilter mRotationFilterToApply
The rotation filter to apply.
bool mUseBatchSuffix
Add a batch suffix to the name of the files.
bool mPlotLockedProperties
Should we plot locked properties?
FBPropertyEvent OnFileOpenCompleted
Event: A File Open has been completed.
File format for Biovision BVH.
Definition: fbapplication.h:78
FBBatchFileFormat mOutputFileFormat
File format of the output files.
bool mUseConstantKeyReducer
Should we use a constant key reducer with the filter?
FBPropertyString FilePath
Read Only Property: Path to the file that will be opened/merged.
bool mPlotAllTakes
Should we plot all takes?
bool FBPreventUIUpdateIsOn()
Call to tell if UI updates are blocked.
#define K_DEPRECATED_2016
Definition: kaydara.h:417
Definition: Python-ast.h:18
File format for FBX (animation only).
Definition: fbapplication.h:80
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
void FBMergeTransactionFileRefEditBegin()
Call to begin the transaction for merging multiple files and applying File Reference edit at the same...
FBOneClickApplication
Possible application for One-Click interop with MotionBuilder.
Option parameters for plotting.
TimeSpan class.
Definition: fbtime.h:381
FBPropertyActor CurrentActor
Read Write Property: Indicate the current actor, as used by the character tool.
class FBArrayTemplate< FBModel * > FBModelList
typedef class FBSDK_DLL FBArrayTemplate FBModelList;
Definition: fbcharacter.h:597
FBString mOutputDirectory
The directory containning the output files.
bool mUseSingleTake
Use only one take to convert all files.
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
FBAudioRateMode RateMode
Property: Rate mode for number of samples per second.
FBPropertyEvent OnFileSaveCompleted
Event: A File Save has been completed.
KEventBase * HKEventBase
Definition: fbcomponent.h:75
bool mWriteRate
Write frame rate in Acclaim AMC files.
bool mWriteTranslation
Write translation animation data included with Acclaim AMC files.
FBPropertyEvent OnFileSave
Event: A File Save has been requested, nothing has been saved yet.
FBActor is used to link motion data to a character.
Definition: fbcharacter.h:988
class FBPropertyBaseComponent< FBActor * > FBPropertyActor
Video Grabbing Options structure.
bool mEvaluateDeformation
Should we evaluate deformation while plotting? This is useful when there is a dependency with the def...
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
void FBMergeTransactionEnd()
Call to end the merge transaction.
void FBMergeTransactionFileRefEditEnd()
Call to end merge transaction with File Reference edit.
PropertyEvent: Event when a file is about to be opened/merged.
void FBMergeTransactionBegin()
Call to begin the transaction for merging multiple files.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
Option parameters for the batch process.
String list.
Definition: fbstring.h:201
FBPlotTangentMode mPlotTangentMode
The tangent mode for plotted curve.
FBBatchOnContainsBatchTakes mOnContainsBatchTakesAction
Action to perform when a scene already contains batch takes while in a batch process.
FBPropertyEvent OnFileExit
Event: A File Exit as been requested, nothing has been destroyed yet.
FBPropertyString FBXFileName
Read Write Property: Current scene filename.
FBPropertyCharacter CurrentCharacter
Read Write Property: Indicate the current character, as used by the character tool.
bool mKeepCharacterConstraint
To keep the character constaint when saving.
A character is the link between a motion source and a character model.
Definition: fbcharacter.h:1364
FBApplication is used mainly to manage files.
Audio Render Options structure.
FBPropertyEvent OnFileOpen
Event: A File Open has been requested, nothing has been loaded yet.
bool mPlotToControlSet
To plot the animation on the control set.
FBPropertyEvent OnFileNewCompleted
Event: A File New has been completed.
FBAudioBitDepthMode BitDepthMode
Property: Bit depth for one sample of audio.
bool mKeepDummyBones
To keep dummy bones.
FBString mSkeletonFile
The Skeleton file (for Acclaim AMC files).
FBAudioChannelMode
Enum FBAudioChannelMode.
Definition: fbaudiofmt.h:63
void(ICallback::* kICallbackHandler)(HIRegister pCaller, HKEventBase pEvent)
Definition: icallback.h:50
void FBPreventUIUpdateBegin()
Call to prevent UI updates when creating/deleting/renaming objects.
Customize motion file loading.
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool