Set up command ports in Maya First thing is to open a port in maya this enables a processing sketch to communicate in real time back to maya. The port numbers need to match up with those used in the sketch. // mel script open port commandPort -name “127.0.0.1:6004” // mel script close port commandPort…
Author: admin
pymel
Triple Shading Switch for per object shading
by admin •
I wanted to render using the maya hardware renderer (very quick). For this to work colors need to be visible in the viewer. Triple Shading Switch in Maya is equivalent to Renderman per object primitive variable shading that I’ve used on other projects. Scroll down for alternative 3delight/Renderman version with pros and cons. …
python
Normalized Values
by admin •
Sometimes its helpful to have a data range scaled into another range aka normalised. I’ve used this for things like having numbers scale into a color ramp that works in the 0-1 range inputVal = 2.1 minVal = 1.2 maxVal = 4.5 normalizedValue = (inputVal – minVal) / (maxVal – minVal) print normalizedValue In this…
pymel
Run Command Line / .exe from Maya
by admin •
I use midicsv, so for convenience I coded this up to run its command line from within maya gui. you run it , you pick input file, in this case a midi file (.mid) it does its thing and outputs a .csv file with the same name. import subprocess import EasyDialogs input_file = EasyDialogs.AskFileForOpen() wanted=unicode…