nicholas_yue Posted September 18, 2014 Share Posted September 18, 2014 Hi, I am prototyping a SOP which generates UVs (2D) using a sampling algorithm Here is what I did in the cook (1) clearAndDestroy() (2) appendVertexBlock(nSamples) (3) addFloatTuple(GA_ATTRIB_VERTEX, "suv", 2) (4) getVertexRange() // for use subsequently (5) set up UT_ValArray<fpreal32> suvResult (6) append data via suvResult.append(resultIter->x) in a loop finally (7) setAttributeFromArray(suvAttrib,vertexRange,suvResult) When I look at the SOP's spreadsheet, I can see the rows matches nSamples but they are all empty Is that because vertex need to reference a point (Point Num) so I'd have to add at least a dummy point ? How would one associate (programmatically) a vertex to the point ? Cheers Quote Link to comment Share on other sites More sharing options...
edward Posted September 18, 2014 Share Posted September 18, 2014 I don't know that the spreadsheet looks at unattached vertices at all. By definition, a vertex is a "point reference that resides in a primitive". See here for the typical polygon case: http://www.sidefx.com/docs/hdk13.0/_h_d_k__geometry__intro.html#HDK_GeometryIntro_AddingPrimitive 1 Quote Link to comment Share on other sites More sharing options...
nicholas_yue Posted September 19, 2014 Author Share Posted September 19, 2014 I don't know that the spreadsheet looks at unattached vertices at all. By definition, a vertex is a "point reference that resides in a primitive". See here for the typical polygon case: http://www.sidefx.com/docs/hdk13.0/_h_d_k__geometry__intro.html#HDK_GeometryIntro_AddingPrimitive Thanks for that Edward, using that example code as a based, I created a dummy primitive with a single dummy point and added all the sampling UV vertex attribute with all the vertices referencing the same single point and the UV data shows up prim_poly_ptr->appendVertex(first_ptoff) Cheers 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.