hampuseh Posted January 28, 2019 Share Posted January 28, 2019 Hello! I am working on a project that consist of different layers of primitives. Layer_1, Layer_2, etc. What I have done is to create a attribute called “Level”. I then base the value of the Level attribute from its Layer_# name. Example: Layer_1 will have a Level attribute with a value of 1. Layer_2 will have a Level attribute with a value of 2. The problem I have is that with the file there comes other named primitives aswell. In this case all I want to do is to have the “Twigs” attribute to always have the highest value. Even if I were to have 100 layers. So in this case I want the Twigs to have a value of 4. How would I do these procedurally? Thanks! Here is what it looks like: Quote Link to comment Share on other sites More sharing options...
toadstorm Posted January 29, 2019 Share Posted January 29, 2019 (edited) Attribute Promote your "level" attribute to a Detail attribute in Maximum mode (without removing the original attribute), so you know what your highest extant level is, then you can just increment on top of that for your twigs... for example: if(s@name == "Twigs") { i@level = detail(0, "maxlevel")+1; } Edited January 29, 2019 by toadstorm Quote Link to comment Share on other sites More sharing options...
hampuseh Posted January 29, 2019 Author Share Posted January 29, 2019 Thank you! That worked perfectly! 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.