Re: 1/2 OT: Programming Languages for XSI

Date : Wed, 9 May 2007 10:10:13 +1000
To : XSI(at)Softimage.COM
From : "Aloys Baillet" <aloys.baillet(at)gmail.com>
Subject : Re: 1/2 OT: Programming Languages for XSI
Hi Luc-Eric and Christian,

The simplest one is PythonWin. Simplest because it comes with pywin32, so it will be available to everyone who can run Python in XSI.
Just use the following 2 lines to run the debugger:

import pywin.debugger
pywin.debugger.set_trace()

For Eclipse/Pydev Extensions, it's just a bit more involved, as you need to add the pydev python debugger to the PYTHONPATH before you can use it.
For the lazy, here's the short version:

import sys
sys.path.append(r'C:\eclipse\plugins\org.python.pydev.debug_1.3.2\pysrc')
import pydevd
pydevd.settrace()

Calling the settrace methods is the same as setting a breakpoint. Unfortunately I didn't find a way to set a real breakpoint as you would do in C++. If you want to debug, you'll have to insert the call to settrace in your code.
For "JustInTime" (tm) debugging, you can enclose any code you wish to debug in case of an exception with a try/except block that runs the settrace method.

Et voila!

I might post more advanced exemples on xsiblog one day...

Cheers,

Aloys

On 5/9/07, Luc-Eric Rousseau <lucer(at)softimage.com> wrote:
There's remote debugging?  And it works with XSI?  How do you set that up?
 

From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Aloys Baillet
Posted At: Tuesday, May 08, 2007 3:09 AM
Posted To: xsi
Conversation: 1/2 OT: Programming Languages for XSI
Subject: Re: 1/2 OT: Programming Languages for XSI

PythonWin, Komodo, Eclipse + PyDev + PyDevExtensions give you remote debugging of Python from inside XSI.
No problem here.
<rant>
C# is just another way to get tied to death with Micro$.
</rant>
That said, they might support their runtime on linux soon... we'll see!

Aloys

On 5/8/07, Luc-Eric Rousseau < lucer(at)softimage.com> wrote:
yes... c# is reportedly fast and has Visual Studio which works with XSI,
if you're a windows person it looks like a good choice.  Python can
leave you scratching your head where piece of code looks perfect but
doesn't run/compile because there are some tabs instead of spaces or
vice-versa.  I wonder how people are debugging python inside of XSI?



--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.