Hi cnever,
Most interface items have a numerical ID. You can find it out either by using the Preferences>Utilities>View Window Id slider that Doug’s link takes you to (thanks Doug), or you can use the [IGetID] zscript command. Note that you can learn about how to use the zscript commands using the online docs zscript section, expecially the command reference: http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/
Sometimes ZBrush will change the ‘button path’ internally and that can cause it to fail in zscript. That is probably what is happening here, as the internal reference will be to a specific image (the current render pass) rather than the default path. But the ID works OK, so we use that instead.
Note that some interface items don’t have useful IDs - notably items in the Tool palette. This is because the Tool palette changes depending on what type of ZTool is selected.
As for the code example:
- You can only use curved brackets in specific situations. They are used to clarify how a particular operation is evaluated. For example, you might use them when doing a math calculation such as 14 * (3 + 18) . In my example they are not strictly needed but I tend to use them in an If statement to show which bit is being evaluated - it just makes the code a little more readable.
- The [StrFind] command looks for a particular string (that is a string or group of characters) in another string. If it’s not found then -1 will be returned. Zero will be returned if the string is found at the start of string being looked at. This is because the index starts at 0 (this is something common in coding). For example, [StrFind, “Hello”, “Hello World”] will return 0 as the first character of “Hello” is the first character of “Hello World”. If we try [StrFind, “World”, “Hello World”] then 6 will be returned, as the first character of “World” is at index 6 (the seventh position). Note that the space is counted as a character. Note also that [StrFind] is case-sensitive, so that [StrFind, “hello”, “Hello World”] will return -1.
- The If statement will be ‘true’ if [StrFind] returns a value greater than -1. That will happen if “Width=” is found in the pop-up info of the button. As this indicates that there is an image associated with the button it is safe to press the button and export the image.
HTH,