This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// two ways for constraint creation | |
// | |
/// 1 - make it from constraint manager and show up in the scene constraints | |
pConstraint = FBConstraintManager::TheOne().TypeCreateConstraint( "Some constraint" ); | |
/// 2 - make it for internal use (hiden from users) | |
pConstraint = new FBSomeConstraint( constraintName ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fn IsPowerOfTwo(int n) | |
* @brief Returns true if /param n is an integer power of 2. | |
* | |
* Taken from Steve Baker's Cute Code Collection. | |
* http://www.sjbaker.org/steve/software/cute_code.html | |
*/ | |
static bool IsPowerOfTwo(int n) { return ((n&(n-1))==0); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// on some create | |
mRenderer = new FBRenderer(0); | |
FBViewingOptions *pViewingOptions = mRenderer->GetViewingOptions(); | |
pViewingOptions->PickingMode() = kFBPickingModeModelsOnly; | |
pViewingOptions->ShadingMode() = kFBModelShadingAll; | |
pViewingOptions->ShowTimeCode() = false; | |
pViewingOptions->ShowCameraLabel() = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get the effector node id | |
for k, v in FBEffectorId.names.iteritems(): | |
print v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char windowTitle[128]; | |
HWND FindInParent(HWND wnd) | |
{ | |
if (wnd == nullptr) | |
return nullptr; | |
GetWindowText( wnd, windowTitle, 128 ); | |
if (strstr( windowTitle, "MotionBuilder" ) != nullptr ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( mSourceTranslation && mConstrainedTranslation ) | |
{ | |
FBComponent *pComp = nullptr; | |
int count = mSourceTranslation->GetSrcCount(); | |
if (count) | |
{ | |
pComp = (FBComponent*) mSourceTranslation->GetSrc(0)->GetOwner(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I took that from HIK example | |
// 1 - in header declare some static procedure | |
static void AddPropertiesToPropertyViewManager(); | |
// 2 - in source implement your custom view set | |
// where ORCONSTRAINTEXTRACTION__CLASSSTR - is your plugin class name | |
// | |
// you can add some folders and pack there your plugin properties | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyfbsdk import * | |
lStory = FBStory() | |
for lTrack in lStory.RootFolder.Tracks: | |
for lClip in lTrack.Clips: | |
print lClip.Name | |
if len(lClip.Parents): | |
for lParent in lClip.Parents: | |
print lParent.Name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: | |
// Usually input animation node should be assigned to constrained object, | |
// but this plug-in create an animation node which assigned to «Camera Switcher» to solve this constraint | |
// before other types of constraints such as ‘Path constraint’ | |
// beacuse MotionBuilder dones’t have deformer propagation system. | |
if ( FBFindModelByName( »Camera Switcher» ) ){ | |
mDummy_AnimationNode = AnimationNodeInCreate ( 0/*Curve_UserId*/, FBFindModelByName( »Camera Switcher» ), ANIMATIONNODE_TYPE_TRANSLATION ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 1 - desclare pointer to a model with special class | |
// | |
HdlFBPlugTemplate<FBModel> mHdlModel; | |
// | |
// 2 - use it and check if pointer is actual | |
// |