Eric, that’s very generous of you. If it works out, I’m sure I will see it show up on the googlepages and if not then we’ll just wait some more, which is ok too.
Thanks!
-Johan
First of all big ups to blur! And yes a max 2010 version would be great!
Maybe while you are at it, just an idea and maybe its quite easy…
Could you develop something like a python contolled mesh/poly or even spline shape. Similar to the mesh scripted plugin that maxscript offers? Or is this possible now and if so how?
Again thanks so much!!!
greetings
Olaf
What do you mean by mesh scripted plugin? With this you can do with python anything that is available through maxscript – just through python. So you can control mesh / poly operations with it…
Thats not entirely true actually –
Rollouts for instance, aren’t accessible through python, and I’m pretty sure scripted controllers and plugins aren’t going to work yet either – I have to figure those out – because they’re generated via the parser and not through the globals hash table.
Will be looking into that in the future as we start developing more – hadn’t had the need for that before, so we’ll have to cross that bridge when we hit it.
THANK YOU!
Now I can finish developing classes that can be used for MotionBuilder, Maya AND Max!
From Blur import awesomeness
Hi eric,
What about maxscript enums ?
I have ported a little script to test Py3dsMax. It’s working very good but I have a problem with addKnot function because it wants maxscript enums as parameters:
MAXScript
addKnot shape splIdx #smooth #curve point
Python
mxsCommand = "addKnot $%s %s #smooth #curve [%s,%s,%s]" % (shape.name, splIdx, point.x, point.y, point.z)
mxs.execute(mxsCommand)
Just out of curiosity and my lack of programming skills – why is everyone so happy about hearing news of Python in max? I know it’s an open-source programming language. As I get it’s a very, very good news to max?
I have some distant plans and intentions of learning maxscript, for purposes of being able to make some customm tools and such. Because of that news is it worth than to invest time now in learning maxscript or it’s better to dive into python which I guess is much harder to learn?
@ ypeuch
Hey man – thanks for the find! I was auto-converting names to strings thinking that all the maxscript methods would take them vs. names (most of them do), but that case doesn’t work. I put up new installs that’ll fix that problem.
Maxscript also natively doesn’t have a constructor that’ll port over:
mxs.#corner will fail in python
and there is no ‘as’ method (“corner” as name)
Easiest way around it was to register a global maxscript method called “namify” in the [max]/scripts/startup/init_py.ms script that’ll do it for you, here’s an example of a python script ported from a maxscript help (you’ll need the 8678 build online now for it to work)
from Py3dsMax import mxs
def drawLineBetweenTwoPoints( pointA, pointB ):
ss = mxs.SplineShape( pos = pointA )
mxs.addNewSpline( ss )
# Create name instances from maxscript using the global namify method
corner = mxs.namify( 'corner' )
line = mxs.namify( 'line' )
mxs.addKnot( ss, 1, corner, line, pointA )
mxs.addKnot( ss, 1, corner, line, pointB )
mxs.updateShape( ss )
return ss
newSpline = drawLineBetweenTwoPoints( mxs.Point3( 10, 20, 30 ), mxs.Point3( 100, 200, 10 ) )
@ kashak
It’ll really be up to the studio/developer what solution will work best. Python is a really well designed language, easy to read and work with, and is used cross many applications and platforms.
The main advantage of exposing python to maxscript for us at Blur is consistency. We use python for all external tools, as well as tools in XSI. Being able to make all of our tools run python (instead of maxscript) allows for reuse of code and libraries (asset tracking, production tracking, pipeline tools that go cross project and application) can all be run from a single code base.
Another advantage of it is the PyQt framework, which, is immensely powerful for both graphics, and data backend.
But again, its up to you…if you’re developing utilities that will improve 3dsMax solely and can achieve what you need with the built-in rollout controls, there might not be an advantage for your needs.
could any volunteer make speed and memory leaking comparison tests for same functions implemented on Python and MXS? (scene exploring, mesh creation, array operations…)
thanks,