rfm2
22.0
A python-based rewrite of RenderMan for Maya
|
Classes | |
class | RfmError |
Functions | |
def | maya_useNewAPI () |
def | build_vertex_buffer (vtx_buffer, vtxs, data_width, scale=1.0) |
def | lines (idx_buffer, num_vtxs, start_idx, loop=False) |
def | line_strip (idx_buffer, num_vtxs, start_idx) |
def | line_loop (idx_buffer, num_vtxs, start_idx) |
def | indexed_lines (idx_buffer, start_idx, idx_list) |
def | triangle_strip (idx_buffer, num_vtxs, start_idx) |
def | triangle_strip_grid (idx_buffer, start_idx, cols, rows) |
def | build_index_buffer (method, idx_buffer, num_vtxs, start_idx, **kwargs) |
def | make_new_sampler () |
Variables | |
dictionary | DEFAULT_LIGHT_DESC |
VP2 utilities.
def rfm2.vp.vp2.build_index_buffer | ( | method, | |
idx_buffer, | |||
num_vtxs, | |||
start_idx, | |||
** | kwargs | ||
) |
def rfm2.vp.vp2.build_vertex_buffer | ( | vtx_buffer, | |
vtxs, | |||
data_width, | |||
scale = 1.0 |
|||
) |
Called by Maya's populateGeometry() method to initialize and fill a VP2 vertex buffer Args: - vtx_buffer (MVertexBuffer): the VP2 vtx buffer - vtxs (list): all the vertices, static and dynamic - data_width (int): how many floats per vertex Kwargs: - scale (float): the representation scale, usually driven by a maya attribute. Raises: - RfmError: If the data_width is not 2 or 3.
def rfm2.vp.vp2.indexed_lines | ( | idx_buffer, | |
start_idx, | |||
idx_list | |||
) |
Fills an index buffer to create lines with explicit indices. Arguments: idx_buffer {MIndexBuffer} -- A maya index buffer start_idx {int} -- Index of the primitive's first vertex idx_list {list} -- List of indices describing line segments
def rfm2.vp.vp2.line_loop | ( | idx_buffer, | |
num_vtxs, | |||
start_idx | |||
) |
Fills an index buffer to create a line loop.
def rfm2.vp.vp2.line_strip | ( | idx_buffer, | |
num_vtxs, | |||
start_idx | |||
) |
Fills an index buffer to create a line strip.
def rfm2.vp.vp2.lines | ( | idx_buffer, | |
num_vtxs, | |||
start_idx, | |||
loop = False |
|||
) |
Fills an index buffer to create many lines. final number of vertices is: num_vtxs * 2 - 2 if loop is False
def rfm2.vp.vp2.make_new_sampler | ( | ) |
def rfm2.vp.vp2.maya_useNewAPI | ( | ) |
The presence of this function tells Maya that the plugin produces, and expects to be passed, objects created using the Maya Python API 2.0.
def rfm2.vp.vp2.triangle_strip | ( | idx_buffer, | |
num_vtxs, | |||
start_idx | |||
) |
Fills an index buffer, assuming the vertex buffer contains a single closed shape with clockwise vertex order (see vertex ordering in example below). Example: ~~~~ 0 1 2 3 0 1 2 3 -> |/|/|/| -> [0, 7, 1, 6, 2, 5, 3, 4] 7 6 5 4 7 6 5 4 ~~~~
def rfm2.vp.vp2.triangle_strip_grid | ( | idx_buffer, | |
start_idx, | |||
cols, | |||
rows | |||
) |
Fills a index buffer, assuming the vertex buffer has been populated in a very specific way (see example below). This is typically used to draw spheres or any other grid-like topology. Example: cols = 3 and rows = 3. The vertex ordering is obviously important... \t 0 1 2 0 1 2 \t |/|/| \t 3 4 5 -> 3 4 5 -> [0, 3, 1, 4, 2, 5, 5, \t |/|/| 3, 3, 6, 4, 7, 5, 8] \t 6 7 8 6 7 8
dictionary rfm2.vp.vp2.DEFAULT_LIGHT_DESC |