90okm 4 Posted January 25, 2017 (edited) Hi ! trying to work with vex snippets and faced the problem ! I've created an integer array attribute on primitives and want to fill it with some values in attrib wrangle but i always get the error message of "Ambiguous call to array index operator ''. Candidates are: 'float vector4[int]', 'float vector2[int]', 'float vector[int]'" being declared within wrangle node the construction like this i[]@arr = {}; @arr[0]=@primnum-21; works fine wrangle_error.hip Edited January 25, 2017 by 90okm Share this post Link to post Share on other sites
fsimerey 26 Posted January 25, 2017 (edited) Try this in wrangle Primitive node: i[]@arr = {-1,0,1}; // Create an array with values i@arr[1] = @primnum; // Set primnum in array[1] This create and set value of an integer array. Edited January 25, 2017 by fsimerey Share this post Link to post Share on other sites
dimovfx 50 Posted January 25, 2017 i[]@arr[0] = 21; this seems to work Share this post Link to post Share on other sites
90okm 4 Posted January 26, 2017 14 hours ago, sasho78 said: i[]@arr[0] = 21; this seems to work Yes it works, but it looks like declaring new attribute....that's why i was confused. thanks Share this post Link to post Share on other sites
dimovfx 50 Posted January 26, 2017 Might be wrong, but if the attribute exists then it's just a statement what type of attribute you are trying to access, otherwise it has to guess what type of attribute is and it seems that it's not very good at it It's not a bad practice to state the type of the attribute every time you want to work with it. Share this post Link to post Share on other sites
f1480187 797 Posted January 26, 2017 Here the list of known attributes which does not require type specified. As stated, all others will be assumed as floats. But you need to write type only once, later you may omit type: v@test = {1, 1, 1}; // Type need to be specified once. @test = 0; // Still a vector assigment, will be set as {0, 0, 0}. You also can declare attributes by writing full type name, in that case value will be used as default: vector @test = {1, 2, 3}; Share this post Link to post Share on other sites