rom12345
Oct. 29, 2011 11:38:05
Hi All
This is probably a very simple one.
How do I get a list of point indices in a prim using hscript ?
Erik_JE
Oct. 29, 2011 12:43:52
rom12345
Oct. 29, 2011 13:11:54
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
Oct. 29, 2011 13:27:36
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
Oct. 29, 2011 16:11:11
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
Oct. 29, 2011 16:22:29
zarti
Oct. 29, 2011 17:58:12
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
Oct. 29, 2011 18:40:27
rom12345
Oct. 29, 2011 19:38:51
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
Oct. 29, 2011 19:51:05
attribute should be inside double quotes ..
> "has_points"
rom12345
Oct. 29, 2011 20:00:32
..
rom12345
Oct. 29, 2011 20:02:14
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
Oct. 29, 2011 20:02:45
double post
zarti
Oct. 29, 2011 20:34:16
try this ..
/ -> echo `primsmap(“/obj/geo1/hasPoints_py1”, “has_points”, 0)`
1-5-4-0
rom12345
Oct. 29, 2011 20:41:41
That's great
I really appreciate this
many thanks.