[Closed] Max python
Python in Maya is about as easy as MXS in Max
Python in 3Ds Max is as easy MXS in Maya
Until you can type and execute a Python command in a Max window out of the box (like Maya), I’ll stay away from driving max via Python.
@SHRIF: To answer your Question there is one solution from blure here.
And you can follow the blog from Christopher Diggins he is the guy by autodesk who implements Python in 3ds max.
The basic idea is that you write you python code and then you can execute it per maxscript. Like this here:
python.ExecuteFile "demoSphereBorg.py"
@denisT: They implemented it because it would be easyer to create crossplatform tools for 3ds max, maya and softimage. So there are benefits for you too if you are used to develop in maya
max, maya, softimage… all implemented with c++ for many years and are owned by the same company. do you know any good cross-platform tool for these products?
there is this > http://www.ephere.com/plugins/coden/ haven’t tried it though but looks awesome…
I understand your point. I come from the c# area. But not every one has the time to learn the 3ds max SDK, Maxscript and C++. In a company there are sometimes guys from the web area. And they may already know Python. Maya, SoftImage, Cinema4D even Blender has Python. It was time for max to support it too.
Besides they are not doing this for fun, but for their customers and they gave them a lot of feedback.
But never mind. now we have everything
That’s a moot point though, python experience with the latest extension is much more similar to the strongly-typed languages as you have to cast objects from one type to another all the time – I mean MaxPlus.FPInterface__CastFrom, MaxPlus.TriObject._CastFrom and so on – and you have to be quite proficient with the C++ SDK to get even some basic things done (how else should you know that only after casting this to that you get access to the method you wanted in the first place?). It’s not at all about knowing python, the python API learning curve is steep, especially compared to maxscript with its comprehensive help with Learning Maxscript chapter, FAQ, macrorecorder and tons of commented examples.
Of course, in some cases it makes sense. For example if you already have a tool written in python that allows you to, let’s say, deform bitmaps in the UI, and the only operation needed on the max side is refreshing the material in scene; that’s a no-brainer. However for newcomers, turning on the macrorecorder, playing around for a while and learning a few mxs commands will be much more fruitful even if they already know some python (heck, at least no explanation of if-then-else,while-do etc. is needed).
For comparison, I’ve picked three simple everyday tasks, in maxscript:
$.Unwrap_UVW.flattenMapByMatID 45 0.02 true 2 true true
(getClassInstances TurboSmooth).isolineDisplay = false
if isKindOf $ Editable_Poly do polyOp.setFaceSmoothGroup $ #all 0
My question now is – is there’s someone brave enough to rewrite them in max python, post it here, tell us how long it took and compare the performance? Preferably someone quite new to max but proficient in python (although I would say it doesn’t matter at all, the most advanced python feature needed might be as well a for loop).
You don’t need to be afraid that they replace maxscript with python. This is not gonna happen. The idea is that you use the language that fits the best to your task. They will keep the maxlistener and the macrorecorder. The idea is to use Maxscript together with phyton.
I dare say no one is afraid of that – but I agree with denisT, adding yet another incomplete tool doesn’t make max any better. Don’t get me wrong, I love python, I don’t even like maxscript as a language for all the inconsistencies (naming conventions aside, what’s a standalone function somewhere is a method elsewhere, sometimes functions just return OK when you would expect boolean, the list goes on and on), I’ve built and installed PySide and tried really hard to find some use case where it would make sense to use python in max… but failed – especially when you take into account the performance again. Note that blurPython and duberPython are different beasts; I can only hope that in the course of lets say five releases max python will change for the better too.
when you have to reinstall windows getting all your python tools up and running again is a real pain in the ******* arse. Like opengl it’s all over the place, bits from here and there with no single download and install and documentation my god it’s hard going you’d think it was written by aliens. I’m going to port to c/c++ compiled command line utilities as this is just too painful to go through again.