ZBrushCentral

Material of Selected Subtool

Is it possible to get the material of the selected subtool?

I know this returns just the name of the subtool but is there a similar command to get the material? :

[MessageOK, [IGetTitle, Tool:Subtool:ItemInfo],“Material”]

No, there’s no precise way of doing what you want. But also it’s possible for a subtool to have more than one material (if it’s been painted with various materials) so a single command wouldn’t be relevant.

It might be possible to get the information you need using the [PixolPick] command which you can specify to return the material index for a given spot on the canvas. You’d need to get your script to do something like this:

  • turn on Solo so that only one subtool is visible
  • frame the mesh so it is central
  • PixolPick the center of the canvas
  • if the result is 0 then this would be Flat Color material and you’ve probably sampled the background (for example if there’s a hole in the subtool that coincides with the center of the canvas) so try PixolPick again with a different spot.

Sorry to bump an old thread but this doesn’t make sense to me…
so If I have 200 different materials I’m supposed to remember
what material I used for each sub tool?? Because there’s noway
to find out the current subtool’s material?

This is giving me a headache and it’s amazing there’s no option
to find out something as obvious as this

:idea: Materials can be named and saved after you’re happy and done fiddling with them. :wink: So, enough said there. :wink: Also subtools save their information, you can have your color and material as when created when you load it from a file. Have you tried dragging from the Material swatch?

My answer applies to zscript only. As a user you can easily find out what material is used anywhere on a model. All you do is click+drag from the large Current Material thumbnail (on the left of the standard UI) to the part of your model that you want to check. The selected material will change to whatever is under the cursor.