Update: Now Technical Artist at Oculus Research!

A couple months ago I made the jump to work on more exciting tech!

New Adventure!

Finally made full-time as Character Technical Artist @ Suckerpunch Productions. Time to get to work!

Maya UI building with Python

Here is a consolidated list of all the maya UI commands for python:

Windows

colorEditor
confirmDialog
createEditor
defaultNavigation
editor
editorTemplate
fontDialog
layoutDialog
minimizeApp
progressWindow
promptDialog
refreshEditorTemplates
scriptEditorInfo
showSelectionInTitle
showWindow
toggleWindowVisibility
window
windowPref

Panels

componentEditor
getPanel
hardwareRenderPanel
hyperGraph
hyperPanel
hyperShade
modelEditor
modelPanel
nodeEditor
nodeOutliner
outlinerEditor
outlinerPanel
panel
panelConfiguration
panelHistory
saveViewportSettings
scriptedPanel
scriptedPanelType
setFocus
spreadSheetEditor
viewManip
visor
webBrowser
webBrowserPrefs

Buttons, Sliders, etc.

attrColorSliderGrp
attrControlGrp
attrFieldGrp
attrFieldSliderGrp
attrNavigationControlGrp
button
canvas
channelBox
checkBox
checkBoxGrp
cmdScrollFieldExecuter
cmdScrollFieldReporter
cmdShell
colorIndexSliderGrp
colorSliderButtonGrp
colorSliderGrp
commandLine
componentBox
control
floatField
floatFieldGrp
floatScrollBar
floatSlider
floatSlider2
floatSliderButtonGrp
floatSliderGrp
gradientControl
gradientControlNoAttr
helpLine
hudButton
hudSlider
hudSliderButton
iconTextButton
iconTextCheckBox
iconTextRadioButton
iconTextRadioCollection
iconTextScrollList
iconTextStaticLabel
image
intField
intFieldGrp
intScrollBar
intSlider
intSliderGrp
layerButton
messageLine
nameField
nodeTreeLister
palettePort
picture
progressBar
radioButton
radioButtonGrp
radioCollection
rangeControl
scriptTable
scrollField
separator
shelfButton
soundControl
swatchDisplayPort
switchTable
symbolButton
symbolCheckBox
text
textField
textFieldButtonGrp
textFieldGrp
textScrollList
timeControl
timePort
toolButton
toolCollection
treeLister
treeView

Layouts

columnLayout
dockControl
flowLayout
formLayout
frameLayout
gridLayout
layout
menuBarLayout
paneLayout
rowColumnLayout
rowLayout
scrollLayout
shelfLayout
shelfTabLayout
tabLayout
toolBar

Menus

artBuildPaintMenu
attrEnumOptionMenu
attrEnumOptionMenuGrp
attributeMenu
hotBox
menu
menuEditor
menuItem
menuSet
menuSetPref
optionMenu
optionMenuGrp
popupMenu
radioMenuItemCollection
saveMenu

Miscellaneous UI

annotate
autoPlace
buttonManip
callbacks
disableIncorrectNameWarning
grabColor
headsUpDisplay
headsUpMessage
hotkey
hotkeyCheck
inViewMessage
linearPrecision
loadPrefObjects
loadUI
multiTouch
nameCommand
overrideModifier
saveAllShelves
savePrefObjects
savePrefs
saveShelf
scmh
setMenuMode
setNodeTypeFlag
setStartupMessage
textManip

Working with fbx files with python in maya

fbx, or fbx(why are you such a pain?)

Working with fbx files in maya using python isn’t the most frustrating format to work with, just very picky.

When using python, try to stay away from using maya file command:

You can by all means use that command, but it’s buggy when you want to have certain options for your import. i.e. if your open file preferences are set to maya native compared to os native, the fbx import options windows doesn’t always come up before import.

A better way is to use maya.mel commands for fbx:

Strange right?

The way fbx code works is kinda like building up what you want for options and then importing your file.

It would make more sense to have a command with options built into it, i.e:

Alas, we can’t have something nice to work with. Now, since we are using mel commands in python, we need a way to transfer between python and mel variables.

To store python data in a mel variable we can use:

To store mel data in a python variable we can use:

Now that’s all fine and dandy, but we are working with python from the start. So we need a way to store a python variable in mel, from python.

So, to do that:

So we can finally put it all together in a python function:

You can find references for commands here:
http://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/GUID-699CDF74-3D64-44B0-967E-7427DF800290-htm.html

stretchy ik spline maya python

A quick function for creating a stretchy ik spline.

strCurve = name of the curve, or have a curve selected
iNum = number of joints you would like created
CreateStretchyIk(strCurve, iNum)

© 2016 Tim Callaway

Theme by Anders NorenUp ↑