Right, so it means you can import a custom module from an arbitrary path
on your system, so if you unpack NSUV into wherever you put foo.py, you
should be able to import NSUV.


On Thu, Apr 30, 2015, at 12:35 PM, Crest Christopher wrote:
> I did 'import foo' and there are no errors ?
>
>
Anthony Tan wrote:
>>
>>
foo is just a placeholder, just like you'll see reference made in
>>
python docs to 'spam', 'eggs', (and possibly 'lumberjack') as
>>
placeholders for things.
>>
If you're asking in terms of what foo.py is in the example? It's a
>>
file you make, that is literally called foo.py, and contains a single
>>
newline, so you can 'import foo' and see if you get errors.
>>
On Thu, Apr 30, 2015, at 12:22 PM, Crest Christopher wrote:
>>>
>>>
Sorry, what is this foo.py file you are referring too ?
>>>
Anthony Tan wrote:
>>>>
>>>>
There's an environment config that results in the paths as per the
>>>>
last dump - however it's gotten into this state isn't material though,
>>>>
this is just a list of paths for the python interpreter to sear ch.
>>>>
When you run an import statement, your interpreter will roll through
>>>>
those paths in order (first in the list, to the last) to find
>>>>
something that is importable. It's either going to be a bare python
>>>>
file, or a directory which houses an __init__.py file. For argument's
>>>>
sake, I'm just going to make reference to foo.py which is a file
>>>>
literally called 'foo.py' and contains a single newline.
>>>>
Based on that, looking at your last sys.path dump, assuming you want
>>>>
to import foo in terms of priority the last place to be searched wil l
>>>>
be C:/Custom Program Settings/Maya_Resources/Preferences/scripts and
>>>>
you should put foo.py there. Theoretically, you could also shove
>>>>
foo.py in C:\Custom Program Settings\Maya_Resources\pythonscripts as
>>>>
well. (These appear to be paths you've set explicitly via PYTHONPATH
>>>>
in maya.env, and implicitly via MAYA_APP_DIR in your windows
>>>>
environment config by the way)
>>>>
If setting up a foo.py thing as described above works, then
>>>>
theoretically, NSUV should also work. If it doesn't, then well, what
>>>>
imports for custom packages you've installed work and where do they
>>>>
come from? For example, if you do an import os, and then say, print os
>>>>
it should tell you that it's a module loaded from C:\Program
>>>>
Files\Autodesk\Maya2013\bin\python26.zip\os.py
>>>>
It's not a *clean* way to do things, but you could theoretically slam
>>>>
foo.py into one of those directories where you've got a working
>>>>
module, just to see what the heck is goin g on.
>>>>
On Thu, Apr 30, 2015, at 11:30 AM, Christopher. wrote:
>>>>>
>>>>>
>>>>>
I've run this command import sys
>>>>>
for pythonPath in sys.path:
>>>>>
print pythonPath
>>>>>
I have 42 python paths, this may be the problem, how do I know what
>>>>>
python path to place python scripts; since obviously the Maya.env
>>>>>
file is not being read where the python scripts are placed ? I don't
>>>>>
understand why I'm having thi s many problems for something that is
>>>>>
relatively easy, I really must say at this point WTF.
>>>>>
On Sunday, April 19, 2015 at 4:06:29 PM UTC-4, Justin Israel wrote:
>>>>>
>>>>>
Not sure how to solve your problem at this point then. Seems you
>>>>>
have a ghost in the machine.
>>>>>
Did you try removing the custom Maya env and trying a standard
>>>>>
install to a scripts location?
>>>>>
>>>>>
On Mon, 20 Apr 2015 1:46 AM Christopher. <[email protected]>
>>>>>
wrote:
>>>>>
>>>>>
I can confirm I see the location where NSUV exists using the
>>>>>
command you posted.
>>>>>
On Sunday, April 19, 2015 at 12:41:30 AM UTC-4, Justin Israel
>>>>>
wrote:
>>>>>
>>>>>
That is where I think your problem is. If you have made a
>>>>>
custom script location, and set that as your maya script
>>>>>
path, and placed a python package in there, then it won't
>>>>>
work. Maya by default has the default script locations
>>>>>
also on the PYTHONPATH. But in your custom Maya script
>>>>>
location, I doubt it too is on the PYTH ONPATH. Can you do
>>>>>
the following from the Script Editor
>>>>>
>>>>>
import sys
>>>>>
for p in sys.path:
>>>>>
print p
>>>>>
>>>>>
And confirm that you see the location where your NSUV
>>>>>
python package exists?
>>>>>
>>>>>
On Sun, 19 Apr 2015 11:08 AM Christopher.
>>>>>
<[email protected]> wrote:
>>>>>
>>>>>
&n bsp; MAYA_SCRIPT_PATH = C:\[folder
>>>>>
name]\[sub-folder-name]\scripts
>>>>>
PYTHONPATH = C:\""\""\pythonscripts\
>>>>>
That is exactly how I have it laid out in my Maya.env
>>>>>
file. All script get placed in the scripts folder,
>>>>>
all python scripts, get placed in the python folder.
>>>>>
In this case NSUV gets placed in the scripts folder,
>>>>>
; I have tested it in the python scripts folder as well
>>>>>
with no positive results.
>>>>>
On Saturday, April 18, 2015 at 4:20:17 PM UTC-4,
>>>>>
Justin Israel wrote:
>>>>>
>>>>>
I just grabbed a copy of that Nightshade plugin
>>>>>
and tried it. Worked right away. Are you sure you
>>>>>
followed the instructions? I just copied over the
>>>>>
c ontents of the bundled "scripts" directory to my
>>>>>
Maya's scripts location. I happened to put it in
>>>>>
the shared scripts location, on my mac:
>>>>>
>>>>>
|$ ls -1 /Users/justin/Library/Preferences/Autodesk/maya/scripts
>>>>>
NSUV
>>>>>
calcUVStats.py
>>>>>
&n bsp; texturePanel_NSUV.mel
>>>>>
texturePanel_NSUV_2015.mel
>>>>>
textureWindowCreateToolBar_NSUV.mel
>>>>>
textureWindowCreateToolBar_NSUV_2014.mel
>>>>>
textureWindowCreateToolBar_NSUV_2015.mel
>>>>>
|
>>>>>
>>>>>
>>>>>
The NSUV package gets picked up because the
>>>>>
shared scripts location is on the default Maya
>>>>>
pythonpath
>>>>>
>>>>>
Maybe post what your installation location looks
>>>>>
like? I haven't tried to customize my Maya.env to
>>>>>
point specifically to this or anything. More
>>>>>
information would be helpful.
>>>>>
>>>>>
>>>>>
On Sun, Apr 19, 2015 at 7:41 AM johan Borgström
>>>>>
<[email protected]> wrote:
>>>>>
>>>>>
Maybe a missing __init__.py ?
>>>>>
>>>>>
--
>>>>>
You received this message because you are
>>>>>
subs cribed 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
>>>>>
[email protected].
>>>>>
To view this discussion on the web visit
>>>>>
https://groups.google.com/d/msgid/python_inside_maya/b51db530-6074-437e-93e0-07675264f128%40googlegroups.com
>>>>>
<https://groups.google.com/d/msgid/python_inside_maya/b51db530-6074-437e-93e0-07675264f128%40googlegroups.com>.
>>>>>
For more options, visit
>>>>>
https://groups.google.com/d/optout
>>>>>
<https://group s.google.com/d/optout>.
>>>>>
>>>>>
>>>>>
--
>>>>>
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
>>>>>
[email protected].
>>>>>
&nbs p; To view this discussion on the web visit
>>>>>
https://groups.google.com/d
/msgid/python_inside_maya/667c64a9-f646-40be-b276-45606081541f%40googlegroups.com
>>>>>
<https://groups.google.com/d/msgid/python_inside_maya/667c64a9-f646-40be-b276-45606081541f%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>>>>
For more options, visit
>>>>>
https://groups.google.com/d/optout
>>>>>
<https://groups.google.com/d/optout>.
>>>>>
>>>>>
>>>>>
&nbs p; --
>>>>>
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
>>>>>
[email protected].
>>>>>
To view this discussion on the web visit
>>>>>
https://groups.google.com/d/msgid/python_inside_maya/5ab9d017-7194-47c1-a71b-59d82d2aa4ee%40googlegroups.com
>>>>>
<https://groups.google.com/d/msgid/python_inside_maya/5ab9d017-7194-47c1-a71b-59d82d2aa4ee%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>>>>
&n b sp; For more options, visit https://groups.google.com/d/optout
>>>>>
<https://groups.google.com/d/optout>.
>>>>>
>>>>>
>>>>>
--
>>>>>
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 [email protected]
>>>>>
<mailto:[email protected]>.
>>>>>
To view this discussion on the web visit
>>>>>
https://groups.google.com/d/msgid/python_inside_maya/d2836700-98bf-48b0-99a7-9a751e557b97%40googlegroups.com
>>>>>
>>>>>
<https://groups.google.com/d/msgid/python_inside_maya/d2836700-98bf-48b0-99a7-9a751e557b97%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>>>>
For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
--
>>>>
You received this message because you are subscribed to a topic in the
>>>>
Google Groups "Python Programmin g for Autodesk Maya" group.
>>>>
To unsubscribe from this topic, visit
>>>>
https://groups.google.com/d/topic/python_inside_maya/bkJcnVhSI0Y/unsubscribe.
>>>>
To unsubscribe from this group and all its topics, send an email to
>>>>
[email protected]
>>>>
<mailto:[email protected]>.
>>>>
To view this discussion on the web visit
>>>>
https://groups.google.com/d/msgid/python_inside_maya/1430359830.4177396.260591381.49F64D36%40webmail.messagingengine.com
>>>>
>>>>
<https://groups.google.com/d/msgid/python_inside_maya/1430359830.4177396.260591381.49F64D36%40webmail.messagingengine.com?utm_medium=email&utm_source=footer>.
>>>>
For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>>
--
>>>>
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 ema il to [email protected]
>>>>
<mailto:[email protected]>.
>>>>
To view this discussion on the web visit
>>>>
https://groups.google.com/d/msgid/python_inside_maya/554191F5.500%40gmail.com
>>>>
<https://groups.google.com/d/msgid/python_inside_maya/554191F5.500%40gmail.com?utm_medium=email&utm_source=footer>.
>>>>
For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
--
>>
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/bkJcnVhSI0Y/unsubscribe.
>>
To unsubscribe from this group and all its topics, send an email to
>>
[email protected]
>>
<mailto:[email protected]>.
>>
To view this discussion on the w eb visit
>>
https://groups.google.com/d/msgid/python_inside_maya/1430361010.4180221.260594849.5F64FAA5%40webmail.messagingengine.com
>>
<https://groups.google.com/d/msgid/python_inside_maya/1430361010.4180221.260594849.5F64FAA5%40webmail.messagingengine.com?utm_medium=email&utm_source=footer>.
>>
For more options, visit https://groups.google.com/d/optout.
>>


>> --
>>
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 [email protected].
>>
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/554194DC.6060507%40gmail.com[1].
>>
For more options, visit https://groups.google.com/d/optout.



Links:

  1. 
https://groups.google.com/d/msgid/python_inside_maya/554194DC.6060507%40gmail.com?utm_medium=email&utm_source=footer

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/1430361480.4183083.260597985.42023AFC%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to