fbsdk/fbscene.h Source File

fbscene.h
Go to the documentation of this file.
1 #ifndef __FBSCENE_H__
2 #define __FBSCENE_H__
3 /**************************************************************************
4 Copyright (c) 1994 - 2009 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 
44 #include <kaydaradef.h>
45 #ifndef FBSDK_DLL
46 
49 #define FBSDK_DLL K_DLLIMPORT
50 #endif
51 
52 #include <fbsdk/fbcomponent.h>
53 #include <fbsdk/fbcore.h>
54 #include <fbsdk/fbdata.h>
55 #include <fbsdk/fbfolder.h>
56 #include <fbsdk/fbrenderer.h>
57 #include <fbsdk/fbshader.h>
58 #include <fbsdk/fbmodel.h>
59 #include <fbsdk/fbhud.h>
60 #include <fbsdk/fbcamera.h>
61 #include <fbsdk/fblight.h>
62 #include <fbsdk/fbvideo.h>
63 #include <fbsdk/fbmotion.h>
64 #include <fbsdk/fbgroup.h>
65 #include <fbsdk/fbfilereference.h>
66 #include <fbsdk/fbnamespace.h>
67 #include <fbsdk/fbobjectpose.h>
68 
69 #if !defined(K_NO_CHARACTER)
70 #include <fbsdk/fbcharacter.h>
71 #include <fbsdk/fbcharacterface.h>
72 #include <fbsdk/fbcharacterpose.h>
74 #endif
75 
76 #if !defined(K_NO_DECK)
77 #include <fbsdk/fbdeck.h>
78 #endif
79 
80 #if !defined(K_NO_AUDIO)
81 #include <fbsdk/fbaudio.h>
82 #endif
83 
84 #if !defined(K_NO_MANIPULATOR)
85 #include <fbsdk/fbmanipulator.h>
86 #endif
87 
88 #if !defined(K_NO_NOTE)
89 #include <fbsdk/fbnote.h>
90 #endif
91 
92 #if !defined(K_NO_POSE)
93 #include <fbsdk/fbpose.h>
94 #endif
95 
96 #if !defined(K_NO_STORY)
97 #include <fbsdk/fbcommand.h>
98 #endif
99 
100 #if !defined(K_NO_PROJECTSETTINGS)
101 #include <fbsdk/fbprojectsettings.h>
102 #endif
103 
104 #ifndef FBSDK_LEAN_AND_MEAN
105 #include <fbsdk/fbuserobject.h>
106 #endif
107 
108 #include <fbsdk/fbconstraint.h>
109 #if !defined(K_NO_OPTICAL)
110  #include <fbsdk/fboptical.h>
111 #endif
112 
113 
114 #ifdef FBSDKUseNamespace
115 namespace FBSDKNamespace {;
116 #endif
117 
119 // FBSceneEvent
123 {
162 };
163 
164 FB_DEFINE_ENUM( FBSDK_DLL, SceneChangeType );
165 
167 
176 {
177 public:
181  FBEventSceneChange( HKEventBase pEvent );
182 
186 };
187 
189 // FBEventTakeChange
193 {
202 };
203 
204 FB_DEFINE_ENUM( FBSDK_DLL, TakeChangeType );
205 
207 
216 {
217 public:
218 
222  FBEventTakeChange( HKEventBase pEvent );
223 
226 };
227 
229 // FBSceneList
234 
238 {
239 private:
240 public:
245  virtual int Add( FBScene* pItem );
249  virtual void RemoveAt( int pIndex );
254  virtual FBScene* operator[](int pIndex);
258  virtual int GetCount();
259 };
260 
262 // FBScene
264 
281 class FBSDK_DLL FBScene : public FBComponent {
283 
284  // We want to disallow the use of the copy constructor and operator for FBScene.
285  FBScene( const FBScene* );
286  FBScene( const FBScene& );
287  FBScene& operator=( const FBScene& );
288 
289 public:
290 
296  FBScene(HIObject pObject);
297 
300  virtual void FBDelete();
301 
304  void Clear();
305 
317  bool Evaluate();
318 
322  bool CandidateEvaluationAndResolve();
323 
327  bool EvaluateDeformations();
328 
332  void GetScriptsPaths( FBStringList& pPathList );
333 
338 
345  int NamespaceGetChildrenList(FBStringList& pNamespaceList, const char* pNamespace = NULL, bool pRecursive = true );
346 
351  FBFileReference* NamespaceGetOwnerFileReference(const char* pNamespace);
352 
357  FBNamespace* NamespaceGet(const char* pNamespace);
358 
363  bool NamespaceExist(const char* pNamespace);
364 
369  bool NamespaceEmpty(const char* pNamespace);
370 
380  void NamespaceGetContentList(FBComponentList& pContentList, const char* pNamespace, FBPlugModificationFlag pModificationFlags = kFBPlugAllContent, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
381 
391  void NamespaceSelectContent(const char* pNamespace, bool pSelect, FBPlugModificationFlag pModificationFlags = kFBPlugAllContent, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
392 
403  bool NamespaceRename(const char* pNameSpace, const char* pNewNamespace, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
404 
409  bool NamespaceDelete(const char* pNamespace);
410 
417  bool NamespaceCleanup();
418 
429  bool NamespaceDeleteContent(const char* pNamespace, FBPlugModificationFlag pModificationFlags = kFBPlugAllContent, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
430 
437  bool NamespaceImport(const char* pNamespace, const char* pFilePath, bool pAsFileReference = false );
438 
446  bool NamespaceImportToMultiple(const FBStringList& pDstNamespaceList, const char* pFilePath, bool pAsFileReference = false );
447 
454  bool NamespaceExport(const char* pNamespace, const char* pFilePath, bool pASCIIFormat = false);
455 
459  int CleanEmptyGroups();
460 
464  int CleanEmptySets();
465 
469  int CleanUnusedMaterials();
470 
474  int CleanUnusedTextures();
475 
479  int CleanUnusedShaders();
480 
484  int CleanUnusedVideoClips();
485 
489  int CleanUnusedAudioClips();
490 
494  int CleanInactiveConstraints();
495 
499  int CleanRelationConstraintsUnusedBoxes();
500 
504  int CleanEmptyRelationConstraints();
505 
506 #if !defined(K_NO_NAMESPACE_UPGRADE)
507 
513  bool NamespaceUpgradeToFileReference(const char* pNamespace, const char* pFilePath, bool pASCIIFormat = false);
514 
519  bool NamespaceDowngradeFromFileReference(const char* pNamespace);
520 #endif
521 
522 
532 
534 #if !defined(K_NO_AUDIO)
536 #endif
537 #if !defined(K_NO_VIDEO)
539 #endif
540 
542 
543 #if !defined(K_NO_FOLDER)
545 #endif
546 
547 #if !defined(K_NO_NOTE)
549 #endif
550 
551 #if !defined(K_NO_POSE)
554 #endif
555 
556 #if !defined(K_NO_ACTOR)
559 #endif
560 
561 #if !defined(K_NO_CHARACTER)
569 #endif
570 
571 #ifndef FB_KERNEL
573 #endif
574 
575 #if !defined(K_NO_PROJECTSETTINGS)
576  FBPropertyProjectSettings ProjectSettings;
577 #endif
578 
585 
586 #ifndef K_NO_UI
588 #endif
589 #ifndef K_NO_HUD
591 #endif
592 
595 
597 
600 #ifndef K_NO_OPTICAL
602 #endif
605 };
606 
607 #ifndef __FB_COMPONENT_SCENE
608 #define __FB_COMPONENT_SCENE
610 #endif
611 
612 
613 #ifdef FBSDKUseNamespace
614 }
615 #endif
616 #endif
617 
Motion interface for FBSDK.
FBPropertyListConstraint Constraints
List: Constraints in scene.
Definition: fbscene.h:531
PropertyEvent: Base event class.
Definition: fbproperties.h:507
After object rename prefix.
Definition: fbscene.h:137
FBPropertyEvent OnTakeChange
Event: Something related to a take has happened.
Definition: fbscene.h:604
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
Before object rename unique prefix.
Definition: fbscene.h:135
Object changed parent.
Definition: fbscene.h:159
FBPropertyListCharacterPose CharacterPoses
List: Character poses in scene.
Definition: fbscene.h:567
FBPropertyListCharacterMarkerSet CharacterMarkerSets
List: Character marker sets in scene.
Definition: fbscene.h:563
FBPropertyListMarkerSet MarkerSets
List: Marker sets in scene.
Definition: fbscene.h:562
PropertyList: Material
Definition: fbmaterial.h:179
After object rename.
Definition: fbscene.h:136
PropertyList: Shader
Definition: fbshader.h:690
After object rename unique prefix.
Definition: fbscene.h:139
PropertyList: Light
Definition: fblight.h:140
Animation data types.
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:161
FBPropertyListNamespace Namespaces
List: Namespace (include FileReference) available in the scene
Definition: fbscene.h:583
Property class: const char * (String).
PropertyList: MarkerSet.
Definition: fbcharacter.h:1854
Before object rename unique.
Definition: fbscene.h:134
Declaration for the FBCommand class.
End clearing file (file new)
Definition: fbscene.h:148
FBPropertyListModelOptical ModelOpticals
Read Write Property: Optical Data in the scene.
Definition: fbscene.h:601
After object rename unique.
Definition: fbscene.h:138
class FBPropertyBaseComponent< FBRenderer * > FBPropertyRenderer
Definition: fbsystem.h:97
FBPropertyListFolder Folders
List: Folders in scene.
Definition: fbscene.h:544
class FBPropertyBaseEnum< enum FBSceneChangeType > FBPropertySceneChangeType
Definition: fbscene.h:164
FBPropertyListModelSkeleton ModelSkeletons
Read Write Property: Bones (Skeletons) in the scene.
Definition: fbscene.h:599
FBPropertyListMaterial Materials
List: Materials for scene.
Definition: fbscene.h:526
PropertyList: Camera
Definition: fbcamera.h:442
Contraint classes.
Audio interface for FBSDK.
FBPropertyListNote Notes
List: Notes in scene.
Definition: fbscene.h:548
PropertyList: ModelSkeleton.
Definition: fbmodel.h:953
FBPropertyListFileReference FileReferences
List: FileReference available in the scene.
Definition: fbscene.h:584
class FBPropertyBaseComponent< FBModel * > FBPropertyModel
Definition: fbcore.h:70
FBSceneChangeType
Types of model selection events.
Definition: fbscene.h:122
FBPropertyListCamera Cameras
List: Cameras in scene.
Definition: fbscene.h:525
Generic optical motion capture device interface.
Contains definitions for object poses.
FBPropertyEvent OnChange
Event: Something in the scene has happened.
Definition: fbscene.h:603
FBPropertyListControlSet ControlSets
List: Control set rigs in scene.
Definition: fbscene.h:564
#define NULL
Definition: kaydara.h:179
Objects Containing class.
FBVideo and derivative classes.
Template class to contain an array of items.
Definition: fbarray.h:77
PropertyList: Actor face.
FBPropertyListUserObject UserObjects
List: User objects
Definition: fbscene.h:572
FBPropertyListPose Poses
List: Poses in scene.
Definition: fbscene.h:552
FBPropertyModel RootModel
Read Only Property: Scene Root model for that scene
Definition: fbscene.h:524
FBPropertyListKeyingGroup KeyingGroups
Read Write Property: Keying Groups in the scene.
Definition: fbscene.h:598
FBPropertyListGroup Groups
List: Groups available in the scene.
Definition: fbscene.h:581
PropertyList: Device
Definition: fbcore.h:566
Begin loading file.
Definition: fbscene.h:145
Object destroyed.
Definition: fbscene.h:125
FBPropertyListLight Lights
List: Lights in scene.
Definition: fbscene.h:533
PropertyList: Character face.
PropertyList: Scene.
Definition: fbscene.h:237
Contains definitions for devices, boxes and models.
FBPropertyListMotionClip MotionClips
List: Motion clips in scene.
Definition: fbscene.h:541
Base Event class.
Definition: fbcomponent.h:955
Base class for Cameras.
FBPropertyListAudioClip AudioClips
List: Audio clips in scene.
Definition: fbscene.h:535
FBPropertyListHandle Handles
List: Handles present in the scene.
Definition: fbscene.h:587
FBPropertyListTake Takes
List: Takes for scene.
Definition: fbscene.h:523
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbscene.h:49
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
FBPropertyListDeformer Deformers
List: Deformers for scene.
Definition: fbscene.h:529
FBPropertyListSet Sets
List: Sets available in the scene.
Definition: fbscene.h:582
Object deselection.
Definition: fbscene.h:131
class FBPropertyBaseComponent< FBComponent * > FBPropertyComponent
Property: FBPropertyBaseComponent(FBComponent*)
FBPropertyListPhysicalProperties PhysicalProperties
List: PhysicalProperties present in the scene.
Definition: fbscene.h:594
PropertyList: ObjectPose.
Definition: fbobjectpose.h:475
Character extension interface for FBSDK.
FBPropertyListCharacterFace CharacterFaces
List: Character faces in scene.
Definition: fbscene.h:566
PropertyList: Texture
Definition: fbtexture.h:158
FBPropertyListComponent Components
List: Generic List of components.
Definition: fbscene.h:580
Select model event class.
Definition: fbscene.h:175
FBPropertyListShader Shaders
List: Shaders for scene.
Definition: fbscene.h:528
Contains definitions for object poses.
FBPropertyTakeChangeType Type
Read Only Property: Type of take change event.
Definition: fbscene.h:224
FBPropertyListHUD HUDs
Read Only Property: Heads Up Displays in the scene.
Definition: fbscene.h:590
PropertyList: VideoClip
Definition: fbvideo.h:495
FBTakeChangeType
Types of take change events.
Definition: fbscene.h:192
FBPropertyComponent Component
Read Only Property: Modified component
Definition: fbscene.h:184
Create new manipulators using the FBManipulator class.
Definition: Python-ast.h:18
PropertyList: KeyingGroup.
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:549
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
Begin clearing file (file new)
Definition: fbscene.h:147
Access to the MotionBuilder scene.
Definition: fbscene.h:281
Before object unparenting.
Definition: fbscene.h:157
FBPropertyListActor Actors
List: Actors in scene.
Definition: fbscene.h:557
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
FBPlugModificationFlag
Definition: fbplug.h:153
FBPropertyString FilePath
Read Write Property: File path of the scene.
Definition: fbscene.h:596
PropertyList: Constraint solver
Definition: fbconstraint.h:610
Basic class definitions.
Groups interface for FBSDK.
PropertyList: Handle.
Definition: fbcore.h:409
KEventBase * HKEventBase
Definition: fbcomponent.h:75
Character extension property list.
Contains abstract deck class to interface with a deck.
FBPropertySceneChangeType Type
Read Only Property: Type of selection event.
Definition: fbscene.h:183
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
Before object parenting.
Definition: fbscene.h:156
FBPropertyListCharacter Characters
List: Characters in scene.
Definition: fbscene.h:565
PropertyList: Handle.
Definition: fbhud.h:415
FileReference interface for FBSDK.
Object change name.
Definition: fbscene.h:154
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
String list.
Definition: fbstring.h:201
PropertyList: MarkerSet.
Definition: fbcharacter.h:1813
FBPropertyListCharacterExtension CharacterExtensions
List: Character extensions available in the scene.
Definition: fbscene.h:568
class FBPropertyBaseEnum< enum FBTakeChangeType > FBPropertyTakeChangeType
Definition: fbscene.h:204
FBPropertyListVideoClip VideoClips
List: Video clips in scene.
Definition: fbscene.h:538
Take change event class.
Definition: fbscene.h:215
Before object rename.
Definition: fbscene.h:132
PropertyList: Contraint
Definition: fbconstraint.h:349
Access to poses.
class FBPropertyBaseComponent< FBTake * > FBPropertyTake
Definition: fbdata.h:2107
Contains definitions for actors, characters, and marker sets In Development.
Object have focus.
Definition: fbscene.h:158
Access to notes.
Object changed name.
Definition: fbscene.h:155
None Modified.
Definition: fbplug.h:155
Contains definitions for actor faces and character faces In Development.
End loading file.
Definition: fbscene.h:146
Before object rename prefix.
Definition: fbscene.h:133
Object selection.
Definition: fbscene.h:130
FBPropertyTake Take
Read Only Property: The take modified.
Definition: fbscene.h:225
PropertyList: Folder
Definition: fbfolder.h:61
Objects Containing class.
Definition: fbnamespace.h:79
PropertyList: Actor.
Definition: fbcharacter.h:1872
PropertyList: Physical properties
Definition: fbconstraint.h:688
FBPropertyListObjectPose ObjectPoses
List: ObjectPoses in scene.
Definition: fbscene.h:553
FBPropertyListTexture Textures
List: Textures for scene.
Definition: fbscene.h:527
Declaration for the classes FBShaderManager, FBShader, FBPropertyListShader and other subclasses...
PropertyList: UserObject.
Definition: fbuserobject.h:109
FBPropertyListDevice Devices
List: Devices for scene.
Definition: fbscene.h:530
Folders interface for FBSDK.
FBPropertyListActorFace ActorFaces
List: ActorFaces in scene.
Definition: fbscene.h:558
PropertyList: ModelOptical.
Definition: fboptical.h:644
PropertyList: CharacterMarkerSet.
Definition: fbcharacter.h:1836
FBPropertyComponent ChildComponent
Read Only Property: Child component of the event.
Definition: fbscene.h:185
PropertyList: Character.
Definition: fbcharacter.h:1898
Rendering engine.
HUD (Head Up Display)
FBPropertyRenderer Renderer
Read Only Property: Local renderer.
Definition: fbscene.h:579
PropertyList: CharacterPose.
FBPropertyListConstraintSolver ConstraintSolvers
List: Constraint Solvers present in the scene.
Definition: fbscene.h:593