VRay SDK for C++
Loading...
Searching...
No Matches
VRay::GeomUtils Class Reference

A group of utility methods related to variuos geometry source plugins. More...

#include <vraysdk.hpp>

Static Public Member Functions

static bool readGaussianData (const Plugin &gaussianPlugin, GaussianReadData &readData)
 
static bool readGaussianData (const std::string &fileName, GaussianReadData &readData)
 
static bool readGeomHairData (const Plugin &nodePlugin, VectorList &vertices, IntList &lengths, int countHint=0)
 
static bool readScatterData (const Plugin &scatterPlugin, std::vector< Transform > &transforms, IntList &topo)
 
static bool readScatterPreset (const ScatterReadParams &params, Plugin(*callback)(VRayRenderer &, const char *assetId, Vector importPosition, void *userData)=0, const void *userData=nullptr)
 
template<class T , Plugin(T::*)(VRayRenderer &, const char *assetId, Vector importPosition, void *userData) TMethod>
static bool readScatterPreset (const ScatterReadParams &params, T &object, const void *userData=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Detailed Description

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

Member Function Documentation

◆ readGaussianData() [1/2]

static bool VRay::GeomUtils::readGaussianData ( const Plugin gaussianPlugin,
GaussianReadData readData 
)
static
Parameters
gaussianPluginA GeomGaussians plugin instance
readDataAn object providing interfaces to all data necessary to create a preview of a single Gaussian model
Returns
false if an error ocurred. Check getLastError() for additional info.

◆ readGaussianData() [2/2]

static bool VRay::GeomUtils::readGaussianData ( const std::string &  fileName,
GaussianReadData readData 
)
static
Parameters
fileNameGaussian file name (.ply)
readDataAn object providing interfaces to all data necessary to create a preview of a single Gaussian model
Returns
false if an error ocurred.

◆ readGeomHairData()

static bool VRay::GeomUtils::readGeomHairData ( const Plugin nodePlugin,
VectorList &  vertices,
IntList &  lengths,
int  countHint = 0 
)
static
Parameters
nodePluginA Node plugin instance containing GeomHair as a geometry source plugin
verticesOutput vertex preview data. Consecutive vertices form hair strands. The i-th strand has lengths[i] consecutive vertices.
lengthsOutput hair strand length data. Each strand can have a different number of vertices.
countHintThe number of hair strands to get. If countHint is not specified, all generated data is returned.
Returns
false if an error ocurred. The returned data could be then used to create a preview of the generated GeomHair

◆ readScatterData()

static bool VRay::GeomUtils::readScatterData ( const Plugin scatterPlugin,
std::vector< Transform > &  transforms,
IntList &  topo 
)
static
Parameters
scatterPluginA GeomScatter plugin instance (the scatter data generation is triggered depending on the plugin parameter config)
transformsFull output transforms data array
topoFull output source topology array. The indices are corresponding to the sources list in GeomScatter::models
Returns
false if an error ocurred. Check getLastError() for additional info.

◆ readScatterPreset()

static bool VRay::GeomUtils::readScatterPreset ( const ScatterReadParams params,
Plugin(*)(VRayRenderer &, const char *assetId, Vector importPosition, void *userData)  callback = 0,
const void *  userData = nullptr 
)
static
Parameters
paramsA struct to read the file name and parameters from.
callback[optional] A function to be called during reading the preset config, responsible for creating the model plugins corresponding to the imported assets Arguments: renderer - The renderer which produced the event assetId - Cosmos assetId to be imported (string) importPosition - the position where the asset should be imported to the scene return - The callback should return the the newly added model (plugin to be scattered) corresponding to the assetId
Returns
false if an error ocurred. Check getLastError() for additional info.

The documentation for this class was generated from the following file: