ZBrushCentral

Dynamesh Subtract Issue: IModSet Value on Subtool

I wanted to automate some common dynamesh workflows, and ran into an interesting issue. I can’t seem to find a way to set the subtool mod flag to tell it to to be a subtractive mesh. If I record a zscript session and switch back and forth between additive and subtractive on the subtool, I get a value of 19 back for both settings! I’m not actually sure how to set a subtool to be subtractive via zscript now.

This is what i get when I toggle back and forth!

[IModSet,Tool:SubTool:PM3D_Cylinder3D1,19]
[IModSet,Tool:SubTool:PM3D_Cylinder3D1,19]
[IModSet,Tool:SubTool:PM3D_Cylinder3D1,19]
[IModSet,Tool:SubTool:PM3D_Cylinder3D1,19]

Attachments

modSetSub.jpg

You need to simulate a click in the right part of the subtool list in order to turn the option on or off. You can get the Mod value by using [IModGet] and then set the option you want. You can use & (as bitwise AND) to check the values, as they are all added together depending on if the subtool is visible etc. The code below shows the method. (Note that this code just works on the selected subtool and it is only a snippet to show how it’s done.)

[IButton,“Set Add”,
[VarSet,subtoolPath,[StrMerge,“Tool:Subtool:”,[IGetTitle,“Tool:Current Tool”]]]
[If,(1 & [IModGet,subtoolPath]) != 1,
[VarSet,wid,[IWidth,subtoolPath]]
[IClick,subtoolPath,wid-100,5] //click the right part of the subtool entry
]
]

[IButton,“Set Subtract”,
[VarSet,subtoolPath,[StrMerge,“Tool:Subtool:”,[IGetTitle,“Tool:Current Tool”]]]
[If,(2 & [IModGet,subtoolPath]) != 2,
[VarSet,wid,[IWidth,subtoolPath]]
[IClick,subtoolPath,wid-75,5]
]
]

[IButton,“Set Intersection”,
[VarSet,subtoolPath,[StrMerge,“Tool:Subtool:”,[IGetTitle,“Tool:Current Tool”]]]
[If,(4 & [IModGet,subtoolPath]) != 4,
[VarSet,wid,[IWidth,subtoolPath]]
[IClick,subtoolPath,wid-50,5]
]
]

[IButton,“Set Colorize”,
[VarSet,subtoolPath,[StrMerge,“Tool:Subtool:”,[IGetTitle,“Tool:Current Tool”]]]
[If,(8 & [IModGet,subtoolPath]) != 8,
[VarSet,wid,[IWidth,subtoolPath]]
[IClick,subtoolPath,wid-25,5]
]
]

[IButton,“Set Visibility”,
[VarSet,subtoolPath,[StrMerge,“Tool:Subtool:”,[IGetTitle,“Tool:Current Tool”]]]
[If,(16 & [IModGet,subtoolPath]) != 16,
[VarSet,wid,[IWidth,subtoolPath]]
[IClick,subtoolPath,wid-10,20]
]
]

1 Like