triarrayΒΆ
class triarray
An array of triangles with their variables
The variables can be accessed by their names. The variables names are :
Basic parameters :
- "P" (point3) : the position of in the primitive space
- "N" (point3) : the normal of the surface in the primitive space
- "st" (point3)" : the surface st
- "color" (point3) : the surface color
- "alpha" (point3) : the surface opacity
- "width" (float) : the curve width
- "P2" .. "P6" (point3) : the Nth position used by the deform motion blur
- "st2" .. "st8" (point3) : the Nth st surface
- "color2" .. "color8" (point3) : the Nth surface color
- "float12" .. "float18" (float) : the Nth float parameter. The first is "width"
- "Pnd" (point3) : the non deformed position. This is the position in world space of the primitive with all its deformers disabled. This parameter is supposed to be constant along the animation.
Members
| barycentric | (
|
Get interpolated variables on a set of triangles using barycentric coordinates |
| getcount | ( ) | Returns the number of triangles |
| getsubid | (
|
Get The triangle subid |
| gettriangleaabb | (
|
Returns the aabb of a triangle |
| gettrianglearea | (
|
Returns the metric area of a triangle |
| gettrianglevar | (
|
Returns a variable of a triangle. |
| gettrianglevars | (
|
Returns all the variables of a triangle |
| hasvar | (
|
Returns true if the variable is present in the triarray |
| shade | (
|
Shades a set of points of a triarray using a primitive material. |
Documentation
Get interpolated variables on a set of triangles using barycentric coordinates
triangles the triangle indicescoordinates the barycentric coordinatesvariables the variable to get, as a list of string
result a list of vect containing the resulting interpolated variables
Returns the number of triangles
result
Get The triangle subid
triangle the triangle index
result the triangle resulting subid
Returns the aabb of a triangle
id The triangle idextend=0 An optional extension to apply to the aabb
result
Returns the metric area of a triangle
id The triangle idvariable="P" The variable to use for area computation
result
Returns a variable of a triangle.
The returned table looks like this for the parameter "float12" :
{
1, -- Point 1's float12
0.5, -- Point 2's float12
0, -- Point 3's float12
}
The returned table looks like this for the parameter "P" :
{
point3 (1, 0, 0), -- Point 1 P
point3 (0, 1, 0, -- Point 2 P
point3 (0, 0, 1), -- Point 3 P
}
id The triangle idname The variable name to get
result Returns a table with the parameter for each vertices of the triangle or nil if the variable is not present.
Returns all the variables of a triangle
The returned table looks like this :
{
"P" =
{
point3 (1, 0, 0), -- Point 1's position
point3 (0, 1, 0, -- Point 2's position
point3 (0, 0, 1), -- Point 3's position
}
"N" =
{
point3 (1, 0, 0), -- Point 1's normal
point3 (0, 1, 0), -- Point 2's normal
point3 (0, 0, 1), -- Point 3's normal
}
"float12" =
{
1, -- Point 1's second float
0, -- Point 2's second float
0, -- Point 3's second float
}
[...]
}
id The triangle id
result
Returns true if the variable is present in the triarray
name The variable name to test
result
Shades a set of points of a triarray using a primitive material.
handle The primitive's handle used to get the materialtriangles An array of triangles id or the triangle id to use with all the points.points 2d vect with the barycentric coordinatesradius 1d vect with the radius for each point to shadeshadedvars A comma separated list of values to be specifically shaded (like "Ci,Oi,FurLength" ...) or nil to shade all values