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
// In SDK samples in most cases, store and retrive use this kind of condition | |
if( pStoreWhat == kAttributes ) | |
{ | |
//... | |
} | |
// This is not correct, cause kAttributes is a bit flag and it could be used with kMerge (in merge pass) | |
// So better to use this kind of condition instead |
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
#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
// 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
/** | |
* @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
// 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
// Regarding to the image data and FBTexture class in OR SDK (MotionBuilder) | |
// In theory you are able to put image frame index direcly to that GetImage method | |
// that should return GLubyte *data of a specified frame | |
// but in practive it will produce error for future MoBu drawing | |
// the way out is to... | |
// 1 - first of all, specify the current frame with "CurrentFrame" property | |
// 2 - execute GetImage() function with a argument -1 by default |
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
const FBVideoFormat clipFormat = (pVideoClip) ? (pVideoClip->Format) : kFBVideoFormat_RGB_24; | |
GLint internalFormat = (compressed) ? GL_COMPRESSED_RGB : GL_RGB; | |
GLint format = GL_RGB; | |
switch (clipFormat) | |
{ | |
case kFBVideoFormat_Any: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; |
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
// FBRenderOptions *pOptions | |
FBCamera *pCamera = pOptions->GetRenderingCamera(); | |
if ( FBIS(pCamera, FBCameraSwitcher) ) | |
pCamera = ((FBCameraSwitcher*) pCamera)->CurrentCamera; |
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
// Even if the function returns to us integers (in the FBModelVertexData class) | |
/** Return Index Array*/ | |
int* GetIndexArray(); | |
// you should remember that VBO buffer type of an element is unsigned int | |
// draw all model sub patches | |
for (int i=0; i<lVertexData->GetSubPatchCount(); ++i) | |
{ |