Notifications
Clear all

[Closed] Max python

hi
am looking for some tutorials for max python
i want to learn the usage
QT
how to develop my work pipeline with python and max script
any guids and alot of links ???

26 Replies
1 Reply
(@denist)
Joined: 10 months ago

Posts: 0

python, QT… why are they? there are maxscript, c++, c#, .net, wpf… all of them much more native to MAX
do you just want to do anything weird?

weird ??!!
yes what a stupid move from autodesk to add python to max
and also that people who created a pined thread on the top of this forum
nothing weird to get learn something

5 Replies
(@denist)
Joined: 10 months ago

Posts: 0

i think so. to do development in MAX you have to know max SDK or MaxScript. if you don’t know one of them the Python can’t help. so…
Qt… the only one thing in max made with using Qt as know are caddies. the most weird UI solution in MAX. but fortunately users can kill them now in max 2014.

(@gazybara)
Joined: 10 months ago

Posts: 0

I miss thad.How can I kill caddies in 2014?

(@miauu)
Joined: 10 months ago

Posts: 0

There is a checkbox in Preferences window, which allows you to use old style Extrude/bevel and so on dialogs(just like in max2009).
Are you using max2014 with Extrude/Bevel dialogs as they looks in max2013?

(@gazybara)
Joined: 10 months ago

Posts: 0

Yup.
I do not mind the look of caddies but how they works. Sometimes when I try to enroll some value input field is frozen. This bug is so annoying.

(@gazybara)
Joined: 10 months ago

Posts: 0

Yes that option (checkbox) is in the
Customize > Preferances… > General > UI Display > Enable Caddy Controls
Tanks Kostadin

I don’t think it’s weird. If you have an existing pipeline that is python and uses qt, makes sense to see how much could port to max, now that it has python (or some degree of implementation…).

Now, having said that, you may be in for a tough time implementing it. As Dennis mentioned the windows based ui systems (wpf/winforms) are tried and tested in max.

I’m not sure if there is much on tutorials/walkthroughs on how to get max and qt playing nice, not that i’m aware of anyway. I’m sure some ninja on this forum will have some more info for you though.

I think the Blur python stuff had qt implemented, so that may be a good resource on how to get it up and running.

I haven’t looked into python too much in max (no chance of us moving from 2013 for a few years so…), but it looks to be a api wrapper like c# so, again as Dennis mentioned, you will need to have a grip of that to use python.

try to understand my position… i’m not against python. i’m against adding python to max when c# is still not really integrated. we’ve had one half-integrated solution, now we have two.

btw… i’m developing in maya right now using python 2.0 api making UI with Qt widgets. and i really enjoy it. and as mostly max developer envy maya’s … not about Qt cell-phone-like gui, but about the api

i don’t have a python-in-max. but i will appreciate if some one could make benchmarking for two basic tasks made with mxs and max python:
#1 collect all mesh vertices positions (~ 100K verts mesh)
mxs:


m = snapshotasmesh obj
for v=1 to m.numverts collect (getvert m v) 

#2 collect all scene node transforms (~10K nodes)


for obj in objects collect obj.transform 

the only trouble with max having another api is as, Denis alludes to, is it will be like all the others half arsed, incomplete and poorly documented. I’ve been using Python with max for several years, I use it to shut down max, from visual studio as a post build event, saving the current file, copy the new plugin over and if needed restarting max. Will I move over from the way I do it at the moment, probably as OLE across the different versions of max is ropey if not broken but does it win me anything ? nope I still won’t be able to unload a plugin without it crashing max or it not reappearing in the gui list if it doesn’t. Will it improve the pages and pages of just header files and undocumented functions in the SDK help?

     100K mesh verts:

mxs: 0.081 sec
python <- listener call: 0.327 sec (0.194 sec in local space)
python timeit: 0.309 sec (0.164 sec in local space)

1.5M mesh verts:
mxs: 1.568 sec
python <- listener call: 5.042 sec (0.549 sec in local space)
python timeit: 5.007 sec (0.515 sec in local space)

     10K objects TM:
     mxs: 0.023 sec
     python <- listener call: 0.403 sec
     python timeit: 0.154 sec
     
     100K objects TM:
     mxs: 0.277 sec
     python <- listener call: 1.951 sec
     python timeit: 1.538 sec

Point3 values alone are quite okay, on the other hand matrices make everything super slow…

     This is the testing code (yeah, no cleanup and stuff - EvalWorldState on nodes with modifiers applied crashes max anyway):
  triObjectID = MaxPlus.Class_ID(0x0009, 0)
         
         def getMeshFromNode(node, time):
         	obj = node.EvalWorldState(time).Getobj()
         	if (obj.CanConvertToType(triObjectID)):
         		return MaxPlus.TriObject._CastFrom(obj.ConvertToType(triObjectID, time)).GetMesh()
         	else:
         		return None
         
         def getNodeVerts(node, time):
         	tm = node.GetObjTMAfterWSM(time)
         	mesh = getMeshFromNode(node, time)
         	return [tm.PointTransform(mesh.GetVertex(v)) for v in xrange(0, mesh.GetNumVertices())]
         
         getNodeVerts(MaxPlus.SelectionManager.Nodes.next(), MaxPlus.Animation.GetTime())
  def getTransforms(nodes):
         	return [node.GetWorldTM() for node in nodes]
         
         getTransforms(MaxPlus.Core.GetRootNode().Children)

thank you Swordslayer

now we can see that python code is longer and slower than mxs. if it’s slower than maxscript it’s slower than c++ for sure.
also we can’t guaranty that everything works in python. do you think i will start any development on python being sure that it will be slow and not being sure that i will be able to complete it?

1 Reply
(@shrif)
Joined: 10 months ago

Posts: 0

DenisT now i see
you know that python is not the supper help in max because you test it
but
i have my experience with mxs but not python
so i have to deal with to decide
also i cant ignore that python is integrated with a lot of software
so learning it will not be a time wastage
for the QT i did some discovering around it
i think its cool and no matter the caddies ridicules because its a design side not the QT it self
specially if we consider the qt designer and how its easy to build a specific tool with it

i hope you will inform us about your progress… but my thought is at least two next max releases the python still be just a toy for ‘python fans’.

Page 1 / 2