Render Sript

60 views
Skip to first unread message

Diego Ruiz

unread,
Jul 14, 2014, 6:09:43 PM7/14/14
to python_in...@googlegroups.com


Hi everyone, I'm new in the group and I'm learning about python for render, I'm using Maya 2014 but I have a problem, when I call the .py file, Maya tells this: 

# Attempting to send notification email

# Error: line 0: IOError: file D:\3D\jesusbuenahora\scripts\notification.py line 32: 2 # 

I check it out many times but always appears taht message, I don't know what to do, does somebody can help me please?, Thanks!!

Arjun Thekkummadathil

unread,
Jul 14, 2014, 11:37:19 PM7/14/14
to python_in...@googlegroups.com
in line 32 check if renderpath exist, generally IOError is when the file doesn't exist, if your scene is not yet rendered anything then likely that file doesn't exist


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b07443b8-4c76-4d3e-8df1-78d8a3dd631c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Israel

unread,
Jul 14, 2014, 11:37:33 PM7/14/14
to python_in...@googlegroups.com
Hi Diego, and welcome to the group.

Unfortunately Maya isn't being very nice in telling you a helpful traceback message. But most likely your problem is that either the renderPath does not yet exist, or is inaccessible. Try doing this first:

if not os.path.isfile(renderPath):
    print "Does not exist!", renderPath




--

Larry Wang

unread,
Jul 15, 2014, 4:46:33 AM7/15/14
to python_in...@googlegroups.com
cmds.renderSettings() returns a string list. But you passed it directly to open(renderPath, ‘rb’) where open() expects a string (path) as its first argument.
You need to be more specific on which file you are trying to open. Looking at the example code on renderSettings(), the list it returns could contain empty strings in the list depending on which arguments you give, so you may have to perform further validation before calling open() as well.

larry

Justin Israel

unread,
Jul 15, 2014, 4:48:12 AM7/15/14
to python_in...@googlegroups.com
He uses the first instead of the returned list:

renderPath = cmds.renderSettings(fin=True, fp=True)[0]

The problem is that he isn't checking if it actually exists before trying to open it. 


Diego Ruiz

unread,
Jul 15, 2014, 12:39:56 PM7/15/14
to python_in...@googlegroups.com
Thanks you guys for all your help, the problem are still there. I've redericed, maya recogniced the rout until the images, but the message is the same.  


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/qxCzPP35Wkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJrOGy9anWorQPQKNvg3RLAJXGMEvOxjjrSfJw8FSz6jnxNdKQ%40mail.gmail.com.

Diego Ruiz

unread,
Jul 15, 2014, 1:31:43 PM7/15/14
to python_in...@googlegroups.com
Thank you Justin, I´m trying to learn but is very hard, this code doesn't work yet, are there other some way to this? Have a nice day


You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/qxCzPP35Wkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0UeC7VBttkuC2p5Q14R%2B-ZHdL2JjZbti6Xe7wPb__NFQ%40mail.gmail.com.

Justin Israel

unread,
Jul 15, 2014, 4:03:13 PM7/15/14
to python_in...@googlegroups.com

Well there are no ways around the fact that trying to open a file that does not exist will produce an error. Have you tried checking and printing if the file does not exist? You should also return from the function after you report the error.

Diego Ruiz

unread,
Jul 15, 2014, 8:24:02 PM7/15/14
to python_in...@googlegroups.com
Thanks guys, like I said I'm new learning this, 
The line of code that you give me:

if not os.path.isfile(renderPath):
    print "Does not exist!", renderPath


is all right?, when I introduce the code in the .py, in script editor of maya gives this message:

# Error: line 0: IndentationError: file <maya console> line 1: unindent does not match any outer indentation level # 

I've rendericed the image therefore the images exists, I see it in the images folder from my project of maya
thanks for help


Justin Israel

unread,
Jul 15, 2014, 10:26:48 PM7/15/14
to python_in...@googlegroups.com
Well that error just means what you have pasted in has inconsistent whitespace (which is important to python syntax). But ultimately your script does have to check if the file exists. If you can get this snippet added to your code and you see it print that it doesn't exist, before crashing, then that would explain it. 
Otherwise, the file exists but there is some other issue with your being able to read it, such as permissions. 



Reply all
Reply to author
Forward
0 new messages