Jump to content
CinnamonMetal

bind into materials

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Posted (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 && $id < 6){
    $Cd = {0.4,1.0,0.1};
}else($prim>8 && $prim<12){
    $Cd = {0.2,0.5,0.12};
    }

 

Edited by CinnamonMetal

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×