Script job in userSetup.mel freezes Maya at start.

Script job in userSetup.mel freezes Maya at start.

malcolm_341
Collaborator Collaborator
368 Views
2 Replies
Message 1 of 3

Script job in userSetup.mel freezes Maya at start.

malcolm_341
Collaborator
Collaborator

Hi, I'm trying to start a script job when Maya starts by putting it in the userSetup.mel file. For some reason my script job keeps Maya from starting and the program is hung while loading the the lookdev plugin while also hammering the CPU I think. Any way to get this script job to run without freezing Maya? I already tried evalDeferred and it produced the same hang.

 

scriptJob -runOnce 0 -compressUndo 1 -event "idle" "m341_extraHUD_refreshTimer";

0 Likes
Accepted solutions (1)
369 Views
2 Replies
Replies (2)
Message 2 of 3

brentmc
Autodesk
Autodesk
Accepted solution

Hi,

Maya will only run a single normal priority idle event each time through the event loop so having a persistent idle event can prevent lower priority idle events from running.

So I would first suggest either changing the event to "idleVeryLow" which will only be run if there are no other higher priority idle events. (and seems to be missing from the scriptJob command documentation)

There is also "idleHigh" which always gets run (and I don't think will starve lower priority idle events) but I would recommend trying "idleVeryLow" first.

Brent McPherson
Principle Engineer
Message 3 of 3

malcolm_341
Collaborator
Collaborator

@brentmcThanks! That's working, now I can get my script to trigger after Maya's been restarted which is a big improvement to the functionality of the tool. Thanks for your help.

0 Likes