FBPlug Class Reference


Detailed Description

Connections Basic Open Reality SDK Element.

Most elements that are available in the SDK inherit from this base class since FBComponent and FBProperty inherit from FBPlug. Basically, all objects can be connected together because they are all "plugs". To simplify the graph, you can think of a "source" connection as a child, and a "destination" connection as a parent. Also, it is correct to assume that a source affect/work on its destination. For example, a shader applied on an object would be seen as the source while the object is the destination. So FBPlug is a set of functions that enables you to control those connections with flexibility and ease.

Examples
BasicOperations/FBConstraintManager.py, BasicOperations/FBFolder.py
Inheritance diagram for FBPlug:

List of all members.

Public Member Functions

 __del__ ()
 Destructor.
object GetHIObject ()
 Return an internal pointer.
bool SetHIObject (object pObject, bool pSDKComponent)
 Assign component to an internal pointer.
bool IsSDKComponent ()
 Return whether or not item is an SDK component.
bool ConnectSrc (FBPlug pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a source connection.
bool ConnectDst (FBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a destination connection.
bool ConnectSrcAt (int pDst_SrcIndex, FBPlug pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a source connection.
bool ConnectDstAt (int pSrc_DstIndex, FBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a destination connection.
bool DisconnectDst (FBPlug pDst)
 Remove a destination connection.
bool DisconnectSrc (FBPlug pSrc)
 Remove a source connection.
 DisconnectAllSrc ()
 Remove all source connections.
 DisconnectAllDst ()
 Remove all destination connections.
bool DisconnectDstAt (int pIndex)
 Remove a destination connection at a specified index.
bool DisconnectSrcAt (int pIndex)
 Remove a source connection at a specified index.
bool ReplaceDstAt (int pIndex, FBPlug pDst)
 Replace a destination connection at a specified index.
bool ReplaceSrcAt (int pIndex, FBPlug pSrc)
 Replace a source connection at a specified index.
bool SwapSrc (int pIndexA, int pIndexB)
 Swap source connection at index A with source connection at index B.
bool MoveSrcAt (int pIndex, int pAtIndex)
 Move source connection at pIndex to pAtIndex.
bool MoveSrcAt (FBPlug pSrc, FBPlug pAtSrc)
 Move source connection pSrc to the position of pAtSrc.
int GetSrcCount ()
 Get source connection count.
FBPlug GetSrc (int pIndex)
 Get a source connection's plug at specified index.
FBConnectionType GetSrcType (int pIndex)
 Get a source connection's type at specified index.
int GetDstCount ()
 Get destination connection count.
FBPlug GetDst (int pIndex)
 Get a destination connection's plug at specified index.
FBConnectionType GetDstType (int pIndex)
 Get a destination connection's type at specified index.
bool BeginChange ()
 Begins a change on multiple plugs.
 EndChange ()
 Ends a change on multiple plugs.
 SetSelfModified (FBPlugModificationFlag pFlag, bool pBool)
 Set the plug's self modification flag.
bool GetSelfModified (FBPlugModificationFlag pFlag)
 Tell if the plug's self has changed.
 SetContentModified (FBPlugModificationFlag pFlag, bool pBool)
 Set the plug's owned property/object's modification flag.
bool GetContentModified (FBPlugModificationFlag pFlag)
 Tell if the plug's content has changed.
int GetPlugConnectionModifiedList (tuple pPlugList, FBPlugModificationFlag pConnectionModificatonFlag, bool pAddRemove)
 Get plug's modified src/dst property/object connection added/removed List.
bool RevertModification (FBPlugModificationFlag pFlag=kFBAllModifiedMask)
 Revert the plug's modification to original status.
 SetStatusFlag (FBPlugStatusFlag pStatus, bool pValue)
 Set the plug's status flag.
bool GetStatusFlag (FBPlugStatusFlag pStatus)
 Tell if the plug's status has changed.
FBPlug GetOwner ()
 Get the owner of this plug.
FBPlug GetOwned (int pIndex)
 Get the owned plug at specified index.
int GetOwnedCount ()
 Get the owned plug count.
str ClassName ()
 internal System vars.
bool Is (int pTypeId)
 Is( int pTypeId ).
int GetTypeId ()
 GetTypeId( int pTypeId ).
bool PlugDataNotify (FBConnectionAction pAction, FBPlug pThis, pData=None, pDataOld=None, int pDataSize=0)
 PlugDataNotify when overloaded is equivalent of FBSystem.OnConnectionDataNotify but in the context of the derived object only.
bool PlugStateNotify (FBConnectionAction pAction, FBPlug pThis, pData=None, pDataOld=None, int pDataSize=0)
 PlugStateNotify when overloaded is equivalent of FBSystem.OnConnectionStateNotify but in the context of the derived object only.
bool PlugNotify (FBConnectionAction pAction, FBPlug pThis, int pIndex, FBPlug pPlug=None, FBConnectionType pConnectionType=kFBConnectionTypeNone, FBPlug pNewPlug=None)
 PlugNotify when overloaded is equivalent of FBSystem.OnConnectionNotify but in the context of the derived object only.
 IObject_Declare (K_IMPLEMENTATION)
 ICallback_Declare (K_IMPLEMENTATION)
 PrintClassDefinitions ()
 Print out internal Class (ID) Definition table.

Public Attributes

str ClassGroupName
 ClassGroupName of the object.
int TypeInfo
 TypeInfo.
bool mAllocated
 Contain the Allocation State of the Component.

Protected Member Functions

 __init__ (object pObject)
 ! Constructor Internal use only.
 FBDelete ()
 Actual destructor for a FBPlug.
int GetInternalClassId ()
 Internal class Id.

Protected Attributes

int mGlobalTypeInfo
 Represente the Type Index.
object mObject
 Handle on the Plug.
bool mSDKComponent
 bool Plug is an SDK component.

Member Function Documentation

FBDelete ( ) [protected]
__del__ ( )

Destructor.

Reimplemented in FBComponent.

object GetHIObject ( )

Return an internal pointer.

bool SetHIObject ( object  pObject,
bool  pSDKComponent 
)

Assign component to an internal pointer.

Reimplemented in FBComponent.

bool IsSDKComponent ( )

Return whether or not item is an SDK component.

bool ConnectSrc ( FBPlug  pSrc,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)

Add a source connection.

Parameters:
pSrcSource plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns:
A boolean indicating success (True) or failure (False).
bool ConnectDst ( FBPlug  pDst,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)

Add a destination connection.

Parameters:
pDstDestination plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns:
A boolean indicating success (True) or failure (False)
bool ConnectSrcAt ( int  pDst_SrcIndex,
FBPlug  pSrc,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)

Add a source connection.

Parameters:
pDst_SrcIndexIndex that tells where to add this source connection in the destination's connection list. if index is out of bound, and this source connection will be appended at the end.
pSrcSource plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns:
A boolean indicating success (True) or failure (False).
bool ConnectDstAt ( int  pSrc_DstIndex,
FBPlug  pDst,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)

Add a destination connection.

Parameters:
pSrc_DstIndexIndex that tells where to add this destination connection in the source's connection list. if index is out of bound, and this destination connection will be appended at the end.
pDstDestination plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns:
A boolean indicating success (True) or failure (False).
bool DisconnectDst ( FBPlug  pDst)

Remove a destination connection.

Parameters:
pDstDestination plug.
Returns:
A boolean indicating success (True) or failure (False).
bool DisconnectSrc ( FBPlug  pSrc)

Remove a source connection.

Parameters:
pSrcSource plug.
Returns:
A boolean indicating success (True) or failure (False).
DisconnectAllSrc ( )

Remove all source connections.

DisconnectAllDst ( )

Remove all destination connections.

bool DisconnectDstAt ( int  pIndex)

Remove a destination connection at a specified index.

Parameters:
pIndexDestination plug index.
Returns:
A boolean indicating success (True) or failure (False).
bool DisconnectSrcAt ( int  pIndex)

Remove a source connection at a specified index.

Parameters:
pIndexSource plug index.
Returns:
A boolean indicating success (True) or failure (False).
bool ReplaceDstAt ( int  pIndex,
FBPlug  pDst 
)

Replace a destination connection at a specified index.

Parameters:
pIndexDestination plug index.
pDstPlug that will replace the other at index.
Returns:
A boolean indicating success (True) or failure (False).
bool ReplaceSrcAt ( int  pIndex,
FBPlug  pSrc 
)

Replace a source connection at a specified index.

Parameters:
pIndexSource plug index.
pSrcPlug that will replace the other at index.
Returns:
A boolean indicating success (True) or failure (False).
bool SwapSrc ( int  pIndexA,
int  pIndexB 
)

Swap source connection at index A with source connection at index B.

Parameters:
pIndexAPlug index.
pIndexBOther plug index.
Returns:
A boolean indicating success (True) or failure (False).
bool MoveSrcAt ( int  pIndex,
int  pAtIndex 
)

Move source connection at pIndex to pAtIndex.

Parameters:
pIndexPlug current index.
pAtIndexPlug new index.
Returns:
A boolean indicating success (True) or failure (False).
Remarks:
This is not like the swap function since the connection at pAtIndex is untouched.
bool MoveSrcAt ( FBPlug  pSrc,
FBPlug  pAtSrc 
)

Move source connection pSrc to the position of pAtSrc.

Parameters:
pSrcPlug.
pAtSrcPlug that mark where we want to insert (will insert before this one).
Returns:
A boolean indicating success (True) or failure (False).
Remarks:
This is not like the swap function since the connection at pAtSrc is untouched.
int GetSrcCount ( )

Get source connection count.

Returns:
Total sources connections count.
FBPlug GetSrc ( int  pIndex)

Get a source connection's plug at specified index.

Parameters:
pIndexIndex of the source connection's plug.
Returns:
Source plug at specified index.
FBConnectionType GetSrcType ( int  pIndex)

Get a source connection's type at specified index.

Parameters:
pIndexIndex of the source connection's type.
Returns:
Source connection's type at specified index.
int GetDstCount ( )

Get destination connection count.

Returns:
Total destinations connections count.
FBPlug GetDst ( int  pIndex)

Get a destination connection's plug at specified index.

Parameters:
pIndexIndex of the destination connection's plug.
Returns:
Destination plug at specified index.
FBConnectionType GetDstType ( int  pIndex)

Get a destination connection's type at specified index.

Parameters:
pIndexIndex of the destination connection's type.
Returns:
Destination connection's type at specified index.
bool BeginChange ( )

Begins a change on multiple plugs.

Returns:
A boolean indicating success (True) or failure (False).
EndChange ( )

Ends a change on multiple plugs.

SetSelfModified ( FBPlugModificationFlag  pFlag,
bool  pBool 
)

Set the plug's self modification flag.

Parameters:
pFlagbitwise AND of self modification flags.
pBooltrue if self changed.
bool GetSelfModified ( FBPlugModificationFlag  pFlag)

Tell if the plug's self has changed.

Parameters:
pFlagbitwise AND of self modification flags.
Returns:
true if self changed
SetContentModified ( FBPlugModificationFlag  pFlag,
bool  pBool 
)

Set the plug's owned property/object's modification flag.

Parameters:
pFlagbitwise AND of content modification flags.
pBooltrue if content has modification.
bool GetContentModified ( FBPlugModificationFlag  pFlag)

Tell if the plug's content has changed.

Parameters:
pFlagbitwise AND of content modification flags.
Returns:
true if content connection changed.
int GetPlugConnectionModifiedList ( tuple  pPlugList,
FBPlugModificationFlag  pConnectionModificatonFlag,
bool  pAddRemove 
)

Get plug's modified src/dst property/object connection added/removed List.

Parameters:
pPlugListplug list to fill up.
pConnectionModificatonFlagSrc/Dst Property/Object connection modification flag.
pAddRemoveAsk for the added list if true, removed list if false.
Returns:
count of list;
bool RevertModification ( FBPlugModificationFlag  pFlag = kFBAllModifiedMask)

Revert the plug's modification to original status.

Parameters:
pFlagthe type of modification to be reverted.
Returns:
true if revert successfully.
SetStatusFlag ( FBPlugStatusFlag  pStatus,
bool  pValue 
)

Set the plug's status flag.

Parameters:
pStatusbitwise AND of status flags.
pValuetrue if status has modification.
bool GetStatusFlag ( FBPlugStatusFlag  pStatus)

Tell if the plug's status has changed.

Parameters:
pStatusbitwise AND of self modification flags.
Returns:
true if self changed
FBPlug GetOwner ( )

Get the owner of this plug.

Very useful for properties since they are plugs too.

Returns:
The owner of this plug.
FBPlug GetOwned ( int  pIndex)

Get the owned plug at specified index.

Parameters:
pIndexIndex of the owned plug to get.
Returns:
The owned plug at specified index.
int GetOwnedCount ( )

Get the owned plug count.

Returns:
The owned plug count.
str ClassName ( )

internal System vars.

Reimplemented in FBComponent.

bool Is ( int  pTypeId)

Is( int pTypeId ).

Parameters:
pTypeIdType Identification.
Returns:
True if Plug is a Instance of pTypeId.

Reimplemented in FBComponent.

int GetTypeId ( )

GetTypeId( int pTypeId ).

Returns:
The TypeInfo of the object

Reimplemented in FBComponent.

bool PlugDataNotify ( FBConnectionAction  pAction,
FBPlug  pThis,
pData  = None,
pDataOld  = None,
int  pDataSize = 0 
)

PlugDataNotify when overloaded is equivalent of FBSystem.OnConnectionDataNotify but in the context of the derived object only.

Parameters:
pActionPlug action, the event type.
pThisPlug concerned.
pDataCurrent data, meaning depends of plug action.
pDataOldPrevious data, meaning depends of plug action.
pDataSizeSize of data.
Returns:
unused should return true
bool PlugStateNotify ( FBConnectionAction  pAction,
FBPlug  pThis,
pData  = None,
pDataOld  = None,
int  pDataSize = 0 
)

PlugStateNotify when overloaded is equivalent of FBSystem.OnConnectionStateNotify but in the context of the derived object only.

Parameters:
pActionPlug action, the event type.
pThisPlug concerned.
pDataCurrent data, meaning depends of plug action.
pDataOldPrevious data, meaning depends of plug action.
pDataSizeSize of data.
Returns:
unused should return true except in the case of property rename kFBRename
bool PlugNotify ( FBConnectionAction  pAction,
FBPlug  pThis,
int  pIndex,
FBPlug  pPlug = None,
FBConnectionType  pConnectionType = kFBConnectionTypeNone,
FBPlug  pNewPlug = None 
)

PlugNotify when overloaded is equivalent of FBSystem.OnConnectionNotify but in the context of the derived object only.

Parameters:
pActionPlug action, the event type.
pThisPlug concerned.
pIndexIndex of the plug.
pPlugOther plug concerned.
pConnectionTypeConnection type between the plugs.
pNewPlugNew plug (for the replace event).
Returns:
should by default return true except in the case of connection requests (kFBRequestConnectSrc or kFBRequestConnectDst)
ICallback_Declare ( K_IMPLEMENTATION  )
PrintClassDefinitions ( )

Print out internal Class (ID) Definition table.

For internal debug purpose only.

int GetInternalClassId ( ) [protected]

Internal class Id.

Reimplemented in FBComponent.


Member Data Documentation

ClassGroupName of the object.

TypeInfo.

Reimplemented in FBComponent.

Contain the Allocation State of the Component.

int mGlobalTypeInfo [protected]

Represente the Type Index.

object mObject [protected]

Handle on the Plug.

bool mSDKComponent [protected]

bool Plug is an SDK component.


FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug
FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug FBPlug