Jump to content

Catch Mantra Error


elecstorm

Recommended Posts

Hi! Is there a way to catch Mantra error in python script?

I want to implement something like this:
hou.hipFile.load(hipPath)
try:
    hou.node("/out/mantra").render((1, 1, 1))
except error:
    #launch manta again or something else...
hou.hipFile.clear()
print "Frame " + str(1) + " was rendered"
Edited by elecstorm
Link to comment
Share on other sites

Ok, I found this way:

    try:
        hou.node("/out/mantra1").render((1,1,1))
    except hou.Error, ex:
        print ex.instanceMessage()

It works in the python shell, I have not tested it with the hython. But I don't understand this exception (I found it somewhere):

except hou.Error, ex

"hou.Error, ex" - It's not definition (because of comma). So, what is it?

Edited by elecstorm
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...