ZBrushCentral

Question: Light setup

Hmm. I’ve done some tests and it looks as though this is one of those problems that happen with zscript sometimes. I’ve tried various things without success - sometimes turning the model black, sometimes crashing ZBrush! :frowning:

I’ll continue to try and find what’s wrong but so far I don’t have a solution…

OK,I know.
Thank you very much for your help.:wink:

Hi,marcus

I’m converting my macro script into a plugin, but I’ll just add the button code now.
I would like to ask, how to add the ZBrush icon, slider and switch to the plug-in, can you give me some code demonstration?

The red area is what I don’t understand,
01.jpg

In addition, there are several scripts are more complex, I do not know how to modify.
Such as ID and 4_Color 3_Object Pass2.
02.jpg

Thanks very much!:wink:

I’ve attached a simple plugin that has a slider and a switch.

My_Plugin_UI.jpg

This is basically all you can do in zscript. A button can have height as well as width specified, and it can have an image (such as the 3D Print Hub plugin has). But the switch and the slider can only have width.

So much of what you highlight in red can’t be done in zscript.

For the scripts that are too complex for you, I’m not sure what the problem is. Can you post the code?

Hi, Marcus
For the switch, slider code, I also know.
I also looked at the command list.

I just don’t know how to change the functionality of the software into a plugin option,:confused:
For example Render:Render Properties:Details slider

Now I want to convert the customize palette options into plugin options.:wink:

The script
https://www.dropbox.com/s/n851jmgm8yjf8s9/QRender.txt?dl=0

3_Object ID, 3_Restore and 4_Color Pass2
The contents of these three parts are similar, and now I can’t make them work properly in the plugin. :o

Thank you very much for your help. :smiley:

You’d need to create a slider (or a switch or button, depending on what you were adapting) and then set the ZBrush item from it like this:

[ISubPalette,“Zplugin:BPR Render”]

[ISlider,“Zplugin:BPR Render: Details”,3,1,1,4
,“Best Preview Render maps detail level”
,[ISet,“Render:Render Properties:Details”,[IGet,0]]
,0
,1]

In this code the [IGet,0] means “get the value of this interface item” so that line of code sets the Render:Render Properties:Details slider to whatever the plugin slider is set to.

However, note that the plugin slider will not update if you adjust the Render:Render Properties:Details slider. There’s no way for a plugin to monitor the ZBrush interface. And as I said, things like the light position widget can’t be duplicated in a plugin. If you want others to use your plugin then you may find it simpler giving them a custom interface configuration file along with the plugin.

For the 3_Object ID, 3_Restore and 4_Color Pass2, these all use a routine called “DoIt” and you have three routines in your plugin with that name. That means there’s no way for ZBrush to know which routine should be called. Renaming them so there aren’t duplicates should fix the problem:

HTH,

ok,i see :wink:

Thank you very much for your help. :smiley:

According to your script, I can load light preset, which is to replace the current set of lights, but I hope that lights on / off, because I close other lights, only to open a light, I will only adjust the light effect, then open the other lights.

Upgrade to R8, and I fixed some script changes.
I found a problem.
when I used the light switching function,Performs scene rendering while switching lights, but there is no such content in the script,
So I would like to ask what is the reason for this?

Thank you very much!

I’m not getting that. It will do that if you have Best render selected in the Render palette - that’s normal behaviour - but I don’t get it for Preview or BPR.