ZBrushCentral

LineMask-plugin as an alternative to Topological Masking?

LineMask-plugin as an alternative to Topological Masking?

I really like to use the Transform: Move, Scale, Rotate possibilities of ZB3 in my (re)modeling.
But the kind of meshes I use do not seem to be compatible with the new Topological
Masking that is introduced in ZB3, which makes using the Transform-mode very clumsy to use for me.

So I started thinking about an alternative for the Topological Masking, and I found a very intuitive one: just define the area that is to be masked by drawing one or two closed masklines (Control+ LMB) in the usual way in the Draw-mode:

snagit pijlvoor1.JPG

“Sim Sala Bim!”, they say in my country when the magic trick succeeds!
However, I’m not a ZScripter, but from my general experience as a programmer I could make a pseudo-code
version of the algorithm, that should do this trick.

To understand this algorithm:
I presume that ZB defines the points of the 3d-space in some sort of (x,y,z)manner.
So that every actual point can be a point on the mesh or not:
(mesh(xAct,yAct,zAct)=true or mesh(xAct,yAct,zAct)=false).
Likewise I presume that every actual point can be a masked
meshpoint(xAct,yAct,zAct)
or not :frowning: mask(xAct,yAct,zAct)=true or mask(xAct,yAct,zAct)=false)
At last I presume that there exists a Button:“LineMask” in the Tool>Masking pallet, which must be pressed before a LMB-click will start the Main Subroutine:

----------------------------------------------------------------------START PSEUDOCODE:

Sub Main
Dim xAct,yAct,zAct
'Comment: This subroutine recurses until all the nabouring meshpoints from
’ the point where LMB was clicked are masked.
’ If before the ButtonEvent:“LineMask” the user has drawn two closed
’ masklines then the masking will only occupy the area within the lines.
’ If before the ButtonEvent:“LineMask” the user has drawn one closed
’ maskline then the masking will only occupy the area on the site of this line
’ where the LMB was clicked.
’ If before the ButtonEvent:“LineMask” the user has drawn no closed
’ maskline then the masking will occupy the whole mesht.
'Comment: The user has defined a mesh-area that he wants to be masked, by 'drawing
’ one or two closed masklines (Control and Draw brushstroke) on the mesh.
’ Then he pushes theButton:“LineMask” and LMB_clicks between in the area
’ that he wants to be masked.
xAct=xLMB
yAct=yLMB
zAct=zLMB
Call SearchUnmasked(xAct,YAct,zAct)
EndSub

Sub SearchUnmasked(xAct,YAct,zAct)
Dim x,y,z

'Comment: Look for the meshstate(true or false)and the maskstate(true or 'false)
'of the nabouring points in the 3d-space;if mesh=true and maske=false then
'make mask for this point true and search it’s nabours.

For x=xAct-1 to xAct+1
For y=yAct-1 to yAct+1
For z=zAct-1 to zAct+1
If mesh(x,y,z)=true and mask(x,y,z)=false Then
mask(x,y,z)=true
Call SearchUnmasked(x,y,z)
EndIf
Next z
Next y
Next x
EndSub

END PSEUDOCODE

Now my question to the scripting-forum:
Would someone be inclined to make a translation of this pseudo-code into ZScript-code, perhaps in the form of a plugin.
I’m absolutely convinced that this algorithm will be not only of great use for me but also for many other ZBrush modelers.

Attachments

snagit pijlna1.JPG

Hello Eddy,

This is a nice idea but there is no direct way of doing what you suggest using zscripting - vertex by vertex mesh details are not available.

There may be another way of achieving the same result; I will have to give it some thought. In the meantime, using the Lasso for masking areas is probably you best option.

Hi Marcus,

A pity that my little plan can not be implemented as I thought would be not to difficult to do. But I’m - as always - delighted that you are willing to focus on other possibilities to make this “LineMask”-idee become ZBrush-reality. :smiley:

If you have much spare ZBrush-scripting time :wink: I have some other improvement-concepts (as without doubt many user will have), but for the moment I would be very pleased with something like “LineMasking”.

By the way, do you happen to know some Z-scripting-literature that goes deeper into the data-managing structure of ZB?; so I can understand why some ideas have a zscript-future and others not.

Greeting, and holding my breath,
EddyL

http://www.zbrushcentral.com/zbc/showthread.php?t=47899

:wink:

Hai Marcus,

Are you still ruminating about how to create something like a LineMasking-plugin into ZB or will it be waiting for a future upgrade of ZB (presuming that this idea (or a variating of it) will be adopted by the pixologic-staff)?

Greetings, EddyL

Hi Eddy,

I’m afraid that so far I have not come up with a suitable solution. And I have no knowledge of what features will be added to future ZBrush updates.

Sorry,