.
.
.
GA_ROAttributeRef uv_ref = gdp->findVertexAttribute("uv");
GA_ROHandleV3 uv_h(uv_ref.getAttribute());
if (! uv_h.isInvalid())
return error();
const GA_Primitive *prim;
const GA_PrimitiveList &primList = gdp->getPrimitiveList();
GA_Range vtx_range;
for (GA_Iterator pr_it(gdp->getPrimitiveRange()); !pr_it.atEnd(); ++pr_it)
{
GA_Offset prim_offset = pr_it.getOffset();
prim = primList.get(prim_offset);
vtx_range = prim->getVertexRange();
for (GA_Iterator vtx_it(vtx_range.begin()); !vtx_it.atEnd(); ++vtx_it)
{
GA_Offset vtx_offset = vtx_it.getOffset()
UT_Vector3 uv(uv_h.get(vtx_offset));
// Do something with uv.......
}
}
.
.
.
If i remove UT_Vector3 uv(uv_h.get(vtx_offset)), houdini doesn't crash anymore. Can you please tell me where i'm wrong. And is this a right approach for iterating over vertices? Strictly speaking, i need only one vertex from each primitive, how can i get it?
Thx!
Edited by Stalkerx777, 22 August 2012 - 04:25 AM.













