Newbie (Hi) Third Party Python Script issue !

88 views
Skip to first unread message

The Christopher

unread,
Nov 23, 2014, 12:04:14 AM11/23/14
to python_in...@googlegroups.com
Hi, I'm new to Python programming in Maya, actually really new, in other words I won't be as active for a while.  In the meantime I was hoping someone can help me with a script to iron out a problem ?

Justin Israel

unread,
Nov 23, 2014, 12:38:15 AM11/23/14
to python_in...@googlegroups.com
Hi

Welcome to the group!

We have plenty of members here that are just getting started. Feel free to ask questions. Just do your best to ask focused questions with examples of what you tried and what you expected, and you should be able to receive focused answers. And put long code samples in a pastebin link (or avoid long code samples)

If it's getting started with Python in general, it will also help to go through some basic tutorials first before asking the group about fundamental python.

Enjoy!

On Sun, 23 Nov 2014 6:04 PM The Christopher <crestchr...@gmail.com> wrote:
Hi, I'm new to Python programming in Maya, actually really new, in other words I won't be as active for a while.  In the meantime I was hoping someone can help me with a script to iron out a problem ?

--
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/4d7e3e6b-c7d6-48d6-8efc-3e5be871c237%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Crest Christopher

unread,
Nov 23, 2014, 1:40:15 AM11/23/14
to python_in...@googlegroups.com
Thanks, I appreciate it.

For now, I have a script I would love if someone on this list could help me with.  The script works, but there is a little issue that plaques me, I'm not the author of the script, and I've tried to get help from the author without much success.

Christopher

Sunday, November 23, 2014 12:38 AM
Hi

Welcome to the group!

We have plenty of members here that are just getting started. Feel free to ask questions. Just do your best to ask focused questions with examples of what you tried and what you expected, and you should be able to receive focused answers. And put long code samples in a pastebin link (or avoid long code samples)

If it's getting started with Python in general, it will also help to go through some basic tutorials first before asking the group about fundamental python.

Enjoy!

--
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.

For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 12:04 AM

Justin Israel

unread,
Nov 23, 2014, 6:19:20 AM11/23/14
to python_in...@googlegroups.com
Post the script on a pastebin. Copy what you did and the errors your are getting. Can't help until we see something.

Crest Christopher

unread,
Nov 23, 2014, 11:53:51 AM11/23/14
to python_in...@googlegroups.com
The script is available online "UV Deluxe", or do you prefer I post the code as well ?

Clicking any one of the tabs within the tool causes this error;

box is false
# Error: 13
# Traceback (most recent call last):
#   File "<custom path>\UVDeluxe\uvdeluxe.py", line 230, in <lambda>
#     ec=lambda *args:uis.setUiState())
#   File "<custom path>\UVDeluxe\uistates.py", line 88, in setUiState
#     UiStates.pickleDump(self)
#   File "<custom path>\UVDeluxe\uistates.py", line 36, in pickleDump
#     datafile = open(UiStates.path+UiStates.filename,'w')
# IOError: [Errno 13] Permission denied: 'C:/config.uvd' #

Christopher
Sunday, November 23, 2014 6:19 AM
Post the script on a pastebin. Copy what you did and the errors your are getting. Can't help until we see something.

--
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.

For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 1:39 AM

Marcus Ottosson

unread,
Nov 23, 2014, 12:40:42 PM11/23/14
to python_in...@googlegroups.com
Crest, I would love nothing more than to help you solve this problem, but you're not making it very easy.

If you have a look at some of the other questions in this list, or on StackOverflow, you'll find that the best thing for you to do would be for you to share an isolated snippet of code with the problem. That way, I could more easily determine what may be causing this issue.

Also, for the best possible answers, I would strongly suggest skimming this.


For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Justin Israel

unread,
Nov 23, 2014, 2:06:17 PM11/23/14
to python_in...@googlegroups.com
Presumably the tool is trying to write out a data file to your C: drive, and does not have permission.
Without the link to the source, I can't be sure, but is there an input for telling it where to store this file? Apparently your C: root is not a sufficient location.

Marcus Ottosson

unread,
Nov 23, 2014, 4:48:53 PM11/23/14
to python_in...@googlegroups.com
Reading my reply again, I find that it probably came off a little blunt. Sorry about that, Crest.

--
Marcus Ottosson
konstr...@gmail.com


Crest Christopher

unread,
Nov 23, 2014, 11:15:55 PM11/23/14
to python_in...@googlegroups.com
Apology accepted.  :-)

What I originally meant was, if you download the script, the problem comes when using it, there is no problem trying to get it to work or anything of that nature.  The problem is strictly once ran and clicking one of the menus I get the error mentioned in my previous message in the script error, and it is that error I hope I can eliminate so the script runs clean. 

There is no script for me to post in pastebin, although if no one wants to download the script on their own, I will post the individual code files for analyzing if needed ?

Thanks again everyone !

Christopher

Sunday, November 23, 2014 4:48 PM
--
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.

For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 2:06 PM
Presumably the tool is trying to write out a data file to your C: drive, and does not have permission.
Without the link to the source, I can't be sure, but is there an input for telling it where to store this file? Apparently your C: root is not a sufficient location.

--
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.

For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 12:40 PM
Crest, I would love nothing more than to help you solve this problem, but you're not making it very easy.

If you have a look at some of the other questions in this list, or on StackOverflow, you'll find that the best thing for you to do would be for you to share an isolated snippet of code with the problem. That way, I could more easily determine what may be causing this issue.

Also, for the best possible answers, I would strongly suggest skimming this.




--
Marcus Ottosson
konstr...@gmail.com

--
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/CAFRtmOCtA2TbONjDHKJEVtgCA-fxhrN4VLUCG9xUkXYYsmY7PQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 11:53 AM

kevco...@gmail.com

unread,
Nov 24, 2014, 11:42:00 PM11/24/14
to python_in...@googlegroups.com
dood. just post the code that's in the script.

Paul Molodowitch

unread,
Nov 25, 2014, 12:43:28 PM11/25/14
to python_inside_maya
Ok, nobody here wants to be a jerk, but I think it needs to be said, so...

Christopher, you're not really using this list for it's intended purpose. While most people here are happy to help if someone shows at least an interest in learning scripting / programming, you really haven't demonstrated any desire to do so.

Instead, what you've done is post a very vague "plea for help" with somebody else's script.  I doubt anybody on this list signed up because they wanted to offer general help-desk service for anybody with a problem in Maya - or anybody with a problem running a script in Maya.

While people will step in and help with these sort of pleas for help from time to time - because most people are nice, and like to help - if this list starts accumulating too many of these requests, folks will start ignoring it and stop using it.  Which would be a shame.

In other words - please don't post to this list unless you're genuinely looking to learn python scripting. Thanks!

On Mon, Nov 24, 2014 at 8:42 PM, <kevco...@gmail.com> wrote:
dood.  just post the code that's in the script.
--
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.

Marcus Ottosson

unread,
Nov 25, 2014, 2:42:58 PM11/25/14
to python_in...@googlegroups.com
That's what I meant to say. Well put, Paul.


For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Crest Christopher

unread,
Nov 26, 2014, 12:47:43 AM11/26/14
to python_in...@googlegroups.com
File A  code - [Link]
File B code - [Link]

Here are the links to the source !

Christopher
Sunday, November 23, 2014 2:06 PM
Presumably the tool is trying to write out a data file to your C: drive, and does not have permission.
Without the link to the source, I can't be sure, but is there an input for telling it where to store this file? Apparently your C: root is not a sufficient location.

--
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.

For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 12:40 PM
Crest, I would love nothing more than to help you solve this problem, but you're not making it very easy.

If you have a look at some of the other questions in this list, or on StackOverflow, you'll find that the best thing for you to do would be for you to share an isolated snippet of code with the problem. That way, I could more easily determine what may be causing this issue.

Also, for the best possible answers, I would strongly suggest skimming this.




--
Marcus Ottosson
konstr...@gmail.com

--
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/CAFRtmOCtA2TbONjDHKJEVtgCA-fxhrN4VLUCG9xUkXYYsmY7PQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Sunday, November 23, 2014 11:53 AM

Eduardo Grana

unread,
Nov 26, 2014, 6:14:16 AM11/26/14
to python_in...@googlegroups.com
Hello Christopher,

try replacing C: (__file__.split('\\')[0]) for you user's home path,
maybe that way you can check if the problem is with writing permissions.
where it says (uistates.py line 9)

class UiStates():
        filename = 'config.uvd'
        path = __file__.split('\\')[0]+'/'

change it to:

class UiStates():
        filename = 'config.uvd'
        #path = __file__.split('\\')[0]+'/'
        path = os.environ['HOMEDRIVE']+os.environ['HOMEPATH'].replace('\\','/')+'/'

Cheers,
Eduardo


For more options, visit https://groups.google.com/d/optout.



--

Crest Christopher

unread,
Nov 26, 2014, 9:52:26 AM11/26/14
to python_in...@googlegroups.com
Hi, the problem has be solved, thank you, no more error. 

What exactly was the problem, it was trying to write to the root drive ?

Christopher

Wednesday, November 26, 2014 6:14 AM
Hello Christopher,

try replacing C: (__file__.split('\\')[0]) for you user's home path,
maybe that way you can check if the problem is with writing permissions.
where it says (uistates.py line 9)

class UiStates():
        filename = 'config.uvd'
        path = __file__.split('\\')[0]+'/'

change it to:

class UiStates():
        filename = 'config.uvd'
        #path = __file__.split('\\')[0]+'/'
        path = os.environ['HOMEDRIVE']+os.environ['HOMEPATH'].replace('\\','/')+'/'

Cheers,
Eduardo




--
--
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.

For more options, visit https://groups.google.com/d/optout.
Wednesday, November 26, 2014 12:47 AM

Marcus Ottosson

unread,
Nov 26, 2014, 10:57:20 AM11/26/14
to python_in...@googlegroups.com

os.environ['HOMEDRIVE']+os.environ['HOMEPATH'].replace('\\','/')+'/'

Ugh, don’t do manual path concatenation! :)

import os
path = os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH'])

Better yet, use expanduser

import os
path = os.path.expanduser("~")

That way it isn’t dependent on Windows.



For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Eduardo Grana

unread,
Nov 26, 2014, 10:58:19 AM11/26/14
to python_in...@googlegroups.com
Well it's a windows thing, try to create a new file on your c: drive root, and probably you'l get
a prompt asking for a user or a password, or simply you will get a denial.
if this is the case, it's because your account doesn't have enough privileges to write there.
maybe if you created a folder (like 'C:/temp/'), you can create files in there.
Cheers,
Eduardo


For more options, visit https://groups.google.com/d/optout.



--

Eduardo Grana

unread,
Nov 26, 2014, 12:30:34 PM11/26/14
to python_in...@googlegroups.com
Hey Christopher,
Marcus is right  ;)
Anyway ,i don't know how the script handles de paths later,
and if it doesn't work with the \\ path
try something like this
path = os.path.expanduser("~")
path = path.replace('\\','/')+'/'
and it will be left just like he original version uses it.
Something about the  __file__.split('\\')[0]+'/' tells me it not a platform independent script...
Cheers,
Eduardo




For more options, visit https://groups.google.com/d/optout.



--

Crest Christopher

unread,
Nov 26, 2014, 8:05:50 PM11/26/14
to python_in...@googlegroups.com
Marcus, I assume you are suggesting I change that line ? :-)

Christopher

Wednesday, November 26, 2014 10:57 AM

Ugh, don’t do manual path concatenation! :)

import os
path = os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH'])

Better yet, use expanduser

import os
path = os.path.expanduser("~")

That way it isn’t dependent on Windows.





--
Marcus Ottosson
konstr...@gmail.com

--
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.

For more options, visit https://groups.google.com/d/optout.
Wednesday, November 26, 2014 9:52 AM
Reply all
Reply to author
Forward
0 new messages