MatDuf Posted April 13, 2015 Share Posted April 13, 2015 Hello! I`m trying to write to a detail attribute which is an array of ints. Here`s what I do: I create the attribute using attribCreate and set an integer of size 10 named myArray and i get this in the spreadsheet: Then in my VEX, I am only able to write to the first entry using the function below: setdetailattrib(geoself(), 'myArray', 8, 'set'); I tried many syntaxes: 'myArray[2]', 'myArray2', '@myArray[2]' but nothing seems to work. Also found this post which seems to explain how to do it in H14 using setattribtypeinfo() but we are stuck with H13 for now. https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=172640&sid=e43b886abc29f89722b567acb0e54efa Any help is appreciated! Thanks! Quote Link to comment Share on other sites More sharing options...
edward Posted April 14, 2015 Share Posted April 14, 2015 Array attributes only got introduced in H14. What you're actually creating is a "tuple attribute" with many components that have to be the same for all geometry elements, whereas an "array attribute" is 1 component of a variable sized array that can differ between each geometry element. In VEX, when you set say a matrix4 value, that actually writes out to a tuple attribute of size 16 (= 4 * 4). I don't think you can use VEX to set attributes with arbitrary number of components. If you need 10, then the hacky way is to use a matrix4, or marshal into a string attribute. 1 Quote Link to comment Share on other sites More sharing options...
MatDuf Posted April 21, 2015 Author Share Posted April 21, 2015 Great! Thanks for the info Edward! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.