1. #1

    Default Question: Update slider limits after loading variables?

    maxSdivP is used as a value of a max slider value but it only updates when I reload the script I would like it to update after hitting Save Peferences (i know typo) Is this possible?

    [VarLoad, maxSdivP, PreferencesQuickTools]
    [IButton, "Save Peferences", "Saves the current preferences",
    [VarSet, maxSdivP, ZScript:maxSDiv]
    [VarSave, maxSdivP, PreferencesQuickTools]
    [VarLoad, maxSdivP, PreferencesQuickTools]
    ]

    also what does the Val and ,n] do?

    [SubToolSelect,[Val,n]]

    I also saw that there was ,n] after a loop to end it?




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

    Default

    I don't think there's a way to do it without reloading the script, and even that probably wouldn't work for a plugin. Probably the best way of getting a limit to work is by incorporating some code like this:

    [If,[IGet,0] > sMax, [ISet,0,sMax]]

    where sMax a variable with value of the slider maximum. The [IGet,0] and [ISet,0 is shorthand for IGet/ISet,"this item path".


    If you have a loop:

    [Loop,[SubToolGetCount],

    [SubToolSelect,[Val,n]]

    ,n]

    Then the 'n' at the bottom is the loop counter variable, so will hold the loop iteration, starting at 0 for the first iteration.

    [SubToolSelect,[Val,n]] selects the subtool which has the value of the loop counter variable, so will start at the top and move down one subtool each time the loop iterates.

    HTH,

  3. #3

    Default

    Thanks man helps a lot! I assume ZBrush reloads the script if you put it in your zplug folder as szc everytime you restart ZBrush?

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

    Default

    Yes, that's right. It would be possible to have a different slider max on ZBrush startup. Your plugin would need to load the preferences file before the plugin interface was created.

  5. #5

    Default

    Thanks for the help as always!

Posting Permissions

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