ZBrushCentral

[Mesh3DGet], [IClose] and ZBrush Scale

Hey everyone,

i started zcripting recently and i’m currently working on a plugin. So far everything works as i planned but there are 3 issues i just cannot solve. Maybe some of you have ideas why this does not work:

  1. [Mesh3DGet, 0]: I need to get the poly or point count of the currently selected subtool. The command list says this should be possible with Mesh3DGet but for some reason it does not work. I tried to simply get the pointcount and give it out as a note for testing but all i get is 0. What is wrong and does anybody know how to get the the polycount on lowest subdivision level?

  2. [IClose]: I worked with the tutorial view so far and my buttons work and update when i reload the script. I now want to create the layout and followed MadPonyInteractives Tutorials on Youtube. He uses [IClose] to close the interface and then reloads it. No matter what i do [IClose] does not work. Any ideas?

  3. ZBrush Import Scale: This is not a problem but if someone knows sth about this i would be glad if you could share your knowledge. I coded a batch import/exporter for Zbrush and Blender to quickly transfer objects. So far everything works just great except a little detail. I tested scales and already have proof that blenders exports are not the problem. So for some reason ZBrush imports files and makes them 10 times smaller. When i export them from ZBrush again Zbrush exports the objects 10 times bigger. So actually the scale is okay in the end but nevertheless it’s a bit weird as the scale in zBrush is off while working. I maybe wanted to include scale options in the plugin so any info would be cool!

Greetings to you all and thanks for responses!

  1. I haven’t tested this command yet in the new version, but I’ll try soon and let you know what I find.

  2. I can confirm that IClose is not working for me in 2021.1.1. This is highly concerning since it’s pretty critical for plugin development and reloading to avoid orphaned interface / state

  3. The scale change you are observing is standard ZBrush operation. It’s tools work best inside of “Unified Space”. This is a normalized 3D working region, and when objects are imported larger than that standard region, ZBrush conforms the imported geometry. On import, the scale factor is recorded, and applied on export. Great care must be taken to preserve that, else you may not be able to faithfully re-scale the model in the external DCC if it needs to leave ZBrush

Hey there!

Thanks a lot for the answers, this helps me a lot! Especially the hint on 3. is very useful, i will see how i can continue my development. Guess working on the UI will be a challenge without iClose :wink:

  1. use mesh3dget that way so you can get the face number:
[VarSet, output, 0]
// 0 = points , 1 =  faces, etc..
[Mesh3dGet, 1,,,output]

cause if you do it that way, it gonna nothing right :rofl:

  1. will be fixed in next build

Hi Facelessmindz,

thanks soooo much!!! I didn’t recognize that you have to specify an output variable. Now everything works just as it should and i can continue my work on a plugin i stopped because i just needed this function.

Again Thanks!

:+1: