View Full Version : Quick ZScrypt question...
Could one of the masters explain how you can combine to things in a variable? For example, if I have variable A = 7, and variable B = 8, how can I make variable C = A & B, or C = 78?
Thanks for any info! :)
In your example, since A and B are both numbers, you could try ...
... which simply multiplies A times 10 and then adds B.
There are other ways to work around this; if you wouldn't mind sharing what you're working on, perhaps we could help you find a solution?
Good luck,
dave
Hmm, perhaps that could work...
I never thought of it that way. :)
What I am trying to do is make a number keypad input. So instead of a slider you would press keys like on a telephone or calculator.
http://www2.zbrushcentral.com/zbc_uploads/user_image-1010191468wef.jpg
As you press keys the ZScript would combine the numbers to make one complete one.
WHOA Muvlo!!
THAT is a GREAT idea!!! :tu: :tu:
:tu: That is a fantastic idea! Simple, elegant and very useful!
Let me work on it a little bit, and give you some ideas.
dave
I'm glad there's some interest in this. :)
If anyone wants to experiment with the interface, here is the ZScript: calculator script (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010198542gfk.txt). :)
WHOAH is right, Kathy's on the money again! It would be even cooler if you could link the numbered keypad on the keyboard to your calculator, for the sake of efficiency.
GREAT idea, Muvlo!
Just playing on your idea Davey, maybe having a variable that is incremented for each button click, so the script knows to multiply it by 10, 100, 1000, etc...
We need a Vulcan. ;)
Here are some suggestions on combining button presses into a numeric value. I found it necessary to limit numbers to 7 digits because of the way ZScripts do math internally.
This should be more than enough for working in the ZBrush interface, but if you need higher numbers I have some more ideas.
Keep me posted on your progress; this is a cool idea :)
dave
Here's the file: calc-ideas.txt (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010209390ywy.txt)
OK, Vulcan found.
Now to looking at this script of yours. :)
First, what is happening in the Display routine?
Perhaps you could go into the nextnumber bit some too, but maybe if I look at it some more I'll understand. :) This is fun.
Edit- Ah, now that display bit makes more sense! :)
Another Edit-- I think I get it now. I've never used some of the commands you have, but with the help of the command list light is beggining to shine in. This will be interesting to explore. :)
drjjwow
01-04-02, 11:31 PM
simply amazing muvlo... this will come in handy when your punching in numbers for zbrush.. very cool... man i can wait to see the final project complete... man what a really sweet treat... please hurry...
s o u t h e r n
01-04-02, 11:42 PM
THis would be fantastic added onto the end of my latest default panel. Go for it guys...
http://www2.zbrushcentral.com/zbc_uploads/user_image-1010216545rji.gif
http://www.southerngfx.co.uk/uploads/sig.jpg
drjjwow
01-05-02, 01:05 AM
so right southern... i dont know how many times i have to go find my calculator to solve a problem...cant wait to add this to my default interface skin...
Here is an updated version of the script.
The Updated Script (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010255189gyo.txt).
The add, subtract, and multiply buttons should now work. At the moment you still need to hit the equal button after each entry, pressing the +,-,and * buttons doesn't do it yet. The divide and decimal buttons don't work yet either. Note that all of the buttons now have a keyboard hot key.
Another question:
When I added in the subtract button something odd happened. When I subtracted two numbers, it would get the right answer, but make it negative. So 9 - 8= -1, and -9 - 8 = 17. In the script I used the NEG math funtion to reverse the number, but it seems that this shouldn't happen. Anyone know why it did? (Silly question, on this forum, at least one person knows the answer to everything!) :)
Edit- another question.
How can you make the enter key a hot key? That would seem to make the most sense for the = button.
Hey Muvlo you did a real Good Job on that :tu: :tu: :)
does davey or anyone know were there a NEW updated List of Commands?.
and is there a way to put a .GIF in the tutorial veiw window?
OK, this one has me stumped. The 'huh?' script (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010274185jxr.txt).
Why is it that the divide button performs an add funtion? For example, 7 / 7 = 14. But you can tell it knows it is supposed to be dividing because 0 / 3 gives the division by zero error.
BTW, the script may have some weird things in it, I was trying something which didn't end up working and I may not have removed everything...
Nice work, Muvlo :tu:
Here are some answers for you...
1) You did the right thing for the Subtract feature. Your script reads [VarSub,n1,n2], which means "subtract n2 from n1". If you hit 8 - 7, n2 becomes 8 and n1 becomes 7, so the script calculates 7-8. Your solution, adding Neg(n1), works just fine :)
2) To make the Enter a hot key, use the number 13 (no quotes). I see in your "huh" script you've chosen ctrl-C, but if you still want to make it the Enter key, you can replace:
,,72,CTRL+'c']
with
,,72,13]
3) For the Divide function, instead of [VarDiv,n1,n2], try this:
[VarSet,n1,n2/n1]
4) Can I have some hot chocolate?
dave
Not until you finish your broccoli.And remember this young,man you can't hide broccoli in a glass of milk.
davey did you see my last question im trying to ask???????
check my previous post
"Ohhh", said the four children, "Oh Aslan, so you can use divides and additions with the VarSet command?"
Thank you extremely much! :)
But um, try reading the code more carefuly:
How right Rhom is. And my dog never eats it either. :(
Gettin' sick of me yet?
I have another question. I was thinking it might be useful if the user could select any slider by clicking on it, and then press a key, and whatever was in the n1 variable would replace that slider's current value. I don't know whether ZBrush can track what slider is selected... Dave? :)
In case there isn't away, here is a new version (with Davey's recent tips implemented) and with a simple Document size changer.
Resizzler (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010470521bym.txt)
The resizer takes what number is in the display area of the calulater. If it is below four it will not except it. Also, there are two option buttons that set whether you want it proportional or not and whether to set height or width. :)
Hi, EZ...
In response to your questions:
The only command lists I'm aware of are 1) the list you can get by pressing "Export Commands" in the ZScript:Modifiers palette, and 2) the fine reference assembled by Digits in this thread (http://www.pixolator.com/zbc-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=000936).
As for displaying GIFs in the ZScript window, it can't be done. Images must be in a PSD format.
Muvlo, I'm going to look into your idea a little further. I think something could be done with the [IKeyPress... command.
dave
Okay, Muvlo, I've got one for you...
In this sample ZScript, float your cursor over any ZBrush slider (you may or may not click it), then press the hotkey combination Shift+Cmd+V. The slider then gets set to 25.
You can simply change the 25 to n1. And pick your own hotkey combination.
Also, this places a button in the ZScript window -- but clicking it won't do anything (it'll try to set the button to 25, which isn't meaningful). I'll leave it up to you to decide what happens when the button is clicked -- show a note, set the document size, make hot chocolate, whatever.
Let me know if you have any more questions, this is fun :)
dave
Ah, clever! :)
Still a problem though. When I inserted it into my script, I found that it will only work some of the time. This does not seem to change depending on whether the slider is selected, or what the keys are. When it does work though, it works fine! :)
calculator.txt (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010531376ius.txt)
thank muvlo.
hey check your (private message )
OK, another quick update:
Messy (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010554994krx.txt).
That is a very messy ZScript. I've been trying many different things. I don't have time right now to go into what I've tryed.
I will go ahead and say I tryed to quickly put in a "to the power of" feature. Uh, somebody tell me, what happened there?
Can't wait till tomarow, which shall bring even more weird Zscripts I hope! :)
drjjwow
01-09-02, 02:18 AM
well i must say you guys put together a awesome utility for zbrush.. however i know your still working on it but you might want to put in a button to actually resize the doc. so far everything works just fine..great job zbuddies
Exponents are expressed with two ^'s. Your line of code should read
And, remember that in your ZScript, n2 is the *first* number you enter, n1 is the *second*, so n2 should come first.
Coming along nicely :)
dave
Ah, that was driving me nuts. :)
Now, I'll go eat. :)
Something with lots of milk. :)
Something with that is not warm and contains no chocolate. :(
OK, highly updated version:
Highly Updated Version (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010623271aaz.txt).
1. This version is fully funtional except for the decimal button. I could really use some help with that. I tryed some stuff I thought would work. Guess what? :)
2. Also, the set button which Davey showed me how to do now works. I think what was wrong was that I hid it behind the equals button and that stopped it from working correctly.
3. I've added a pi button that enters pi to the fullest extent the display can hold. The exponent button now works.
4. I added in an extra title thing behind the "Version 1.0" caption. For some reason I had to do a lot of stuff to get it centered correctly. Why was this?
5. There are, I'm sure, still some other bugs, so if you notice something that doesn't work right, let me know! :)
I don't understand, all of a sudden the Set button is having problems again. For example, let's say I enter 22. Then I place the mouse over Material ::Modifier ::Diffuse. Now I press the 'V' key. The first time, the calculater display will change to 222. Then the 'V' key again. This time it works. It's like this every time, 1st time doesn't work, 2nd time does. Also, it doesn't seem to work at all with the Tool ::Modifiers section.
Man this looks really clever Muvlo! Well done! (sorry I can't help you with your programming though! I'm not a coder)
Hey but I've had a wee idea for a script that I'm not sure if it could take flight... Any feedback from the "coders" would be appreciated.
IDEA: If there was a whole alphabet of tools "letters" converted from a DFX saved seperatly as Ztools into a alphabet draw;- is it possible to create a script where you type out each letter in a input box and ZBrush loads each presaved letter-tool into a multi-marker compiled tool???? Is it possible to create a text input box? It should be pretty easy to type a letter and ZBrush could at least load the letter into the tool palette shouldn't it?? You could even add a z-extrusion slider!
If this is possible I'd be willing to do the text-2-dfx-2-ZTool converstion!
Upham :)
Where's Digits when you need him??!!!
Stonecutter
01-09-02, 05:20 PM
Now, THAT'S a cool idea, Upham!!!
This place is making me crazy...It's like I've fallen into a den of hyperactive, pan-dimensional alien energy-based lifeforms!
:tu: :tu: :tu:
And THANK YOU, MUVLO FOR STARTING THIS !
:D :cool: :cool: :cool: :D
That's a good idea Upham! :)
I don't think there is a text input box, but another keypad with hotkeys would allow you to type a message...
And yeah, what happened to him? Is he on vacation or something?
Yeah! Change the text-input box to a string of buttons that have ABCDEFG....XYZ and 123...890 on them! Good idea. Call it --- TEXT MASTER! --
Digits is properly out cruising amongst the hot spots in his boat! Lucky so-and-so!
Upham :)
A Next-Project maybe?
http://www2.zbrushcentral.com/zbc_uploads/user_image-1010627206ghl.jpg
;)
AAAAAAAHHHhhhhhhh! :tu: :tu: (fonzy-cool)
I'll get started on the font-2-ztool conversion tomorrow, and see if it develops?
Upham :)
Another question for Davey:
Since we need to have both uppercase and lowercase letters, plus all the other double keys, it would make sense to use the Shift key for the top one. On the other hand, that would steal the hotkey from some commands, like the snapshot's SHIFT+S. This would not be a big deal in most cases, but I was thinking that maybe the capslock key could be used. If it is off, then the key press will be the bottom one, and if it is on it will be the top one. So (*whew*) what is the ZScript key code for the capslock, if any?
:)
I'm sorry to be bogging things down with all these questions, but I've got more:
I've been experimenting with the Z+ Alphabet interface. As I was putting buttons down, a few odd things happened.
1. The tilde (~) key. It shows up blank in the script window unless you put the mouse over it, then it shows up until you move the mouse off of it. The popup works fine.
2. The bracket keys ([) and (]). These two show up fine, but are red letters instead of white.
3. The other bracket keys ({) and (}). The first one shows up blank, no popup either. The second one shows a graphic of a bright orange circle-- no popup.
4. The seperater key (|). This one shows a graphic of a bright orange triangle-- no popup.
And there were two I wasn't sure how to do at all.
1. The comma key.
2. The qoutation mark key.
Any suggestions? Thanks in advance. :)
Here is a screenshot:
http://www2.zbrushcentral.com/zbc_uploads/user_image-1010634820fhj.jpg
I have duplicated a regular keyboard except that the letters are in the natural order.
You can see the odd buttons too.
:)
good god man we think a like LOL im letting the cat out of the bag...
im 90% done im setting up a FONT MASTER with .BMP in ALPPA.
what this does is you click a letter on your keyboard and the FONT shows up in ALPHA with some setting.
AND puts it out on the canvas i been working on it since last night i have .Bmp from A-Z
You Click the letter (A) on your keyboard the (A font.BMP)shows in alpha ready to go http://www.pixolator.com/zbc-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=003179
Well I've knocked out the whole Alphabet as Uppercase, lowercase, Numbers and special keys and converted them to ZTools!
http://www2.zbrushcentral.com/zbc_uploads/user_image-1010645592cxr.jpg
(Blah! Bad jpeg conversion!)
Four Zip Files to give away to good homes!
:: Uppercase.zip (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010644169eww.zip) (258kb),(please change file "user_file-1010644169eww" to "Uppercase")
:: Lowercase.zip (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010644378szf.zip) (321kb),(please change file "user_file-1010644378szf" to "Lowercase")
:: Numbers.zip (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010644716jsa.zip) (181kb),(please change file "user_file-1010644716jsa" to "Numbers")
:: Special.zip (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010644918moh.zip) (254kb),(please change file "user_file-1010644918moh" to "Special")
(thanks Pix for letting me store these on your server!)
They are the Arial-black font and I plan to make another set of fonts soon. (which one?)
You'll find the center or rotation point at the bottom of every letter or at the point where the the font would cross the baseline, (for j's, g's & y's).
I'd advise you to make a folder in your ZTools draw called Alphabet with seperate Uppercase, lowercase, numbers and Special draws inside.
The bad thing is that they are not entirely international. If anyone wants to donate a pound, yen, etc sign, please post them here.
The other bad thing is that since they are not native ZBrush objects you can't Polymesh them together with the multi-marker tool! (fiddle-sticks! :mad: )
:: Now they need a good programmer to make incorporate them into a script!! (Muvlo??)
Upham :)
juandel
01-10-02, 09:05 AM
http://www.cyber-webs.com/zbrush/written.jpg
- juandel
You guys are amazing. I bow in your presence.
Thank you again! :tu: :cool: :tu:
http://www2.zbrushcentral.com/zbc_uploads/user_image-1010692300fwv.jpg
Thanks Juandel and Nikko! Those textures look great on those fonts. I've got to admit that font looks pretty boring doesn't it! I'll have to knock out another!
The top ZBrush picture was text with a glow material and placed with a marker, and in the 2nd layer the same multimarker-text was placed in the exact same position with the marker and brought forward a bit and a different material applied. Then rendered with 'Flatten-Layers' turned off so the glow can be seen radiating out behind the second layer.
Man, if this text could be polymeshed, I'd have a heap of fun bending and twisting it!!
Upham :)
Very cool!
I wonder, if you can manually create the letters in Zbrush :eek: each letter would have its own script. click on "A" and the script would run to create an "A"...
Hey, Upham -- try baking the layer and then doing a grab. Apply the resulting texture to a Plane3D, and even use a slightly larger version of the alpha to create a transparency mask.
drjjwow
01-10-02, 04:51 PM
here you go upham thanks... all you guys are too cool ... http://www2.zbrushcentral.com/zbc_uploads/user_image-1010710280fum.jpg
Good job Upham! I'll give this thing a try, but anyone else who wants might have a go to! If you want to use my interface (still with the odd stuff on it, sorry!) here it is:
The Interface (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010717103trz.txt). The backspace key is gone due to some stuff I was doing. I'll let you know if I get anywhere...
nice KeyBoard :tu: :tu:
i sent you a private message maybe you can help me on it..
OK, I've passed a few early start what went wrongs, and now I've found some more good stuff with the shortcut keys. I'm starting small and getting just a few letters keys to work at first and I'll build up from there. :)
Onward, onward! OK, I have the lowercase letters a-z working. (The rest will take only a moment to add.) What it does so far is, as you type, place the letters on the screen starting at 20,20. Each letter is moved over by 20 pixels. The space key and backspace keys work. As each letter is placed, so is a marker. When it is finished the MultiMarker tool can grab them, though as Upham pointed out not polymesh. Though, as Kaz said, you could make a script to create the letters within ZBrush. And eek ( :eek: ) is right! :)
Here is the script:
Uglified pre-version (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010882039scw.txt).
For it to work, place it in this file path:
ZBrushDirectory\ZScripts\Muvlo\Alphabet
Put Uphams lowercase set in:
ZBrushDirectory\ZScripts\Muvlo\Alphabet\lowercase
If you want it somewhere else you will need to edit the ZScript itself.
Let me know if you have any suggestions, and I'll get to work attaching it to the main interface... :)
Magic stuff Mulvo!!!
I can't try it until tomorrow :( (off to see LOTRs!), but I'm looking forward to haveing a bash with it!!!
Thanks for doing this!!!!
I somehow missed your above posts - sorry.
Upham :)
A few more things:
I think it should be pretty easy to add options for:
:b3: Making the word go across or down. (Possibly even choose an inbetween.)
:b3: Changing which way the letters face.
:b3: Change the start position.
:b3: Change the letter size.
:b3: A button that puts the script in standby mode, allowing you to use the regular shortcut keys in ZBrush.
--
Something I'd like to do but I'm unsure as to whether I can:
:b4: Make the models load as you click each button. The trick here is to make sure they do not double load.
--
I'll upload the script later today hopefuly, with at the very least all of the keys working on the full interface. I should probably have some other things working by then too.
AUH HA i GOT a Brainstorm ok im using a 3D SPHERE as a sample but so load your ZTL into the TOOL pallet and call out for your letters like this
:tu: :tu: :tu: :tu:
no need to click the red button just a sample click the letter A on your keyboard and it will do the same as Your letter.ZLT just change it here download the ZIP i can probley set it up so when it loads the Gyro will be in SCALE mode allso.
so yours will look like if you click the letter A,B,C,D,E ect ect on your (KEYBOARD) it puts the A.ZTL B.ZTL C.ZTL on the Canvas for you.
EZkey.zip (http://www2.zbrushcentral.com/zbc_uploads/user_file-1010953949gjj.zip)
Powered by vBulletin® Version 4.1.11 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.