Re: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Justin Israel
On Sat, 29 Oct 2016, 7:18 AM Padraig O Cuinn 
wrote:

> I don’t get any errors it just doesn’t pass but it does freeze up on me.
>
Please provide a small reproduction of the problem via pastebin or gist.
After Roberts suggestion to correct a naming issue, I can't see anything
else wrong in your small snippets of code.

>
>
> Padraig O Cuinn
>
> Technical Director / Artist
>
> --
> 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/005c01d23147%24b83f7050%2428be50f0%24%40Gmail.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/CAPGFgA1h_A1r4qeos06OQpC9Gjr5yPF-CaSexvHEAe5Rcquyzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Padraig O Cuinn
I don’t get any errors it just doesn’t pass but it does freeze up on me.

 

Padraig O Cuinn

Technical Director / Artist

-- 
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/005c01d23147%24b83f7050%2428be50f0%24%40Gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Robert White
What error exactly are you getting when you try that?


On Friday, October 28, 2016 at 12:50:46 PM UTC-5, Padraig Ó Cuínn wrote:
>
> Nope no difference
>
> On Friday, 28 October 2016 08:58:37 UTC-7, Robert White wrote:
>>
>> Does this work by chance?
>>
>> # File_1 
>> from file_2 import selection as sel
>>
>>
>> def create_window():
>> 
>>  def pushButton():
>>  sel()
>>
>>
>>
>> On Friday, October 28, 2016 at 10:46:26 AM UTC-5, Padraig Ó Cuínn wrote:
>>>
>>> Hi Marcus,
>>>
>>> I am trying to get to selection() which is in a maya code file, The UI 
>>> is built under a create_window() function, in a UI specific file. The 
>>> code is separated from the UI. 
>>>
>>> under create_window() I have another function nested in it for the 
>>> button to call selection() but it is not reaching due to the enclosure,
>>>
>>> File_1 
>>> from file_2 import selection as sel
>>>
>>>
>>> def create_window():
>>> 
>>>  def pushButton():
>>>  file_2.sel()
>>>
>>> File_2
>>> import pymel.core
>>>
>>>
>>> def selection():
>>> pymel.core.selection(n="transforms")
>>>
>>> as you can see there are two files and due to the closure I can't 
>>> execute the selection function. I know I could easily throw it under the 
>>> pushbutton inside the UI but i strictly want UI code alone and maya code 
>>> alone on another file. 
>>>
>>> Thanks again
>>>
>>

-- 
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/8fa92a6d-64d9-48bc-ad46-615ac0d1fa41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Padraig Ó Cuínn
Nope no difference

On Friday, 28 October 2016 08:58:37 UTC-7, Robert White wrote:
>
> Does this work by chance?
>
> # File_1 
> from file_2 import selection as sel
>
>
> def create_window():
> 
>  def pushButton():
>  sel()
>
>
>
> On Friday, October 28, 2016 at 10:46:26 AM UTC-5, Padraig Ó Cuínn wrote:
>>
>> Hi Marcus,
>>
>> I am trying to get to selection() which is in a maya code file, The UI 
>> is built under a create_window() function, in a UI specific file. The 
>> code is separated from the UI. 
>>
>> under create_window() I have another function nested in it for the 
>> button to call selection() but it is not reaching due to the enclosure,
>>
>> File_1 
>> from file_2 import selection as sel
>>
>>
>> def create_window():
>> 
>>  def pushButton():
>>  file_2.sel()
>>
>> File_2
>> import pymel.core
>>
>>
>> def selection():
>> pymel.core.selection(n="transforms")
>>
>> as you can see there are two files and due to the closure I can't execute 
>> the selection function. I know I could easily throw it under the pushbutton 
>> inside the UI but i strictly want UI code alone and maya code alone on 
>> another file. 
>>
>> Thanks again
>>
>

-- 
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/e898505d-1c98-4e19-aeb4-8b6ecd906eb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Robert White
Does this work by chance?

# File_1 
from file_2 import selection as sel


def create_window():

 def pushButton():
 sel()



On Friday, October 28, 2016 at 10:46:26 AM UTC-5, Padraig Ó Cuínn wrote:
>
> Hi Marcus,
>
> I am trying to get to selection() which is in a maya code file, The UI is 
> built under a create_window() function, in a UI specific file. The code 
> is separated from the UI. 
>
> under create_window() I have another function nested in it for the button 
> to call selection() but it is not reaching due to the enclosure,
>
> File_1 
> from file_2 import selection as sel
>
>
> def create_window():
> 
>  def pushButton():
>  file_2.sel()
>
> File_2
> import pymel.core
>
>
> def selection():
> pymel.core.selection(n="transforms")
>
> as you can see there are two files and due to the closure I can't execute 
> the selection function. I know I could easily throw it under the pushbutton 
> inside the UI but i strictly want UI code alone and maya code alone on 
> another file. 
>
> Thanks again
>

-- 
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/a6ed571e-c9ef-4274-a263-cfd47d779837%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Padraig Ó Cuínn
Hi Marcus,

I am trying to get to selection() which is in a maya code file, The UI is 
built under a create_window() function, in a UI specific file. The code is 
separated from the UI. 

under create_window() I have another function nested in it for the button 
to call selection() but it is not reaching due to the enclosure,

File_1 
from file_2 import selection as sel


def create_window():

 def pushButton():
 file_2.sel()

File_2
import pymel.core


def selection():
pymel.core.selection(n="transforms")

as you can see there are two files and due to the closure I can't execute 
the selection function. I know I could easily throw it under the pushbutton 
inside the UI but i strictly want UI code alone and maya code alone on 
another file. 

Thanks again

-- 
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/722fd689-aeb6-4298-a54b-90e718ae211c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Help with a closure in Maya and Python.

2016-10-28 Thread Marcus Ottosson
I can't understand the problem. Would it be possible to rephrase the
question, and possibly supply an example UI to illustrate what you are
experiencing problems with?

An imported module follows the same rules as any object; like a class. So
your example doesn't necessarily need to include multiple files, which
could simplify things.

-- 
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/CAFRtmODvRkvfbWZo6U_RzNs-g0xvtBBgt6ChLyxFFGMR8Z%3Dyug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Help with a closure in Maya and Python.

2016-10-27 Thread Padraig Ó Cuínn
Hi everyone. 

I am trying to figure a way out of exiting a closure and executing the 
nested function within it. 
So far I have only seen on the net closures within the 1 file. let me show 
you what I mean. 

#File_1

def pressButton():
for nodes in file_2.selection():
print nodes


pressButton is nested in a function called create_window

#File_2

def selection():
pymel.core.selection(n="transforms")

selection is the function I want to call from pressButton() but is imported 
from another file.

I am looking for most efficient way to escape this closure while still 
maintaining functionality of the UI.

Thanks in advance.

-- 
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/740e93d4-3934-42b1-9b9a-1cc5fe78ae60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.