ZBrushCentral

Regarding the problem of ZScript obtaining the volume of the current subtool object。

Hi everyone !
I want to know, how to get the volume of the currently selected subtool object through ZScript?
It is currently known that the size and volume parameters of the currently selected subtool object can be obtained through the “Transform:Subtool Analysis:Analyze SelectedSubtool” button. However, I only need the volume parameters. How can I obtain them separately?

@marcus_civis
Hi, marcus_civis。
Could you please help me answer this question?

@facelessmindz
Hi , Could you please help me answer this question?

make sure the mesh is water tight;
and this might do the job :

[If, [IsPolymesh3DSolid],
	[VarSet, vol, [GetPolyMesh3DVolume]]
	[note, [StrMErge, "Volume = ", vol]]
,//else
	[note, "the subtool is not solid;]]
]

Well do not forget to check the last Zscript documentation from Zbrush Zscript palette, i know the official zscript commands references is not updated.

hope it helps,
Nicolas

Thanks Nicolas, your answer made me think of a great solution.

@facelessmindz
I would like to ask you one more question.
[Note, “Hello”]
I want the “Hello” inside to be a different font color, and I want it centered in the pop-up message window.
May I ask how to write this code?

please don’t ping me, like that every time you have a question.

If you want a centered button then you just determine the size of the button and his horizontal /vertical position with the main note area.

For that take a look at the Note interface tutorial here :
https://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/sample-zscripts/

about colored text you can use this method : \C + hexadecimal RGB value

so it would looks like
[Note, "\Cffffffsome text in black. \C000000 Some text in white"]

Nicolas