PDA

View Full Version : Proportional Subdivision



Marsyas
06-16-05, 06:00 PM
(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.

marcus_civis
06-17-05, 12:06 AM
Good work and useful. Thanks! :tu:

wenna
06-17-05, 05:24 AM
Thanks so much for the script! Can't wait to try it out!

Digits
06-17-05, 05:40 AM
I didn't even know this was possible, thank you!

ryankingslien
06-17-05, 09:27 AM
For a first post, not bad! :D

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

r

Svengali
09-07-05, 10:25 AM
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

Marsyas
09-07-05, 11:07 AM
Thanks Svengali! I was actually hoping someone would make a decent script of this function. :)

marcus_civis
09-07-05, 01:55 PM
Good work Sven! :tu:

Very useful .... what's the hotkey?? :confused:

Svengali
09-07-05, 06:26 PM
Marsyas -
Hey, glad to do it. It's really a very useful function and the conversion was trivial. Thank's again! :)


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

Sven

aminuts
09-07-05, 10:34 PM
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.

marcus_civis
09-07-05, 10:58 PM
No hotkey, sorry - gotta pressa da button.
Sven

OK Sven, but why is the '123' in your code?
;)

Svengali
09-07-05, 11:45 PM
OK Sven, but why is the '123' in your code?


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

Sven - (trying to do six things at once)

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

highlander_72
01-18-07, 12:01 AM
Just have to add my two cents here! Super script, Marsyas (http://www.pixolator.com/zbc/member.php?u=6517) and Svengali! Just what I needed but was too dumb to create or even think of! Keep up the great work!

highlander_72
05-31-07, 06:36 AM
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.

Svengali
05-31-07, 07:23 AM
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. (http://www.zbrushcentral.com/zbc/showthread.php?t=45593)

Sven

highlander_72
05-31-07, 09:04 AM
Many thanks, Sven! :D

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!:tu:

Greetings from Berlin,
Felix

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

WailingMonkey
05-31-07, 09:38 AM
another goodie....thanks for the update, Svengali! :)


WailingMonkey

zerodean
06-09-07, 03:05 PM
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. :)

feureau
06-16-07, 12:52 PM
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
]

Svengali
06-16-07, 03:19 PM
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?
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

feureau
06-24-07, 03:24 PM
Ah, yes, it all suddenly becomes clear now. Thanks, Svengali! :P

SNARK
07-24-07, 08:17 AM
Marsyas,

This plugin works great! Does it eliminate the need to set a morph target before subdivision or should that still be manually set?

~S.~

Marsyas
07-24-07, 06:43 PM
Thank Svengali for the plugin. :)

This method of subdividing has nothing to do with morph targets, it simply utilitzes the 'cage' button.

The basic steps are:

subdivide with 'smooth' turned off
lower subdivision
press 'cage'
delete higher subdivision
subdivide with smooth turned on

SNARK
07-26-07, 05:00 AM
Hi, Marsyas.

I really like your method but I have a question. In the typical approach to Z3 subdivision sculpting you start with a morph target of your low-res mesh. Your technique does not require morph targets. Does this mean that if I choose your method, no morph target is required at all to proceed with my subdivision sculpting? Does your method replace the need for a morph target at all? Just want to be clear.

Thanks!

Marsyas
07-26-07, 05:45 AM
Hi Snark,

I'm not really sure what you're refering to. I've never seen a need to set a morph target before I subdivide. You can set a morph target whenever you want during your work flow for various reasons. Perhaps you're refering to a certain workflow someone has mentioned for their particular pipeline.

SNARK
07-26-07, 09:48 AM
Hi, Marsyas.

You're probably right. I'm basically a hobbyist who loves the program but I don't get to work with it very much. Thanks for the response.

~S.~

precisionart
09-03-07, 05:00 PM
Are my choices either proportional subdivision OR crease divide? Or is there a way of getting the benifits of both?

Could these two plugins be integrated into one?

Thanks,
mike

Marsyas
09-04-07, 07:34 PM
I'd say to just use whichever gives you the results you want. I'm not familiar with crease divide but I know proportional subdivision sometimes gives funny results with sharp corners.

SNARK
01-14-09, 11:39 AM
Hi, Marsyas.

Great plugin.

How do I install it? I'm having some trouble. Where should it be installed? Once installed, where (in ZBrush) what palette do I go to in order to find and activate it?

I've installed this before with no trouble but now with my new system (I'm using Vista 64) it doesn't show up in ZBrush at all. What gives?

Thanks!

~S.~

Marsyas
01-16-09, 12:42 PM
Hi SNARK,

I'm not really sure either actually. I just tried extracting it into my zplugs folder but I don't see it anywhere in the Z3 interface.

I only subdivide like this occasonally so I just do it manually when I need it. Maybe Svengali can help you.

highlander_72
11-25-09, 02:16 AM
Any chance this will be available for 3.5R3? As far as the list on the announcement page goes its not included in the Install.

I thought I'd give this a selfish little bump, since i use it a lot in 3.1.:D

Cheers and thanks a lot for your efforts!