getting data from the geometry spreadsheet

   7397   3   0
User Avatar
Member
17 posts
Joined: 7月 2005
オフライン
Hey There,

I got a quick question:

Say I have an add sop and I have an attributeCreate sop below it (that adds some value/variable). Now below this I have a point sop.

How do I read the values I created with my attributeCreate into the point sop. I can see all my points in the spreadsheet and all their values but I dont know how to access them…the local variable created by the attributeCreate does not seem to be available.
Thanks again,
Phillip
User Avatar
Member
1634 posts
Joined: 7月 2005
オフライン
Hi Phillip,

You can use the point() function to read the value of the attributes.
/ -> exhelp point
float point (string SOP, float point_number, string attribute, float index)
This function will extract information from a point in a sop. The
attribute parameter is the name of the attribute (eg. “Cd” for
diffuse color). Two special attributes exist “P” and “Pw” which
represent the position of the point in space (“Pw” allows you to
access the W component of the position).

For example:
point(“/obj/geo1/facet1”, 3, “P”, 0)
Will return the X component of point 3 of the facet1 SOP in geo1.

point(“/obj/geo1/facet1”, 3, “N”, 2)
Will return the Z component of the normal attribute of point 3 in the
facet1 SOP of object geo1.

Note: This function will interpolate between point values if the point
number is fractional, such as 3.35

I hope the above helps!

Cheers!
steven
User Avatar
Member
8071 posts
Joined: 7月 2005
オフライン
The point function is generally not required though if you wish to access the local variable downstream of your AttribCreate SOP. Simply refer to it by its name in all uppercase. eg. if the name was foo, then $FOO will let you use it. See the help on the AttribCreate SOP for some more examples.
User Avatar
Member
17 posts
Joined: 7月 2005
オフライン
Thanks guys for your help….I'm back on track
Thanks again,
Phillip
  • Quick Links