Thread cutting script - WIP

 From:  Michael Gibson
5451.60 In reply to 5451.54 
Hi Martin,

> Michael, I use moi:CommandDoneCancel and WaitForDialogDone(). How do I handle the
> Cancel button correctly. At the moment it doesn't work as it should.

WaitForDialogDone will return false if the cancel button was pushed.

So you can do something like (example here taken from Rebuild.js) :

code:
	if ( !WaitForDialogDone() )
		return;


Under normal circumstances where a command just has one factory you can just not call factory.commit() if you want to cancel and any objects that were shown previously from calls to .update() will be automatically cleared out.

But if you've previously called .commit() on any factories, those will be considered complete at the time of the .commit() call so you actually may not want to call .commit() on any ones that are meant to be used for temporary calculations.

- Michael