PDA

View Full Version : Finished Zplugin: ZQuickMask


marcus_civis
06-03-05, 11:04 AM
ZQmaskpic.jpg

ZQuickMask is a plugin for anyone who wants to paint their own masks.



Click the button to enter 'mask mode'.
Paint your mask. You can use any alpha or stroke.
Shift+click the button when you've finished to convert to stencil.


The mask is 'flat', with no depth info or soft edges: ideal for masking areas of a 2.5D painting before applying color or materials.

Use ZQuickMask to create stencils for use in Projection Master to help texture models.

When using with Projection Master it is best to make the mask/stencil before using Projection Master.

Full instructions in the zip.

I hope you find ZQuickMask useful.

[EDIT:
I've revised the plugin slightly, just added a couple of error messages and a small bug fix.

A few points:

To erase mistakes use the 'TransMat' custom material loaded when ZQuickMask is launched. You'll find it at the bottom of the Materials palette; it looks flat white.
For basic painting use the 'MaskMat' custom material loaded by default (flat black).
Any tool, alpha, stroke or material can be used with sometimes interesting results. ;) Adjust lighting and use Best Render for fibers etc.
To save a stencil for re-use, export the appropriate alpha. When re-using, import the alpha,then load the custom curve from the ZStartUp\ZPlugs\ZMask_data folder before pressing the Alpha>Make Stencil button.

Bas Mazur
06-03-05, 11:39 AM
Thanks Marcus, I can use it. Works all fine! :tu: :tu:

johnny blaze
06-03-05, 11:49 AM
This is something I have been waiting to see implemented for a long time.
Thanks you are a true asset to the Zcommunity.

3djock
06-03-05, 12:34 PM
Very Cool Thanks!!! :tu: :tu: :tu:

Svengali
06-03-05, 12:40 PM
This is something I've wondered about for a while. Great potential! Thanks Marcus.

Sven

50'sKID
06-03-05, 01:27 PM
Usefull?!! YES. My thanks, Marcus 50.

Sebcesoir
06-03-05, 01:46 PM
Very interesting.. I have to try it fastly.. Thanks!

lemonnado
06-03-05, 02:44 PM
Wow, cool, excellent! There goes the Saturday morning 8-). It should be forbidden to post cool toy's friday afternoon :D:D:D

Thanks!:tu::tu::tu:
LemonNado

wenna
06-03-05, 03:14 PM
Thank you so much! Can't wait to try it out!!

Digits
06-03-05, 05:23 PM
Awesome Dood! :tu::tu: I must admit I had forgotton all about the stencil tool, this is pretty slick

aminuts
06-03-05, 10:37 PM
Sweet!!!!

I needed a new toy to tear me away from Digits worm widget which I have been having way too much fun with......

there oughtta be a law......

that we get a new toy every 2 weeks hahahaa.

Cool, Thank you Marcus!!!!

marcus_civis
06-04-05, 07:34 AM
Thanks for the comments, guys. It means a lot. :)

A small update at the top of the thread. Also adjusted the instructions slightly. You can use pretty much what you want when making a mask with sometimes pleasing results. The image used the fiber material among other things...

posterize.jpg

Buckie
06-04-05, 08:18 AM
You script & plugin dudes make my day, everyday...

Thanks Marcus, great work & very useful...:D

boozy floozie
06-06-05, 01:43 AM
A superb script.

Many thanks for your hard work and generosity.

--------------------------------------------------------

P.S Did ZLauncher ever get re-written for ZB2 so this could load when I start the application? I

never could get the old version of Zlauncher to work correctly with ZB2 on the Mac.

marcus_civis
06-06-05, 03:02 AM
Thanks guys. :)

Boozy,

ZQuickMask is designed as a plugin and if installed to your ZStartup\ZPlugs\ folder will load on start up. You can Ctrl+drag the button to your interface and then store the configuration (Ctrl+Shift+I) to keep it there.

And if you want to use ZLauncher, it works fine with ZB2. You can get ZLauncher to load automatically at start up by editing your default zscript (I think there are instructions with the original post by Pixolator but PM me if you need help to do this).

Any problems, let me know.

Cheers,

boozy floozie
06-06-05, 03:31 AM
Marcus,
I never realised that this was possible with plug-ins.
Thanks for that tip.

I've always loaded them as zscripts.

Can any script be loaded in this manner as a plugin?

Casting my mind back to the ZLauncher issue I'm sure I tried that workaround some time ago but never got the original full functionality.

I'm shy to try it again incase of melencholy.

marcus_civis
06-06-05, 04:05 AM
Can any script be loaded in this manner as a plugin?

Casting my mind back to the ZLauncher issue I'm sure I tried that workaround some time ago but never got the original full functionality.

I'm shy to try it again incase of melencholy.

No, you can't load a zscript as a plugin. A plugin script is coded to add a button to the interface; without the code, it won't appear and you won't be able to access the script.

If you want a particular zscript to load at start up, the simplest way is to edit the default zscript... but I agree, melancholy should be avoided.

boozy floozie
06-06-05, 05:09 AM
Many thanks for the extra info.

BTW your script is a wonderful time saver from previous work-arounds to achieve this effect.

What a great idea.

A quick doodle using your plugin to say thanks.

lion.jpg

marcus_civis
06-06-05, 07:33 AM
Boozy,

I'm delighted that you find the plugin useful, and thank you so much for the doodle-poodle; truly appreciated! :tu:

If should you think of any possible improvements to ZQuickMask, let me know.

[EDIT: Oops, just saved to my special ZPictures gallery. Doodle-poodle-LION, my apologies to the delightful creature ! :)

Cheers,

Frenchy Pilou
06-06-05, 01:29 PM
Pilou

boozy floozie
06-06-05, 04:05 PM
One thought I thunk was....

an extra option to allow the tools that will create the stencil to also interact with the normals of the under layers may be nice and would allow further possibilities.

At the moment the default is all tools pull out straight on to the canvas.

Just a thought.

Here's another thank you from the little Princess that lives in my shoe - whom is also quite delighted with your plugin.

thanks_marcus.jpg

She thinks creating some lovely Batik effects next would be a fun way to use your plugin.

Regards

marcus_civis
06-07-05, 02:29 AM
Boozy,

Wonderful picture! Many thanks. :) I really love your original and imaginative style.

One thought I thunk was....

an extra option to allow the tools that will create the stencil to also interact with the normals of the under layers may be nice and would allow further possibilities.

At the moment the default is all tools pull out straight on to the canvas.


This is possible without difficulty:

1. Press the ZQuickMask button to create the mask layer.

2. In the layers palette, click the Displace Z slider and enter 4096 (push the slider all the way to the RIGHT).

Now you will be able to draw 3D objects on the mask layer which will interact with the pixols on other layers.

ZQuickMask works by creating a transparent 3DPlane and placing it in front of everything else on the canvas (at -4096 ZDepth). This is how you can draw a flat mask. By moving the mask layer backwards in ZDepth (positive values in the slider), the other pixols will poke through the plane and new drawn objects will interact.

Hope this helps,

Frenchy Pilou
06-07-05, 02:51 AM
Pilou

boozy floozie
06-07-05, 03:04 AM
This is possible without difficulty:

Music to my tiny ears.
Once again many thanks indeed.

Pilou :D

boozy floozie
06-07-05, 03:16 AM
"ZQuickMask works by creating a transparent 3DPlane and placing it in front of everything else on the canvas "

Marcus would it be difficult to create a plugin that would easily allow photoshop style layer paintings (using for example the simple brush) by creating temporary transparent under layers at key z distances for each layer added?

Am I making sense?

This would be a great addition.

marcus_civis
06-07-05, 03:22 AM
would it be difficult to create a plugin that would easily allow photoshop style layer paintings (using for example the simple brush) by creating temporary transparent under layers at key z distances for each layer added?

Am I making sense?

This would be a great addition.

Perfect sense.

I've thought of this and I'm working on it. There are drawbacks but it's not difficult. Would you test out my efforts before I launch my next baby on an unsuspecting world? :)

boozy floozie
06-07-05, 03:38 AM
Fantastic news.
Very exciting.

Ofcoarse I'd be delighted to test it.
Send a pm when your ready.

marcus_civis
06-07-05, 03:56 AM
Great, OK, will do.

Digits
06-07-05, 05:57 AM
ZQuickMask works by creating a transparent 3DPlane and placing it in front of everything else on the canvas (at -4096 ZDepth). This is how you can draw a flat mask. By moving the mask layer backwards in ZDepth (positive values in the slider), the other pixols will poke through the plane and new drawn objects will interact.
Ah! that is how it works. Perhaps you could add a shortcut button that you could press and read a point on the canvas to set the Zdepth for the mask using PixolLook. That way you could control which portions of the canvas to interact with, much like the Fog sliders.

marcus_civis
06-07-05, 06:08 AM
That's a great idea, thanks Digits! It would be very useful as a starting point for shifting a layer back and forth. You can actually cycle layers 16 times forwards or backwards before they loop (16 x 4096). Not sure exactly how that relates to Z depth.

[EDIT: now I am. Never looked closely at Z in PixolPick before. Because of the layers I'd always assumed that ZDepth ended at -4096. I see it doesn't. It's -32576. At least, according to the command reference, though 8*4096 is 32768. :)

Certainly fog-like effects are possible, though more than one layer can cause problems of visibility/transparency. I'm still playing with that...

geccko
06-09-06, 04:11 AM
Thank you very much . This is very usefull.

Rory_L
06-09-06, 04:58 AM
`The mask is [...] with no [...] soft edges`


Marcus, I tried it out and am eager to use the plugin, though if it is restricted to creating clip map style masks I`ll have to pass on it. I`m surely misunderstanding the usage here: there has to be a way of making antialiased and gradient-edged stencils with your plugin, hasn`t there? Otherwise you`ll end up with texture and mesh jaggies, no?

Cheers,

R

marcus_civis
06-09-06, 05:23 AM
geccko,
Thanks, I'm glad you find the plugin useful.

Rory_L,
The plugin is designed for 2.5D work rather than masking 3D models. You can mask models in the way you want by using alphas, painting with Ctrl pressed, and so on. Having said that I do intend to update the plugin at some point and will certain improve it in the way you suggest, if it's possible.

Cheers,

Rory_L
06-12-06, 03:00 AM
Thanks, Marcus: I`ll keep an eye out for updates!

Cheers,

Rory (gift-horse dentist)

bonbaez
01-08-07, 11:30 PM
great tool!!

spiraloid
10-08-08, 02:45 AM
Hey Marcus,

so I tried my hand using this, but I realized I wanted to work on my masks as textures so I could use projection master, zmapper, stencils, masks etc while I fine tuned my masks. great for doing texture work. I wrote the script as a toggle, but of course, I'm getting a syntax error. I've tried everything I could think of, but perhaps someone else interested in something like this might have some ideas what I'm doing wrong?

-b

marcus_civis
10-08-08, 03:45 AM
Hi spiraloid,

I'm a little unsure what you want your script to do. As far as I can see the second part sets a mask based on color intensity and then converts a texture back to polypainting. This means that any areas you have masked won't get the color from the texture.

I edited the script so that the first press converts any polypainting to a texture then clears the polypainting. The next press then clears the mask and restores the polypainting. Any masking you do would have to be applied - and used - between button presses.

HTH,

spiraloid
10-08-08, 03:55 PM
Hey marcus, thanks for taking a look!

so the goal of the script is to be able to press it a thousand times without creating thousands of 2048 textures. I want to keep all of my colors as vertex color so I can use symmetry, smooth etc. I'm trying to use the texture as a "clipboard" for the final color while I paint a new greyscale vertex color that I can turn back into a mask to use on the original vertex colors.

all this is because I want to use the masking tools to edit my masks.

(if you've ever used the q key in photoshop, this is what I'm trying to make)

I've got it close, but I'm a little confused about the next step. I have a mask, and now I want to reload the original colors as vertex colors on the whole object so I can use the mask to edit them. whenever I do this, the mask is active. so the conversion filters through the mask. is there a way to temporarily deactivate the mask so I can Txr>Col for the whole object and not use the mask?



-b

spiraloid
10-08-08, 04:04 PM
the pseudo code looks like:

//if quickmask state off

// save current tools vertex color to clipboard texture and hide it.

// clear object color to white, set brush color to black.

// set quickmask state on.

//else

// create a mask using current color intensity

// deactivate mask.

// recall clipboard texture and convert back to vertex color for whole object.

// activate mask.

// set quickmask state off.

//end

-b

spiraloid
10-08-08, 08:49 PM
here's the pseudo code expanded to what I could figure out. it doesn't run because I think I'm miss casting data types, typos, etc.

I can't for the life of me figure out how to to keep the mask around but not active. I guess I can make an alpha, but then I'd be accumulating alphas each time I run it. so, fail. hmmm. this makes me feel like an idiot. perhaps zbrush can't do this unless I write my own texture manager in zcripts. but since I'm allocating memory etc in the "scripting" language, maybe I should just write it in c++, jeez. who'da thought making a temporary mask editing mode would be so involved. I'm sure I'm missing something. suggestions, welcome.

-b

marcus_civis
10-09-08, 10:33 AM
OK, I think this can be done but I may not be able to get back to you for a day or two. :)

marcus_civis
10-09-08, 11:58 AM
Well maybe try this. Unzip and put the ZSC in the ZStartup/ZPlugs folder. Restart ZBrush and the button will be in the Stencil palette.

spiraloid
10-13-08, 05:48 PM
Hey thanks for taking a look again marcus. crashed out for me. it errors asking for me to shift click to create a stencil, then a dialogue saying texture00 has not been created.

marcus_civis
10-22-08, 08:46 AM
Hey thanks for taking a look again marcus. crashed out for me. it errors asking for me to shift click to create a stencil, then a dialogue saying texture00 has not been created.

Have you got the original ZQuickMask - from the start of this thread - installed? It looks as though you have because those errors will be produced by that version (which is not compatible with ZBrush 3).

romeocostan
10-22-08, 11:29 AM
well, the button dont appear in stencil palette :eek: