Jump to content

SOP : Input source queries


Recommended Posts

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

 

Link to comment
Share on other sites

 (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()

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...