CinnamonMetal Posted February 14, 2019 Author Share Posted February 14, 2019 I've attached the scene. qa_inlinevop.hipnc Quote Link to comment Share on other sites More sharing options...
j00ey Posted February 14, 2019 Share Posted February 14, 2019 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 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 14, 2019 Author Share Posted February 14, 2019 You must bind import the attribute; but only attributes which are not global variables used within the material context, otherwise the inline vop can't find the attribute, correct ? Although it is still not working ? See updated attached file. qa_inlinevop.hipnc Quote Link to comment Share on other sites More sharing options...
j00ey Posted February 14, 2019 Share Posted February 14, 2019 (edited) 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 February 14, 2019 by j00ey Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 14, 2019 Author Share Posted February 14, 2019 I rushed that scene out too fast; hence the errors Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 14, 2019 Author Share Posted February 14, 2019 (edited) Although if you take the scene which I rushed, and fix the errors; and even take your code and paste it into the inline vop of my scene; there are no errors, but it doesn't render the primitives a color ? Edited February 14, 2019 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
j00ey Posted February 14, 2019 Share Posted February 14, 2019 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 Quote Link to comment Share on other sites More sharing options...
j00ey Posted February 14, 2019 Share Posted February 14, 2019 At a guess I'd say your loop isn't executing Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 15, 2019 Author Share Posted February 15, 2019 (edited) @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 February 15, 2019 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
j00ey Posted February 15, 2019 Share Posted February 15, 2019 I haven't looked at your scene but in the amended one of mine you've disconnected the enumerate SOP so there's no id attribute to bind, so it will always be zero and the conditions in the inline VOP always evaluate as false Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 15, 2019 Author Share Posted February 15, 2019 (edited) @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 February 16, 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.