ZBrushCentral

Problem with renaming in R8

Hi there,
first of all: “what an awesome update”. So many new cool features, thanks a lot :)!

Regarding my Problem:
I started to write a script in 4R7 to rename subtools/add suffix/prefix using the following function of the ZFileUtils:
[IFreeze,
[FileExecute,dllPath,“PasteText”,#textToPaste]
[IPress,Tool:SubTool:Rename]
] //end freeze

The script worked like a charm in R7, but in R8 I encountered a problem when the new name contained a “_”.
It simply gets ignored, so “New_Name” now results in “NewName”.
In fact no special characters seem to work when renaming via the ZFileUtils function.
Is there anything I can do about it? I haven’t read anything about this in the official Thread.

Ps.:
I have read in the Changes Thread about the new Subtool Mod-states, could someone be so kind and explain to me what this:
&32 == 32
actually means? I’m a bit confused by the “&” :(.

Hi,

The ZFileUtils needs updating for 4R8 - ZBrush 4R8 is now compiled for Unicode so that it can handle multiple languages. There’s something else going wrong with the Paste Text function though, so I will need to look at that. The update to ZFileUtils should be released some time in the next week.

For the &32 == 32 -
& is the Bitwise Operator AND. What that means is that ZBrush compares the actual bit values for the Mod and returns true if the bit for a decimal value of 32 is set to 1.

In binary, 32 = 100000, so the 6th bit from the right is set to 1.
16 = 10000, so the 5th bit is set to 1.

A value of 48 would put these two together to give a binary value of 110000. With the code below, both visibility and polypaint would be on, as both the 32 bit and 16 bit are set to 1:

[If,([IModGet,“Tool:Subtool 0”]&32 == 32),
[Note,"Is visible
",-1]
]
[If,([IModGet,“Tool:Subtool 0”]&16 == 16),
[Note,"Polypaint on
",-1]
]

This makes it easy to test if a particular value is set, regardless of what other values are set. Otherwise you would need a lot of code to cope with the different combinations.

HTH,

Thank you Marcus, for getting back so fast and clearing things up!
I am looking forward for the new ZFileUtils version, and will in the meantime experiment with the new modsystem.
Thanks for the explaination :), it sounds like a great way to dealing with the states.