starion83 0 Posted February 9, 2021 (edited) Hi everyone, I'm trying to assign materials to a set of objects (each with a unique name attrib). But instead of randomly applying materials, I'd like to weight the application of materials, so that for example 10% have mat1, 40% have mat2 and 40% have mat3. My first thought is using for each piece + vex with if else for weightings? Or is there an easier way I'm not aware of? Thanks in advance! Edited February 9, 2021 by starion83 solved problem Share this post Link to post Share on other sites
starion83 0 Posted February 9, 2021 Looks like what I was missing is the assignment of material path. with s@shop_materialpath = "...."; A weighting of 10% / 90% can be achieved by looping over objects with vex: if(rand(@class) < 0.1) s@shop_materialpath = "/mat/Test1"; else s@shop_materialpath = "/mat/Test2"; Share this post Link to post Share on other sites
anim 1,264 Posted February 10, 2021 you can also use Attribute Randomize in Custom Discrete mode of String type to create shop_materialpath attribute, it will allow you to specify weight for each string value and put class in Options/Seed Attribute parameter Share this post Link to post Share on other sites
starion83 0 Posted February 11, 2021 22 hours ago, anim said: you can also use Attribute Randomize in Custom Discrete mode of String type to create shop_materialpath attribute, it will allow you to specify weight for each string value and put class in Options/Seed Attribute parameter Thank you Tomas! I'll give this a try Share this post Link to post Share on other sites