formZ SDK | 5.0 API Reference | Project | Modeling | Objects | Analysis

# fz_objt_get_rndr_mesh

Description

Gets information about instanced objects
NOTE: must first call to get the size of data. Then allocate memory and call to get the data in your allocated blocks
flags: bit 0 : indicates do quads, else do triangles (default). bit 1 : indicates no clipping planes, else apply active clipping planes (default).
flags was do_quads in versions prior to 8.5.4
If do_quads is FALSE, nquads will always be returned as 0. If its TRUE be aware that you will still get triangles if they naturally occur in the object or than can come from the resolution of a non planar face.
bytes_per_ref is the number of bytes used in the triangle and quads data and its based on the number of points (ie 1 byte for ncord < 256, 2 bytes for ncord < 65536, else 4 bytes). Note that you should use the value returned by bytes_per_ref as this size rule could change in the future. The triangles and quads are packed unsigned indexes to the coordinates. That is for bytes_per_ref == 1: byte1, byte2 and byte 3 are the coordinate indexes of the first triangle, byte 4, byte 5 and byte 6 are the coordinate indexes of the second triangle etc.
nfact_color id for multicolor objects only. If this is returned as 0 then the object is a single color. if its != 0 then fact_color is an array of packed fz_rmtl_ptr parallel to the triangles and quads (in that order) representing the materail that should be used for that facet.
The cord, cord_norm, cord_txuv, and cord_colr arrays are parellel. Note that cord_colr is not yet implemented but will be in the future. When implemented it is assumed that cord_colr will override fact_color or the objects material.
has_tmat tells you if the objects real position is transformed from render mesh. This will be true for instances of components. It will be true in the future for objects being transformed. You must transform your data before rendering (watch those normals as the matrix might be scalar)

Plugin Prototype

fzrt_error_td fz_objt_get_rndr_mesh(

fzrt_int | windex,
fz_objt_ptr | obj,
fzrt_int | flags,
fzrt_int * | bytes_per_ref,
fzrt_unsigned_int * | ntrng,
fzrt_ptr | trng,
fzrt_unsigned_int * | nquad,
fzrt_ptr | quad,
fzrt_int * | nfact_color,
fz_rmtl_ptr * | fact_color,
fzrt_unsigned_int * | ncord,
fz_xyz_float_td * | cord,
fz_xyz_float_td * | cord_norm,
fz_xy_float_td * | cord_txuv,
fz_rgba_float_td * | cord_colr,
char * | has_tmat,
fz_mat4x4_td * | tmat )

Parameters

windex [Input]

project window index

obj [Input]

object

flags [Input]

do_quads (1) else triangles (0)

bytes_per_ref [Result, Optional]

number of bytes used in the triangle and quads data

ntrng [Result, Optional]

number of triangles in mesh

trng [Result, Optional]

packed triangle data

nquad [Result, Optional]

number of quads in mesh

quad [Result, Optional]

packed quad data

nfact_color [Result, Optional]

number of facet color (multi color objects only)

fact_color [Result, Optional]

packed quad data

ncord [Result, Optional]

number of coordinates (points) in mesh

cord [Result, Optional]

coordinates

cord_norm [Result, Optional]

coordinates

cord_txuv [Result, Optional]

coordinates

cord_colr [Result, Optional]

coordinates

has_tmat [Result, Optional]

mesh has transform matrix

tmat [Result, Optional]

mesh has transform matrix

Returns

Error codes

Availability

7.0.0.0

See Also

Function Set

fz_model_fset

Defined in

fz_objt_api.h