Introduction to Maya - Rendering in Arnold
This course will look at the fundamentals of rendering in Arnold. We'll go through the different light types available, cameras, shaders, Arnold's render settings and finally how to split an image into render passes (AOV's), before we then reassemble it i
# 1 25-06-2005 , 12:56 PM
Enivob's Avatar
Registered User
Join Date: Jun 2004
Posts: 3

DoEvents in MEL?

Hi All,

There is a command in Visual Basic called "DoEvents" this allows the system to process normally while you are waiting in a loop. I need Maya to do the same thing.

Consider this code.

Code:
// Wait for an object to be select.

string  $allObjects[];
string  $obj;
select -cl;
$allObjects = `ls -sl -o`;
while (size($allObjects) = 0)
{
	//Wait until we get something in our list
	$allObjects = `ls -sl -o`;
}
print ($allObjects[1] + "\n");
I want to clear the selection then wait for the user to pick an object. But this code locks up Maya because the while is an infinite loop until a selection is made. But because it is an infinite loop, no selection can be made. I need to instruct Maya in the inifnite loop to "Act normally" or "DoEvents" as in Visual basic. Does anyone have a sloution or work around for this?

Thanks,

Enivob

# 2 25-06-2005 , 02:25 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
You need to use script jobs for that. Look it up in the manual.


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads