Ah thanks for the kind replies!
I am super new to Maxscript. I actually sort of tried what you two suggested, but there’s a high chance I’m doing it wrong because my n00bness to Maxscript, so I’ll keep beating my head against it. But I’ll also detail how I tried in a write up below. If anyone spots something obvious that I’m doing wrong, that’d be really helpful.
First, like I said, I figured
mouseTrack() is expecting a function in Maxscript rather than Python, so I created a function in 3dsmax. I did this by going into the Max listener and wrote up the following:
fn myGlobalFunction =
print "Test of a global function"
After creating it, the function worked as expected when I manually would call it from the Max listener.
(I just wanted to do a simple print function to test. Didn’t want to bother with trying to fire off a Python function from Max just yet.)
Second, back in Python, I wrote up the mouseTrack() command as so:
runtime.mouseTrack(on=self.DrawOnObject, prompt=promptString, trackCallback='myGlobalFunction()')
Finally, the error I get in Max when I run my Python code:
RuntimeError: MAXScript exception raised.
-- Runtime error: Bad trackCallback: argument: "myGlobalFunction()"
Not sure exactly what I’m doing wrong, but after getting the positive replies from you two, I suspect I’m setting up these things wrong and I just need to try doing this same thing but figure out the correct setup.