CinnamonMetal Posted February 25, 2019 Share Posted February 25, 2019 I have a question regarding getting point or primitives attributes into materials; must only the enumerate sop be used in order to bind those attributes into a material network; is there not another method ? Quote Link to comment Share on other sites More sharing options...
anim Posted February 25, 2019 Share Posted February 25, 2019 You can bind any attribute in a material using Bind or Parameter VOP just like in your do in Attribute VOP SOP Enumerate SOP doesn't have anything to do with it other that that it can help you create attribute with equivalent values to @ptnum or @primnum or similar per group enumerated values Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 25, 2019 Author Share Posted February 25, 2019 8 minutes ago, anim said: You can bind any attribute in a material using Bind or Parameter VOP just like in your do in Attribute VOP SOP Enumerate SOP doesn't have anything to do with it other that that it can help you create attribute with equivalent values to @ptnum or @primnum or similar per group enumerated values I know you can bind any attribute into the material; from my experiments, without the enumerate sop, I can't bind any global attributes which typically reside on the geometry onto the material. Quote Link to comment Share on other sites More sharing options...
anim Posted February 25, 2019 Share Posted February 25, 2019 here is an example of ordinary attributes automatically overriding Parameter or Bind VOPs in materials if the name and type matches bind_attributes_to_material_parameter_or_bind_vops.hip Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 25, 2019 Author Share Posted February 25, 2019 24 minutes ago, anim said: here is an example of ordinary attributes automatically overriding Parameter or Bind VOPs in materials if the name and type matches bind_attributes_to_material_parameter_or_bind_vops.hip What if you wanted to bring in the @primnum and use it within an inline vop within a material ? Quote Link to comment Share on other sites More sharing options...
anim Posted February 25, 2019 Share Posted February 25, 2019 3 minutes ago, CinnamonMetal said: What if you wanted to bring in the @primnum and use it within an inline vop within a material ? as I mentioned before 2 hours ago, anim said: Enumerate SOP doesn't have anything to do with it other that that it can help you create attribute with equivalent values to @ptnum or @primnum or similar per group enumerated values so yes, you can use Enumerate to create attribute that will allow you to access value that in CVEX context of Attribute VOP you can access through @primnum but to do the same you can just create attribute using Prim Wrangle for example: @prim = @primnum; or in case of accessing primitive number in material, just access it using Get Primitive ID VOP without needing any attribute Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 7, 2019 Author Share Posted March 7, 2019 (edited) @anim The following code is shooting an error, but I'm only writing to color (Cd) within an inline vop, yes; I'm binding in the $prim & $numberid attribute ? $Cd = 1.0; if($numberid>2 && $numberid < 6){ $Cd = {0.4,1.0,0.1}; }else($prim>8 && $prim<12){ $Cd = {0.2,0.5,0.12}; } Edited March 28, 2019 by CinnamonMetal 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.