ZBrushCentral

Set all variables in a list at once?

Is there any way to set all the variables in a variable list with one command?

I have a fairly large list and right now I am just looping varset with the loop number as the index. I was just curious if there was a better/easier way.

No, not for a global variable. A local variable would be automatically reset. For example, at the start of the routine you would declare the variable like this:

[VarDef,myVar(10),5]

This would ensure that every time the routine was called each variable in the list myVar was set to 5. But of course the list variable would only be available within the routine.

I should think that in terms of processing time there’s really no difference though. Each variable in the list has a separate memory address and the processor has to set each one, whatever code you use.

Ah ok. I assumed that was the case.

I just didn’t know if there was any secret hidden in there :slight_smile:

Thanks for the info again Marcus.