Finished ZScript (with code): ZTimer
Pixolator's promise of a timing zscript here 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.
Last edited by marcus_civis; 02-05-05 at 07:42 AM.
Reason: Added code for switching off Show Actions
now you must take a break from coding cool stuff and work on your AMNC piece!!
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.
aminuts: thanks, I'm working on my AMNC entry, really I am!
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.
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.
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.
Thanks, I'm glad you like it!