Jump to content

inline vop


Recommended Posts

I hadn't actually read your code properly earlier but again you're setting a condition which can never be true.

You initialise a variable id as zero, then you say if it's between 2 and 10 set the Cd variable, but it's always zero.

For the id workflow I mentioned you need to read in the id from the geometry, in your sample scene you've set it as an output, and as a vector.

 

Attached is a sample scene.

inline_colour_by_id.hip

Link to comment
Share on other sites

For a start you have id set as a vector output, and you're binding it as a vector too. It's an integer.

I haven't really got time to try and unpick the logic of your for loop but it seems to me you're trying to run before you can walk.

Houdini is telling you via the colour labels what's an int, float, vector etc. You need to be able to recognize them and know what data types you need to use to get what you're after. Don't overcomplicate with for loops, learn about basic stuff first like setting outputs in your inline VOP, writing to them, reading in geometry attributes, manipulating them and then outputting them.

 

Edited by j00ey
Link to comment
Share on other sites

Also it's a good idea when you're testing things and figuring out what's going on in your shaders to work at the top level of a material network, not inside a material builder because you can assign anything as a material.

What I usually do is make a null, call it 'test' and assign that as a material, then just plug things into that to test

Link to comment
Share on other sites

@j00ey This is your scene, slightly modified; it renders as strictly white ?

B_inline_colour_by_id.hipnc

Attached is also my original scene although modified, which renders as simply white, as well ?

Sorry, if I should so happen to have missed something before posting the scenes.

 

qa_cinnamonInline.hipnc

Edited by CinnamonMetal
Link to comment
Share on other sites

@j00ey You have to use the enumerate vop in order to use global attributes which are outside of the material global attributes inside of a inline vop; I thought that was by choice ?

I tried, rather then the enumerate vop to use

@id;

or

@id = @id;

in a primitive wrangler; and neither worked ?

One cannot also do multiple attribute within the enumerate sop as in; @id  @primnum etc.

If this is the only method by means to get attributes to be applied to the geometry for which the inline vop can read these attributes, only once they are bound in to the material; excluding global variables which are native to the material context those don't need to be bound, if this is all correct ?

Edited by CinnamonMetal
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...