Open Reality Reference Guide
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
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 {
103  kFBBatchStatusSuccess,
104  kFBBatchStatusError,
105  kFBBatchStatusCharacterNotSpecified,
106  kFBBatchStatusCharacterNotCharacterized,
107  kFBBatchStatusCharacterHasNoReference,
108  kFBBatchStatusInputActorNotSpecified,
109  kFBBatchStatusActorInputMarkersetNotSpecified,
110  kFBBatchStatusActorInputMarkersetHasNoReferenceModel,
111  kFBBatchStatusActorInputMarkersetNotCorrectlyAssociated,
112  kFBBatchStatusInputCharacterNotCharacterized,
113  kFBBatchStatusInputCharacterHasNoReference,
114  kFBBatchStatusInputDirectoryNotValid,
115  kFBBatchStatusAsfSkeletonFileNotSpecified,
116  kFBBatchStatusCantOpenAsfSkeletonFile,
117  kFBBatchStatusOutputDirectoryNotValid
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 {
167  kFBRotationFilterNone,
168  kFBRotationFilterGimbleKiller,
169  kFBRotationFilterUnroll
170 };
171 FB_DEFINE_ENUM( FBSDK_DLL, RotationFilter );
172 
175 {
176  kFBPlotTangentModeSmooth,
177  kFBPlotTangentModeSmoothClamp,
178  kFBPlotTangentModeSpline,
179  kFBPlotTangentModeSplineClamp,
180  kFBPlotTangentModeAuto
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)
240 FB_DEFINE_COMPONENT( FBSDK_DLL, 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:
276  FBEventOverrideFileOpen( HKEventBase pEvent );
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)
590  FBPropertyActor CurrentActor;
591 #endif
592 #if !defined(K_NO_CHARACTER)
593  FBPropertyCharacter CurrentCharacter;
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
bool mPlotAllTakes
Should we plot all takes?
FBTimeSpan TimeSpan
Property: Start and stop selection time to render.
Schematic view.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBPropertyString FilePath
Read Only Property: Path to the file that will be opened/merged.
FBPropertyEvent OnFileNewCompleted
Event: A File New has been completed.
K_DLLIMPORT void FBMergeTransactionFileRefEditEnd()
Call to end merge transaction with File Reference edit.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
FBBatchProcessType mProcessType
What process should be done? Load, Save or Both.
FBBatchFileFormat mOutputFileFormat
File format of the output files.
File format for Acclaim AMC.
Definition: fbapplication.h:77
bool mPlotLockedProperties
Should we plot locked properties?
Time data structure.
Definition: fbtime.h:87
FBViewerMode
Different viewer modes for the 3D viewer.
bool mUseSingleTake
Use only one take to convert all files.
FBCharacter * mCharacter
The character to receive the animation.
Basic string class.
Definition: fbstring.h:66
FBBatchFileFormat mInputFileFormat
File format of the input files.
FBPropertyEvent OnFileSave
Event: A File Save has been requested, nothing has been saved yet.
FBAudioRateMode RateMode
Property: Rate mode for number of samples per second. 44100 hz default,8000, 11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000 available for audio render.
FBBatchStatus
Different return values of the Batch process.
A take is a container for animation in a scene.
Definition: fbdata.h:1692
bool mUseConstantKeyReducer
Should we use a constant key reducer with the filter?
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbapplication.h:48
K_DLLIMPORT bool FBMergeTransactionFileRefEditIsOn()
Call to tell if system is during File Reference Edit Merge transaction.
View four panes.
bool mPlotToCharacter
To plot the animation on the character.
FBString OutputFileName
Property: Audio Render destination file.
Overwrite the take.
Definition: fbapplication.h:87
FBAudioBitDepthMode BitDepthMode
Property: Bit depth for one sample of audio. 8, 16 and 24 bits available for audio render...
bool mPlotAuxEffectors
Should we plot aux effectors?
K_DLLIMPORT void FBMergeTransactionBegin()
Call to begin the transaction for merging multiple files.
Customize file loading and saving.
Definition: fbfbxoptions.h:123
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
FBPropertyString FBXFileName
Read Write Property: Current scene filename.
K_DLLIMPORT void FBMergeTransactionFileRefEditBegin()
Call to begin the transaction for merging multiple files and applying File Reference edit at the same...
bool mStartAnimationAtZero
Set the time of all loaded files to 0.
FBString mOutputDirectory
The directory containning the output files.
bool mKeepCharacterConstraint
To keep the character constaint when saving.
Creates custom cameras and manages system cameras.
Definition: fbcamera.h:206
Customize motion file loading.
K_DLLIMPORT void FBPreventUIUpdateBegin()
Call to prevent UI updates when creating/deleting/renaming objects.
bool mPlotTranslationOnRootOnly
Should we plot the translation on root only?
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
bool mKeepDummyBones
To keep dummy bones.
PropertyEvent: Event when a file is about to be opened/merged.
PropertyEvent: Base event class.
Definition: fbproperties.h:507
bool mFrameAnimation
Set timeline start and end time to corespond with the start and end of animation. ...
FBApplication is used mainly to manage files.
bool mConstantKeyReducerKeepOneKey
Should the constant key reducer keep at least one key?
File format for Motion Analysis TRC.
Definition: fbapplication.h:75
FBPlotTangentMode
The tangent mode for plotted curve.
File format for Biovision BVH.
Definition: fbapplication.h:78
File format for Motion Analysis HTR.
Definition: fbapplication.h:79
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
Save the takes in different files.
Definition: fbapplication.h:67
FBPropertyEvent OnFileOpen
Event: A File Open has been requested, nothing has been loaded yet.
Event that is called before a file open/merge.
FBRotationFilter
Rotation filters.
FBPropertyActor CurrentActor
Read Write Property: Indicate the current actor, as used by the character tool. Can be NULL...
class K_DLLIMPORT FBArrayTemplate< FBModel * > FBModelList
typedef class FBSDK_DLL FBArrayTemplate<FBModel*> FBModelList;
Definition: fbcharacter.h:597
String list.
Definition: fbstring.h:201
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
bool mPreciseTimeDiscontinuities
Should we use precise time discontinuities?
bool mPlotOnFrame
Should we plot on frame?
FBBatchOnTakeExist mOnTakeExistAction
Action to perform when a take already exist while in a batch process.
FBPropertyEvent OnFileSaveCompleted
Event: A File Save has been completed.
FBString mSkeletonFile
The Skeleton file (for Acclaim AMC files).
Property class: const char * (String).
Basic class definitions.
K_DLLIMPORT bool FBMergeTransactionIsOn()
Call to tell if system is during Merge transaction.
FBBatchOnTakeExist
Different actions to perform when a take already exist while in a batch process.
Definition: fbapplication.h:85
Option parameters for the batch process.
K_DLLIMPORT bool FBPreventUIUpdateIsOn()
Call to tell if UI updates are blocked.
FBBatchOnContainsBatchTakes mOnContainsBatchTakesAction
Action to perform when a scene already contains batch takes while in a batch process.
bool mOverwriteScaling
Set the scaling to a default setting of 1.0.
FBOneClickApplication
Possible application for One-Click interop with MotionBuilder.
No application.
FBTime mPlotPeriod
The plot period (1/fps).
TimeSpan class.
Definition: fbtime.h:383
FBBatchFileFormat
Different file formats for the batch.
Definition: fbapplication.h:73
Model class.
Definition: fbmodel.h:273
FBPropertyEvent OnFileMerge
Event: A File Merge has been requested, nothing has been loaded yet.
Base Event class.
Definition: fbcomponent.h:953
View three panes.
bool mEvaluateDeformation
Should we evaluate deformation while plotting? This is useful when there is a dependency with the def...
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
FBPropertyEvent OnFileExit
Event: A File Exit as been requested, nothing has been destroyed yet.
bool mUseBatchSuffix
Add a batch suffix to the name of the files.
Does the load and save.
Definition: fbapplication.h:68
bool mPlotToControlSet
To plot the animation on the control set.
FBAudioRateMode
Enum FBAudioRateMode.
Definition: fbaudiofmt.h:77
FBAudioChannelMode ChannelMode
Property: Audio render channel number, 1 for Mono(left channel right channel render mixed to one chan...
View two panes.
FBPropertyEventOverrideFileOpen OnOverrideFileOpen
Event: Called when a file is about to be opened/merged. The user can override the process with his ow...
Video Grabbing Options structure.
File format for FBX (animation only).
Definition: fbapplication.h:80
FBAudioChannelMode
Enum FBAudioChannelMode.
Definition: fbaudiofmt.h:63
FBBatchProcessType
Different process type for the batch.
Definition: fbapplication.h:64
FBBatchOnContainsBatchTakes
Different actions to perform when a scene already contains batch takes while in a batch process...
Definition: fbapplication.h:93
FBPropertyCharacter CurrentCharacter
Read Write Property: Indicate the current character, as used by the character tool. Can be NULL. If not null, CurrentActor must be null, as the character tool works on only one item at a time.
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
FBPropertyEvent OnFileNew
Event: A File New has been requested, nothing has been destroyed yet.
bool mWriteRate
Write frame rate in Acclaim AMC files.
K_DLLIMPORT void FBPreventUIUpdateEnd()
Call to end blocking the UI updates.
File format for Vicon C3D.
Definition: fbapplication.h:76
bool mWriteTranslation
Write translation animation data included with Acclaim AMC files.
K_DLLIMPORT void FBMergeTransactionEnd()
Call to end the merge transaction.
FBRotationFilter mRotationFilterToApply
The rotation filter to apply.
Audio Render Options structure.
FBPropertyEvent OnFileOpenCompleted
Event: A File Open has been completed.
Option parameters for plotting.
FBAudioBitDepthMode
Enum FBAudioBitDepthMode.
Definition: fbaudiofmt.h:70
FBActor is used to link motion data to a character.
Definition: fbcharacter.h:988
A character is the link between a motion source and a character model.
Definition: fbcharacter.h:1364
FBString mInputDirectory
The directory containning the input files.
FBPlotTangentMode mPlotTangentMode
The tangent mode for plotted curve.
Load the files and plot the character with every take.
Definition: fbapplication.h:66
FBPropertyBool WillOverride
Read Write Property: Set to true for handling the file load, false by default. If the return value is...