View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View linearRamp.py
from PIL import Image
width, height = 256, 32
image = Image.new("RGB", (width, height))
pixels = image.load()
for i in range(image.size[0]):
for j in range(image.size[1]):
pixels[i,j] = (i, i, i)
image.save("Linear_Ramp.png", "PNG")
View getSelectedOrder.py
from pyfbsdk import *
def getSelectedOrder():
# selectionOrder selection order
# Get the current selection
lModelList = FBModelList()
pParent = None
pSelected = True
pSortSelectedOrder = True
FBGetSelectedModels( lModelList, pParent, pSelected, pSortSelectedOrder )
View ezTD_mobuSetup.py
########################################################################################
## ezTD_mobuSetup.py
## version: 2.0
## Author: Jason Barnidge
## jbarnidge [at] OmniZed.com
## www.OmniZed.com
## Description:
## Easily setup & maintain a standardized pipeline for Animators in MotionBuilder
## Also helpful when/if a MotionBuilder bug resets the config files
########################################################################################
View mobuCurrentFrRange.py
## snippet function
from pyfbsdk import *
from pyfbsdk_additions import *
def getZoomStartEndFrames():
""" getFrameRange of Zoom Slider
returns start and end """
lPlayer = FBPlayerControl()
lStartFr = lPlayer.ZoomWindowStart.GetTimeString()
lEndFr = lPlayer.ZoomWindowStop.GetTimeString()
View SelectPythonFileInExplorer.py
# Select current python file in explorer
import os, sys, subprocess, inspect
subprocess.Popen(r'explorer /select,%s' % os.path.abspath(inspect.getfile(inspect.currentframe())))
## or...
pFileName = os.path.abspath(inspect.getfile(inspect.currentframe()))
pFileDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
print 'pFileName = %s\n' % pFileName
View changeMoBuTxtrs.py
from pyfbsdk import *
for v in FBSystem().Scene.VideoClips:
print v.Filename
v.Filename = r'C:\someDir\txtrFile.tga'
View transferKeys.py
from pyfbsdk import *
mySource = FBFindModelByName("cube_source")
myDestination = FBFindModelByName("cube_destination")
print mySource.Name,myDestination.Name
myDestination.Translation.GetAnimationNode().Nodes[0].FCurve = mySource.Translation.GetAnimationNode().Nodes[0].FCurve
myDestination.Translation.GetAnimationNode().Nodes[1].FCurve = mySource.Translation.GetAnimationNode().Nodes[1].FCurve
myDestination.Translation.GetAnimationNode().Nodes[2].FCurve = mySource.Translation.GetAnimationNode().Nodes[2].FCurve