Remember 3December
Find out where to celebrate your 3D CG art...
  • 1/3
You are here:Forum Home / Autodesk 3ds® Max® / MaxScript / how do you use python in 3dsmax?
  RSS 2.0 ATOM  
2 pages: 1.2 first

how do you use python in 3dsmax?
Rate this thread
 
2498
 
Subscribe to this thread
avatar
  • Total Posts: 29
  • Joined: 2007-10-02 09:05:06

I haven’t tried to dock one yet, although I bet it could be done.  The win32 API is pretty full-featured with respect to windows, and the Python win32 extensions are just a big wrapper around that API.



Adam Pletcher
Technical Art Director, Volition, Inc. / THQ
blog: Tech Art Tiki

Replies: 0
avatar
  • specxor
  • Posted: 29 January 2008 04:37 AM
  • Total Posts: 1
  • Joined: 2006-08-22 03:36:29

Adam Pletcher 11 December 2007 07:09 PM

The COM bits of what we’re doing is explained in this thread on CGTalk, as someone mentioned above.

Some of the win32 code posted in that thread is actually from the book “Python Programming on Win32” by Mark Hammond and Andy Robinson.  An excellent book if you want to learn more about Python and COM, and the Win32 API in general.

I’ll be happy to post some code examples when my GDC talk is further along and I’ve cleaned things up a bit.

Hi Adam,

You’re presentation sounds awesome, hopefully I can make it this year… I was just curious how you bind the wx window to max, I have created several wx based tools that I use with max (and maya) and just parse commands back to max via com, I would love to know how to make the wx window a child of max’s. Would you consider posting some demo code?

Cheers
David Mackenzie



Replies: 0
avatar
  • Total Posts: 29
  • Joined: 2007-10-02 09:05:06

My GDC talk “Python for Technical Artists” was today.  It seemed to go pretty well.  I’ve posted my slides and code sample files here:

http://www.volition-inc.com/gdc

The Python examples include several scripts in a few Tech Art-oriented categories:
- Data mining (large XML files)
- Data Serialization/Persistence
- Screen scraping
- Textures
- Databases (MySQL, etc)
- Windows COM

The COM group includes examples on driving 3ds Max and Maya in various ways from outside of those apps, using Python.  There’s a fun example that uses a 360 controller to fly a camera around a 3ds Max scene and place world objects on a landscape, with just a few lines of embedded MaxScript.

Check out the examples, let me know what you think.



Adam Pletcher
Technical Art Director, Volition, Inc. / THQ
blog: Tech Art Tiki

Replies: 0
avatar
  • CyFeR
  • Posted: 27 February 2008 08:36 PM
  • Total Posts: 3
  • Joined: 2006-08-23 05:33:06

thanks for sharing this
i really appreciate it

Mohab Gamal



Replies: 0
avatar
  • Total Posts: 6
  • Joined: 2009-11-05 19:10:29

Hey guys -

We’ve developed some plugins to actually wrap maxscript as a Python module so you don’t have to work through COM.

It implements a Python/PyQt gui as your dialogs, so you can use all of python, with all of Qt, and then access max through the module.

from Py3dsMax import mxs  # import mxs module

sphere mxs.getNodeByName( "Sphere01"
print sphere.radius

Thats just a very small sample - we have much more at http://blur-dev.googlecode.com

Enjoy!

Eric Hulser
Software Developer
Blur Studio



Replies: 0
avatar
  • Location: Philadelphia, PA , US
  • Total Posts: 143
  • Joined: 2006-08-22 13:15:44

I’m sure I’m not the only one who sez “big thanks” to Adam & Volition and Eric & Blur for sharing this stuff. I’m a one-person shop, but getting increasingly interested in the code side of things, and developing app-agnostic scripts sounds very sensible!

thanks again,
Jeff



Replies: 0
2 pages: 1.2 first




   
  Settings Choose Theme color: