ZBrushCentral

Aurick: Critical Question on using the Unify Button

Hi Matt…

In >> this thread you discuss the UNIFY button and its effect on SCALE…

This whole issue of UNIFY-button-use inside a script leaves me kind of queasy.

UNIFY can be very useful, even essential when trying to maintain symmetry, but if UNIFY automatically rescales as well, then that could be a problem… no, that will likely be a big problem.

I’m working on a ZScript that includes liberal use of the UNIFY command while manipulating the model. Apparently this means anyone who uses this ZScript is going to discover that their model may be different from what it used to be after using the ZScript and not know why. If I were a user and that happened to me I’d be upset with the script and the scripter. <cough>

Is there some way for me to accurately restore the original scale for ANY model, not just those which have been imported? Is there any way that a script can detect and store the current ZBrush unit that is in effect when the script is first executed? I’m not really sure even what to ask or how to talk about this secondary UNIFY effect on the model.

Basically I think what I need to know is how can I monitor and control (and restore if necessary) any scale change that is a “by-product” of using the UNIFY command in my ZScript.

Can you point me to some kind of definitive source of information for ZScripters on this UNIFY issue about how to control and neutralize its effect?

OR, am I worring about something that’s not really even an issue?

Thanks, Sven

PS If any other ZScripters (from their own experience) have light to shed on using and controlling UNIFY secondary effects I would appreciate any input, thanks.

Hi Sven,

Interesting question. :slight_smile:

Although it would be possible to restore the size of the tool using
[IGet,Preferences:Importexport:Unify Scale]
and then the Deformation:Size slider, as you’ve probably realized, this has drawbacks. There’d be no way of knowing whether the Unify Scale had been changed at any time. Although you could perhaps assume that users weren’t in the habit of changing it too often, and importing an obj during that session would be OK, ztools appear to save their Zunit size in the .ztl file and there’s no way of getting at that info that I can see.

Rather than try to restore things to how they were, perhaps a better route would be to Clone the tool you wish to unify and carry out the operations on the clone. The original then stays as it was. It may be that by also not changing the pivot point of the tool you avoid upsetting people who like control of such things. :wink:

Hope this helps,

Do I worry too much?

Thanks Marcus for the suggestions - for the moment I’m proceeding as if the UNIFY scale change doesn’t matter. But in the long run it probably does because the script (as you know) involves saving of the user’s model (with an implied warranty :frowning: ).

I hope Matthew has something definitive to say.

Sven

If your script uses the Unify option on an imported mesh, then the result will be that the mesh will be exported smaller than when it came in. The whole purpose of Unify is to do exactly what the name of the option implies: it unifies the object with ZBrush’s internal scaling system of 1 ZBrush unit.

There may be a way around this, but to figure out what it might be we’ll need more information about what you’re trying to achieve.

Matt,

Could you PM me with an email address where I can send you a .zip of my script-in-progress? I’ll include a quick description of what it’s doing and my concerns.

Thanks a bunch, Sven

can you restrict any use of the unify to 100? if so then can you keep track of it’s use? if so then couldn’t one re-scale -50(or whatever it was Aurick stated) x amount of times to get it back?

some food for thought since I ain’t no scripter I don’t know all the coding yet and what all you can do.

Hi Sven,

The [Mesh3DGet,…] command can return the current XYZ bounds of a polymesh tool, unfortunately that parameter is inactive in the current ZBrush 2.0. If active you could compare the XYZ bounds of the before and after Unified state and calculate a Size deformation value necessary to bring you back to the previous XYZ bounds. There might be issues regarding the Size deformation, I am not sure how precise it is with fractional values.

Right now I believe your only option would be to parse and calculate the bounding box of an exported .obj, both before and after pressing Unify.

There might be another way of course.

I am probably missing something but I cannot figure out why you want to use the Unify deformation, the Set Pivot Point button should work for symmetry. But you have your reasons I am sure.

Hi TV,

Actually, this short script demonstrates the Unify/rescaling issue. The question of symmetry was a kind of red herring, but maybe not.

Sven

[Edit: I’ve sent you an email explaining the problem…]