ZBrushCentral

Arrays in and out of a Routine

Anyone know if it possible to send arrays in and out of Routines? I’ve been testing it, but I can’t get any form syntax to work

[RoutineDef, MultVec3,[Loop, 3,

[VarSet, product(n), [Var,vecA(n)] + [Var,vecB(n)]]

[Note, #product(n)]

, n]
, vecA, vecB // inputs
, product // outputs
]

*Edit, the NOTE var assignment was wrong, but still I can’t seem to figure out how to get arrays working with routines

This code worked OK for me:

[RoutineDef, MultVec3,
[Loop, 3,
[VarSet, product(n), [Var,vecA(n)] + [Var,vecB(n)]]
[Note, #product(n)]
, n]
, vecA, vecB // inputs
, product // outputs
]

[IButton,TestList,
[VarDef,vecX(3),0]
[VarDef,productZ(3),0]
[VarDef,vecY(3),0]
[VarSet,vecX(0),1]
[VarSet,vecX(1),2]
[VarSet,vecX(2),3]
[VarSet,vecY(0),2]
[VarSet,vecY(1),4]
[VarSet,vecY(2),6]
[RoutineCall,MultVec3,vecX,vecY,productZ]
]

oh… I never tried removing the parentheses from the Routine Call :rolleyes:

When passing the arguments in I wrote them as “vecX()”. So nothing I did on the Routine Definition worked.

Thanks for helping me with that one Marcus!