ZBrushCentral

[ipress,texture:varname] fails

some code to explain my newbe-problem:

[vardef, varname,""]

//some not really known tool is active,so I try to getthe name of the tool:

[varset,varname,[igettitle,tool:iteminfo]]
[varset,varname,[strextract,varname,0,[strlength,varname]-2]]
//to check for the correct varname:
[messageOK,[strmerge,“varname=”,varname]]

//the name is the right one and I want to activate the texture which I know that exists under the same name, which I caught in the as string defined variablename:varname:

[ipress,texture:varname]

And here zb says that texture with the name:varname does not exists; apparently zb does not recognize ‘varname’ as a variable?
So how can I get zb to recognize the variable-content, for instance:thistool#3, in stead of just taking the varname as ‘varname’?

I hope I made my problem clear.

EddyL

You can’t simply add a variable into a command like that. The way you do it is to use StrMerge like this:

[IPress,[StrMerge,"Texture:",#varname]]

The hash [#] in the code is to indicate a variable. Although this isn’t always strictly necessary, I find it useful in StrMerge so as to quickly see where the variables are.