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* | |
global i | |
global my_system | |
i = 0 | |
my_system = FBSystem() | |
# go to next frame until finished | |
def OnIdleEvent(control, event): |
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
# script to export projected points | |
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
import maya.OpenMayaAnim as omAnim | |
import inspect | |
# select canonical mesh and region meshes |
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
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
import maya.OpenMayaAnim as omAnim | |
def getSkinCluster(dag): | |
"""A convenience function for finding the skinCluster deforming a mesh. | |
params: | |
dag (MDagPath): A MDagPath for the mesh we want to investigate. | |
""" |
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* | |
PREVIX = "_marker" | |
# get selected models | |
models = FBModelList() | |
FBGetSelectedModels(models) | |
# we assume that first selected model is our bone | |
boneModel = models[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
import traceback | |
import StringIO | |
import logging | |
import os, sys | |
from pyfbsdk import * | |
def print_to_hud(text): | |
printed = 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
# script is running inside the same context, so it could be splitted into initialization step and evaluation step | |
# here is an example | |
try: | |
initialize > 0 | |
print "evaluating" | |
except (NameError,),e: | |
initialize = 1 | |
print "initilize" |
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
struct SComponentListHolder | |
{ | |
public: | |
// a constructor | |
SComponentListHolder() | |
{ | |
component_list = FBCreateComponentList(); | |
} | |
~SComponentListHolder() | |
{ |
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
// don't forget to check for VBO offsets | |
FBModelVertexData *pVertexData = pModel->ModelVertexData; | |
if (pVertexData == nullptr || pVertexData->IsDrawable() == false) | |
return false; | |
const unsigned int positionId = pVertexData->GetVertexArrayVBOId(kFBGeometryArrayID_Point); | |
const unsigned int normalId = pVertexData->GetVertexArrayVBOId(kFBGeometryArrayID_Normal ); | |
const unsigned int uvId = pVertexData->GetUVSetVBOId(); |
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
/* | |
super important to initialize oriIndex variable with value like 0. | |
Othewise ShapeGetDiffPoint will not work and return false !!! | |
*/ | |
int oriIndex=0; | |
FBVertex posDiff; | |
FBNormal normalDiff; | |
pGeometry->ShapeGetDiffPoint(i, j, oriIndex, posDiff, normalDiff); |
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
lTime = FBTime(0,0,0,-1710) | |
strValue = lTime.GetTimeString() | |
print strValue | |
lTime2 = FBTime(0) | |
lTime2.SetTimeString(strValue) | |
frameIdx = lTime2.GetFrame() |
NewerOlder