[Maya-Python] couple of userSetup file questions.

2017-09-11 Thread jettam
Q1 .. Is it okay for Maya (2017) to load two userSetup files upon launch, a 
.mel version and a .py version? 


Q2. I am trying to get maya to auto load my 'see' module upon launch. So I 
add this code to my userSetup.py  Unfortunately this doesnt work. Could 
someone tell me what I am missing in this code.

// PYTHON CONVENIENCE TOOL
from see import see


-- 
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_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/1b028a8e-5868-48f4-81c9-e79faf78145d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] couple of userSetup file questions.

2017-09-11 Thread Justin Israel
On Tue, Sep 12, 2017 at 11:01 AM jettam  wrote:

> Q1 .. Is it okay for Maya (2017) to load two userSetup files upon launch,
> a .mel version and a .py version?
>
>
> Q2. I am trying to get maya to auto load my 'see' module upon launch. So I
> add this code to my userSetup.py  Unfortunately this doesnt work. Could
> someone tell me what I am missing in this code.
>
> // PYTHON CONVENIENCE TOOL
> from see import see
>

If I remember correctly, Maya would pick up the py file first if it exists,
otherwise it would use the mel script (or visa versa?) but I believe you
should only have one or the other.
That import statement looks correct to me, and it is similar to what I do
in my own userSetup.py:

import maya.cmds as cmds
import maya.OpenMaya as om


>
>
> --
> 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_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/1b028a8e-5868-48f4-81c9-e79faf78145d%40googlegroups.com
> 
> .
> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2pw0HE1qhy%3DFuGXVP0nCTF6MMVsePE1MKCFCVx3EKPTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] couple of userSetup file questions.

2017-09-11 Thread Robert White
Maya will exec every single `userSetup.py` files that it finds on 
`sys.path` during startup, into the `__main__` namespace, the GUI won't 
exist yet, so any modifications you want to make to the interface need to 
be wrapped in a function that is passed to `maya.utils.executeDeffered` 
which will trigger during the next idle tick, at which point the GUI will 
exist.

At the end of startup, maya will then run the first `userSetup.mel` that it 
finds on the MAYA_SCRIPT_PATH.

So you can have multiple `userSetup.py` files, but only one `userSetup.mel`.



On Monday, September 11, 2017 at 6:04:29 PM UTC-5, Justin Israel wrote:
>
>
>
> On Tue, Sep 12, 2017 at 11:01 AM jettam > 
> wrote:
>
>> Q1 .. Is it okay for Maya (2017) to load two userSetup files upon launch, 
>> a .mel version and a .py version? 
>>
>>
>> Q2. I am trying to get maya to auto load my 'see' module upon launch. So 
>> I add this code to my userSetup.py  Unfortunately this doesnt work. Could 
>> someone tell me what I am missing in this code.
>>
>> // PYTHON CONVENIENCE TOOL
>> from see import see
>>
>
> If I remember correctly, Maya would pick up the py file first if it 
> exists, otherwise it would use the mel script (or visa versa?) but I 
> believe you should only have one or the other.
> That import statement looks correct to me, and it is similar to what I do 
> in my own userSetup.py:
>
> import maya.cmds as cmds
> import maya.OpenMaya as om
>  
>
>>
>>
>> -- 
>> 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_maya+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/1b028a8e-5868-48f4-81c9-e79faf78145d%40googlegroups.com
>>  
>> 
>> .
>> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/0240a306-5ed1-4402-80bc-089fe3fb15a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] couple of userSetup file questions.

2017-09-11 Thread Robert White
If you're interested in seeing how maya handles `userSetup.py`, the code 
exists here on windows (no clue on other platforms, but probably a similar 
location):
`c:\Program 
Files\Autodesk\Maya2018\Python\Lib\site-packages\maya\app\startup\basic.py`

One extra thing, if you set the `MAYA_SKIP_USERSETUP_PY` environment 
variable, no `userSetup.py` files will be executed. I don't know if there 
is a similar way to block `userSetup.mel`

On Monday, September 11, 2017 at 6:10:13 PM UTC-5, Robert White wrote:
>
> Maya will exec every single `userSetup.py` files that it finds on 
> `sys.path` during startup, into the `__main__` namespace, the GUI won't 
> exist yet, so any modifications you want to make to the interface need to 
> be wrapped in a function that is passed to `maya.utils.executeDeffered` 
> which will trigger during the next idle tick, at which point the GUI will 
> exist.
>
> At the end of startup, maya will then run the first `userSetup.mel` that 
> it finds on the MAYA_SCRIPT_PATH.
>
> So you can have multiple `userSetup.py` files, but only one 
> `userSetup.mel`.
>
>
>
> On Monday, September 11, 2017 at 6:04:29 PM UTC-5, Justin Israel wrote:
>>
>>
>>
>> On Tue, Sep 12, 2017 at 11:01 AM jettam  wrote:
>>
>>> Q1 .. Is it okay for Maya (2017) to load two userSetup files upon 
>>> launch, a .mel version and a .py version? 
>>>
>>>
>>> Q2. I am trying to get maya to auto load my 'see' module upon launch. So 
>>> I add this code to my userSetup.py  Unfortunately this doesnt work. Could 
>>> someone tell me what I am missing in this code.
>>>
>>> // PYTHON CONVENIENCE TOOL
>>> from see import see
>>>
>>
>> If I remember correctly, Maya would pick up the py file first if it 
>> exists, otherwise it would use the mel script (or visa versa?) but I 
>> believe you should only have one or the other.
>> That import statement looks correct to me, and it is similar to what I do 
>> in my own userSetup.py:
>>
>> import maya.cmds as cmds
>> import maya.OpenMaya as om
>>  
>>
>>>
>>>
>>> -- 
>>> 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_maya+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/1b028a8e-5868-48f4-81c9-e79faf78145d%40googlegroups.com
>>>  
>>> 
>>> .
>>> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/5b88ad89-99cd-4651-9cf3-3484f02bc1a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] couple of userSetup file questions.

2017-09-11 Thread Marcus Ottosson
@robert, thanks for that info, goldmine!

@jettam If that comment is present in your userSetup.py then you’ve got a
syntax error and the import would not happen. Try using a # instead of a //

// PYTHON CONVENIENCE TOOLfrom see import see

# PYTHON CONVENIENCE TOOLfrom see import see

​

On 12 September 2017 at 00:13, Robert White 
wrote:

> If you're interested in seeing how maya handles `userSetup.py`, the code
> exists here on windows (no clue on other platforms, but probably a similar
> location):
> `c:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages\maya\
> app\startup\basic.py`
>
> One extra thing, if you set the `MAYA_SKIP_USERSETUP_PY` environment
> variable, no `userSetup.py` files will be executed. I don't know if there
> is a similar way to block `userSetup.mel`
>
> On Monday, September 11, 2017 at 6:10:13 PM UTC-5, Robert White wrote:
>>
>> Maya will exec every single `userSetup.py` files that it finds on
>> `sys.path` during startup, into the `__main__` namespace, the GUI won't
>> exist yet, so any modifications you want to make to the interface need to
>> be wrapped in a function that is passed to `maya.utils.executeDeffered`
>> which will trigger during the next idle tick, at which point the GUI will
>> exist.
>>
>> At the end of startup, maya will then run the first `userSetup.mel` that
>> it finds on the MAYA_SCRIPT_PATH.
>>
>> So you can have multiple `userSetup.py` files, but only one
>> `userSetup.mel`.
>>
>>
>>
>> On Monday, September 11, 2017 at 6:04:29 PM UTC-5, Justin Israel wrote:
>>>
>>>
>>>
>>> On Tue, Sep 12, 2017 at 11:01 AM jettam  wrote:
>>>
 Q1 .. Is it okay for Maya (2017) to load two userSetup files upon
 launch, a .mel version and a .py version?


 Q2. I am trying to get maya to auto load my 'see' module upon launch.
 So I add this code to my userSetup.py  Unfortunately this doesnt work.
 Could someone tell me what I am missing in this code.

 // PYTHON CONVENIENCE TOOL
 from see import see

>>>
>>> If I remember correctly, Maya would pick up the py file first if it
>>> exists, otherwise it would use the mel script (or visa versa?) but I
>>> believe you should only have one or the other.
>>> That import statement looks correct to me, and it is similar to what I
>>> do in my own userSetup.py:
>>>
>>> import maya.cmds as cmds
>>> import maya.OpenMaya as om
>>>
>>>


 --
 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_maya+unsubscr...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/ms
 gid/python_inside_maya/1b028a8e-5868-48f4-81c9-e79faf78145d%
 40googlegroups.com
 
 .
 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/5b88ad89-99cd-4651-9cf3-
> 3484f02bc1a8%40googlegroups.com
> 
> .
>
> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBs6-6BfHLvHqH0RyUmD%3D3QUkct0o0OvYDh4RpAtN-xBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] couple of userSetup file questions.

2017-09-11 Thread jettam
YES!!! Thank you so much Marcus.  I have been tying to solve this one on 
and off for the past 48 hours. I was about to give up on it for the night, 
then your reply turned up :) 


On Monday, September 11, 2017 at 10:35:17 PM UTC-7, Marcus Ottosson wrote:
>
> @robert, thanks for that info, goldmine!
>
> @jettam If that comment is present in your userSetup.py then you’ve got a 
> syntax error and the import would not happen. Try using a # instead of a 
> //
>
> // PYTHON CONVENIENCE TOOLfrom see import see
>
> # PYTHON CONVENIENCE TOOLfrom see import see
>
>

-- 
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_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a7512dda-b076-482f-bc39-595615581e1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] couple of userSetup file questions.

2017-09-11 Thread Marcus Ottosson
No problem, happy to help. :)

On 12 September 2017 at 06:44, jettam  wrote:

> YES!!! Thank you so much Marcus.  I have been tying to solve this one on
> and off for the past 48 hours. I was about to give up on it for the night,
> then your reply turned up :)
>
>
> On Monday, September 11, 2017 at 10:35:17 PM UTC-7, Marcus Ottosson wrote:
>>
>> @robert, thanks for that info, goldmine!
>>
>> @jettam If that comment is present in your userSetup.py then you’ve got
>> a syntax error and the import would not happen. Try using a # instead of
>> a //
>>
>> // PYTHON CONVENIENCE TOOLfrom see import see
>>
>> # PYTHON CONVENIENCE TOOLfrom see import see
>>
>> --
> 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_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/a7512dda-b076-482f-bc39-
> 595615581e1d%40googlegroups.com
> 
> .
>
> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC%2Bk7k_7gsGm2koGKEsr%3DanXWTj7xh7r%2BJUdB5i4-teFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.