ZBrushCentral

How should I scale to the same size as the actual screen xyz?

Please tell me how should I scale it to the same size as the actual screen xyz?

My exact requirement is how to preview the actual produced size on the screen

That’s actually quite difficult to do. Aside from adjusting the size on screen within ZBrush, you also need to know the screen resolution of the device that ZBrush is displayed on - something that is beyond the scope of zscript.

Thank you very much, is it possible to use dll to achieve it?

I saw that other teachers have made such a zbrush script plug-in, which can realize this function, but I have thought about it for a long time and have no idea.

What other ZBrush plugin has this functionality? I’d be interested in seeing how they work.

Yes, you need a dll to make it work. This example uses the PaintStop plugin dll, so you must have that installed in order for it to work. (PaintStop is part of the default ZBrush installation.)

This example also assumes a screen resolution of 96 ppi, so it won’t work with retina screens. It is possible to get the ppi of a screen but that function is not included in the dll I’m using. Also, it is very unlikely that you will get a perfectly accurate result!

DisplayActualSize.txt (1.9 KB)

Thank you very much for your help, do you use the caliper master plug-in, there is this 1:1 actual scaling function, I think he is made using dll

May I ask why there will be errors in 2019-2021, only 2022 will notSnipaste_2022-01-17_11-06-58

Thanks - yes, I remember that but have not used it.

The script I posted will only work with ZBrush 2022. You would have to edit the PaintStop data folder name for it to work in previous versions.

Thank you so much

Instead of using a dll you could simply get the user to input the values to a couple of sliders, one for the actual width of their screen in inches, and the other for the horizontal display resolution (i.e. the number of pixels across the screen width).

You would then use those values like this:

[VarSet,screenWidth,23.5]//actual width of visible display
[VarSet,pixelsWidth,2560]//horizontal resolution
[VarSet,ppi,pixelsWidth/screenWidth] //actual pixels per inch

[VarMul,displaySize,(ppi/25.4)]//for mm

The values I’ve used for “screenwidth” and “pixelsWidth” are just examples but these would be got from the user.

This is actually the most accurate way of doing it because the dll can’t reliably get the actual number of pixels per inch.

This way doesn’t need the “screenFactor” - that was simply an adjustment between the defined pixels per inch and the actual pixels per inch.

ok thanks again

Excuse me again! I want to know some knowledge about dll, such as [VarSet,screenF,[FileExecute, [Var,dllPath], GetScreenFactor]], how did you find this GetScreenFactor function, is there any way to open source to view the dll What about functions? Or how should I call someone else’s dll, or is there any way to develop my own dll? Thanks again for your help

I wrote the dll. The GetScreenFactor function was included because I needed it for PaintStop (which I wrote).

Although it is possible to find out what functions a DLL has, it’s not easy to use them because you won’t know what parameters to send to the DLL. It is better to write your own using the C++ programming language - but of course that means you will need to know (or learn) C++ and you’ll need a compiler and editor such as Microsoft’s Visual Studio.

For some common functions you may be able to use the ZFileUtils.

If you are going to trying writing your own you may find this template useful:
ZBrush_DLL_Template_2022.zip (10.2 KB)

1 Like

I dreamt that a documentation where added with access to uvmaster, decimation and zremesher was referenced :slight_smile: Would be so good to share the headers directly so we can do something with what we have.

vscode + cmake + mingw work well too :smiley:

Nicolas

Thanks a lot for the help, I will continue my research