sueshijuu Posted August 18, 2012 Share Posted August 18, 2012 Hello people, I'm trying to apply a different shader to a bunch of different groups. The group selection takes place inside a ForEach node (.. because otherwise it would be a big network). At the end I apply a material with a Material node. Now what I'd like is to add the current number of the loop we are in (the FORVALUE I guess) to the end of the shader name. So that I'd get: /shop/shader1 /shop/shader2 /shop/shader3 etc. in the Material name parameter. How would I achieve that? Basically I just need to append the current FORVALUE to /shop/shader. Numbers and strings and whichever all added together to point to a material. But I don't know how to do that correctly. I can't even get the number there haha. I also made an attribute which has the correct number..( $SN ). Thanks for any help! If you need pictures if it's unclear, let me know. Quote Link to comment Share on other sites More sharing options...
wick3dParticle Posted August 19, 2012 Share Posted August 19, 2012 Hello people, I'm trying to apply a different shader to a bunch of different groups. The group selection takes place inside a ForEach node (.. because otherwise it would be a big network). At the end I apply a material with a Material node. Now what I'd like is to add the current number of the loop we are in (the FORVALUE I guess) to the end of the shader name. So that I'd get: /shop/shader1 /shop/shader2 /shop/shader3 etc. in the Material name parameter. How would I achieve that? Basically I just need to append the current FORVALUE to /shop/shader. Numbers and strings and whichever all added together to point to a material. But I don't know how to do that correctly. I can't even get the number there haha. I also made an attribute which has the correct number..( $SN ). Thanks for any help! If you need pictures if it's unclear, let me know. Hello sueshijuu, One way would be to use the 'opdigits' expression. You can assign opdigits(stamps("..", "FORVALUE","")) to an attribute and string it in to your material path. I made an example file for you. Best, ~Ilan IG_forEach_MTL.hipnc 1 Quote Link to comment Share on other sites More sharing options...
sueshijuu Posted August 20, 2012 Author Share Posted August 20, 2012 (edited) Thank you, Ilan. I got it working fine now. I tried just adding my attribute ( $SN ) but somehow it didn't work for me then. But that was the way to go! Cheers. Edited August 20, 2012 by sueshijuu 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.