Search - User list
Full Version: point indices in prim (hscript)
Root » Technical Discussion » point indices in prim (hscript)
rom12345
Hi All
This is probably a very simple one.

How do I get a list of point indices in a prim using hscript ?
rom12345
pointlist(surface_node, group_name)

are you sure this is not to get the list of points in a group.
i would expect to be able input the prim index

ie
pointlist(surface_node, prim_index)
Erik_JE
Yeah. I missread the question. Thought it was for the whole object for some reason. No idea how to do this with hscript but you can do it by combining some python expressions.
rom12345
I'm quite new to this.
so I would appreciate an example if possible.

Also how do I :

get a prim count in a mesh
get a vertex count in a prim

At the moment I need to use Hscript.
Erik_JE
http://www.sidefx.com/docs/houdini11.1/expressions/nprims [sidefx.com]

Returns primcount in mesh. Second i don't know in hscript.
zarti
rom12345
I'm quite new to this.
so I would appreciate an example if possible.

Also how do I :

get a prim count in a mesh
get a vertex count in a prim

At the moment I need to use Hscript.

hi ,

i don't know why you insist about Hscript , but here you have a Pythonic otl :

this creates a string attribute containing the points of each prim .

controls are minimal ; assign values to only one / to all prims .

optionally( im not sure though )you can execute this python code as a script using Hscript's execute command .

never tried that myself ..
rom12345
many thanx for this.

This thread
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=23623 [sidefx.com]
will explain why I need to use hscript for now.
rom12345
Hey zarti

I have tried out your otl.

The attribute “has_points” is created ok

I figured I would get a string out
but when I try to query it in the textport I get :

echo `prim(“/obj/box”,2,has_points,0)`
2
zarti
attribute should be inside double quotes ..

> "has_points"
rom12345
..
rom12345
I tried that, but I'm getting the same result

I tried to do a quick test by modifying your code

prim.setAttribValue(hasPoints_attri,“hello”
but i still get :

echo `prim(“/obj/box”,2,“has_points”,0)`
0
rom12345
double post
zarti
try this ..

/ -> echo `primsmap(“/obj/geo1/hasPoints_py1”, “has_points”, 0)`
1-5-4-0
rom12345
That's great
I really appreciate this
many thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB