PDA

View Full Version : Plugin: PowerOf2


aurick
05-23-05, 05:32 PM
PowerOf2_Logo.jpg

As you probably already know, the recommended size for working with textures in ZBrush (and most other 3D applications) is a power of two. For example: 512x512, 1024x1024 or 2048x2048. This will give the best results when calculating AUVTiles or GUVTiles UV mapping, as well as when texturing the model with Projection Master.

PowerOf2 is a very simple plugin that places six new buttons into the Texture palette. Clicking any of these buttons will immediately create a new texture of that size, ready to go.

To install this plugin, simply download the PowerOf2.zip file by clicking the link below, then extract it into your ZStartup\Zplugs folder. The new buttons will then automatically be available every time you launch ZBrush.

(If your ZStartup folder does not already have a Zplugs folder within it, create one. Do not place the plugin into your ZData folder.)

Enjoy!

Sebcesoir
05-23-05, 05:36 PM
Cool plug!

Thanks a lot!!

ega
05-23-05, 09:59 PM
so simple, so util!!!

aminuts
05-23-05, 10:54 PM
Thanks Aurick,

This'll be way cool if I can drag those buttons out to my shelf for quick clicks....definitely beats loading old textures in the size I want and clicking new...will be much quicker to go back and forth!

aurick
05-23-05, 11:13 PM
Yes, because it's a plugin the buttons are there when ZBrush launches. That means that they can be added to the Shelf if you'd like.

Buckie
05-23-05, 11:53 PM
Very handy, cheers Aurick..:cool:

Abyssis
05-23-05, 11:56 PM
oooh, aurick, so useful:tu: :tu: :tu: thanx...

Moochie
05-24-05, 12:04 AM
Thank you.:D

marcus_civis
05-24-05, 12:22 AM
Nice work and very useful. Thanks! :tu:

Frenchy Pilou
05-24-05, 05:14 AM
...first to use "power" and the french Nicolas Chuquet for the writing of of the number "2" in mathematical expression :cool:
Pilou
Cool script ;)

Digits
05-24-05, 05:42 AM
Great Tool! Thanks :tu::tu::tu:

lemonnado
05-24-05, 08:36 AM
Thanks !!!

Less clickedyclickedyclick!

:tu::tu::tu:
LemonNado

PS:Now we just need the same for the document size :cool:. That would be decadent.... And... speaking of decadent.... could it read the 6 value pairs in from a file so any preset could be stored? :D.

Strannik
05-24-05, 09:51 AM
it's very useful, thank you:tu:

TVeyes
05-24-05, 10:22 AM
Great little zplugin. Simple and very useful:tu: Thanks.

Noggin
05-24-05, 01:18 PM
Very handy little plug!:tu:

DimitrisLiatsos
05-24-05, 04:24 PM
Thanks Aurick...this will come very handy ..... ;)

Buckie
05-25-05, 12:03 AM
Sooooo simple & sooooo useful, this has to be the handiest little plugin so far...:cool:

doron
05-25-05, 12:20 AM
maybe something that should be part of Zbrush 3?

sadicus
05-25-05, 07:39 AM
Thank you for such a simple yet effective tool!
It will be interesting to see all the new helpfull production tools that will Automaticaly load up in the new version of ZB!;)

3djock
05-25-05, 11:28 AM
Thanks for the great Plugin !!!;) ;) :D

Junk
05-25-05, 03:02 PM
cool

At last

Maybe a link button between width & heigth in futur version coud be nice and offer more possibilities

Aztec...soljA
05-25-05, 06:32 PM
Thank you Master Z:D

KenH
06-05-05, 12:48 PM
Very practical. Thanks.

boozy floozie
06-06-05, 05:11 PM
Thanks Aurick.

:tu:

MrMoe
10-27-05, 05:58 AM
Thankyou Aurick,

Another great utility, Aurick by any chance are you a super computer
locked away in some waterside factory turning out these plugins for
some evil software developer.

PS give me the nod I,ll spring ya.

Cheers MrMoe.

aurick
10-27-05, 09:47 AM
Thankyou Aurick,

Another great utility, Aurick by any chance are you a super computer
locked away in some waterside factory turning out these plugins for
some evil software developer.

PS give me the nod I,ll spring ya.

Cheers MrMoe.
Nope. Not a super computer. In fact, I'm an indifferent programmer at best. But that's what's great about ZScripts -- you don't need to be a whiz kid to be able to make use of the scripting language. Anyone could turn out a utility like this one with a minimum of learning or effort.

juliowassaf
10-28-05, 09:37 AM
Thanks Aurick!! :D :D :D :D :tu:

dark knightmare
01-08-06, 01:32 PM
sorry to revive an old thread, but can you post the source code, im trying to learn how to do plugins where you can add butons to a pallete

aminuts
01-08-06, 03:33 PM
there are some recent posts on this plus a gazillion posts that give great tips on creating plugins.....read anything by tveyes, svengali, marcus_civus, and any old ones by Davy or pixolator....chock full of how to's and info.

don't forget to check out the thread with the link to all the commands which has examples of use as well...it's a sticky thread I believe.

good luck.

dark knightmare
01-08-06, 03:41 PM
well thanks for the tips on zscripts, i managed to find zscripts 101 which is very helpful.

also i dled the plugin and it works very well.

aurick
01-10-06, 09:17 AM
I'm happy to supply the source code for this one. It's really simple, actually, and shows just how easy it is to place buttons within the interface. Combined with the Commands List from www.ZBrush.com you'll be able to quickly make sense of what's going on.


Active ZScript: \Cffa000PowerOf2\Ce0e0e0 revA

[IConfig,2]
[ISubPalette,"Texture:PowerOf2",1]
[IButton,"Texture:PowerOf2:128","Creates a blank 128x128 texture.",
[IShowActions,0]
[ISet,Texture:Width,128]
[ISet,Texture:Height,128]
[IPress,Texture:New],0,.33,,,.13
]
[IButton,"Texture:PowerOf2:256","Creates a blank 256x256 texture.",
[IShowActions,0]
[ISet,Texture:Width,256]
[ISet,Texture:Height,256]
[IPress,Texture:New],0,.34,,,.13
]
[IButton,"Texture:PowerOf2:512","Creates a blank 512x512 texture.",
[IShowActions,0]
[ISet,Texture:Width,512]
[ISet,Texture:Height,512]
[IPress,Texture:New],0,.33,,,.13
]
[IButton,"Texture:PowerOf2:1024","Creates a blank 1024x1024 texture.",
[IShowActions,0]
[ISet,Texture:Width,1024]
[ISet,Texture:Height,1024]
[IPress,Texture:New],0,.33,,,.13
]
[IButton,"Texture:PowerOf2:2048","Creates a blank 2048x2048 texture.",
[IShowActions,0]
[ISet,Texture:Width,2048]
[ISet,Texture:Height,2048]
[IPress,Texture:New],0,.34,,,.13
]
[IButton,"Texture:PowerOf2:4096","Creates a blank 4096x4096 texture.",
[IShowActions,0]
[ISet,Texture:Width,4096]
[ISet,Texture:Height,4096]
[IPress,Texture:New],0,.33,,,.13
]

marcus_civis
01-10-06, 09:48 AM
Well, you learn something every day. I didn't know you could use proportional width/height for buttons. Thanks. :)

dark knightmare
01-10-06, 12:14 PM
i learned some thing new too, {Ishowactions,0] . perfect for a big plugin im making that will eventually lead to some huge things in zbrush (or atleast within this plugin)

just one question, what is this line doing? Active ZScript: \Cffa000PowerOf2\Ce0e0e0 revA

edit- also, why did you put [iconfig,2]. isnt it that by default?

Svengali
01-11-06, 07:30 AM
Aurick/Marcus_civis:

Proportional buttons? Proportional to what? the width of the ZPlugin palette? Hmm - Useful, I'm guessing, to guarantee button order and placement when adding buttons to existing subpalettes, or your own, new subpalettes.


dark knightmare:

\Cffaa00 is just a "color switch" you use to change text color. Be sure the C is capitalized and you provide hexidecimal pairs for R,G and B.

Obviously the IConfig command lets you designate which release of ZBrush your ZScript was designed for. Early versions of certain ZScript commands have had parameters added in successive releases of ZBrush... of course each new release requires that new commands be added.

When ZBrush 2.5 comes out IConfig will let it know - when running Aurick's PowerOf2 and any other recent plugin - that commands from version 2.0 had been used.

Going by past releases, we will likely have a number of new ZScript commands that take advantage of the new capabilities in ZBrush version 2.5.

Including an IConfig command is just good practice.

Sven

marcus_civis
01-11-06, 02:08 PM
Sven,
Yes, proportional to the subpalette. At least, in my quick test, a width of .99 came out full width. Presumably there's a default subpalette height too, of which .13 gives the standard button height, though I've not experimented. Perhaps Aurick will shed some more light?

geccko
06-09-06, 08:03 AM
Hello, And thank you

I just new to Zbrush very much so am rom around to this Center and found a lot of good plugin .

I might come in handly .

Thank you

Svengali
06-17-06, 04:33 AM
Relocating the PowerOf2 buttons to the TOOL Palette...

Most every time I want to generate a new texture I pull up PowerOf2 from the Texture Palette and choose a size. However, most every time I do this, the Tool Palette is already open. So I said to myself, "Self, why not bump thePowerO2 buttons to load within the Tool Palette?" To which I answered "Why not?"

Here's what I changed in the script(Original lines in Blue, new lines in Yellow):


[ISubPalette,"Texture:PowerOf2",1]
[ISubPalette,TOOl:PowerOf2,0,,0,6,0,0]
// the extra values create a subheading which is initially closed - saving a line or three in the TOOL interface

[IButton,"Texture:PowerOf2:128","Creates a blank 128x128 texture.",
[IButton,"TOOL:PowerOf2:128","Creates a blank 128x128 texture.",

[IButton,"Texture:PowerOf2:256","Creates a blank 256x256 texture.",
[IButton,"TOOL:PowerOf2:256","Creates a blank 256x256 texture.",

[IButton,"Texture:PowerOf2:512","Creates a blank 512x512 texture.",
[IButton,"TOOL:PowerOf2:512","Creates a blank 512x512 texture.",

[IButton,"Texture:PowerOf2:1024","Creates a blank 1024x1024 texture.",
[IButton,"TOOL:PowerOf2:1024","Creates a blank 1024x1024 texture.",

[IButton,"Texture:PowerOf2:2048","Creates a blank 2048x2048 texture.",
[IButton,"TOOL:PowerOf2:2048","Creates a blank 2048x2048 texture.",

[IButton,"Texture:PowerOf2:4096","Creates a blank 4096x4096 texture.",
[IButton,"TOOL:PowerOf2:4096","Creates a blank 4096x4096 texture.",


Finally, you need to save the modified file as PowerOf2.txt in the ZPlugs directory. With ZBrush running, use the ZScript>Load command to run the PowerOf2.txt file. This will generate a new version of the PowerOf2.zsc plugin and when you restart ZBrush you'll find the PowerOf2 buttons in the Tool Palette.

Thank you to Matthew for sharing your original ZScript...

Sven

marcus_civis
06-17-06, 11:37 AM
Sven,
A useful enhancement, thank you. Incidentally, installing the text file in the ZPlugs folder and restarting ZBrush is enough. ZBrush always updates the zsc if there is a txt file present of the same name (in the ZPlugs folder).

Cheers,

CG_Monk
01-08-07, 04:29 AM
Well ! I can't say anything more than a ThankYou !!! THANK YOU VERY^infinity MUCH_:) :lol: :)

piz
09-12-07, 10:10 PM
Great Plug!

krasas
08-29-08, 11:33 AM
Thanks Aurick,

ghaal
09-15-08, 06:43 PM
very usefull plug !!!
keep going
good work