ZBrushCentral

Proportional Subdivision

(This tiny script retains the proportions of a model when subdividing.)

I’m not sure if this has been covered before elsewhere but I figured out a way to use Zbrush’s Cage button to retain the proportions of a low-poly mesh when subdividing. The result is a high-poly mesh which conforms much more closely to the shape of the original low-poly mesh.

prop_subdiv.jpg

Just load the script (Prop_SDiv.TXT) from the Zscript Menu and two buttons will appear in the Zscript window:

1.) Prop.Subdivide (“Press this to retain a model’s proportions when subdividing.”)

2.) Undo (“Undoes last Proportional Subdivide. Use only immediately after Proportionally Subdividing (simply Undoes last four actions).”)

The script is pitifully simple because I have no expertise in creating scripts. After watching the script play a few times you might want to start subdividing in this fashion without the script just to see how and why it works the way it does. Turn off “Show Actions” in the Zscript Menu if you want it to play faster.

Good work and useful. Thanks! :+1:

Thanks so much for the script! Can’t wait to try it out!

I didn’t even know this was possible, thank you!

For a first post, not bad! :smiley:

Thanks for this! Very innovative use. I like the way you are thinking about ZBrush. :+1: :+1: :+1: :+1:

r

I really liked the concept for the original script here by Marsyas but thought it might be used more often if it were available as a plugin button.

So I created a Smart Div plugin version. For anyone interested in the conversion process, I’ve included the SmartDiv.txt script.

However, to use Smart Div, you will want to install the SmartDiv.zsc version found in the attached zip file:

// Plugin button for Smart Proportional Subdivision - adapted by Svengali, Sept. 05
// Originally, a marvelous tool for a controlled subdivide conceived and posted by Marsyas...
// presented in the ZBCentral thread at:  http://www.zbrushcentral.com/zbc/showthread.php?t=26639

[ISubPalette,TOOL,0,,0,6,0,0]
[IButton,"TOOL:Smart Div","Smart proportional subdivision of model",
	[If,[IGet,TRANSFORM:EDIT OBJECT] == 0,
		[Note,"No active PolyMesh...",,1]
		[IPress,ZSCRIPT:Previous]
		[Exit]
	]
	[If, [IExists,TOOL:Geometry:Reconstruct Subdiv] == 0,
		[Note,"Must be a PolyMesh...",,1]
		[IPress,ZSCRIPT:Previous]
		[Exit]
	,  // else
		[ISet,Tool:Geometry:SDiv,[IGetMax,Tool:Geometry:SDiv]]		// needs to be at highest subD
		[IUnPress,Tool:Geometry:Smt]
		[IPress,Tool:Geometry:Divide]
		[IPress,Tool:Geometry:Lower Res]
		[IPress,Tool:Geometry:Cage]
		[IPress,Tool:Geometry:Del Higher]
		[IPress,Tool:Geometry:Smt]
		[IPress,Tool:Geometry:Divide]
		[IPress,ZSCRIPT:Previous]
	]
	,,72,,,20
]

To install, simply unzip SmartDiv.Zip into the ZStartup/ZPlugs folder. The next time you startup ZBrush2 you’ll find a button called Smart Div under the Tool Palette.

Note that the “smart proportional subdivision” will only be performed on a PolyMesh model in Edit Mode.

Thanks Marsyas for a neat and original utility! Hope Zbrushers will find this plug-in version useful.

Sven

Thanks Svengali! I was actually hoping someone would make a decent script of this function. :slight_smile:

Good work Sven! :+1:

Very useful … what’s the hotkey?? :confused:

Marsyas -
Hey, glad to do it. It’s really a very useful function and the conversion was trivial. Thank’s again! :slight_smile:

Marcus -
No hotkey, sorry - gotta pressa da button. :rolleyes:

Sven

hey this is cool…don’t know how I missed this thread in the first place but thanks to both of you…Marsyas and Sven!

another cool one to add to the growing page of coolness.

OK Sven, but why is the ‘123’ in your code?
:wink:

AhHa! Because I cut and pasted a little piece of code from an old script and missed that I’d brought it along. :smiley:

Sven - (trying to do six things at once)

[edit - Removed the 123 from the above script… ]

Just have to add my two cents here! Super script, Marsyas and Svengali! Just what I needed but was too dumb to create or even think of! Keep up the great work!

Since I have only been playing with old sculpts in Z3 so far, I was wondering if a script such as this one is needed for Z3 or if it has a built-in feature similar to this? Proportional Subdivide was invaluable to me in Z2 and saved me a lot of grief, that is why I am asking.

Hi Lander,

Here ya go. unzip and drop into ZStartup\ZPlugs. SmartDiv Button appears at end of Tool menu… Works in ZB3 the same.

Also, check out the CreaseDivide Plugin.

Sven

Many thanks, Sven! :smiley:

This is one of my fave’s and you cant imagine my joy reading your message with the download link. I have been using this exclusively as sub-d mode since I first discovered it and am extremely happy to be able to continue with it in Z3.

Thanks a lot again!:+1:

Greetings from Berlin,
Felix

PS: Moving on to the other plugin. The referral is much appreaciated!

another goodie…thanks for the update, Svengali! :slight_smile:

WailingMonkey

Awesome! Thanks so much! I’m looking forward to using this!

Note: It would be great if this came with a readme.txt file in the zip. Preferably labelled: “scriptname_readme.txt” so that it can be referred to in installed directory as necessary, without searching ZBC for info.

And with a corresponding link in the ReadMe to this thread for up-to-date reference and versions. :slight_smile:

Sweet! Thanks for the plugin, guys! Also, Svengali, using your first plugin, if I SmartDiv in quick succession, sometimes it’d take me back to the welcome screen. Is there a difference between the two?

Edit:
I think it’s because [IPress,ZSCRIPT:Previous]. I //ed them and try to put the SmartDiv buttun inside TOOL:Geometry but now it wouldn’t automatically load on startup. Any ideas?

// Plugin button for Smart Proportional Subdivision - adapted by Svengali, Sept. 05
 // Originally, a marvelous tool for a controlled subdivide conceived and posted by Marsyas...
 // presented in the ZBCentral thread at:  http://www.zbrushcentral.com/zbc/showthread.php?t=26639
 
 [ISubPalette,TOOL,0,,0,6,0,0]
 [IButton,"Tool:Geometry:Smart Div","Smart proportional subdivision of model",
 	[If,[IGet,TRANSFORM:EDIT OBJECT] == 0,
 		[Note,"No active PolyMesh...",,1]
 	//	[IPress,ZSCRIPT:Previous]
 		[Exit]
 	]
 	[If, [IExists,TOOL:Geometry:Reconstruct Subdiv] == 0,
 		[Note,"Must be a PolyMesh...",,1]
 	//	[IPress,ZSCRIPT:Previous]
 		[Exit]
 	,  // else
 		[ISet,Tool:Geometry:SDiv,[IGetMax,Tool:Geometry:SDiv]]		// needs to be at highest subD
 		[IUnPress,Tool:Geometry:Smt]
 		[IPress,Tool:Geometry:Divide]
 		[IPress,Tool:Geometry:Lower Res]
 		[IPress,Tool:Geometry:Cage]
 		[IPress,Tool:Geometry:Del Higher]
 		[IPress,Tool:Geometry:Smt]
 		[IPress,Tool:Geometry:Divide]
 	//	[IPress,ZSCRIPT:Previous]
 		[Exit]
 	]
 	,,72,,,20
 ]

Hi feureau,
You are right to comment out ZSCRIPT:Prevous. I think everyone writing ZScripts for ZB3 has now abandoned that strategy because of the new opening script… too bad. We tried several different work arounds but each still created another problem.

As for not being able to put the button inside TOOL:Geometry, I think it’s because at startup, the TOOL:Geometry subgroup doesn’t exist (no 3dtool loaded yet) and whenever the ZPlug loader can’t resolve a line in a plugin, it just rejects it.

If you want to, you can change the script to read:


[ISubPalette,ZPLUGIN:Svengali,0,,0,6,0,0]
 [IButton,"ZPLUGIN:Svengali:Smart Div","Smart proportional subdivision of model",

Which will put the button in the Plugins menu under Svengali… then you can drag it wherever you want it… or you can just make the old code as it was.

Sven