Sure I don’t mind sharing.
So marcus_civis explained how to put the Active Points in a variable:
[VarDef,pointCount,0]
[Mesh3DGet,0,,,pointCount]
Here’s how I used it:
MY “IDEAL” SETUP
I wanted to automate Decimation Master and 3D Print Exporter down to 1 button click. I work with a team of 6 guys. We’re constantly sending models off for 3d prints. So I thought I’d streamline the decimation and export process.
Here is what I wanted (there is one big reason this won’t work, explained later):
- Pre-Process All subtools through Decimation Master
- Cycle through every subtool, check the active point count. If the point count is over 75k then decimate it down to 75k. Otherwise, leave it alone and go to the next subtool. Repeat the process
- Export subtools using 3D Print Exporter found in zbrush
The reason this won’t work is, as soon as my code clicks the Pre-Process All button in Decimation Master, my script exits because Decimation Master is a plugin that calls it’s own scripts. So as soon as the Decimation Master script starts my scripts ends. I really wish this wasn’t the case. It would be very useful since I can’t access the code for Decimation Master.
//<<WARNING: THIS WON'T WORK BECAUSE AS SOON AS A BUTTON FROM ANOTHER PLUGIN IS CALLED MY SCRIPT EXITS//Create button
[IButton,"Decimate All to 75k","Decimate All subtools to 75k",
// [IFreeze,
// [IShowActions,0]
//Variables
[VarDef,totalSubtools,0]
[VarDef,pointCount,0]
//put total number of subtools in a variable
[VarSet,totalSubTools,[SubToolGetCount]]
//Decimation Master Pre-Process All subtools
// [IPress,Zplugin:DecimationMaster:Pre-process All]
// This script stops working at this point!!!
//Scroll to bottom of subtool menu
[ISet,Tool:SubTool:Subtool Scrollbar,0,0]
//Select top subtool
[IPress,Tool:Subtool:Subtool 0]
[Loop,#totalSubtools,
//put Subtool Point Count in a variable
[Mesh3DGet,0,,,pointCount]
//reduce active point count down to 75,000
[If,(pointCount < 75000),
//than
[ISet,Zplugin:Decimation Master:% of decimation,100]
,//else
[VarDiv,pointCount,75000]
[ISet,Zplugin:Decimation Master:% of decimation,pointCount]
]//end IF
//Decimate current subtool
[IPress,Zplugin:DecimationMaster:DecimateCurrent]
//select next subtool above
[IPress,Tool:Subtool:SelectUp]
]//end LOOP
// ]//end freeze
// [IShowActions,-1]
,,1//button size
]//end button
MY “REALITY BITES” SETUP
I still found a way for this to be semi useful. Here are the steps:
- I click Pre-Process All in Decimation Master.
- I select a subtool
- Run my script … subtool is decimated to 75k.
- I select next subtool
- run my script, etc
- The 3d Print Exporter process can’t be streamlined, so I export everything manually.
Not ideal but at least it speeds up the process a little.
Here is what I ended up with:
//Create button
[IButton,"Decimate to 75k","Decimate selected subtool to 75k (You need to run a Pre-Process first)",
[IFreeze,
[IShowActions,0]
//put Subtool Point Count in a variable
[Mesh3DGet,0,,,pointCount]
//reduce active point count down to 75,000
[If,(pointCount < 75000),
//than
[ISet,Zplugin:Decimation Master:% of decimation,99.99]
,//else
[VarSet,percent,[Val,75000 / pointCount]]
[VarSet,percent,[Val,percent * 100]]
[ISet,Zplugin:Decimation Master:% of decimation,percent]
]//end IF
//Decimate current subtool
[IPress,Zplugin:DecimationMaster:DecimateCurrent]
]//end freeze
[IShowActions,-1]
,,1//button size
]//end button
QUESTION
Concerning 4R5 ...
All of the plugins now have this listed under them in the ZBrush Plugins Download Center: *This plugin is included with a default installation of ZBrush 4R5. See here: http://www.pixologic.com/zbrush/downloadcenter/zplugins/
Does this mean the plugins are now integrated into zbrush? Or do they still reside under the Plugin menu?
I’d prefer them to actually be truly integrated into zbrush so I can call them in my own scripts.