Maya Window UI create Event?

105 views
Skip to first unread message

Arvid Schneider

unread,
Oct 26, 2014, 10:29:13 AM10/26/14
to python_in...@googlegroups.com
Hey Group, 

I am trying to figure out how to register an ui create event. What I am trying to achieve is run a  script when the renderViewWindow opens.
Arvid

Justin Israel

unread,
Oct 26, 2014, 5:59:04 PM10/26/14
to python_in...@googlegroups.com
It might be something that you either have to create a custom event for, in the API, or to hook into the Qt events for the app and watch for a showEvent(). That is my guess.

--
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/34e8c823-5648-4269-a542-4eb57e1f4bb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arvid Schneider

unread,
Oct 26, 2014, 7:38:33 PM10/26/14
to python_in...@googlegroups.com
I will give it a try. I was looking in the API already, but couldnt find anything useful. 
How would you go about to create a custom even?

It would be great if that would work:

while not pm.window('renderViewWindow', q = True, ex = True):
    print 'renderView Closed'
else:
    runFunction

I will have a look in the Qt Events though





'On Sunday, October 26, 2014 10:59:04 PM UTC+1, Justin Israel wrote:
It might be something that you either have to create a custom event for, in the API, or to hook into the Qt events for the app and watch for a showEvent(). That is my guess.
On Mon, Oct 27, 2014 at 3:29 AM, Arvid Schneider <arvidsc...@gmail.com> wrote:
Hey Group, 

I am trying to figure out how to register an ui create event. What I am trying to achieve is run a  script when the renderViewWindow opens.
Arvid

--
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+unsub...@googlegroups.com.

Justin Israel

unread,
Oct 26, 2014, 7:47:49 PM10/26/14
to python_in...@googlegroups.com
I've never actually create and registered a custom event before. But I assume you would have to do the same thing, latching onto showEvents through Qt. You wouldn't want to do anything that is polling at intervals. It would be Qt telling you when windows are shown, and you would have to check the objectName to see if it is one that you care about.

Maybe there is another way, but I didn't see anything possible through the message API 


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/c126bf44-8ae9-4b6a-a23f-62b58099ecb6%40googlegroups.com.

Michael Boon

unread,
Nov 3, 2014, 8:39:14 PM11/3/14
to python_in...@googlegroups.com
Arvid, did you have any luck with this? I'm trying to do the same thing and haven't figured out how yet.


On Monday, 27 October 2014 10:47:49 UTC+11, Justin Israel wrote:
I've never actually create and registered a custom event before. But I assume you would have to do the same thing, latching onto showEvents through Qt. You wouldn't want to do anything that is polling at intervals. It would be Qt telling you when windows are shown, and you would have to check the objectName to see if it is one that you care about.

Maybe there is another way, but I didn't see anything possible through the message API 

On Mon, Oct 27, 2014 at 12:38 PM, Arvid Schneider <arvidsc...@gmail.com> wrote:
I will give it a try. I was looking in the API already, but couldnt find anything useful. 
How would you go about to create a custom even?

It would be great if that would work:

while not pm.window('renderViewWindow', q = True, ex = True):
    print 'renderView Closed'
else:
    runFunction

I will have a look in the Qt Events though





'On Sunday, October 26, 2014 10:59:04 PM UTC+1, Justin Israel wrote:
It might be something that you either have to create a custom event for, in the API, or to hook into the Qt events for the app and watch for a showEvent(). That is my guess.
On Mon, Oct 27, 2014 at 3:29 AM, Arvid Schneider <arvidsc...@gmail.com> wrote:
Hey Group, 

I am trying to figure out how to register an ui create event. What I am trying to achieve is run a  script when the renderViewWindow opens.
Arvid

--
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+unsubscribe@googlegroups.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_maya+unsub...@googlegroups.com.

Michael Boon

unread,
Nov 3, 2014, 10:47:47 PM11/3/14
to python_in...@googlegroups.com
Actually I think I got it. I updated my "Adding Controls to the Hypershade" thread at https://groups.google.com/forum/#!topic/python_inside_maya/P3XXQnWIT9k

The solution would work the same way here, except you'd have to check child.objectName() == 'renderViewWindow' 

Arvid Schneider

unread,
Nov 4, 2014, 5:42:28 PM11/4/14
to python_in...@googlegroups.com
Hey thanks Michael! 
I will check right into that! 
I will keep you posted
Reply all
Reply to author
Forward
0 new messages