Home Technical Talk

any zScripting buffs among us ?

tacit math
polycounter lvl 17
Offline / Send Message
tacit math polycounter lvl 17
hey guys. if any of you can offer any help here that would be awesome. knocked up this quick script. patched together from simple macro recording etc :

[code]//ZBRUSH MACRO - Recorded in ZBrush version 4.2
[IButton,???,"Press to run this macro. Macros can be aborted by pressing the

Replies

  • BeatKitano
    Offline / Send Message
    BeatKitano polycounter lvl 16
    Nevermind didn't read carefully enough.
  • tacit math
    Offline / Send Message
    tacit math polycounter lvl 17
    just bumping this guy in the hope of finding a solution
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    hey Tacit, I just tried my hand at this... I think you're the only reason I've ever messed with zbrush macros haha. cool idea though

    anyway I've only mucked about for a bit but I think the problem is that on larger subtool lists the original subtool is no longer in the range of the scrollbar.

    Edit:
    So I opted to manipulate the scrollbar because that seems to be the accepted way to solve this problem. Now it'll toggle visibility on the current subtool, and turn off others you hover on

    [code]//ZBRUSH MACRO - Recorded in ZBrush version 4.2
    [IButton,???,"Press to run this macro. Macros can be aborted by pressing the
  • tacit math
    Offline / Send Message
    tacit math polycounter lvl 17
    Bunnies you dirty bloody wizard. bit of lag but so far so long as i'm mouseOvered a tool it'll do the trick. takes a dump if nothing is there to be selected of course. i'll tinker with some conditionals ( the best option i reckon would be to unhide everything in that case. since i'd need to setup that key at some point )

    i absolutely concede ignorance here but. man. that feels like some pretty clunky shit if it's required that the scrollbar be in a given position to work

    anyway. as is this seems functional. thanks so much for your help a. object management in zb is still fucking stupid so this will be huge workflow boost
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    ah i see what you mean, I edited the script for one way to hopefully do what you were thinking

    man this language is so bonkers I can hardly believe it haha
  • tacit math
    Offline / Send Message
    tacit math polycounter lvl 17
    what you did bro works perfectly. my attempts at the conditional though. . . you'd think it would be as simple as comparing the two var strings

    but. grr. such does not seem to be the case
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    yeah I was actually bashing my head trying to figure out how to compare strings for the last half hour -_-

    lemme know if you have any problems yo!
  • tacit math
    Offline / Send Message
    tacit math polycounter lvl 17
    well. i've juggled a ton of options thus far. nothing. when you run a note ( for example ) on var0 and var1 you get the name of each. a string. why the fuck then is the conditional not simply :

    [If, SubToolTitle_1 == SubToolTitle_0
    ,
    //do this
    ,
    //else. do this

    ]
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    oh yeah, did you see the conditional I had to put in?
    I wish it'd compare the string for you, it's pretty weird for a scripting language haha
    [If,(([StrLength,#InitSubtool] == [StrLength,#HoverSubtool])&&([StrFind,#HoverSubtool,#InitSubtool]>-1)), 
    	//Do this
    	stuff,
    	//else do this
    	stuff
    ]
    
  • tacit math
    Offline / Send Message
    tacit math polycounter lvl 17
    [code]//ZBRUSH MACRO - Recorded in ZBrush version 4.2
    [IButton,???,"Press to run this macro. Macros can be aborted by pressing the
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    hey tacit, so it looks like the only differences between our scripts are:

    you press the visibility button twice on currentSubtools? what's the benefit to this rather than having a toggle?
    and you use the popup again instead of a loop? is this just for cleanliness?

    I really don't know much about Zscript so I figured I'd ask so I know next time I want to try it out :)
  • tacit math
    Offline / Send Message
    tacit math polycounter lvl 17
    man i doubt there's any benefit in any of the ways this is hacked in. 'cept for it's the shortest route i could piece together to achieve the functionality

    it would need a more elegant write up with a bunch of checks in place to overcome its failings ( 1 being if the eye of your current sub is off. won't work. 2 the most significant. fails with subtools of same name ) and yours is likely very much closer to that. but i'm quite reluctant to sink any further time into this scripting language. once you see you have to programmatically shift the scrollbar to have access to other subtools ( ?!? ). well. fuck off right
Sign In or Register to comment.