|
We have released code that’ll allow you to develop for 3dsMax completely in python.
You’ll need to know maxscript as thats the actual interface into the program, but its wrapped as a Python module - all your code and calls are actually python.
For downloads and more information, check out http://blur-dev.googlecode.com
Quick Example:
How its done in Maxscript:
function randomizeObjects objs randPos:True = (
for obj in objs do (
obj.wirecolor = (color (random 0 255) (random 0 255) (random 0 255))
if ( randPos ) then (
obj.pos = [ random 0 500, random 0 500, random 0 500 ]
)
)
)
randomizeObjects $objects
randomizeObjects $selection randPos:False
and now in Python:
from Py3dsMax import mxs # import the maxscript module from the Py3dsMax package from blurPython from random import randrange # import python's random module
def randomizeObjects( objs, randPos = True ):
for obj in objs:
obj.wirecolor = mxs.Color( randrange( 0, 255 ), randrange( 0, 255 ), randrange( 0, 255 ) )
if ( randPos ):
obj.pos = mxs.Point3( randrange( 0, 500 ), randrange( 0, 500 ), randrange( 0, 500 ) )
randomizeObjects( mxs.objects )
randomizeObjects( mxs.selection, randPos = False )
mxs.redrawViews() # python doesn't automatically refresh like maxscript does...little faster
|