Home Technical Talk

a little zbrush scripting help needed..

nickholl
polycounter lvl 3
Offline / Send Message
nickholl polycounter lvl 3

Hi,

Ive never run any scripts in zbrush before (and aren't a coder) but id really like to utilise this one that lets you toggle dynamic sub divisions on ALL subtools.

https://www.zbrushcentral.com/t/question-dynamic-subdivision-toggle-for-all-subtools/337555

If I run this script, it toggles dynamic subdivision on and off for the current subtool, but I would like it to toggle all subtools at once.

[If,[IGet,Tool:Geometry:s.Dynamic] == 1, //Dynamic Subd is ON

[IUnPress,Tool:Geometry:s.Dynamic]

,//else is OFF so turn on

[IPress,Tool:Geometry:s.Dynamic]

]


would anybody know what I need to change?

many thanks for your help

Nick

Replies

  • cryrid
    Offline / Send Message
    cryrid interpolator

    You'll want something like this


    [IButton,DynamicToggle,"Press to toggle Dynamic Sub-D on all Subtools",
    [IShowActions,0]
    [IConfig,2022]
    [VarSet,idx,[SubToolGetActiveIndex]]
    [IFreeze, [Loop,[SubToolGetCount],
       [SubToolSelect,[Val,n]]
       [If,n>0,
        [VarSet,subToolPath,[IGetTitle,Tool:Item Info]]
               ]
       [If,[IGet,Tool:Geometry:s.Dynamic] == 1, //Dynamic Subd is ON
    
    
    [IUnPress,Tool:Geometry:s.Dynamic]
    
    
    ,//else is OFF so turn on
    
    
    [IPress,Tool:Geometry:s.Dynamic]
    
    
    ]
     ,n]
    [SubToolSelect,idx]
    ]
    ]
    

    This code only toggles the Dynamic Button like your code did. So if some subtools have it set off and others are on, it'll basically just invert them. If you want a hard setting where it either turns everything on or turns everything off then you'll want to modify it accordingly (or perhaps split it into two buttons)

  • nickholl
    Offline / Send Message
    nickholl polycounter lvl 3

    Hi!


    thanks for your help! When I load the script gives me an error :-/

  • cryrid
    Offline / Send Message
    cryrid interpolator

    It probably has to do with the version of zbrush you're using, or missing a line of code. Listing the error message would be a good place to start troubleshooting.

Sign In or Register to comment.