1. #1
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default Question Regarding ISwitches and IButtons

    Update:

    See last post for question.
    Last edited by Darukin; 09-06-09 at 02:51 PM.
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  2. #2
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    I'm not sure I understand what you're trying to do. Do you mean modify an existing curve (such as the smoothing curve) or create a curve of your own for storing/restoring values?

  3. #3
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    I meant creating a curve for storing / restoring values, a curve similar to the many curves in Zbrush as modifiers etc. like y against x values etc
    Last edited by Darukin; 09-03-09 at 11:58 AM.
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  4. #4
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    Well in that case all you need to do is define some values and then interpolate between them:

    http://www.pixologic.com/docs/index....e#Calculations

  5. #5
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    Thanks for your reply Marcus!

    But the problem is that I want users to be able to define the curve and input basically, just like all the other curves in Zbrush, is there a way?
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  6. #6
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    No, I'm afraid I can't think of one. You'd need to b able to get the values out again and I don't think you can do that through scripting either.

  7. #7
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    New question, same thread. How do you go about making more interesting looking slider, buttons and in ZScript ??
    Last edited by Darukin; 09-05-09 at 02:14 PM.
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  8. #8
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    I guess you sorted out your floor/ceiling dilemma. If you didn't then it's easy enough to create routines to return the right values by making use of the INT function which always returns the integer that remains afer the fraction is taken off. See the text file for a demo script.

    And for your next question: you can add images to buttons :

    [IButton,"Button Name","Pop up text",
    //commands
    ,,/*button width*/,,"MyDataFolder\buttonImage.psd",/*button height*/]

    But there's no way to do the same with sliders.

    HTH,
    Attached Files Attached Files

  9. #9
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    Hey thanks for your replies Marcus, much appreciated!

    Yea I sorted the floor/ceiling thing manually, I was just asking if there was function for it but there isn't like you said.

    Finally, one last question.

    Is there a way to make an ISwitch or IButton in ZScript and then delete it through ZScript and create another new switch or button in the middle of the script?

    If not, then even better, is there at least a way in which to change the text or image file or other attributes of the switch or button afterwards in ZScript without deleting it later on throughout the script?

    Thanks in advance and real sorry to bother as it seems you're the only one replying Marcus, but I really appreciate it though.
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  10. #10
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    For a zscript that uses the ZScript Window for its interface you can use 'zscript:reload' to update and show changes. This means you can store different button names or image names in variables. The attached file shows the basic method.

    However, this doesn't work for plugins. With plugins you can use 'IShow' and 'IHide' to show and hide different buttons (the method used for the orange highlight behind the brush buttons in PaintStop).

    HTH,
    Attached Files Attached Files

  11. #11
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    Thanks Marcus

    And is there a way in which to create many similar buttons through a loop (many small buttons) or must each be manually created only every time? thanks!

    Also is there a way in which to specify a specific position to draw your button on the window? thats important! or are they drawn based on which was defined first only?

    Finally, how can u simulate a button press of one of your ZScript's own button's or toggle a switch for one of your own ISwitch's through ZScript using buttonPress command i.e. how do you specify what that button's path is if it's your ZScript button, or for example set a value on a slider using buttonset through ZScript if it's your own ZScript slider?

    thanks!
    Last edited by Darukin; 09-06-09 at 05:13 PM.
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  12. #12
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    Another question

    For interpolate, is there a way in which to interpolate over 1 list of values, not over 2, coz I have a list containing many individual values that i wanna interpolate over.

    Thanks
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  13. #13
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    I don't see why a loop shouldn't work but it will depend on what you're doing so you'll need to experiment. The button path for a button in the zscript window is "zscript:ButtonName", so you can use
    [IPress,zscript:ButtonName]
    to press a button. [IPress,n] where n is the number relative to the position of the button that contains the command will also work.

    Have you looked at the examples on the Wiki? There's stuff in those that you may find useful and the Command Reference gives all the stuff for positioning buttons and so on:
    http://www.pixologic.com/docs/index....utorial_Window

    http://www.pixologic.com/docs/index....ndow_interface

    With Interpolate you can use a Loop if you've a lot of numbers.

  14. #14
    Senior Member Follow User Gallery
    Join Date
    Mar 2007
    Age
    29
    Posts
    1,211

    Default

    Thanks again Marcus, u always have the answer!

    Yea loop doesn't work for creating several buttons as they must be top level commands, I tried, but never mind.

    Thanks for the tutorial links checked em out! Yea they had the answers.

    As for interopolate Im still not sure about the method u would go about looping.

    Say you've got an interval u wanna interpolate i.e. point at 0.5 (middle) on graph, and then you wish to interpolate over 10 values, do u loop to interpolate first over first 4, then over second four, then take average or what you mean? This should be the last major point.

    Thanks again.

    Also really what Im trying to do is smooth the graph by replacing all the values with interpolated values from noisy points on the graph, or does the interpolate function not really do this at all with a smooth curve?

    thanks
    Last edited by Darukin; 09-07-09 at 07:56 AM.
    SketchBook
    ZAnimator (Video Demo): The Zbrush Animation Plugin (Keyframe and Timeline based)
    ZAnimator Zbrush Thread
    Blog / Webfolio: Darukin's Arts and Crafts

  15. #15
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    Here's a test script so that you can play around with interpolating. It demonstrates interpolating values and lists. For the values, put a sphere in Edit mode and scale it small. Position on one side of the canvas and press the 'Start' button. Scale it larger and position somewhere else then press the End button. Now press the zscript 'Render' button. Experiment with the Mid position buttons.
    Attached Files Attached Files
    Last edited by marcus_civis; 09-07-09 at 10:13 AM.

Posting Permissions

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