AdamM Posted August 29, 2020 Share Posted August 29, 2020 Hi. I have a for each loop (looping over path) that reads primgroup details. If a prim is found to be part of a particular group I store the prim number in a string array detail attribute using setdetailattrib - append. The string array is declared before the loop begins. I have checked each iteration of the loop using single pass and the values are being generated correctly (per loop). I don't seem to be able to accumulate the values of the loop in the detail attribute. It will only remember the last iteration of the loop. What am I doing wrong? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Eckxter Posted August 31, 2020 Share Posted August 31, 2020 I think you need to set the attribwrangle to run over primitives. I'm thinking that it needs to run over every primitive, so it changes the detail attribute each time. Instead of detail which runs once, giving you one value. Also, what is that attribcopy doing in the for-loop? Isn't it overwriting the attribute you want to change? Quote Link to comment Share on other sites More sharing options...
animatrix Posted August 31, 2020 Share Posted August 31, 2020 Hi, If all you want is an array of elements in that group, you can use the expandprimgroup function: 1 Quote Link to comment Share on other sites More sharing options...
AdamM Posted September 1, 2020 Author Share Posted September 1, 2020 That copy node was just one of the many attempts I made at trying to consolidate the information into the detail attribute, I shouldn't of posted it in the picture. On the first pass of the loop I get the following prims [0, 2, 6, 9, 10, 12]. Second pass gives me an empty array (this is expected) Third pass gives me [3, 4, 5, 15, 16, 23, 32, 68] I want to exit the loop with the detail array having [0, 2, 6, 9, 10 12, 3, 4, 5, 15, 16, 23, 32, 68], but it only ever has [3, 4, 5, 15, 16, 23, 32, 68]. I simplified the case using the expandprimgroup function and tried both a detail and primitive loop. The primitive numbers (and geometry) are changed on the right hand side of the graph, that is why I copy back them back to the left hand side. I have worked out a way to get it working. I simply record the current primitive number as a primitive attribute and then later copy it back to a detail attribute. Update. This got it working. Turns out that each time the loop inputs with the per piece it clobbers the detail attrib. A second loop input with feedback retains attribute. Thanks for helping 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.