Search the Community
Showing results for tags 'prim'.
-
while pointvop only run over points, is it possible for the point to find out what's the prim number belongs to, and then retrieve a attribute from the prim? i am currently making: 1) attributes in a curve 2) promoting the attributes to points 3) using those attributes, but now i have 3 loops over the geometry =( and i would like to optimize since will be a lot of curves/points, i would like to vopsop loop the point, find what's the Prim number that belongs to and retrieve the attribute from that prim. thanks guys optimize_vopsop.hip
-
Hello, Can someone please explain to me what a linear vertex is properly? I thought I understood it when I was initially trying with lines but once I applied the function on the grid, everything seems wrong. I understood it as, primvertex points to the point number, so vertex 2 of primitive 1 should return 2 but instead it is returning 6. Not sure why? The same function with lines give me the correct answer.
-
Hi, can someone please explain to me, why we would set the run over parameter in a wrangle node to detail or points? What is the difference between these two? I know that run over points means that the vex code is run over each point in parallel, but what exactly is run over details? Thank you
-
Hi Everyone, i am new to houdini and i am looking for a solution in vex for that trivial problem: 1. create a grid 2. store the prims in a wrangle (primid, points assigned to primnum or whatever is needed to restore the topology) 3. use an add sop to delete all prims - keep points 4. restore prims in a wrangle - voila the grid is back i allready had a look at this and tried alot whitout no luck http://www.tokeru.com/cgwiki/index.php?title=Points_and_Verts_and_Prims#Store_point_order_of_prims_via_vex unfortunately, in this example he splits the prims before he stores them - i dont want this - there must be a solution with a loop going through the shared points and generating a new Prim from that. Maybe you can push me in the right direction.. Cheers Cruzifer maybe you can push me in the right direction
-
Hello, I feel like I should know this but Houdini keeps erroring on me so I am doing something wrong. I want to read the primitive attribute Cd, multiple the values by say 6, and then add it to a new attribute called color. For the example scene, drop a box, a color sop and set it to primitive and bounding color, followed with a python sop. I am not looking for this in VEX, via nodes, or any other language. It has to be in python for this case. Thanks for the help, -Ben
-
Hi everybody, Apologies if this has been asked a thousand times, but my searching hasn't found anything conclusive yet. I'm attempting to take a packed primitive and extract the polygon geometry data from the packed prims in my C++ ROP. Here's a rough sketch of how the code looks right now. I've omitted a lot of error checking code, but this is the gist: // the packed prim gdp = _sopNode->getCookedGeo(context, 1); for (GA_Iterator it(gdp->getPrimitiveRange()); !it.atEnd(); ++it) { // the GEO_Primitive of the sub-primitive const GEO_Primitive* p = gdp->getGEOPrimitive(*it); const GU_PrimPacked* pack = UTverify_cast<const GU_PrimPacked*>(p); const GU_PackedGeometry* pImpl = UTverify_cast<const GU_PackedGeometry*>(pack->implementation()); // dest has the mesh GU_Detail dest; pImpl->unpackUsingPolygons(dest); for (GA_Iterator jt(dest.getPrimitiveRange()); !jt.atEnd(); ++jt) { // now looking at the individual faces on the poly const GEO_Primitive* face = dest.getGEOPrimitive(*jt); GA_ROHandleV3 ptREF(&dest, GA_ATTRIB_POINT, "P"); for (GA_Iterator pt(face->getPointRange()); !pt.atEnd(); ++pt) { GA_Offset ptoff = pt.getOffset(); UT_Vector3 pos = ptRef.get(ptoff); // have the position of the points for this face } } } So, I have the points. Yay for that. Now I'm looking to figure out the vertex indices for these points. Some of these points being printed out are exactly the same, which makes me think the faces are sharing a vertex. How do I get those vertex indices from the face? I've been playing with a VertexMap, but the numbers coming out are all exactly the same as the offset, which makes me think I'm doing something wrong. If I have a polygon like: 1--------2--------3 | | | 4--------5--------6 I'd expect vertices 2 and 5 to be shared between the two faces, so my position information would look like: 1 (0, 0, 0) 2 (1, 0, 0) 3 (2, 0, 0) 4 (0, 1, 0) 5 (1, 1, 0) 6 (2, 1, 0) And my face index lists would be something like: Face A : 1 2 5 4 Face B : 2 3 6 5 How do I get that face index list information out of my GEO_Primitive for the face? Many thanks for any tips.