How is python being used with max? Is it all COM or is there some other magic involved?
I think it’s pretty much COM or nothing. We have tools that call MaxScript COM from Python, and others that go the other direction.
One of the Blur guys wrapped a Python interpreter in a Max plugin, but I don’t think he got very far. It’s linked off Paul Neale’s site, I think.
http://penproductionsinc.com/
You could also set-up connections from Python & Max with named pipes or sockets, but I’m not aware of any examples.
How is Python used within Max? I’m also think it is pretty much COM or nothing.
How is Python used with Max, though? That’s a different (and simpler) story… you can just use command line parameters to pass to your Python scripts, and though I’m not sure I’d suggest it as a real pipeline solution, communicate simple results via a text file.
thats what i figured. We are using it in that capacity just wanted to make sure i wasn’t missing out on something better
Have you guys noticed any instabilities when using python and max? I have one little tool that essentially loads a file. If i use this tool a few times, max will explode at any random point.
Its really hard to debug since its so simple and I can’t reliably reproduce the problem.
It’s been remarkably stable, in my experience. Can you post your script? I can see if it behaves the same here, or eyeball it for any obvious differences.
class PyMax(object):
"""Creates a COM connection to 3dsmax"""
def __init__(self):
self.kill = False
try:
self.app = win32com.client.Dispatch("MAX.Application.8")
self.app._FlagAsMethod("loadMaxFile")
self.app._FlagAsMethod("gc")
except:
pass
def load(self, maxFile):
"""This will attempt to load maxFile into 3dsmax"""
try:
self.app.loadMaxFile(maxFile)
self.app.gc()
return True
except:
return False
I’m doing something similar without any issues here, but I’m using execute to pass the file to load in as a maxscript command instead of a direct method from python.
I heard of talks from an Autodesk rep at one point talking about Max having integrated python, to the level of Maxscript and beyond. This was in 2007 some time, and apparently that was just a pipe dream