Tuesday, December 23, 2008

OpenReality SDK first look

It is a large SDK so It'll need some time to get used to it but it seems to be a straight forward implementation and doesn't seem weird (like Houdini SDK :p), so it won't be difficult.

I still don't know several most basic stuff such as what a plug owner means, but it'll be enough for now until I can use motionbuilder itself (now I use only PLE). I'll test some on it, look at and run the sample programs which come with it then.


Class hierarchy

FBWrapperHolder
FBPlug
FBComponent
FBBox etc. A lot other
FBProperty
FBPropertyBasicList : abstruct
FBPropertyBaseList<> : template, abstruct
FBPropertyListFCurveKey, etc. A lot other
FBPropertyListComponentBase
FBPropertyListBox, etc. A lot other
FBPropertyListComponent
FBPropertyListCamera, etc. A lot other
FBPropertyBase : template
FBPropertyBaseComponent
FBPropertyBaseEnum
Other (FBPropertyStringList, FBPropertyAnimatable, FBPropertyEvent)


-----------------------------------------------------------
[FBWrapperHolder]
Probably Python wrapper related? Let's ignore this for now.


-----------------------------------------------------------
[FBPlug]
Connect*()
Disconnect*()
Standard plug implementation

HFBPlug GetOwner()
Nested hierarchy. Looks a plug can be owned by another. Not the same as parent.
Maybe used for a plug(component) to own a plug(propery)? as property/component has
no methods to get "who owns it"/"owned by whom" info.

int GetOwnerCount()
Implies multiple owners. A plug can be shared by multiple plugs.

virtual char* ClassName()
virtual int GetTypeId()
These two implies property is typed (different from Property type)

bool MoveSrcAt(int pIndex, int pAtIndex): Move source connection at pIndex to pAtIndex.
Multiple sources allowed and its order is important.


-----------------------------------------------------------
[FBComponent]
Represent objects (camera, curve, constraint...). Property holder.
Components with callback funcs have a FBPropertyEvent type property,
which has add()/remove() methods that accept a pointer to a user defined callback function.
e.g. FBLayout::OnIdle/OnResize etc.

virtual int PropertyAdd(FBProperty *Property)
void PropertyRemove(FBProperty *Property)
Behaves as a property holder

FBObjectFlag GetObjectFlags()
selectable, savable, deletable, etc.


void SetObjectStatus(FBObjectStatus pStatus, bool pValue)
bool GetObjectStatus(FBObjectStatus pStatus)
creating, deleting, storing, etc.
Used within a callback? Why is there set? Can the SDK user set it?

FBPropertyManager PropertyList Read Only Property: Manages all of the properties for the component.

FBPropertyListComponent Component List: List of components.
What's this? Children?

FBPropertyListComponent Parents List: Parents.
Similar hierarchy to Property? Why no get/setChildren() stuff?

FBPropertyBool Selected Read Write Property: Selected property.

FBPropertyString Name Read Write Property: Unique name of object.
Component is Named, Component has a concept of namespace.


-----------------------------------------------------------
[FBProperty] holder for function callbacks into the internals of the application
Holder for func callbacks? Not just a data representation? What are the correspondent methods?

char* GetName()
void SetName(char *pName)
Has name

virtual FBPropertyType GetPropertyType()
char* GetPropertyTypeName()
int, float, ... (different from Plug type)

int AsInt()
bool SetInt(int pInt)
virtual char* AsString()
virtual bool SetString(char *pString)
Value get/set.
Why can set*() fail?
Why string methods are virtual? expression related?

FBPropertyFlag GetPropertyFlags()
notset, hide, forcestatic, disable, animated, notsavable, readonly, notuserdletable

void SetMinMax(double pMin, double pMax)
Similar to Maya

void* GetParent()
Not the same as owner. Why void*?

virtual void SetData(void *pData)
virtual void GetData (void *pData, int pSize, FBEvaluateInfo *pEvalInfo=NULL) const
Looks for more complex type of data


-----------------------------------------------------------
[FBPropertyBasicList]
Abstruct class. Property container.
Type independent methods are here.

virtual int GetCount ()=0 Get the number of properties in the list.
virtual void RemoveAt (int pIndex)=0 Remove property at pIndex.
Methods to act as a container.


-----------------------------------------------------------
[FBPropertyBaseList<>]
Abstruct template class. Type independent methods are in FBPropertyBasicList.
Container of non-component properties.
Base class of FBPropertyListRigidBody, FBPropertyListMotionClip, etc.

virtual int Add(tType pItem)=0 Add a property to the list.
virtual tType operator[](int pIndex)=0 [] operator overload.
virtual int Find(tType pItem) Locate a property in the list.
virtual int Remove(tType pItem) Remove pItem from the list.
virtual tType GetAt(int pIndex) Get a property at pIndex.
Methods to act as a container.


-----------------------------------------------------------
[FBPropertyListComponentBase]
Abstruct *non-template* class. Type independent methods are in FBPropertyBasicList.
Container of component properties (i.e. FBComponent).

virtual int Add(FBComponent *pItem)
virtual void RemoveAt(int pIndex)
virtual FBComponent* GetAt(int pIndex)=0
FBComponent* operator[](int pIndex)
virtual int GetCount()
virtual int Find(FBComponent *pItem)
virtual int Remove(FBComponent *pItem)
Methods to act as a container.
It doesn't inherit FBPropertyBaseList but all the methods are implemented here with it's template type tType=FBComponent.
Bbefore FBPropertyBaseList was used for components as well. It is epareted for some reason.


-----------------------------------------------------------
[FBPropertyListComponent]
Implements only GetAt() method.

virtual FBComponent* GetAt(int pIndex)


-----------------------------------------------------------
[FBPropertyBase, FBPropertyBaseComponent, FBPropertyBaseEnum]
No idea yet.

No comments: