PDA

View Full Version : Finished ZScript (with code): ZTimer


marcus_civis
02-04-05, 02:49 PM
Pixolator's promise of a timing zscript here (http://www.zbrushcentral.com/zbc/showthread.php?p=190286#post190286) set me thinking and I came up with this. It's pretty basic but may be useful.

It works pretty much like a stop watch. Start and stop it at any time during a ZBrush session. It doesn't need to stay loaded - simply press Start to start the timer and you can then call other zscripts or whatever. Just reload it when you want to Stop it or see how much time has elapsed by pressing the Time? button. Press 'Clear' after stopping to reset timer. The time setting is saved between ZBrush sessions (whether 'Stop' is pressed or not) as long as the timer is loaded when exiting ZBrush.

The code is included in the zip.

aminuts
02-04-05, 10:54 PM
cool Marcus.....

now you must take a break from coding cool stuff and work on your AMNC piece!!

Svengali
02-05-05, 06:05 PM
Another helpful post! Way to go Marcus! Thank you.

I'm inspired to use this somehow to try adding a timer to the PSnap plugin. Someone suggested it when PSnap was first posted but I didn't think a timer could be done. You and Pix have shown that it can.

Sven

marcus_civis
02-06-05, 12:35 AM
aminuts: thanks, I'm working on my AMNC entry, really I am! :D

Sven: I do hope you will add in a timer functionality to PSnap; that would be a great addition to an already useful plugin and I'm sure would please a lot of people.

Svengali
02-06-05, 07:01 PM
Marcus,

Well, I gave it a go but can't see how to use SLEEP to interrupt another active script to do an automatic save or even manage a warning "beep". If it's possible I'd be pleased if someone could show the way.

Perhaps when Pixologic releases the SDK, it will provide us a way.

Thanks for your other SLEEP command demos which WILL work very well for the Ctrl+button "HELP" operation I talked about. :)

Sven

Ron Harris
02-06-05, 09:59 PM
the timer works like a charm..thank you.....no problems at all.

ron:tu: :cool: :tu:

marcus_civis
02-07-05, 06:30 AM
Sven,
That's a pity; I had thought that the Sleep function in a plugin would stay loaded but hadn't tried it out. I can get the script to ring a bell on exit (using the ZScript shutdown Sleep event) but even that doesn't always work. It works fine for some scripts like PM but for some plugin buttons it doesn't. I had thought that maybe Pix's TimeLapse script used Sleep but if it does then there's some magic involved too, perhaps with the dll. Writing a dll to do the job is presumably possible but I've no idea how to go about that, at the moment.


Ron,
Thanks, I'm glad you like it! :)