Tech Artists Forums  

Go Back   Tech Artists Forums > Technical Discussion > Languages

Reply
 
Thread Tools Display Modes
Old 03-18-2009, 10:19 AM   #1
sebddd
Seb
 
sebddd's Avatar
Name: Sebastien Demurtas
 
Join Date: Aug 2008
Location: London
Posts: 41
Send a message via MSN to sebddd Send a message via Yahoo to sebddd
Default What do you do with Python ?

Hi, my question might sound weird but I really would like to know what is it all about with Python ?

Everytime I talk with someone about tech artist stuff I hear :
"oh you should really take a look at Python, etc... blablabla..."

But I'm doing technical artist stuff and I just don't need it, at all.
So I don't get it : why is it so wanted ?
Offline   Reply With Quote
Old 03-18-2009, 01:52 PM   #2
Bharris
Technical Director
 
Bharris's Avatar
Name: Brandon Harris
Company: reelFX
 
Join Date: Nov 2008
Location: Dallas, Texas
Steam ID: irrigger
Posts: 120
Send a message via AIM to Bharris
Default

I don't know about everyone else, but I really enjoy the way it handles over Mel. I can create my own objects, nest procedures, recast data types, just to name a few things.

Python is also becoming a universal language in 3D. 3DS Max, Maya, Cinema 4D, Houdini, Motion Builder, Nuke, I'm pretty sure that Blender can even use python.

Python also will let me build incredibly custom tools (Like tools that have their own thread, although I don't use this very often)

a downside is in building your own commands, Maya doesn't give the option to throw custom errors. (I.E if I make a command that requires a string value for a flag, and the user puts and int. Maya will just throw an error. Not a specific "String Value Required")
Offline   Reply With Quote
Old 03-18-2009, 02:26 PM   #3
Rob Galanakis
Administrator
 
Rob Galanakis's Avatar
Name: Rob Galanakis
Company: BioWare Austin
 
Join Date: Jun 2008
Location: Austin, Texas
Posts: 536
Send a message via MSN to Rob Galanakis
Default

We are a Max house and have had huge use for Python. We use it over MXS for a couple reasons.
  • First, speed. It is MUCH faster than MAXScript.
  • Second, ease of use. You don't have to launch Max to do something.
  • Third, language features. Having real classes is great.
  • Fourth, text stuff. Even with our stringOps struct (which basically mirrors all of Python's string functions), it is much faster and cleaner to use Python. String editing has always been Python's ace.

What we do with Python includes:
  • Scouring directories to compare files.
  • Processing XML/ASCII animation files (for compression and to 'tailor' them for other skeletons)
  • Script deployment (we launch max via a python script, instead of just a bat file, it allows us to do more complex things (such as compare dates so we don't keep copying over certain files that need to be copied).
  • Image processing for our hueing system.
  • Pretty much all our character markup data creation.

Anything that doesn't NEED to be in Max, we keep out of it. This allows us to do those things without having to go through Max, allows other apps and tools to use them, and it is much faster. It is really an extension of the library approach we try to take with our code. By abstracting and separating out what doesn't need to happen in the app, and communicating back and forth via DOS/text files/COM, we maintain much better modularity and reusability. So we get the coding benefits of an excellent language, and the structural benefits of more modular code along with it.
__________________
Forum Administrator
www.robg3d.com
Offline   Reply With Quote
Old 03-18-2009, 09:15 PM   #4
Count_Zr0
integer
 
Count_Zr0's Avatar
Name: Jason Parks
Company: Sony Online Entertainment
 
Join Date: Sep 2008
Posts: 42
Default

Oh man, don't get me started:

-String functions are worth the price of admission. You can slice up and replace and search a string a million different fast and easy ways.

-os.walk (traverses entire directories). Very easy to process lots of files

-win32com libraries allow access to control practically any windows application (ie.- photoshop, etc.)

-Unlimited libraries some popular ones I use to interact and create xml and excel documents. Handy for making reports, email, etc.

-Debugging in an IDE (wing or Eclipse). Invaluable help stepping through code one line at a time seeing stack trace, etc. Code completion, code analysis, refactoring, etc.

OOP and classes if needed

Features over MEL:
-Nestability of tuples, lists, dictionaries, objects, etc. In other words, you have a million better container types that MEL's simple array.

-pymel is a super combo of Maya python and Maya api

-Python bindings to some very nice GUI apps: wx, tk, QT, etc. Some of which can be used w/ maya right now/soon

-Can even debug scripts running directly in Maya, either command line or in-session using wingIDE. This is so darn helpful you can't believe it. You'll never know how valuable a good IDE is until you start to use one. Then you'll realize scripting MEL in a script editor (even a good one) is really slow and ancient.

But really its a matter of do you take yourself seriously, why not do it? Look at the industry and your skill set. Everything is going Python so it absolutely cannot hurt to know more of it. Even more of a bonus if you get PAID to learn it on the job coding for your favorite DCC app! Scripting is fun and easy and a good place to start. Python is also fun and easy, but it is also a very good stepping stone to do more serious, powerful work. Python is Object Oriented, so you can start to dabble with more classes and OOP programming.

Just give it a try, you'll probably not regret it and never turn back.
__________________
-jason
Offline   Reply With Quote
Old 03-18-2009, 11:56 PM   #5
Bharris
Technical Director
 
Bharris's Avatar
Name: Brandon Harris
Company: reelFX
 
Join Date: Nov 2008
Location: Dallas, Texas
Steam ID: irrigger
Posts: 120
Send a message via AIM to Bharris
Default

I don't know if this happens to anyone else, but when I switch back to mel, I end up punching myself in the face from all the things I forget about. $, ;, [], {}, etc.
Offline   Reply With Quote
Old 03-19-2009, 11:11 AM   #6
sebddd
Seb
 
sebddd's Avatar
Name: Sebastien Demurtas
 
Join Date: Aug 2008
Location: London
Posts: 41
Send a message via MSN to sebddd Send a message via Yahoo to sebddd
Default

Ok I get it now and that's what I was suspecting...
This is the new standard for 3d apps scripting.
Bye bye Maxscript and MEL then

Sigh... I feel too old-school now, I really need to catch it up hehe...
Offline   Reply With Quote
Old 03-19-2009, 10:42 PM   #7
Drea
__name__ != "__main__"
 
Drea's Avatar
Name: Andreas Tawn
Company: Ubisoft
 
Join Date: Jul 2008
Location: Newcastle, UK.
Posts: 32
Default

I'll add data mining. Whether aggregating log files or, with PIL, generating heatmaps of framerate, memory use, gameplay events and collision data.

We don't integrate Python with Max yet, so I often dump text files with MXS, do some processing in Python and apply that data back via MXS.

I <3 Python for loads of things.

I also do Motionbuilder scripts It makes me cry.
Offline   Reply With Quote
Old 03-20-2009, 02:46 AM   #8
bclark
Co-Founder Rigging Dojo
 
bclark's Avatar
Name: Brad Clark
 
Join Date: Jul 2008
Location: Austin
Posts: 178
Default

Speaking of, I have had a hard time finding time/ or having projects that get me in to python. does any one have a link or examples of a max or mel script that they then converted over to python so I can compare and see what the python flow is?

Thanks,
Brad.
Offline   Reply With Quote
Old 03-20-2009, 11:03 AM   #9
sebddd
Seb
 
sebddd's Avatar
Name: Sebastien Demurtas
 
Join Date: Aug 2008
Location: London
Posts: 41
Send a message via MSN to sebddd Send a message via Yahoo to sebddd
Default

Hey bclark : I'm not alone then

I get the feeling that this Python excitement has emerged due to a lack of "tools programers" out there, possibly because of the annoying constantly changing MaxSDK or MayaSDK ?

Back in the days where you'd have a coder developing a proper .mll or .dle plugin for the users : you didn't have to do all these funky things and Maxscript/MEL was enough to play around minor tasks.

Am I wrong or is the technical artist becoming more and more a "technical guy" than an "artist" ?

If so : I believe it might end up in situations where a good coder "interested by 3d art" would have more chances to get a technical artist position than "an artist who learned how to write some scripts" these days ...

The thing that stops me sometimes is that I want to limit as much as possible to end up into a "language-oriented-job" in order to keep this first focus on art intact.


ps: speaking of "outside 3d apps", to build "stuff" in general : I just use GNU make, I approached Python when having a look at scons but buildsystem specialists say this one is not quite doing the job... yet.
Offline   Reply With Quote
Old 03-20-2009, 11:33 AM   #10
sebddd
Seb
 
sebddd's Avatar
Name: Sebastien Demurtas
 
Join Date: Aug 2008
Location: London
Posts: 41
Send a message via MSN to sebddd Send a message via Yahoo to sebddd
Default

Python in the Tiobe language popularity trends :
http://www.tiobe.com/content/paperinfo/tpci/index.html
Offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 08:41 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2008, Rob Galanakis