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

#include <vraysdk.hpp>

Public Types

enum  ReadFlags {
  MESH_VERTICES = (1 << 4) , MESH_NORMALS = (1 << 5) , MESH_MTLIDS = (1 << 6) , MESH_VELOCITIES = (1 << 7) ,
  MESH_UVS = (1 << 8) , MESH_SHADERS = (1 << 9) , MESH_OBJECTINFOS = (1 << 10) , MESH_HAIROBJECTINFOS = (1 << 11) ,
  MESH_PARTICLEOBJECTINFOS = (1 << 12) , MESH_HAIRGEOMETRY = (1 << 13) , MESH_PARTICLESGEOMETRY = (1 << 14) , MESH_GEOMETRYMESHESBBOXES = (1 << 15) ,
  MESH_HAIROBJECTBBOXES = (1 << 16) , MESH_PARTICLEOBJECTBBOXES = (1 << 17) , MESH_ALL
}
 

Public Member Functions

 ProxyReadData (int flags=MESH_ALL)
 Pass different flags (or call setFlags later) if you want to limit the read data.
 
int getAllVoxelsCount () const
 Get the number of all voxels (geometry + hair + particle). Useful when the proxy file contains voxels of more than 1 type.
 
std::vector< int > getArrayOfLengths (const int *startIndices, int elementsCount, int objectCount) const
 
std::vector< int > getArrayOfLengths (const int *startIndices, int elementsCount, int objectCount, int uvSetsCount) const
 
const std::vector< int > & getEdgeVisibility () const
 Get an array of edge visibility flags, each integer in the array has edge visibility information for 10 consecutive faces (3 bits per face)
 
Box getGeometryVoxelBBox (int voxelIndex) const
 Get bounding box of the geometry voxel with the given index.
 
const std::vector< Box > & getGeometryVoxelsBBoxes () const
 Get the array of bounding boxes of all geometry voxels.
 
int getGeometryVoxelsCount () const
 Get the number of all geometry voxels. A geometry object contains 1 or more geometry voxels.
 
ObjectInfo getHairObjectInfo (int meshIndex) const
 Get the object info of the hair object with the given index.
 
int getHairObjectInfosCount () const
 Get the number of hair objects with object info. A hair object contains 1 or more hair voxels.
 
const std::vector< int > & getHairVelocitiesStartIndices () const
 Get the array of indices, where the hair velocities data starts - the i-th hair voxel starts at hairVelocities[hairVelocitiesStartIndices[i]].
 
const std::vector< Vector > & getHairVertices () const
 Get the full array of the hair geometry vertices.
 
const std::vector< int > & getHairVerticesPerStrand () const
 Get the full array of the hair strands length data (The i-th strand has hairVerticesPerStrand[i] consecutive vertices in hairVertices).
 
const std::vector< int > & getHairVerticesPerStrandStartIndices () const
 Get the array of indices, where the hair strands data starts - the strands data of the i-th hair voxel starts at hairVerticesPerStrand[hairVerticesPerStrandStartIndices[i]].
 
const std::vector< int > & getHairVerticesStartIndices () const
 Get the array of indices, where the hair vertices data starts - the i-th hair voxel starts at hairVertices[hairVerticesStartIndices[i]].
 
Box getHairVoxelBBox (int hairVoxelIndex) const
 Get bounding box of the hair voxel with the given index.
 
VoxelInfo getHairVoxelInfo (int meshIndex) const
 Get the voxel info of the hair object with the given index.
 
const std::vector< Box > & getHairVoxelsBBoxes () const
 Get the array of bounding boxes of all hair voxels.
 
int getHairVoxelsCount () const
 Get the number of all hair voxels. A hair object contains 1 or more hair voxels.
 
std::vector< VectorgetHairVoxelVelocities (int hairVoxelIndex) const
 Get velocities array of the voxel with the given index.
 
std::vector< VectorgetHairVoxelVertices (int hairVoxelIndex) const
 Get vertex array of the hair voxel with the given index.
 
std::vector< int > getHairVoxelVerticesPerStrand (int hairVoxelIndex) const
 Get the hair strands length data of the hair voxel with the given index.
 
std::vector< float > getHairVoxelWidths (int hairVoxelIndex) const
 Get widths array of the hair voxel with the given index.
 
const std::vector< float > & getHairWidths () const
 Get the full array of the hair geometry widths.
 
const std::vector< int > & getHairWidthsStartIndices () const
 Get the array of indices, where the hair widths data starts - the i-th hair voxel starts at hairWidths[hairWidthsStartIndices[i]].
 
int getLengthFromStartIndex (int objectIndex, const int *startIndices, int elementsCount, int objectCount) const
 
int getLengthFromStartIndex (int objectIndex, int setIndex, const int *startIndices, int elementsCount, int objectCount, int uvSetsCount) const
 
const std::vector< int > & getMaterialIDs () const
 Get material IDs for each consecutive triangle in the full mesh.
 
ObjectInfo getMeshObjectInfo (int meshIndex) const
 Get the object info of the geometry object with the given index.
 
int getMeshObjectInfosCount () const
 Get the number of geometry objects with object info. A geometry object contains 1 or more geometry voxels.
 
VoxelInfo getMeshVoxelInfo (int meshIndex) const
 Get the voxel info of the geometry object with the given index.
 
const std::vector< int > & getNormalIndices () const
 Get indices in the normal for each triangle (every 3 consecutive ints are one triangle).
 
const std::vector< Vector > & getNormals () const
 Get full mesh normal vectors array.
 
int getNumFrames () const
 Get the number of all frames in the proxy file. Useful when checking whether the proxy file contains animation data.
 
ObjectInfo getParticleObjectInfo (int meshIndex) const
 Get the object info of the particle object with the given index.
 
int getParticleObjectInfosCount () const
 Get the number of particle objects with object info. A particle object contains 1 or more particle voxels.
 
const std::vector< int > & getParticleVelocitiesStartIndices () const
 Get the array of indices, where the particle velocities data starts - the i-th particle voxel starts at particleVelocities[particleVelocitiesStartIndices[i]].
 
const std::vector< Vector > & getParticleVertices () const
 Get the full array of the particle geometry vertices.
 
const std::vector< int > & getParticleVerticesStartIndices () const
 Get the array of indices, where the particle vertices data starts - the i-th particle voxel starts at particleVertices[particleVerticesStartIndices[i]].
 
Box getParticleVoxelBBox (int particleVoxelIndex) const
 Get bounding box of the particle voxel with the given index.
 
VoxelInfo getParticleVoxelInfo (int meshIndex) const
 Get the voxel info of the particle object with the given index.
 
const std::vector< Box > & getParticleVoxelsBBoxes () const
 Get the array of bounding boxes of all particle voxels.
 
int getParticleVoxelsCount () const
 Get the number of all particle voxels. A particle object contains 1 or more particle voxels.
 
std::vector< VectorgetParticleVoxelVelocities (int particleVoxelIndex) const
 Get velocities array of the particle voxel with the given index.
 
std::vector< VectorgetParticleVoxelVertices (int particleVoxelIndex) const
 Get vertex array of the particle voxel with the given index.
 
std::vector< float > getParticleVoxelWidths (int particleVoxelIndex) const
 Get widths array of the particle voxel with the given index.
 
const std::vector< float > & getParticleWidths () const
 Get the full array of the particle geometry widths.
 
const std::vector< int > & getParticleWidthsStartIndices () const
 Get the array of indices, where the particle widths data starts - the i-th particle voxel starts at particleWidths[particleWidthsStartIndices[i]].
 
int getShaderID (int shaderIndex) const
 Get the ID of the shader (material) with the given index. Returns -1 if unavailable.
 
std::string getShaderName (int shaderIndex) const
 Get the name of the shader (material) with the given index.
 
int getShadersCount () const
 Get the number of available shader (material) name/ID pairs.
 
std::vector< int > getUVOriginalIndices () const
 Get an array with the original proxy file indices of the UV sets. They may not equal their index in the data arrays here.
 
std::string getUVSetName (int setIndex) const
 Get the name of the UV set with the given index.
 
int getUVSetsCount () const
 Get the number of available UV data sets (mapping channels).
 
const std::vector< int > & getUVValueIndices () const
 Get the full array of UVW per-vertex indices.
 
const int * getUVValueIndices (int setIndex) const
 Get an index array for the coordinates returned by getUVValues(). The data is owned and freed by this object.
 
size_t getUVValueIndicesCount (int setIndex) const
 Get the length of the array returned by getUVValueIndices().
 
const std::vector< Vector > & getUVValues () const
 Get the full array of UVW 3-tuples.
 
const VectorgetUVValues (int setIndex) const
 Get an array of UVW mapping coordinates for the given mapping channel index. The data is owned and freed by this object.
 
size_t getUVValuesCount (int setIndex) const
 Get the length of the array returned by getUVValues().
 
const std::vector< Vector > & getVelocities () const
 Get velocity vectors for each vertex in the vertex array.
 
const std::vector< int > & getVertexIndices () const
 Get indices in the vertex array for each triangle (every 3 consecutive ints are one triangle).
 
const std::vector< Vector > & getVertices () const
 Get full mesh vertex positions array.
 
std::vector< int > getVoxelEdgeVisibility (int voxelIndex) const
 Get an array of edge visibility flags of the voxel with the given index. Each integer in the array has edge visibility information for 10 consecutive faces (3 bits per face)
 
const std::vector< Bool > & getVoxelInfoFlipNormals () const
 Get an array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be flipped)
 
int getVoxelInfoObjectsCount () const
 Get the number of geometry + hair + particle objects, which have voxel info.
 
const std::vector< Bool > & getVoxelInfoSmoothed () const
 Get an array of smoothed flags (1 flag per mesh object - true if the voxel should be rendered with smoothed normals)
 
const std::vector< Color > & getVoxelInfoWireColor () const
 Get an array of diffuse (wire) colors - 1 Color per mesh object.
 
std::vector< int > getVoxelMaterialIDs (int voxelIndex) const
 Get materialIDs array of the voxel with the given index.
 
const std::vector< int > & getVoxelMaterialIDsStartIndices () const
 Get the array of indices, where the voxel materialIDs data starts - the i-th voxel starts at materialIDs[voxelMaterialIDsStartIndices[i]].
 
std::vector< int > getVoxelNormalIndices (int voxelIndex) const
 Get normal indices array of the voxel with the given index.
 
const std::vector< int > & getVoxelNormalIndicesStartIndices () const
 Get the array of indices, where the voxel normalIndices data starts - the i-th voxel starts at normalIndices[voxelNormalIndicesStartIndices[i]].
 
std::vector< VectorgetVoxelNormals (int voxelIndex) const
 Get normals array of the voxel with the given index.
 
const std::vector< int > & getVoxelNormalsStartIndices () const
 Get the array of indices, where the voxel normals data starts - the i-th voxel starts at normals[voxelNormalsStartIndices[i]].
 
std::vector< int > getVoxelUVValueIndices (int voxelIndex, int setIndex) const
 Get UV value indices in the UV values array of the voxel with the given index and of the set with the given index.
 
const std::vector< int > & getVoxelUVValueIndicesStartIndices () const
 Get the array of indices, where the voxel UV value indices data starts - the j-th set of the i-th voxel starts at uvValueIndices[voxelUVValueIndicesStartIndices[j * geometryVoxels_count + i]].
 
std::vector< VectorgetVoxelUVValues (int voxelIndex, int setIndex) const
 Get UV values array of the voxel with the given index and of the set with the given index.
 
const std::vector< int > & getVoxelUVValuesStartIndices () const
 Get the array of indices, where the voxel UV values data starts - the j-th set of the i-th voxel starts at uvValues[voxelUVValuesStartIndices[j * geometryVoxels_count + i]].
 
std::vector< VectorgetVoxelVelocities (int voxelIndex) const
 Get velocities array of the voxel with the given index.
 
const std::vector< int > & getVoxelVelocitiesStartIndices () const
 Get the array of indices, where the voxel velocities data starts - the i-th voxel starts at velocities[voxelVelocitiesStartIndices[i]].
 
std::vector< int > getVoxelVertexIndices (int voxelIndex) const
 Get the vertex indices array of the voxel with the given index.
 
const std::vector< int > & getVoxelVertexIndicesStartIndices () const
 Get the array of indices, where the voxel vertex indices data starts - the i-th voxel starts at indices[voxelVertexIndicesStartIndices[i]].
 
std::vector< VectorgetVoxelVertices (int voxelIndex) const
 Get the vertex array of the voxel with the given index.
 
const std::vector< int > & getVoxelVerticesStartIndices () const
 Get the array of indices, where the voxel vertices data starts - the i-th voxel starts at vertices[voxelVerticesStartIndices[i]].
 
Bool hasVelocityChannel () const
 True, in case the currently read frame contains at least one of geometry/hair/particle velocity data. Useful when checking whether the proxy file contains animation data.
 
void setFlags (int flags)
 Pass a combination of ReadFlags for the parts of the proxy data you need to read.
 

Friends

class Proxy
 
class VRayRenderer
 

Detailed Description

This is used by Proxy::readFullData(). Use the constructor parameter or setFlags() to define which parts of the proxy data you need. If readFullData succeeds, the various get* methods give you access to the data.

Member Function Documentation

◆ getArrayOfLengths() [1/2]

std::vector< int > VRay::ProxyReadData::getArrayOfLengths ( const int *  startIndices,
int  elementsCount,
int  objectCount 
) const

A helper method, which returns an array[objectCount] of lengths calculated from the corresponding startIndices array - the i-th object has result[i] elements

Parameters
startIndices- a pointer to the corresponding startIndices array, e.g. &(getVoxelVerticesStartIndices())[0] or &(getHairVerticesStartIndices())[0] or &(getParticleVerticesStartIndices())[0]
elementsCount- the number of elements contained in the data array, e.g. getVertices().size() or getHairVertices().size() or getParticleVertices().size()
objectCount- the number of all available objects, e.g. getGeometryVoxelsCount() or getHairVoxelsCount() or getParticleVoxelsCount()

◆ getArrayOfLengths() [2/2]

std::vector< int > VRay::ProxyReadData::getArrayOfLengths ( const int *  startIndices,
int  elementsCount,
int  objectCount,
int  uvSetsCount 
) const

A helper method, which returns an array[objectCount * uvSets_count] of lengths calculated from the corresponding startIndices array - the j-th set of the i-th object has result[j * geometryVoxels_count + i] UV values

Parameters
startIndices- a pointer to the corresponding startIndices array, e.g. &(getVoxelUVValuesStartIndices())[0]
elementsCount- the number of elements contained in the data array, e.g. getUVValues().size()
objectCount- the number of all available objects - getGeometryVoxelsCount()
uvSetsCount- the number of all available UV sets - getUVSetsCount()

◆ getLengthFromStartIndex() [1/2]

int VRay::ProxyReadData::getLengthFromStartIndex ( int  objectIndex,
const int *  startIndices,
int  elementsCount,
int  objectCount 
) const

A helper method, which returns the length (number of elements) - for the object with the given index

Parameters
objectIndex- the index of the object between 0 and objectCount
startIndices- a pointer to the corresponding startIndices array, e.g. &(getVoxelVerticesStartIndices())[0] or &(getHairVerticesStartIndices())[0] or &(getParticleVerticesStartIndices())[0]
elementsCount- the number of elements contained in the data array, e.g. getVertices().size() or getHairVertices().size() or getParticleVertices().size()
objectCount- the number of all available objects, e.g. getGeometryVoxelsCount() or getHairVoxelsCount() or getParticleVoxelsCount()

◆ getLengthFromStartIndex() [2/2]

int VRay::ProxyReadData::getLengthFromStartIndex ( int  objectIndex,
int  setIndex,
const int *  startIndices,
int  elementsCount,
int  objectCount,
int  uvSetsCount 
) const

A helper method, which returns the length (number of elements) - for the object with the given index and with the set with the given index

Parameters
objectIndex- the index of the object between 0 and objectCount
setIndex- the index of the set between 0 and uvSetsCount
startIndices- a pointer to the corresponding startIndices array, e.g. &(getVoxelUVValuesStartIndices())[0]
elementsCount- the number of elements contained in the data array, e.g. getUVValues().size()
objectCount- the number of all available objects - getGeometryVoxelsCount()
uvSetsCount- the number of all available UV sets - getUVSetsCount()

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