Jump to content

Vertices Number


Arthur Spooner

Recommended Posts

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

if the cube is connected to let's say first input it would be 

i@cr = nvertices(0); 

if it's not connected, but lives at the same level then

i@cr = nvertices("op:../box1"); 
Edited by anim
Link to comment
Share on other sites

 

if the cube is connected to let's say first input it would be 

i@cr = nvertices(0); 

if it's not connected, but lives at the same level then

i@cr = nvertices("op:../box1"); 

 

 

Ahh declare an integer for the variable, couldn't int nverticies, do the same thing ?  :unsure:

Edited by Arthur Spooner
Link to comment
Share on other sites

well, regardless of the VEX snippet, to find out the statistics about geometry of any SOP you can jsut middle click and hold on it

 

if you want to actually see the result of the function you can assign it to an attribute and see it in Geometry Spreadsheet (RMB/Spreadsheet...)

i@nvtx = nvertices(0); 

will create integer attribute nvtx which will contain number of vertices of the first geometry and it depends on Wrangle type which attribute it will be (Point, Vertex, Primitive, Detail)

then you either see it in Geometry Spreadsheet or create visualizer in viewport

 

and be aware that  vertices and points are not the same thing, so if you want points use npoints() function

Link to comment
Share on other sites

This is my VEX code, is this how it should be written in wrangler ?  :unsure:

i@cr = nvertices("op:../box1");
i@nvtx = nvertices(0);

I recall somewhat the Geometry Spreadsheet, how do I create a visualizer in the viewport ?  :)

 

Vertices and points are not one in the same; what is the difference ?

 

In your previous message you wrote the following path, do you have any resources on how I can learn command such as op as you used in Houdini etc ?

i@cr = nvertices("op:../box1"); 

Thanks.

Link to comment
Share on other sites

I recall somewhat the Geometry Spreadsheet, how do I create a visualizer in the viewport ?  :)

http://www.sidefx.com/docs/houdini15.0/basics/visualizers#menu

In your previous message you wrote the following path, do you have any resources on how I can learn command such as op as you used in Houdini etc ?

http://www.sidefx.com/docs/houdini15.0/io/op_syntax

Link to comment
Share on other sites

No, just look at your geometry spreadsheet. Always have a geometry spreadsheet open. ALWAYS!

 

If you set the wrangle to run in details mode, set the geo spreadsheet to detail. If you set it to point, look at points.

 

Animated gif FTW:

 

post-7292-0-84211500-1459171543_thumb.gi

 

Yes, you can use a visualiser, it lets you take point/vertex/prim data and display it in the viewport as text/colour/vectors, but most of the time the geometry spreadsheet is less visual clutter, and keeps you thinking about the data your shunting around on your geometry.

Edited by mestela
Link to comment
Share on other sites

Does Vertex have more precedence over points ? I was reading the link mestela posted and that is what I understood, I'm probably wrong ?

 

Vertex are sub-level of points ?

 

Instead of using a file name, one can simply use op:<path> to the node ? Rather then (../../) you use (op:../) ?

 

What kind of visualizer does one apply to a pointWrangler node, marker, color, volume or tag in my situation.  I tried a marker node, and if that is the correct node visualizer, then I didn't do the right settings.

Edited by Arthur Spooner
Link to comment
Share on other sites

I can never remember which way the order of precedence goes, so I usually explicitly set whatever attributes I want at the level I want, and delete others. Eg, if I want point colour, I'll attribpromote from prim to point if that's where my existing colour is, delete prim colour, and continue on.

 

Re point/vert/prim, it makes more sense if you think about how you'd construct shapes from 'nothing'.

 

A point can be standalone, like a single particle in maya.

 

Points can be linked together to form primitives, their linking structure is stored as vertices.

 

Put down a platonic sold in tetrahedron mode, and look at the geometry spreadsheet for points, verts, prims. The points store positions. The vertex id on the far left column represents prim:vert. You can see there's 3 prims (0,1,2), and each prim has 3 verts, and each vert references 1 point.

 

It makes more sense when you start creating your own primitives in wrangles. You take your points, add an empty primitive, then add verticies to the primitive that refernce points. Eg, say I had 3 points floating in space (with @ptnum's of 0, 1, 2), I could run this in a detail wrangle to connect them up into a triangle, by first creating the primitive, then adding verticies:

int myprim = addprim(0, 'poly');

addvertex(0,myprim,0);
addvertex(0,myprim,1);
addvertex(0,myprim,2);
Edited by mestela
Link to comment
Share on other sites

A cube doesn't contain 24 points, so for each corner of the cube visualizer is displaying 24, that has to do with vertex and points, correct ?

 

ps - I understand your point about the Geo Spreadsheet graph, more options the better :)

 

Each face contains 4 verts. You have 6 faces, so 6*4 = 24.

Link to comment
Share on other sites

Put down a platonic sold in tetrahedron mode, and look at the geometry spreadsheet for points, verts, prims. The points store positions. The vertex id on the far left column represents prim:vert. You can see there's 3 prims (0,1,2), and each prim has 3 verts, and each vert references 1 point.

 

 

When you said, vertix id on the far left column represents prim:vert, did you mean here ? 

 

 

post-15586-0-12797600-1459219150.png

Edited by Arthur Spooner
Link to comment
Share on other sites

prim:vertex

 

to make it a little clearer I've switched to the dodecahedron primitive, and turned on point, vertex, prim numbering in the viewport (d hotkey in viewport, markers tab, enabled, point number, verticies number, prim number), that'll help you decipher whats going on.

 

I've also set the font to large (hit d in the viewport, guides tab, guide font -> large), and by blasting faces in turn, can see the relationship between points, verts, prims.

 

 

verts are local to each prim, so because each prim has 5 verts, the vertex numbers in the viewport only ever go 0-5.

 

post-7292-0-95153400-1459222949_thumb.gi

 

 

 

 

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