top of page

Debugging in Maya with Stack Trace

  • Writer: Fernanda
    Fernanda
  • Sep 1, 2020
  • 1 min read

Updated: May 21, 2021

Did you know that having this option enabled in your script editor will make your life a lot easier?

ree

It might seem obvious to point this out. But if we all assume something is obvious and don't talk about it, how are less experienced game devs supposed to learn it? School doesn't teach you everything!




The Show Stack Trace option enables a feature in the script editor that gives you a more detailed error message. It shows you which line and/or functions the error happened.


Ex.1

1 def doSomething(a):
2   a += 1 
3   print "\nI'm doing %s somethings" %a
4    
5 doSomething(4)

If I run this, it correctly returns:

I'm doing 5 somethings

To demonstrate, I'm going to run doSomething("ohno") :

ree

We can't add a string and an integer together, so Stack Trace tells me that when it tried to run the function doSomething() on line 5, it encountered an TypeError on line 2 (a += 1).


I hope this helps!

-Fernanda





Recent Posts

See All
Tech Art Q&A #1

Sometimes I get emails from students who want to learn more about Tech Art. Many of them are enrolled in a game development college...

 
 
 

Comments


bottom of page