Which first? Tcl or C++ ???


#1

I am wanting to learn a programming language and can’t decide what would be most beneficial to a career in high end CGI. On one hand, if I learn C++ it will help me with Renderman, Mental Ray, 3dsmax SDK, etc. On the other hand, Tcl will allow me to use MToR SOOOO much better, and maybe other programs such as PiranhaHD… I also am primarily focusing on linux apps such as Shake, Maya, Houdini, Piranha, and Renderman. I know this is very vague, but I could use some advice from other TDs out there or those of you who have gone this route already. My ultimate goal is to be either a Technical Director, shader writer, procedural fx animator, or pipeline engineer. And yes, I do hate sleep.

Thanks!

Sean Looper


#2

Well, as a pipeline engineer myself, I mostly work in C++ - at the moment, most of the work I’m doing is plugins for Shake and Maya… I’ve done a couple of tiny Tcl scripts, but that’s about it (don’t really know Tcl, though)

Personally, I think C++ is a very solid language to know - it will help you all over the place, and it certainly won’t hurt to know it.

Another language that I’m learning at the moment is Python - I’ve not used it before, but I suspect that it will become my scripting language of choice in not too long - it seems great because it can be used for both short scripts and quite complex programs…

Anyway, going back to what you wanted to do:

Technical Director: Well, it really depends on what kind - if you’re working in Maya, though, there’ll be a lot of MEL to do.

Shader Writer: I really don’t know enough of what this involves to be able to make suggestions here…

Procedural FX Animator: This depends on whether you’d just be the Animator, or if you’d be the FX TD too… If you’d be setting it all up, then you’d certainly want to know MEL - and knowing C++ would be useful too, so that you could (if needs be) write new fields, for example…

Pipeline Engineer: What you need to know for this purely depends on what kind of thing the company wants for the pipeline - it might be a matter of shell scripts to set everything up properly, or it might involve writing plugins for the various pieces of software involved so that the user doesn’t have to think about where things go… I’d definately say learn C++ for this - and shell scripting/python/ - also the various scripting languages in the packages you’d be using - MEL and Shake Macros in my case…

Hope that’s been of some use…


#3

C++ is the way to go. Personaly i don’t like TCL/TK. I would prefer Python.

I mean you can start with Python and than you can move to C++.
Cause Python is the most beautiful and easy language.


#4

I was expecting that C++ was the way to go, at least initially. I hadn’t considered Python. I will most likely learn that second, then. Maybe someone could tell me if Tcl is really worth learning then considering I’ve only seen it in PiranhaHD and MToR? This is a great help though.

Last thing, are there any specific concepts in C++ that I should avoid or focus on? I have several books on the subject, and want to do more of a crash course in C++ rather than become a complete guru. I don’t plan on being able to write extremely complex programs, just to be able to script SDK plugins and other simple external tools for Maya or 3dsmax… Also, I know a lot of MEL already, so it’s good to know that it is relied on heavily in a production environment.

Oh! And is it possible to compile C++ scripts for windows on a linux machine? If not, are there free compilers for windows that I could use?

Thanks again for all the advice!

Sean


#5

Python won’t work with Maya like Mel or C++ …
But at least(i assume you are a beginner to programming) Python is the best language around for beginners and for undestanding the basic concepts of OO programming. And it’s very very easy. Once you learn Python, you’ll see that you can learn other languages easier.
As i said, forget about Tcl/tk. C++ and MEL will do your Maya jobs…
And it’s a great language. And Maya is written in C++. Also Windows and Linux are written in C/C++.
Start with Python(for understanding object oriented programming) ,then switch to C++. That’s my opinion.


#6

TCL is currently considered a somewhat outdated scripting language and has never been known for its speed. Its syntax is also rather cumbersome and the lack of true variable types and built-in OO is also an issue.
However, in the early 90s, it was the best alternative as it was the only easy to use graphic toolkit (Tk). Not surprising, within the gfx community some programs still do use it. Besides MTOR, Houdini and Nuke also rely on it for part of its GUIs.

Today, the graphic toolkit that made tcl so attractive(Tk) is available pretty much for all scripting languages with a similar syntax, so people tend to prefer more powerful or modern languages.

Python has recently evolved to be a very mature and one of the most advanced scripting languages around. Yet, I admit not liking its syntax and conventions (also, some of the new constructs in 2.2 like iterators and similar seem quite obfuscated to me). Also its speed still leaves some to be desired, imho, when compared to perl.
However, a language that I’d highly recommend these days (probably even over python) would be Ruby as a potential investment for the future. Ruby combines the simplicity of python’s syntax (with no stupid tabulation issues or having to type so much) with some of perl’s strengths (builtin regex, closures, etc). Its OO is probably one of the simplest around and it has a very elegant way of binding C++ code, too. More so, it recently introduced a way of getting rid of bindings all together and allowing DLL functions to be called directly doing a direct mapping of Ruby<->C structs (this could potentially make adding C libraries to the language a no brainer perhaps). My quick impressions is that its speed is closer to Perl’s and that it is more strongly typed than python (ie. numbers are builtin classes).
Unlike python, ruby can function as sed, perl or similar replacements in the command line with identical syntax, too.
Also, besides supporting Tk, it supports FOX which is a much more advanced GUI toolkit (on linux and Windows, no mac yet) and the GL bindings are also the best I’ve seen in any scripting language.
Ruby’s biggest disadvantage is that it is similar to python’s state some years ago: it is rather new and it is not yet as popular and as such documentation and books are still scarce.
But I am already starting to see A LOT of future in it.


#7

If I were hiring a TD-type person I would want them to know at least C, C++, Perl, Python, and at least some of the more common package scripting languages (MEL, etc). And with C I mean not just the language but also most common APIs (POSIX and/or Win32, definitely OpenGL, BSD sockets, at least one GUI toolkit, etc). With C++ I’d add at least one of the major “programming support” APIs - STL, Boost, .NET/managed code, etc (just so that you’re not writing your own String or List classes all the time). Knowlege of make, sed, awk, etc would be implied.


#8

woah there is a 3ds max SDK?! where can i get it?


#9

I would have thought that your 3DSMax reseller would be able to give you directions - I don’t know whether it comes with Max or whether you have to download it seperately…

Certainly with Shake, you have to contact Apple and ask for it…


#10

Originally posted by Ifx3d
woah there is a 3ds max SDK?! where can i get it?

It`s on your 3dsmax CD.


#11

I think Python is a really great scripting language and an excellent one to start with. It has a decent set of libraries and has good objects. Plus it doesn’t have pointers which can be confusing (although useful in certain situations).

Perl is great too, although there is definitely a dividing line where you should use Perl for small things and Python for anything that needs complex data structures (not that Perl can’t do them but they get crazy quickly…).

Ruby does have it’s place, but I couldn’t recommend it at the moment as it hasn’t really got into production use widely yet. This may change, but not yet. (Japan may be different).

Most places use the unix C shell. Knowing foreach and while loops is useful, but for anything more complicated do yourself a favour and use Perl or Python.

You will have to learn C at some point (and C++). If you want to make it more interesting a really good tip I got was to learn it with something else - eg OpenGL. Then at least you have something graphical to work with. http://nehe.gamedev.net/ is a great place to start. Personally I’d start with the GLUT version or a windowing system you’d like to learn rather than win32.

Also for shaders you will need to know RenderMan Shading Language (RSL) - there is almost no way of getting away from it! Essential RenderMan Fast by Ian Stephenson is a really good introduction, but you’ll want to get Advanced RenderMan by Antony Apodaca and Larry Gritz as well as it goes into far beter detail. If you only get one get Advanced RenderMan. Good renderers to practise with if you don’t have Pixar’s Prman are 3delight or Aqsis . Unfortunately exporting to RenderMan without MTOR can get tricky.

Also Steve May’s Renderman Notes and the new RenderMan Accademy are very good online resources.

Houdini’s VEX language is based off of RenderMan Shading Language and Mental Ray uses C. RSL is based off of C anyway so knowing some C first is encouraged.

Personally I wouldn’t bother learning Tcl specifically. The Tcl MTOR uses you can pick up very quickly. The main area Tcl is used is SLIM templates and the number of keywords is fairly limited. Download some from http://zj.deathfall.com/. The important thing to note is that the names of your parameters is not important, only the order as they are used to call your RSL function. This is the opposite of calling shaders from RIB where the name is important and not the order.

Also MEL is extremely useful - even though it is the most frustrating language you’ll ever use! Alias has the Personal Learning Edition if you don’t have access to the full version. Unfortunately you won’t be able to export to RIB without the full version. The best way of learning this is to think up some projects which need complex setup and try them out. Something like laying out a street scene and then blowing it up (particle expressions help too) or flocking rather than character animation.MEL scripting for Maya Animators by Mark Wilkins is a really good book for learning MEL and expressions. Complete Maya Programming by David Gould is more of a reference, but goes into more detail and also covers writing Maya plugins. (very useful).

Hope that helps a bit.

Simon


#12

I started really getting into Python yesterday (just dabbled with it last week) and I’m going to have to, again, add my voice of support to it…

It feels as powerful as C++ but as easy as shell scripting…

Give me a few more days to get into it, and I might be able to give more of an in-depth review of the language


#13

Now if we could only get Alias to rewrite Maya in Python :wink:

Simon


#14

And get Pixar to ditch that sonofabitch that is Slim and write a replacement in Python. mmmm yummy python.

Speaking of which, anyone see that thing about a 49’ python in the paper today?


#15

So to try and summarize the mass of knowledge above for a beginner like myself.
It sounded like;
Learn Python first, for ease of use, and then learn C/C++?
Hold off on Ruby for lack of reference?
I know it’s also preference, and individual needs, but this is the path I gathered.
Thanks to everyone who has posted so far in this thread.


#16

It’s also worth noting that Python and C++ are used for very different tasks. The choice about whether to use python or c++ is determined by the task you want to do, you can’t simply switch one for another and expect great results.


#17

playmesumch00ns

Thanks, that much I do understand.
I keep reading that Python is a great first language to learn, and that it is a good way to ease into C/C++. I’ve been learning C on my own. I’m wondering if, with what I keep hearing about Python, maybe that’s the way I should be going about this. Again thanks for your reply.


#18

Sorry to be offtopic, but anybody wanting some Ruby references can find a good introduction here http://www.linux-mag.com/2002-04/ruby_01.html.

It looks like it could translate pretty easily to Slimtemplates as a lot of the syntax is similar. eg. Tcl’s puts and {} block statements - useful to put RSL code in like Slim does.

But it also has Python style classes, iterators and functions and Perl style regex (the one thing I don’t like about Python).

I think it’s definitely worth having a look at by people out there (but not really as a first language - hence offtopic). I’m warming to it.

Simon


#19

Looks like the bastard offspring of python and tcl shudder. Thanks for the heads up, will be keeping an eye on this one…


#20

Bit more of a menagerie a trois. There’s a bit of Perl love child in there too!

Simon