1. #1
    Senior Member Follow User Gallery
    Join Date
    Jun 2004
    Posts
    361

    Post Pausing ZScripts

    A few people have asked if it's possible to pause those long, recorded ZScripts...

    The problem is, if you pause the ZScript, change some settings, then resume, the rest of the ZScript will not function properly.

    However, I do have a solution that might make some of you happy... It makes use of a Routine: a smaller snippet of ZScript coding that can be called over and over.

    Here's the way it works: it checks to see if the left mouse button is pressed; if so it displays a note until the button is pressed again.

    Furthermore, some of you may have noticed that there's a setting called "Replay Delay" in the ZScript palette; it only delays the ZScript playback when a CanvasStroke action is happening -- not when jumping around the ZBrush interface to select items.

    This Routine also checks to see if the SHOW ACTIONS button is pressed; if so it uses the value of this "Replay Delay" slider to wait before performing another action.

    Here's the Routine, followed by some explanation:
    <blockquote><table border="0" cellpadding="6" cellspacing="0" bgcolor="#cccccc"><tr><td bgcolor="#cccccc"><font color="black" size="2">[RoutineDef,PauseDelay,
    [If,[MouseLButton],
    [Note,"ZScript Paused -- Click to continue",0,,,1]
    ]

    [If,[IGet,ZScript:Show Actions],
    [Delay,[IGet,ZScript:Modifiers:Replay Delay]/1000]
    ]
    ]
    </font></td></tr></table></blockquote>
    There are two If commands at work here. The first checks to see if the MouseLButton has been pressed, and displays a note if it has. This note goes away when the user clicks the mouse button again.

    The second If checks to see if the SHOW ACTIONS button (in the ZScript palette) has been pressed -- that's what the IGet is for. If it has, it issues a Delay command.

    The Delay command is simple -- it looks like this:
    <blockquote><table border="0" cellpadding="6" cellspacing="0" bgcolor="#cccccc"><tr><td bgcolor="#cccccc"><font color="black" size="2">[Delay, number of seconds ]</font></td></tr></table></blockquote>
    The "number of seconds" can also be a fraction of a second.

    Since the "Replay Delay" slider goes from 0 to 1000, and 1000 means one second, it's necessary to divide this slider by 1000 to arrive at the "number of seconds".

    <font size="4">To Use This Routine:</font>
    Simply place this Routine at the very top or very bottom of your ZScript -- outside of the IButton command!

    Then, use your text editor, search and replace all closing-brackets "]" with this:

    <blockquote><table border="0" cellpadding="6" cellspacing="0" bgcolor="#cccccc"><tr><td bgcolor="#cccccc"><font color="black" size="2">][RoutineCall,PauseDelay]</font></td></tr></table></blockquote>The result should be a nice, pausable ZScript, for which you can set the delay value while it runs.

    While paused, just as when a ZScript runs normally, no other ZBrush interface settings can be changed.

    For your convenience, here is that Routine in a ZIP file: PauseDelay.zip.

    dave

  2. #2
    Senior Member Follow User Gallery
    Join Date
    Jul 2001
    Location
    Ladner, British Columbia, Canada
    Posts
    4,617

    Talking

    Thanks Davey! Since I do a fair number of scripts for people, it will be nice to enable a pause capability, so the viewer can actually follow what I'm attempting to show...

  3. #3
    Senior Member Follow User Gallery
    Join Date
    Apr 2001
    Location
    USA
    Posts
    2,205

    Thumbs up

    The master does it again... I imagine this will have lots of use for people. Thanks!

  4. #4
    Senior Member Follow User Gallery
    Join Date
    Dec 1969
    Posts
    2,340

    Post

    That Will Work Thank davey.
    i was trying some stuff instead of the Left click i was trying Keystroke like i did on font master i had no Luck i was even trying to have the key stroke activate the Zscript Message box which would disabled the user from click any other buttons and pause long as he liked.
    just like you said , if you pause the ZScript, change some settings, then resume, the rest of the ZScript will not function properly.
    i tried it and it worked like a champ you da Man.
    im sure some newbie or memebers that might not understand Would Love to see a Demonstration why Don't you make a Z Script and show a Sample For everyone to see.
    you think you can Make one of these Work http://www.pixolator.com/zbc-bin/ult...c&f=1&t=004031
    he he he he

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •