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 * | |
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 |
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 * | |
for v in FBSystem().Scene.VideoClips: | |
print v.Filename | |
v.Filename = r'C:\someDir\txtrFile.tga' |
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
# 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 |
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
## 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() |
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
######################################################################################## | |
## 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 | |
######################################################################################## |
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 * | |
def getSelectedOrder(): | |
# selectionOrder selection order | |
# Get the current selection | |
lModelList = FBModelList() | |
pParent = None | |
pSelected = True | |
pSortSelectedOrder = True | |
FBGetSelectedModels( lModelList, pParent, pSelected, pSortSelectedOrder ) |
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 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") |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
''' | |
FBXWrapper | |
This module provides a python wrapper for every method exposed in the FBX plugin. | |
The arguments for the calls are the same as for the equivalent mel calls, however they can be passed with typical | |
python syntax, which is translated to mel-style flags and arguments under the hood. The actual flags and arguments | |
are documented here: | |
usage: |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
This is a helper FBX class useful in accessing and modifying the FBX Scene | |
Documentation for the FBX SDK | |
http://help.autodesk.com/view/FBX/2015/ENU/?guid=__cpp_ref_index_html | |
Examples: | |
# instantiate the class, as seen below with a path to an FBX file | |
fbx_file = FBX_Class(r'c:\my_path\character.fbx') |