ZBrushCentral

Select Interface Element by 'string eval' [Solved]

Hi all,

I would like to select and Alpha (or anything) after concatenating a string

for example :


[VarDef, myAlpha, "theAlpha"]
[VarSet, myvar,
   [StrMerge,"Alpha:",myAlpha]
]
[IPress,*myvar*] // *myvar* should expand to Alpha:theAlpha

I have looked through the docs but can’t find how to “expand” variables into callable interface elements.

Any help will be appreciated

Your code works fine for me:


[IButton,Test,,
[VarDef, myAlpha, "Alpha 11"]
[VarSet, myvar,
   [StrMerge,"Alpha:",myAlpha]
]
[IPress,myvar]
]

Bear in mind that interface items must be available (for example, visible in the subtool list) before this will work. A test using [IExists] should normally be enough.

Hey thanx marcus,
I found somewhere on these forums that by placing a hash before var like :
#myvar
is cricket.
I was having problems with IPress, Alpha:myvar and were told that the interface element named myvar(literal) does no exists.

maybe it’s a mac thing, or perhaps I imagined it.

Anyway problem solved, many thanks.

Interesting. I’m aware of using # before a variable but I’ve never found it to be critical. Perhaps it can make all the difference in StrMerge under some circumstances, I don’t know.