vray.LightUtils

class vray.LightUtils

Bases: object

A group of utility methods related to variuos light source plugins.

Methods

__init__()

readIESPreviewData(self, lightPlugin)

Builds a 3D representation mesh corresponding to the given IES profile and returns the preview data.

readLuminaireFieldPreviewData(self, …)

Returns the generated data needed for Luminaire field preview.

static readIESPreviewData(self, lightPlugin: Plugin | str) → tuple[VectorList, IntList]

Builds a 3D representation mesh corresponding to the given IES profile and returns the preview data.

Arguments:
  • lightPlugin - A LightIES plugin instance or a string path to a IES file name (.ies)

Returns a tuple (vertices, indices) or None on failure:
  • vertices, VectorList - Output vertex preview data. The array can be passed on directly to DirectX/OpenGL etc. (and the indices too)

  • indices, IntList - Output face index data. Each three consecutive elements make up one triangle

static readLuminaireFieldPreviewData(self, luminaire: Plugin | str, getConvexHullData: bool | None = None) → dict

Returns the generated data needed for Luminaire field preview. If the second argument regarding the presence of the convex hull data is not provided then it will be resolved internally whether to provide the convex hull data.

Arguments:
  • luminaire - A LightLuminaire plugin instance or a string path to a Luminaire cache file name (.vlw|.vlg|.vlsh).

  • getConvexHullData - Force the returned object to contain the convex hull data. Optional. If ommited, it will be resolved internally whether to provide the convex hull data.

Returns a dictionary of data or None on failure:
  • useConvexHull, boolean - If true, the convex hull data is needed for the preview. Otherwise, only the bounding box. Always present. * bbox, Tuple - Bounding box of the luminaire. Always present.

  • scale, number - The relative scale of the luminaire geometry upon export. Should be 1.0 for cm. Always present.

  • vertices, VectorList - Vertices of light’s convex hull. Optional.

  • indices, IntList - Vertex indices of the convex hull in consecutive triplets. Optional.