ZBrushCentral

Canvas Color Palette (zb3.1 & zb3.5)

Canvas Color Palette for zb3.5 and zb3.1.

      Like many of you, I loved [marcus_civis' ZSwatch plugin](http://www.zbrushcentral.com/showthread.php?t=23194).  As a scripting exercise I wanted to make my own version with a slightly different twist.
      
       [![ccp_ui.jpg|172x187](upload://kq5vyESD7pSt4gJvmnDOpQFLgBy.jpeg)]![ccp_screen_highlight.jpg|1020x930](upload://xiJ4fjAe08Lq8BJH2ySrU4MqeLz.jpeg)

Canvas Color Palette use:

  • Using the left hand menu's color picker, or the color picker from the Color menu, select a color.
  • Decide if you would like your palette on the top or bottom. Press your selection: "top" for top or "bot" for bottom. ( Note: zb3.5 will toggle between the selections, zb3.1 will not )
  • Decide if you would like your palette on the left or right. Press your selection: "lf" for left or "rt" for right.
  • Decide if you would like a horizontal or vertical palette. Press your selection: "hor" for horizontal or "vrt" for vertical.
  • *Note* You only have to make the placement selections once, unless you would like to make another palette in a new location.
  • Adjust the "Width" and "Height" sliders to the size patch you would like.
  • Press one of the numbered buttons. Number "0" will place a color in the corner of the canvas, while "9" will place a color towards the middle of the canvas, but still on the edge.
  • Place up to 10 colors in each palette location. "0" overlaps in each corner.
  • As you paint, hover over a color you would like to use. Hit the "c" hotkey ( zb default ) to grab the color of your choice from any of your palettes and keep painting.
Load/Save/Clear
  • The "Load" button pulls up a dialog box asking for a "zdt" file. If you have saved a palette previously, select it and your palette will load onto the canvas.
  • The "Save" button pulls up a dialog box to save your current palette.
  • *Note* I am using "zdt" because I found that extension in an example Zscript. I don't know if it is a valid ZBrush extension. It's worked for me so far....
  • The "Clear" button clears the canvas. If you have anything else dropped to the canvas, it will clear that too. The active tool stays on the canvas. It also clears the memory, so you can start a fresh palette.
In the image above I have placed the buttons and sliders into the left hand menu directly under the color picker. To do the same:
  • Go to Preferences -> Custom UI -> Enable Customize
  • Press and hold "ctrl"
  • Drag and drop the button or slider to a new location
  • Repeat for the other buttons and sliders
  • Turn off Enable Customize
  • Save your UI and Config
I've included a zb3.5 plugin as well as a zb3.1. I've also added the source script in case anyone would like to modify the script for their own use.
   -Toddp

Attachments

ccp_zbc_thumb01.jpg

canvas_color_palette_1.0_3.5.zip (13.3 KB)

Looks great! I will try it immediately!!!

Great Color Palette! Thank you so much. :smiley:

Great plugin and a neat implementation, thank you :+1: Nice touch with the size of the buttons so that they fit in the quick menu (although the left side of my menu is wider :))

Thanks for the enthusiasm. Tell me if it’s working for you.

[ccp_zbc_thumb01.jpg]ccp_zbc_thumb01.jpg

Works pretty well, thanks!

I do have a couple of comments though:

I could not see swatch 0, and I think I finally figured out why: My canvas size is slightly bigger than my screen. is there something in Zscript that can be done to remedy this?

Also, it would be grand to have more swatches. Perhaps you can build a whole slew of them (50?) into the plugin menu and just let people pull out as many as they like, instead of limiting to 10?

Is it possible to implement a stack of rows or columns instead of just one strip? perhaps A B C D E toggle buttons, where each letter indicates the next row or column? So if I want to add a 5th swatch to the 3rd column of swatches, I would toggle “C” then press “5”

At any rate, nice script, thanks so much!!!

Do you know wheres the color picker button in ZB? i need to change the default “C” hotkey.

alannoon - Thanks for the feedback.

  • I debated whether to account for a canvas that was larger than could be seen. There are plenty of zscript commands I could have used to place the palettes on screen. Ultimately I decided that it was better if they always appeared in a predictable location on the document even if it was off screen. As soon as the user would zoom out or scroll, new color patches would appear in a new location which was not preferable to me.

  • You can actually have 80 ( less 4 since the corners overlap ) patches of color by selecting a different side or orientation. I purposefully limited the number because I’m storing the data in memory so you can save and load them. Granted 1620 bytes ( 1.5K ) is very small, but I wanted to be minimally intrusive.

  • I thought about rows and columns of patch locations as well, but again wanting to keep things minimal, decided to go with what you see. I may make another version and do exactly as you describe.

-Toddp

Doqpelganger - I do not know of any equivalent button press that would give you the same functionality as the default “c” hotkey. My guess is that it is something similar to a zscript, but internal to the exe and/or not revealed to the user. I suggest one of the following workarounds:


  • Hover in the rgb/hsv box in the left hand menu. Press and hold the left mouse button. Drag to any location onscreen from which you would like to grab the color. Release the mouse button. The color should now be the active color.
  • Write an equivalent zscript. This may not be a viable solution for some ( many? ). If I have some extra time, I can write one and post it.
-Toddp

A very interesting and useful solution. :+1:

You could add a couple of buttons for color picking so that users could assign their own hotkeys. You need the code below


//commands for picking shaded color
[IFreeze,
[IKeyPress,ALT,[IClick,3352,[IHPos,3352,1],[IVPos,3352,1],([MouseHPos,1]-[IHPos,3352,1]),([MouseVPos,1]-[IVPos,3352,1])]]
]

//commands for picking unshaded color
[IFreeze,
[IClick,3352,[IHPos,3352,1],[IVPos,3352,1],([MouseHPos,1]-[IHPos,3352,1]),([MouseVPos,1]-[IVPos,3352,1])]
]

(You might need to change the item ID for ZB 3.1 Mini HSV Color selector, I’ve a feeling it might be 3331.)

HTH,

Cool Plug in very usefull thank you.
If you make a color row with the size of 32x32 and then change the size to smaler numbers lets say half the size, then you can ad more colors to your row because the smaler overlay the biger one.

marcus_civis - Thanks for the ideas. I was thinking of using PixolPick, but yours would allow for the shaded color as well.

zayzcoon - Yes, that was my intention to allow for multiple sizes to overlap. Just be aware that you will only be able to save and load the last patch if multiple patches overlay each other.

For example:


  • You select “top”, “lf”, “hor” orientation.
  • You set the patch to be 32x32.
  • You click “5”.
  • You select a new color.
  • You adjust the size to be 32x16.
  • You click “5”.
  • The script would overwrite ( in memory ) the 32x32 patch. You would see both patches, one on top of the other, but if you saved the palette, only the 32x16 patch would load.
Another way to save/load overlapping palette patches would be to save the document and load it up in your next session.

-Toddp

This is a very sweet and useful plugin…now no more go back to photoshop to get the colour i used for my models

Doqpelganger - To change the hotkey for picking the main color simply assign a hotkey to the Color > Main Color swatch. This also works for the Secondary Color swatch. Note that you can only pick unshaded colors this way.

Damn, I just found this and it’s fantastic! This is exactly what I’ve been wanting for a long time. I can’t believe with all of the powerful texturing tools ZB has, something like this isn’t implemented as a base feature already. FYI, this works perfectly on Mac 3.2 as well! Great job! :+1: :+1: :+1: :+1: :+1:

industripop - Thank you, glad you like it. Nice to know it works for the Mac version.

Thanks so much,
This is very helpful to me and i really appreciate all your
hard work and effort.

I did have trouble with the swatches getting due to
canvas being cutoff from UI.

So i thought i would use the new option in 3.5
“The W next to New Document” to create a new document
window with the size of the viewable canvas.:o

But it seems that once the document gets resized the plugin
doesn’t update with it. So if you create a smaller document,
the swatches get cut completely off.

Is there anyway you could add a center button, so that
they start from the bottomcenter or topcenter of the canvas.

Either way…love the plugin, so thanks.

Xsmoke - Thank you for the kind words and for taking the time to send feedback.

I have been spending some time this morning trying to replicate your findings. The only time I could get the plugin to fail to make a color patch was when Edit mode was turned off.

Currently, if Edit mode is off, the plugin exits and does NOT make a color patch. That is intentional, and somewhat lazy code writing on my part. Looking back the documentation that I provided in the op, I did not mention you have to be in Edit mode for the plugin to work.

Hopefully making sure Edit mode is ON will fix your issue.

If I have some time, I may make an updated version of the plugin based on everyone’s feedback from this thread.

Thanks,
Todd

Is this safe to use with 4.0?

Its exactly what im looking for right now.

@phrenzy84 - I have not updated it for Z4. It does not appear to be working properly now that I’ve finally tried it in Z4. An update will come this week.