nicholas_yue Posted September 13, 2014 Share Posted September 13, 2014 Hi, I am prototyping an UV base Scattering SOP. Note : The following questions may have come about because my design is flawed and not inline with the procedural nature of the SOP network. This UVScatter SOP takes two input, source0 is the mesh input and source1 are the UVs used for evaluating the points on the input mesh. (1) How do I check if a particular source is connected ? I see source change methods with index parameters but that is probably not useful for me as there could be nothing connected yet. (2) How do I check if a particular class of attribute is supplied by a given source ? My first source (source 0) must have UVs on the mesh so I do a check for "uv" but the gdp->Find*Attribute() does not differentiate the source of the attributes. Or would it be the case that I need to be selective as to how I duplicate source and keep them separate for checking ? Cheers Quote Link to comment Share on other sites More sharing options...
nicholas_yue Posted September 13, 2014 Author Share Posted September 13, 2014 Answering my own question, I found a parent method call inputGeo() and was able to use it to achieve the effect I needed. i.e. const GU_Detail* gdp1 = inputGeo(1); Quote Link to comment Share on other sites More sharing options...
edward Posted September 13, 2014 Share Posted September 13, 2014 (2) How do I check if a particular class of attribute is supplied by a given source ? My first source (source 0) must have UVs on the mesh so I do a check for "uv" but the gdp->Find*Attribute() does not differentiate the source of the attributes. GA_Detail::find*Attribute() methods are either like findPointAttribute(), findVertexAttribute(), etc... If you have a GA_Attribute (or attribute ref), you can also get the detail, and compare &attr->getIndexMap() with the detail's &getPointMap() 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.