ZBrushCentral

ZSpheres in Zscript

Hello, I am making My first Zscript and I am having some troubles with Zspheres… My problem is that I dont seem to get anything from [ZsphereGet]… I used inside the Zsphereedit command… Not sure what I am doing wrong. For example, I am trying to get the number of Zspheres [ZsphereEdit,[ ZsphereGet,0]] …and I get 0…
Another little question if someone knows the answer…, Whats does Timestamp means in the Zsphereget command?

Might take a note to use it. http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/#Special_3D_Tool_Commands

You need to assign the return value to something in order to use it. For example, in the code below the variable ‘totalZSpheres’ is set to the return value of [ZSphereGet,0].

[ZSphereEdit,
[VarSet,totalZSpheres,[ZSphereGet,0]]//get total number of zspheres
,0]
[Note,totalZSpheres]

The Timestamp is basically the creation time of the particular ZSphere. This can be useful if you want to check for whether symmetry was used as two (or more) ZSpheres will have the same Timestamp value.

HTH,

Thanks Marcus! you are always helpfull!

Thanks, I was using a message OK :-/ But my problem was that I used the command zsphereedit inside the VarSet when it should be like marcus wrote, first ZSphereEdit and then varset and then ZSphereGet. Messageok or note , it really doesnt matter. Sorry for being a pain. but thanks!

I am trying to set the color of my zspheres , either from ZSphereSet or ZSphereadd when I create Them ,but I don’t get any color change.
I am also assuming that the zspheres color will determine polygroups in adaptative mesh…

I have tried Hexadecimal color code and the value from the RGB command … It doesnt give me any error but nothing happens.
this is the code I am trying…[ZSphereEdit, [ZSPhereSet,5,0,0x0000FF]]… this should make my 0 sphere blue… I have also tried [RGB,0,0,255]

I don’t believe it’s possible to do anything other than set a color and create your armature. :confused: With PolyF enabled, the polygroups will be different colors when previewed and isolation is easy after making the adaptive skin.

I figured it Out, You have to add [Ipress,color:fill3Dobject]… I dont know if there is another way but this seems to work…
Edit:Well, I think doug jones was right… Maybe it’s not possible…

I don’t mind the colors , I just want to be able to assign polygroups… I know I could do it after but that would be time consuming. I am making a tree with many branches and i want to set a different polygroup for the trunk and other for the branches or the caps…thats the idea. If i have a tree with many of branches I dont want to go one by one making polys… the script is already working pretty good , I will keep posting stuff here. and thank you very much for the interes…

Interesting. Would you have a text version you’d share?

Sure, I sent you a private message.

well, I don’t think its possible to do what I wanted. ZSphere colors don’t mean adaptativemesh groups :mad:. I think they would be a lot more usefull if you could set groups and not just colors. masking doesnt work either since group by mask doesnt work with zspheres.

But what you do have is both quite interesting and amazing. Thanks for that, more to come :wink:

http://youtu.be/GWH0EFS2oLo
http://youtu.be/WmgMYfUSsd0

That’s very impressive and I’d love to try it if you feel able to share.

You can set the polygroup by applying the same timestamp to the zspheres you want to be in the same group. This doesn’t give you any control over the polygroup color. Also, it means that you can’t then use the timestamp to, for example, determine if symmetry was used to place the zspheres.

EDIT: Forgot to mention, when adding a color to zspheres you can just turn on Tool>Polypaint>Colorize.

HTH,

It’s pretty neat. I jotted a basic idea down(similar) a couple months ago, but didn’t proceed from there. Still playing with it here :wink:

oh Thats So good! Thank you! i will have to use that and change a couple of things! … i was planning to release the zplug after I write some instructions. But I m really bad explaining myself.

Just a couple minutes to do this. You guys and gals are going to love it once released :wink:
ZTree1.jpg