VRay SDK for C++
Loading...
Searching...
No Matches
vraysdk.hpp
1#ifndef _VRAY_SDK_HPP_
2#define _VRAY_SDK_HPP_
3
4#if !defined(_M_AMD64) && !defined(__amd64__) && !defined(_M_ARM64) && !defined(__aarch64__)
5 #error "V-Ray supports only 64-bit architectures"
6#endif
7
8#ifndef VRAY_NOTHROW
9 #include "vraythrow.hpp"
10#endif
11
12#include "errcodes.h"
13
14#include <new>
15#include <cmath>
16#include <utility>
17#include <cstdint>
18#include <cstddef>
19#include <cstdio>
20#include <cstdlib>
21#include <cstring>
22#include <string>
23#include <sstream>
24#include <vector>
25#include <fstream>
26#include <atomic>
27
28#include "_vraysdk_utils.hpp"
29
30#define VRAY_MINIMUM2(a, b) ((a) < (b) ? (a) : (b))
31#define VRAY_MAXIMUM2(a, b) ((a) > (b) ? (a) : (b))
32#define VRAY_MAXIMUM3(a, b, c) VRAY_MAXIMUM2(VRAY_MAXIMUM2(a, b), c)
33#define VRAY_MAXIMUM4(a, b, c, d) VRAY_MAXIMUM2(VRAY_MAXIMUM3(a, b, c), d)
34
35#ifdef APPSDK_QT_NAMESPACE
36namespace APPSDK_QT_NAMESPACE {
37class QWidget;
38} // namespace APPSDK_QT_NAMESPACE
39#else
40#define APPSDK_QT_NAMESPACE
41class QWidget;
42#endif // APPSDK_QT_NAMESPACE
43
44#if defined(VRAY_ALLOW_UNSAFE_NATIVE_HANDLE) || (!defined(_WIN32) && !defined(__APPLE__))
45 typedef void* NativeWindowHandle;
46 typedef void* NativeWidgetHandle;
47#else
48 #ifdef _WIN32
49 #ifndef _WINDEF_
50 typedef struct HWND__ *HWND;
51 #endif
52 typedef HWND NativeWindowHandle;
53 typedef HWND NativeWidgetHandle;
54 #elif __APPLE__
55 #ifdef __OBJC__
56 #define VRAY_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
57 #else
58 #define VRAY_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
59 #endif
60 VRAY_FORWARD_DECLARE_OBJC_CLASS(NSWindow);
61 typedef NSWindow *NativeWindowHandle;
62 VRAY_FORWARD_DECLARE_OBJC_CLASS(NSView);
63 typedef NSView *NativeWidgetHandle;
64 #endif
65#endif
66
67namespace VRay {
68
69namespace Internal {
70 inline float linear_to_srgb(float x) {
71 if (x <= 0.0031308f) {
72 x *= 12.92f;
73 } else {
74 x = 1.055f*powf(x, 1.0f/2.4f)-0.055f;
75 }
76 return x;
77 }
78 inline float srgb_to_linear(float x) {
79 if (x < 0.04045f) {
80 x /= 12.92f;
81 } else {
82 x = powf((x+0.055f)/1.055f, 2.4f);
83 }
84 return x;
85 }
86
87 inline float interpolate(float x, float a, float b) noexcept {
88 return (b - a) * x + a;
89 }
90}
91
92#ifdef _MSC_VER
93# pragma warning(push)
94# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
95#endif // _MSC_VER
96
97#ifdef _MSC_VER
98# define VRAY_DEPRECATED(msg) __declspec(deprecated(msg))
99#else // unix
100// GCC <= 4.4 doesn't support the optional message parameter
101# if defined(__clang__) || COMPILER_VERSION >= 450
102# define VRAY_DEPRECATED(msg) __attribute__((deprecated(msg)))
103# else
104# define VRAY_DEPRECATED(msg) __attribute__((deprecated))
105# endif
106#endif // _MSC_VER
107
108#ifdef VRAY_SDK_INTEROPERABILITY
109 struct Vector;
110 struct Color;
111 namespace VUtils {
112 class Value;
113 class CharString;
114 struct TraceTransform;
115 template<class T> struct PtrArray;
116 typedef PtrArray<int> IntRefList;
117 typedef PtrArray<float> FloatRefList;
118 typedef PtrArray<Vector> VectorRefList;
119 typedef PtrArray<Color> ColorRefList;
120 typedef PtrArray<TraceTransform> TransformRefList;
121 typedef PtrArray<CharString> CharStringRefList;
122 typedef PtrArray<Value> ValueRefList;
123 }
124#endif // VRAY_SDK_INTEROPERABILITY
125
127 enum RendererState {
128 FATAL_ERROR = -1,
129 IDLE_INITIALIZED,
130 IDLE_STOPPED,
131 IDLE_ERROR,
132 IDLE_FRAME_DONE,
133 IDLE_DONE,
134 PREPARING,
135 RENDERING,
136 RENDERING_PAUSED,
137 RENDERING_AWAITING_CHANGES,
138 };
139
140 enum AddHostsResult {
141 FAILED_TO_RESOLVE = -2,
142 RENDERER_ERROR = -1,
143 FAILED_TO_CONNECT = 0,
144 SUCCESSFULLY_ADDED = 1,
145 SUCCESS_BUT_NO_WORK = 2,
146 };
147
148 enum Type {
149
150 // Plugin Property Types
151 TYPE_INT = 0,
152 TYPE_FLOAT = 1,
153 TYPE_DOUBLE = 2,
154 TYPE_BOOL = 3,
155 TYPE_VECTOR = 4,
156 TYPE_COLOR = 5,
157 TYPE_ACOLOR = 6,
158 TYPE_MATRIX = 7,
159 TYPE_TRANSFORM = 8,
160
161 TYPE_STRING = 9,
162 TYPE_PLUGIN = 10,
163 TYPE_TEXTURE = 11,
164 TYPE_LIST = 12,
165 TYPE_TEXTUREFLOAT = 13,
166 TYPE_TEXTUREINT = 14,
167 TYPE_TEXTUREVECTOR = 15,
168 TYPE_TEXTUREMATRIX = 16,
169 TYPE_TEXTURETRANSFORM = 17,
170
171 // List types
172 TYPE_GENERAL_LIST = TYPE_LIST,
173
174 // Typed Lists
175 TYPE_TYPED_LIST_BASE = 100,
176 TYPE_INT_LIST = TYPE_TYPED_LIST_BASE + TYPE_INT,
177 TYPE_FLOAT_LIST = TYPE_TYPED_LIST_BASE + TYPE_FLOAT,
178 TYPE_DOUBLE_LIST = TYPE_TYPED_LIST_BASE + TYPE_DOUBLE,
179 TYPE_BOOL_LIST = TYPE_TYPED_LIST_BASE + TYPE_BOOL,
180 TYPE_VECTOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_VECTOR,
181 TYPE_COLOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_COLOR,
182 TYPE_ACOLOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_ACOLOR,
183 TYPE_MATRIX_LIST = TYPE_TYPED_LIST_BASE + TYPE_MATRIX,
184 TYPE_TRANSFORM_LIST = TYPE_TYPED_LIST_BASE + TYPE_TRANSFORM,
185 TYPE_STRING_LIST = TYPE_TYPED_LIST_BASE + TYPE_STRING,
186 TYPE_PLUGIN_LIST = TYPE_TYPED_LIST_BASE + TYPE_PLUGIN,
187 TYPE_TEXTURE_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTURE,
188 TYPE_TEXTUREFLOAT_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREFLOAT,
189 TYPE_TEXTUREINT_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREINT,
190 TYPE_TEXTUREVECTOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREVECTOR,
191 TYPE_TEXTUREMATRIX_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREMATRIX,
192 TYPE_TEXTURETRANSFORM_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTURETRANSFORM,
193
194 // Output (multi-texture) Property Types
195 TYPE_OUTPUTTEXTURE = 1000,
196 TYPE_OUTPUTTEXTUREFLOAT = 1001,
197 TYPE_OUTPUTTEXTUREINT = 1002,
198 TYPE_OUTPUTTEXTUREVECTOR = 1003,
199 TYPE_OUTPUTTEXTUREMATRIX = 1004,
200 TYPE_OUTPUTTEXTURETRANSFORM = 1005,
201
202 TYPE_UNSPECIFIED = 10000,
203
204 TYPE_ERROR = -1
205 };
206
208 enum MessageLevel {
209 MessageError = 0,
210 MessageWarning = 1,
211 MessageInfo = 2,
212 MessageDebug = 3
213 };
214
215 enum LicenseUserStatus : int {
216 Disabled = 0,
217 QueryFailure = 1,
218 NoActiveUser = 2,
219 ActiveUserPresent = 3,
220 };
221
223 enum ImagePassType {
224 ImagePass_Final = 0,
225 ImagePass_LightCache = 1,
226 ImagePass_IrradianceMap = 2,
227 };
228
230 enum DefaultsPreset {
231 quality_draft,
232 quality_low,
233 quality_medium,
234 quality_high,
235 quality_veryHigh,
236 };
237
239 enum VFBRenderElementType {
240 renderElementType_lightMix=0,
241 renderElementType_denoiser,
242
243 renderElementType_last
244 };
245
246 enum VFBMouseButton {
247 mouseButton_left = 1,
248 mouseButton_right = 2,
249 };
250
253 {
254 int x0, y0, x1, y1;
255
256 ImageRegion(int x = 0, int y = 0, int w = 0, int h = 0) {
257 set(x, y, w, h);
258 }
259
260 void set(int x, int y, int w, int h) {
261 x0 = x;
262 y0 = y;
263 x1 = x + w;
264 y1 = y + h;
265 }
266
267 void setX(int x) {
268 x0 = x;
269 }
270
271 void setY(int y) {
272 y0 = y;
273 }
274
275 void setWidth(int width) {
276 x1 = x0 + width;
277 }
278
279 void setHeight(int height) {
280 y1 = y0 + height;
281 }
282
283 int getX() const {
284 return x0;
285 }
286
287 int getY() const {
288 return y0;
289 }
290
291 int getWidth() const {
292 return x1 - x0;
293 }
294
295 int getHeight() const {
296 return y1 - y0;
297 }
298 };
299
300 typedef unsigned long long InstanceId; // FOR INTERNAL USE ONLY
301 typedef unsigned long long PluginTypeId; // FOR INTERNAL USE ONLY
302 constexpr InstanceId NO_ID = InstanceId(-1);
303 constexpr PluginTypeId NO_TYPE_ID = PluginTypeId(-1);
304
305 namespace Internal {
306 static_assert(sizeof(InstanceId) == 8, "InstanceId should be 8 bytes long");
307 static_assert(sizeof(PluginTypeId) == 8, "PluginTypeId should be 8 bytes long");
308
309 constexpr int INSTANCE_ID_BITS = 48;
310
311 // A helper function to combine InstanceId and PluginTypeId by truncating InstanceId to INSTANCE_ID_BITS (48) bits
312 // and combine and set typeIdIdx in the remaining higher (sizeof(InstanceId) - INSTANCE_ID_BITS) (64-48 = 16) bits.
313 inline InstanceId combineInstanceIdAndTypeIndex(InstanceId id, int typeIdIdx) {
314 return (id & ((InstanceId(1) << INSTANCE_ID_BITS) - 1)) | (InstanceId(typeIdIdx) << INSTANCE_ID_BITS);
315 }
316 }
317
318 typedef int LayerUID; // FOR INTERNAL USE ONLY
319 const LayerUID NO_LAYER_ID = -1;
320
322 namespace VFBLayerProperty {
325 enum Type {
326 IntEnum = -1,
327 Bool,
328 Int,
329 Float,
330 Color,
331 String,
344 Stream
345 };
346
347 enum Flags {
348 NoFlags = 0,
349 Internal = (1 << 0),
350 Hidden = (1 << 1),
351 EnumRadioButtons = (1 << 2),
352 EnumComboBox = (1 << 3),
353
356 Command = (1 << 4),
357
361
362 Transient = (1 << 6),
363 ReadOnly = (1 << 7),
366 NoCustomStyleTag = (1 << 10),
367 NonResettable = (1 << 11),
368 NoUndo = (1 << 12),
369 Advanced = 1 << 13,
370
371 HasPipetteTool = 1 << 14,
372
374 Const = 1 << 15,
375
379
381 Stretched = 1 << 17
382 };
383
393 };
394
399 };
400
406 };
407
414 char fontFace[100];
415 };
416
451
455
457 };
458 };
459
460 typedef unsigned char byte;
461 typedef signed char sbyte;
462 typedef int RGB32;
463 typedef int Bool;
464
465 class VRayRenderer;
466 class Value;
467 struct Color;
468 struct AColor;
469 struct Vector;
470 struct Transform;
471 class Plugin;
472
473 typedef std::vector<int> IntList;
474 typedef std::vector<float> FloatList;
475 typedef std::vector<Color> ColorList;
476 typedef std::vector<Vector> VectorList;
477 typedef std::vector<Transform> TransformList;
478 typedef std::vector<Value> ValueList;
479 typedef std::vector<std::string> StringList;
480 typedef std::vector<Plugin> PluginList;
481
484
485 protected:
486 MemoryBuffer() {}
488
489 public:
490 const void* getData() const {
491 return static_cast<const void*>(this);
492 }
493 void* getData() {
494 return static_cast<void*>(this);
495 }
496 void operator delete(void* ptr);
497 };
498
500 class Png : public MemoryBuffer {};
502 class Jpeg : public MemoryBuffer {};
504 class VFBState : public MemoryBuffer {};
505
506 #pragma pack(push, 1)
507
510 unsigned short bfType;
511 unsigned bfSize;
512 unsigned bfReserved;
513 unsigned bfOffBits;
514 };
515
518 unsigned biSize;
519 int biWidth;
520 int biHeight;
521 unsigned short biPlanes;
522 unsigned short biBitCount;
523 unsigned biCompression;
524 unsigned biSizeImage;
525 int biXPelsPerMeter;
526 int biYPelsPerMeter;
527 unsigned biClrUsed;
528 unsigned biClrImportant;
529 };
530
533 void* getPixels() const {
534 return (byte*)this + bfOffBits;
535 }
536
537 unsigned getRowStride() const {
538 return (getWidth()*(biBitCount/8) + 3) & ~3;
539 }
540
541 int getWidth() const {
542 return abs(biWidth);
543 }
544
545 int getHeight() const {
546 return abs(biHeight);
547 }
548
549 int getBitsPerPixel() const {
550 return biBitCount;
551 }
552 };
553
555 class Bmp : public BmpHeader, public MemoryBuffer {};
556
557#pragma pack(pop)
558
561 struct VRayImage {
562 static VRayImage* create(int width, int height);
563 void operator delete (void *bmp);
564 VRayImage* clone() const;
565
566 int getWidth() const;
567 int getHeight() const;
568 bool getSize(int& width, int& height) const;
569
571 VRayImage* getCropped(int x, int y, int width, int height) const;
572
574 VRayImage* getResized(int width, int height) const;
575
577 VRayImage* getResizedCropped(int srcX, int srcY, int srcWidth, int srcHeight, int dstWidth, int dstHeight) const;
578
581 VRayImage* getDownscaled(int width, int height) const;
582
585 VRayImage* getDownscaledCropped(int srcX, int srcY, int srcWidth, int srcHeight, int dstWidth, int dstHeight) const;
586
589 VRayImage* getFitIn(int width, int height) const;
590
593 VRayImage* getFitOut(int width, int height) const;
594
597 VRayImage* getCutIn(int width, int height) const;
598
600 static VRayImage* createFromBmp(const void* buffer, size_t size = 0);
602 static VRayImage* createFromBmp(const VRayRenderer& renderer, const void* buffer, size_t size = 0);
603
605 static VRayImage* createFromPng(const void* buffer, size_t size);
607 static VRayImage* createFromPng(const VRayRenderer& renderer, const void* buffer, size_t size);
608
610 static VRayImage* createFromJpeg(const void* buffer, size_t size);
612 static VRayImage* createFromJpeg(const VRayRenderer& renderer, const void* buffer, size_t size);
613
616 bgra_byte = 0,
620 };
621
623 static VRayImage* createFromRawData(const void* buffer, size_t size, IntList_DataType dataType, int width, int height);
624
627 static VRayImage* load(const char* fileName);
629 static VRayImage* load(const std::string& fileName);
630
633 static void loadSize(const char* fileName, int& width, int& height);
635 static void loadSize(const std::string& fileName, int& width, int& height);
636
639 bool setGamma(float gamma);
640
643 float getGamma() const;
644
652 bool changeSRGB(bool apply = true);
653
659 bool changeGamma(float gamma);
660
661 enum WhiteBalanceMode {
662 WHITE_BALANCE_NONE,
663 WHITE_BALANCE_AVERAGE,
664 WHITE_BALANCE_WEIGHTED_AVERAGE,
665 WHITE_BALANCE_HIGHLIGHTS
666 };
667
669 AColor calculateWhiteBalanceMultiplier(WhiteBalanceMode mode) const;
670
674 float calculateDifference(const VRayImage* image) const;
675
676 enum DrawMode {
679 };
680
683 bool draw(const VRayImage* image, int x, int y, DrawMode mode = DRAW_MODE_COPY);
684
685 bool addColor(const Color& color);
686 bool addColor(const AColor& color);
687 bool mulColor(const AColor& color);
688 bool changeExposure(float ev);
689 bool changeContrast(float contrast);
690 bool makeNegative();
691
692 bool saveToBmp(const char* fileName, bool preserveAlpha = false, bool swapChannels = false) const;
693 bool saveToBmp(const char* fileName, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
694 bool saveToBmp(const std::string& fileName, bool preserveAlpha = false, bool swapChannels = false) const;
695 bool saveToBmp(const std::string& fileName, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
696
697 bool saveToPng(const char* fileName, bool preserveAlpha = false, int bitsPerChannel = 8) const;
698 bool saveToPng(const char* fileName, const VRayRenderer& renderer, bool preserveAlpha = false, int bitsPerChannel = 8) const;
699 bool saveToPng(const std::string& fileName, bool preserveAlpha = false, int bitsPerChannel = 8) const;
700 bool saveToPng(const std::string& fileName, const VRayRenderer& renderer, bool preserveAlpha = false, int bitsPerChannel = 8) const;
701
702 bool saveToJpeg(const char* fileName, int quality = 0) const;
703 bool saveToJpeg(const char* fileName, const VRayRenderer& renderer, int quality = 0) const;
704 bool saveToJpeg(const std::string& fileName, int quality = 0) const;
705 bool saveToJpeg(const std::string& fileName, const VRayRenderer& renderer, int quality = 0) const;
706
707 bool saveToTiff(const char* fileName, int bitsPerChannel = 16) const;
708 bool saveToTiff(const char* fileName, const VRayRenderer& renderer, int bitsPerChannel = 16) const;
709 bool saveToTiff(const std::string& fileName, int bitsPerChannel = 16) const;
710 bool saveToTiff(const std::string& fileName, const VRayRenderer& renderer, int bitsPerChannel = 16) const;
711
712 bool saveToExr(const char* fileName) const;
713 bool saveToExr(const char* fileName, const VRayRenderer& renderer) const;
714 bool saveToExr(const std::string& fileName) const;
715 bool saveToExr(const std::string& fileName, const VRayRenderer& renderer) const;
716
718 Bmp* compressToBmp(bool preserveAlpha = false, bool swapChannels = false) const;
720 Bmp* compressToBmp(size_t& size, bool preserveAlpha = false, bool swapChannels = false) const;
722 Bmp* compressToBmp(const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
724 Bmp* compressToBmp(size_t& size, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
725
727 Png* compressToPng(bool preserveAlpha = false) const;
729 Png* compressToPng(size_t& size, bool preserveAlpha = false) const;
731 Png* compressToPng(const VRayRenderer& renderer, bool preserveAlpha = false) const;
733 Png* compressToPng(size_t& size, const VRayRenderer& renderer, bool preserveAlpha = false) const;
734
736 Jpeg* compressToJpeg(int quality = 0) const;
738 Jpeg* compressToJpeg(size_t& size, int quality = 0) const;
740 Jpeg* compressToJpeg(const VRayRenderer& renderer, int quality = 0) const;
742 Jpeg* compressToJpeg(size_t& size, const VRayRenderer& renderer, int quality = 0) const;
743
757 MemoryBuffer* toBitmapData(size_t& size, bool preserveAlpha = false, bool swapChannels = false, bool reverseY = false, int stride = 0, int alphaValue = -1) const;
758
759 IntList toIntList(IntList_DataType type) const;
760
764 AColor* getPixelData(size_t& count);
766 const AColor* getPixelData() const;
768 const AColor* getPixelData(size_t& count) const;
769
770 private:
771 VRayImage();
772 VRayImage(const VRayImage&);
773 VRayImage& operator=(const VRayImage &image);
774 };
775
778 VRayImage* img;
779 LocalVRayImage(const LocalVRayImage& img);
780 LocalVRayImage& operator=(const LocalVRayImage& img);
781
782 public:
783 LocalVRayImage(VRayImage* img) : img(img) {}
784
785 operator VRayImage* () {
786 return img;
787 }
788
789 VRayImage* operator->() {
790 return img;
791 }
792
793 VRayImage& operator*() {
794 return *img;
795 }
796
797 LocalVRayImage& operator=(VRayImage* image) {
798 delete img;
799 img = image;
800 return *this;
801 }
802
804 delete img;
805 }
806 };
807
811 int asInt;
812
813 struct {
814 bool multipleFiles : 1;
815 bool skipAlpha : 1;
816 bool frameNumber : 1;
817 bool noAlpha : 1;
818 bool singleChannel : 1;
819 bool skipRGB : 1;
822 bool multiChannel : 1;
824 bool writeExifData : 1;
825 };
826
827 ImageWriterFlags() : asInt() {}
828 } flags;
829
830 enum CompressionType {
831 DEFAULT,
832 NO_COMPRESSION,
833 RUN_LENGTH,
834 ZIP_SCANLINE,
835 ZIP_BLOCK,
836 PIZ,
837 PXR24,
838 B44,
839 B44A,
840 DWAA,
841 DWAB
843
845
847 };
848
850 struct Vector {
851 union {
852 struct { float x, y, z; };
853 float f[3];
854 };
855
856 Vector(const Vector&) noexcept = default;
857 Vector(Vector&&) noexcept = default;
858 Vector& operator=(const Vector&) noexcept = default;
859 Vector& operator=(Vector&&) noexcept = default;
860
861 Vector() noexcept : x(), y(), z() {}
862
863 template <typename T1, typename T2, typename T3>
864 Vector(T1 x, T2 y, T3 z) noexcept : x(float(x)), y(float(y)), z(float(z)) {}
865
866 template <typename T>
867 explicit Vector(T value) noexcept : x(float(value)), y(float(value)), z(float(value)) {}
868
869 std::string toString() const;
870
872 template <typename T1, typename T2, typename T3>
873 Vector& set(T1 x_, T2 y_, T3 z_) noexcept {
874 x = float(x_), y = float(y_), z = float(z_);
875 return *this;
876 }
877
879 Vector& makeZero(void) noexcept {
880 z = y = x = 0;
881 return *this;
882 }
883
885 Vector& operator +=(const Vector &other) noexcept {
886 x += other.x, y += other.y, z += other.z;
887 return *this;
888 }
889
891 Vector& operator -=(const Vector &other) noexcept {
892 x -= other.x, y -= other.y, z -= other.z;
893 return *this;
894 }
895
897 Vector& operator *=(int factor) noexcept {
898 x *= float(factor), y *= float(factor), z *= float(factor);
899 return *this;
900 }
901
903 Vector& operator *=(float factor) noexcept {
904 x *= factor, y *= factor, z *= factor;
905 return *this;
906 }
907
909 Vector& operator *=(double factor) noexcept {
910 x *= float(factor), y *= float(factor), z*=float(factor);
911 return *this;
912 }
913
915 Vector& operator /=(int divisor) noexcept {
916 x/=float(divisor); y/=float(divisor); z/=float(divisor);
917 return *this;
918 }
919
921 Vector& operator /=(float divisor) noexcept {
922 x/=divisor; y/=divisor; z/=divisor;
923 return *this;
924 }
925
927 Vector& operator /=(double divisor) noexcept {
928 x/=float(divisor); y/=float(divisor); z/=float(divisor);
929 return *this;
930 }
931
933 Vector operator -(void) const noexcept {
934 return Vector(-x, -y, -z);
935 }
936
938 float& operator [](const int index) noexcept {
939 return f[index];
940 }
941
943 const float& operator [](const int index) const noexcept {
944 return f[index];
945 }
946
948 float length(void) const noexcept {
949 return sqrtf(x*x + y*y + z*z);
950 }
951
953 float lengthSqr(void) const noexcept {
954 return x*x + y*y + z*z;
955 }
956
958 void rotate(const Vector &axis) noexcept;
959 };
960
963 inline Vector operator *(const Vector &a, int factor) noexcept {
964 Vector res(a);
965 res *= factor;
966 return res;
967 }
968
971 inline Vector operator *(const Vector &a, float factor) noexcept {
972 Vector res(a);
973 res *= factor;
974 return res;
975 }
976
979 inline Vector operator *(const Vector &a, double factor) noexcept {
980 Vector res(a);
981 res *= factor;
982 return res;
983 }
984
987 inline Vector operator *(int factor, const Vector &a) {
988 Vector res(a);
989 res *= factor;
990 return res;
991 }
992
995 inline Vector operator *(float factor, const Vector &a) noexcept {
996 Vector res(a);
997 res *= factor;
998 return res;
999 }
1000
1003 inline Vector operator *(double factor, const Vector &a) noexcept {
1004 Vector res(a);
1005 res *= factor;
1006 return res;
1007 }
1008
1011 inline Vector operator /(const Vector &a, int factor) noexcept {
1012 Vector res(a);
1013 res /= factor;
1014 return res;
1015 }
1016
1019 inline Vector operator /(const Vector &a, float factor) noexcept {
1020 Vector res(a);
1021 res /= factor;
1022 return res;
1023 }
1024
1027 inline Vector operator /(const Vector &a, double factor) noexcept {
1028 Vector res(a);
1029 res /= factor;
1030 return res;
1031 }
1032
1035 inline double operator *(const Vector &a, const Vector &b) noexcept {
1036 return double(a.x)*double(b.x) + double(a.y)*double(b.y) + double(a.z)*double(b.z);
1037 }
1038
1041 inline Vector operator +(const Vector &a, const Vector &b) noexcept {
1042 Vector res(a);
1043 res += b;
1044 return res;
1045 }
1046
1049 inline Vector operator -(const Vector &a, const Vector &b) noexcept {
1050 Vector res(a);
1051 res -= b;
1052 return res;
1053 }
1054
1057 inline Vector operator /(const Vector &a, const Vector &b) noexcept {
1058 return Vector(a.x/b.x, a.y/b.y, a.z/b.z);
1059 }
1060
1063 inline Vector mul(const Vector &a, const Vector &b) noexcept {
1064 return Vector(a.x*b.x, a.y*b.y, a.z*b.z);
1065 }
1066
1069 inline bool operator !=(const Vector &a, const Vector &b) noexcept {
1070 return a.x != b.x || a.y != b.y || a.z != b.z;
1071 }
1072
1076 inline bool operator ==(const Vector &a, const Vector &b) noexcept {
1077 return a.x == b.x && a.y == b.y && a.z == b.z;
1078 }
1079
1082 inline Vector operator ^(const Vector &a, const Vector &b) noexcept {
1083 return Vector(
1084 double(a.y)*double(b.z) - double(b.y)*double(a.z),
1085 double(a.z)*double(b.x) - double(b.z)*double(a.x),
1086 double(a.x)*double(b.y) - double(b.x)*double(a.y)
1087 );
1088 }
1089
1092 inline double mixed(const Vector &a, const Vector &b, const Vector &c) noexcept {
1093 return
1094 (double(a.y)*double(b.z) - double(b.y)*double(a.z))*double(c.x)+
1095 (double(a.z)*double(b.x) - double(b.z)*double(a.x))*double(c.y)+
1096 (double(a.x)*double(b.y) - double(b.x)*double(a.y))*double(c.z);
1097 }
1098
1101 inline Vector normalize(const Vector &a) noexcept {
1102 return a/a.length();
1103 }
1104
1107 inline float length(const Vector &a) noexcept {
1108 return a.length();
1109 }
1110
1113 inline float lengthSqr(const Vector &a) noexcept {
1114 return a.lengthSqr();
1115 }
1116
1119 inline void Vector::rotate(const Vector &axis) noexcept {
1120 float oldLen = length();
1121
1122 Vector d = axis ^ (*this);
1123 d += (*this);
1124
1125 float newLen = d.length();
1126 if (newLen > 1e-6f)
1127 (*this) = d*oldLen/newLen;
1128 }
1129
1132 inline Vector rotate(const Vector &v, const Vector &axis) noexcept {
1133 Vector r(v);
1134 r.rotate(axis);
1135 return r;
1136 }
1137
1138 inline std::ostream& operator <<(std::ostream& stream, const Vector& vector) {
1139 stream << "Vector(" << vector.x << ", " << vector.y << ", " << vector.z << ")";
1140 return stream;
1141 }
1142
1143 inline std::string Vector::toString() const {
1144 std::ostringstream stream;
1145 stream << *this;
1146 return stream.str();
1147 }
1148
1149 struct Matrix;
1151 struct Color {
1152 union {
1153 struct { float r, g, b; };
1154 float rgb[3];
1155 };
1156
1157 Color(const Color&) noexcept = default;
1158 Color(Color&&) noexcept = default;
1159 Color& operator=(const Color&) noexcept = default;
1160 Color& operator=(Color&&) noexcept = default;
1161
1162 Color() noexcept : r(), g(), b() {}
1163
1164 template <typename T1, typename T2, typename T3>
1165 Color(T1 r, T2 g, T3 b) noexcept : r(float(r)), g(float(g)), b(float(b)) {}
1166
1167 template <typename T>
1168 explicit Color(const T& value) noexcept : r(float(value)), g(float(value)), b(float(value)) {}
1169
1172 CIE, sRGB, ACEScg
1173 };
1174
1176 static Color fromTemperature(float temperature, RGBColorSpace colorSpace = sRGB);
1177
1179 float getClosestTemperature(RGBColorSpace colorSpace = sRGB) const;
1180
1182 float getClosestTemperatureAndColor(Color& closestColor, RGBColorSpace colorSpace = sRGB) const;
1183
1189 static Matrix getRGBtoRGBmatrix(RGBColorSpace srcColorSpace, RGBColorSpace dstColorSpace);
1190
1192 float getIntensity() const noexcept {
1193 return (r + g + b) * (1.0f / 3.0f);
1194 }
1195
1197 float getLuminance() const noexcept {
1198 const float RED_LUMINANCE_COMPONENT = 0.3f;
1199 const float GREEN_LUMINANCE_COMPONENT = 0.59f;
1200 const float BLUE_LUMINANCE_COMPONENT = 0.11f;
1201 return RED_LUMINANCE_COMPONENT * r + GREEN_LUMINANCE_COMPONENT * g + BLUE_LUMINANCE_COMPONENT * b;
1202 }
1203
1205 float getLengthSquared() const noexcept {
1206 return r * r + g * g + b * b;
1207 }
1208
1210 float getLength() const noexcept {
1211 return sqrtf(r * r + g * g + b * b);
1212 }
1213
1215 float getPower() const {
1216 return r + g + b;
1217 }
1218
1221 void setSaturation(float k) noexcept {
1222 if (k == 1.0f) return;
1223 float grey = (r + g + b) / 3.0f;
1224 r = Internal::interpolate(k, grey, r);
1225 g = Internal::interpolate(k, grey, g);
1226 b = Internal::interpolate(k, grey, b);
1227 }
1228
1232 void setContrast(float k, float middle = 0.5f) noexcept {
1233 if (k == 1.0f) return;
1234 r = (r - middle) * k + middle;
1235 g = (g - middle) * k + middle;
1236 b = (b - middle) * k + middle;
1237 }
1238
1240 Color getWhiteComplement() const noexcept {
1241 return Color(std::fmaxf(0.0f, 1.0f - r), std::fmaxf(0.0f, 1.0f - g), std::fmaxf(0.0f, 1.0f - b));
1242 }
1243
1246 void makeWhiteComplement() noexcept {
1247 r = std::fmaxf(0.0f, 1.0f - r);
1248 g = std::fmaxf(0.0f, 1.0f - g);
1249 b = std::fmaxf(0.0f, 1.0f - b);
1250 }
1251
1252 std::string toString() const;
1253
1256 void operator +=(const Color &c) noexcept {
1257 r += c.r;
1258 g += c.g;
1259 b += c.b;
1260 }
1261
1264 void operator -=(const Color &c) noexcept {
1265 r -= c.r;
1266 g -= c.g;
1267 b -= c.b;
1268 }
1269
1272 void operator *=(const Color &c) noexcept {
1273 r *= c.r;
1274 g *= c.g;
1275 b *= c.b;
1276 }
1277
1280 void operator *=(int factor) noexcept {
1281 float f = static_cast<float>(factor);
1282 r *= f;
1283 g *= f;
1284 b *= f;
1285 }
1286
1289 void operator *=(float factor) noexcept {
1290 r *= factor;
1291 g *= factor;
1292 b *= factor;
1293 }
1294
1297 void operator *=(double factor) noexcept {
1298 float f = static_cast<float>(factor);
1299 r *= f;
1300 g *= f;
1301 b *= f;
1302 }
1303
1306 void operator /=(const Color &c) noexcept {
1307 r /= c.r;
1308 g /= c.g;
1309 b /= c.b;
1310 }
1311
1314 void operator /=(int factor) noexcept {
1315 float f = static_cast<float>(factor);
1316 r /= f;
1317 g /= f;
1318 b /= f;
1319 }
1320
1323 void operator /=(float factor) noexcept {
1324 r /= factor;
1325 g /= factor;
1326 b /= factor;
1327 }
1328
1331 void operator /=(double factor) noexcept {
1332 float f = static_cast<float>(factor);
1333 r /= f;
1334 g /= f;
1335 b /= f;
1336 }
1337
1339 float maxComponentValue() const noexcept {
1340 const float rg = r > g ? r : g;
1341 return rg > b ? rg : b;
1342 }
1343
1346 Color color2 = Color(r, g, b);
1347 color2.r = Internal::srgb_to_linear(color2.r);
1348 color2.g = Internal::srgb_to_linear(color2.g);
1349 color2.b = Internal::srgb_to_linear(color2.b);
1350 return color2;
1351 }
1352
1355 Color color2 = Color(r, g, b);
1356 color2.r = Internal::linear_to_srgb(color2.r);
1357 color2.g = Internal::linear_to_srgb(color2.g);
1358 color2.b = Internal::linear_to_srgb(color2.b);
1359 return color2;
1360 }
1361
1362 };
1363
1364 std::ostream& operator <<(std::ostream& stream, const Color& color);
1365
1367 inline Color operator +(const Color& a, const Color& b) noexcept {
1368 return Color(
1369 a.r + b.r,
1370 a.g + b.g,
1371 a.b + b.b
1372 );
1373 }
1374
1376 inline Color operator -(const Color& a, const Color& b) noexcept {
1377 return Color(
1378 a.r - b.r,
1379 a.g - b.g,
1380 a.b - b.b
1381 );
1382 }
1383
1385 inline Color operator *(const Color& a, const Color& b) noexcept {
1386 return Color(
1387 a.r * b.r,
1388 a.g * b.g,
1389 a.b * b.b
1390 );
1391 }
1392
1396 inline Color operator *(const Color& a, int factor) noexcept {
1397 float f = static_cast<float>(factor);
1398 return Color(a.r * f, a.g * f, a.b * f);
1399 }
1400
1404 inline Color operator *(const Color& a, float factor) noexcept {
1405 return Color(a.r * factor, a.g * factor, a.b * factor);
1406 }
1407
1411 inline Color operator *(const Color& a, double factor) noexcept {
1412 float f = static_cast<float>(factor);
1413 return Color(a.r * f, a.g * f, a.b * f);
1414 }
1415
1419 inline Color operator *(int factor, const Color& a) noexcept {
1420 return a * float(factor);
1421 }
1422
1426 inline Color operator *(float factor, const Color& a) noexcept {
1427 return a * factor;
1428 }
1429
1433 inline Color operator *(double factor, const Color& a) noexcept {
1434 return a * float(factor);
1435 }
1436
1438 inline Color operator /(const Color& a, const Color& b) noexcept {
1439 return Color(a.r / b.r, a.g / b.g, a.b / b.b);
1440 }
1441
1445 inline Color operator /(const Color& a, int factor) noexcept {
1446 float f = static_cast<float>(factor);
1447 return Color(a.r / f, a.g / f, a.b / f);
1448 }
1449
1453 inline Color operator /(const Color& a, float factor) noexcept {
1454 return Color(a.r / factor, a.g / factor, a.b / factor);
1455 }
1456
1460 inline Color operator /(const Color& a, double factor) noexcept {
1461 float f = static_cast<float>(factor);
1462 return Color(a.r / f, a.g / f, a.b / f);
1463 }
1464
1467 inline bool operator !=(const Color& a, const Color& b) noexcept {
1468 return a.r != b.r || a.g != b.g || a.b != b.b;
1469 }
1470
1474 inline bool operator ==(const Color& a, const Color& b) noexcept {
1475 return a.r == b.r && a.g == b.g && a.b == b.b;
1476 }
1477
1479 struct AColor {
1480 Color color;
1481 float alpha;
1482
1483 AColor(const AColor&) noexcept = default;
1484 AColor(AColor&&) noexcept = default;
1485 AColor& operator=(const AColor&) noexcept = default;
1486 AColor& operator=(AColor&&) noexcept = default;
1487
1488 AColor() noexcept : color(), alpha() {}
1489
1490 template <typename T>
1491 AColor(Color c, T a) noexcept : color(c), alpha(float(a)) {}
1492
1493 template <typename T1, typename T2, typename T3>
1494 AColor(T1 r, T2 g, T3 b) noexcept : color(r, g, b), alpha(1.0f) {}
1495
1496 template <typename T1, typename T2, typename T3, typename T4>
1497 AColor(T1 r, T2 g, T3 b, T4 a) noexcept : color(r, g, b), alpha(float(a)) {}
1498
1499 template <typename T>
1500 explicit AColor(const T& value) noexcept : color(value), alpha(1) {}
1501
1502 std::string toString() const ;
1503
1506 void operator +=(const AColor& c) noexcept {
1507 color += c.color;
1508 alpha += c.alpha;
1509 }
1510
1513 void operator -=(const AColor& c) noexcept {
1514 color -= c.color;
1515 alpha -= c.alpha;
1516 }
1517
1520 void operator *=(const AColor& c) noexcept {
1521 color *= c.color;
1522 alpha *= c.alpha;
1523 }
1524
1527 void operator *=(int factor) noexcept {
1528 color *= float(factor);
1529 alpha *= float(factor);
1530 }
1531
1534 void operator *=(float factor) noexcept {
1535 color *= factor;
1536 alpha *= factor;
1537 }
1538
1541 void operator *=(double factor) noexcept {
1542 color *= float(factor);
1543 alpha *= float(factor);
1544 }
1545
1548 void operator /=(const AColor& c) noexcept {
1549 color /= c.color;
1550 alpha /= c.alpha;
1551 }
1552
1555 void operator /=(int factor) noexcept {
1556 color /= float(factor);
1557 alpha /= float(factor);
1558 }
1559
1562 void operator /=(float factor) noexcept {
1563 color /= factor;
1564 alpha /= factor;
1565 }
1566
1569 void operator /=(double factor) noexcept {
1570 color /= float(factor);
1571 alpha /= float(factor);
1572 }
1573
1575 float getLength() const noexcept {
1576 return sqrtf(color.getLengthSquared() + alpha * alpha);
1577 }
1578
1580 float getLengthSquared() const noexcept {
1581 return color.getLengthSquared() + alpha * alpha;
1582 }
1583
1585 AColor getWhiteComplement() const noexcept {
1586 return AColor(color.getWhiteComplement(), std::fmaxf(0.0f, 1.0f - alpha));
1587 }
1588
1591 void makeWhiteComplement() noexcept {
1592 color.makeWhiteComplement();
1593 alpha = std::fmaxf(0.0f, 1.0f - alpha);
1594 }
1595
1597 float maxComponentValue() const noexcept {
1598 return color.maxComponentValue();
1599 }
1600
1602 AColor fromSRGB() const noexcept {
1603 return AColor(
1604 Internal::srgb_to_linear(color.r),
1605 Internal::srgb_to_linear(color.g),
1606 Internal::srgb_to_linear(color.b),
1607 alpha
1608 );
1609 }
1610
1612 AColor toSRGB() const noexcept {
1613 return AColor(
1614 Internal::linear_to_srgb(color.r),
1615 Internal::linear_to_srgb(color.g),
1616 Internal::linear_to_srgb(color.b),
1617 alpha
1618 );
1619 }
1620
1621 };
1622
1623 inline std::ostream& operator <<(std::ostream& stream, const AColor& acolor) {
1624 stream << "AColor(" << acolor.color.r << ", " << acolor.color.g << ", " << acolor.color.b << ", " << acolor.alpha << ")";
1625 return stream;
1626 }
1627
1628 inline std::string AColor::toString() const {
1629 std::ostringstream stream;
1630 stream << *this;
1631 return stream.str();
1632 }
1633
1635 inline AColor operator +(const AColor& a, const AColor& b) noexcept {
1636 return AColor(
1637 a.color + b.color,
1638 a.alpha + b.alpha
1639 );
1640 }
1641
1643 inline AColor operator -(const AColor& a, const AColor& b) noexcept {
1644 return AColor(
1645 a.color - b.color,
1646 a.alpha - b.alpha
1647 );
1648 }
1649
1651 inline AColor operator *(const AColor& a, const AColor& b) noexcept {
1652 return AColor(
1653 a.color * b.color,
1654 a.alpha * b.alpha
1655 );
1656 }
1657
1661 inline AColor operator *(const AColor& a, int factor) noexcept {
1662 return AColor(
1663 a.color * float(factor),
1664 a.alpha * float(factor)
1665 );
1666 }
1667
1671 inline AColor operator *(const AColor& a, float factor) noexcept {
1672 return AColor(
1673 a.color * factor,
1674 a.alpha * factor
1675 );
1676 }
1677
1681 inline AColor operator *(const AColor& a, double factor) noexcept {
1682 return AColor(
1683 a.color * float(factor),
1684 a.alpha * float(factor)
1685 );
1686 }
1687
1691 inline AColor operator *(int factor, const AColor& a) noexcept {
1692 return a * float(factor);
1693 }
1694
1698 inline AColor operator *(float factor, const AColor& a) noexcept {
1699 return a * factor;
1700 }
1701
1705 inline AColor operator *(double factor, const AColor& a) noexcept {
1706 return a * float(factor);
1707 }
1708
1710 inline AColor operator /(const AColor& a, const AColor& b) noexcept {
1711 return AColor(
1712 a.color / b.color,
1713 a.alpha / b.alpha
1714 );
1715 }
1716
1720 inline AColor operator /(const AColor& a, int factor) noexcept {
1721 return AColor(
1722 a.color / float(factor),
1723 a.alpha / float(factor)
1724 );
1725 }
1726
1730 inline AColor operator /(const AColor& a, float factor) noexcept {
1731 return AColor(
1732 a.color / factor,
1733 a.alpha / factor
1734 );
1735 }
1736
1740 inline AColor operator /(const AColor& a, double factor) noexcept {
1741 return AColor(
1742 a.color / float(factor),
1743 a.alpha / float(factor)
1744 );
1745 }
1746
1749 inline bool operator !=(const AColor& a, const AColor& b) noexcept {
1750 return a.color != b.color || a.alpha != b.alpha;
1751 }
1752
1756 inline bool operator ==(const AColor& a, const AColor& b) noexcept {
1757 return a.color == b.color && a.alpha == b.alpha;
1758 }
1759
1761 struct Matrix {
1762 Vector v0, v1, v2;
1763
1764 std::string toString() const;
1765
1767 Vector& operator [](const int index) noexcept {
1768 return (&v0)[index];
1769 }
1770
1772 const Vector& operator [](const int index) const noexcept {
1773 return (&v0)[index];
1774 }
1775
1777 Matrix() noexcept = default;
1778
1779 Matrix(const Matrix&) noexcept = default;
1780 Matrix(Matrix&&) noexcept = default;
1781 Matrix& operator=(const Matrix&) noexcept = default;
1782 Matrix& operator=(Matrix&&) noexcept = default;
1783
1785 explicit Matrix(float value) noexcept : v0(value, 0, 0), v1(0 ,value, 0), v2(0, 0, value) {}
1786
1788 explicit Matrix(Vector diagonal) noexcept : v0(diagonal.x, 0, 0), v1(0, diagonal.y, 0), v2(0, 0, diagonal.z) {}
1789
1794 Matrix(const Vector &a, const Vector &b, const Vector &c) noexcept : v0(a), v1(b), v2(c) {}
1795
1798 //Matrix(const Matrix& other) noexcept : v0(other.v0), v1(other.v1), v2(other.v2) {}
1799
1804 void set(const Vector &a, const Vector &b, const Vector &c) noexcept {
1805 v0 = a, v1 = b, v2 = c;
1806 }
1807
1809 void set(float value) noexcept {
1810 v0.set(value, 0, 0);
1811 v1.set(0, value, 0);
1812 v2.set(0, 0, value);
1813 }
1814
1817 void set(const Matrix& other) noexcept {
1818 v0 = other.v0;
1819 v1 = other.v1;
1820 v2 = other.v2;
1821 }
1822
1826 void setCol(const int i, const Vector &a) noexcept {
1827 (*this)[i] = a;
1828 }
1829
1833 void setRow(const int i, const Vector &a) noexcept {
1834 (*this)[0][i] = a.x, (*this)[1][i] = a.y, (*this)[2][i]=a.z;
1835 }
1836
1838 void makeZero(void) noexcept {
1839 v0.makeZero();
1840 v1.makeZero();
1841 v2.makeZero();
1842 }
1843
1845 void makeIdentity(void) noexcept {
1846 v0.set(1.0f, 0.0f, 0.0f);
1847 v1.set(0.0f, 1.0f, 0.0f);
1848 v2.set(0.0f, 0.0f, 1.0f);
1849 }
1850
1853 void makeDiagonal(const Vector &a) noexcept {
1854 v0.set(a.x, 0.0f, 0.0f);
1855 v1.set(0.0f, a.y, 0.0f);
1856 v2.set(0.0f, 0.0f, a.z);
1857 }
1858
1859 void makeOuterProduct(const Vector &a, const Vector &b) noexcept {
1860 v0 = a.x*b;
1861 v1 = a.y*b;
1862 v2 = a.z*b;
1863 }
1864
1866 void makeTranspose(void) noexcept {
1867 float t;
1868 t = v0[1], v0[1] = v1[0], v1[0] = t;
1869 t = v0[2], v0[2] = v2[0], v2[0] = t;
1870 t = v1[2], v1[2] = v2[1], v2[1] = t;
1871 }
1872
1876 bool makeInverse(void) noexcept {
1877 Matrix r;
1878 double d = mixed(v0, v1, v2);
1879 bool ret = true;
1880 if (d) {
1881 r.setRow(0, (v1^v2)/d);
1882 r.setRow(1, (v2^v0)/d);
1883 r.setRow(2, (v0^v1)/d);
1884 } else {
1885 r.makeZero();
1886 ret = false;
1887 }
1888 *this = r;
1889 return ret;
1890 }
1891
1892 void addDiagonal(const Vector &a) noexcept {
1893 v0[0] += a[0];
1894 v1[1] += a[1];
1895 v2[2] += a[2];
1896 }
1897
1898 void addTranspose(const Matrix &b) noexcept {
1899 v0[0] += b.v0[0];
1900 v0[1] += b.v1[0];
1901 v0[2] += b.v2[0];
1902
1903 v1[0] += b.v0[1];
1904 v1[1] += b.v1[1];
1905 v1[2] += b.v2[1];
1906
1907 v2[0] += b.v0[2];
1908 v2[1] += b.v1[2];
1909 v2[2] += b.v2[2];
1910 }
1911
1913 void operator *=(float x) noexcept {
1914 v0 *= x, v1 *= x, v2 *= x;
1915 }
1916
1918 void operator /=(float x) noexcept {
1919 v0 /= x, v1 /= x, v2 /= x;
1920 }
1921
1924 void operator +=(const Matrix &m) noexcept {
1925 v0 += m.v0;
1926 v1 += m.v1;
1927 v2 += m.v2;
1928 }
1929
1932 void operator -=(const Matrix &m) noexcept {
1933 v0-=m.v0;
1934 v1-=m.v1;
1935 v2-=m.v2;
1936 }
1937
1939 void rotate(const Vector &axis) noexcept {
1940 v0.rotate(axis);
1941 v1.rotate(axis);
1942 v2.rotate(axis);
1943 }
1944
1945 void makeOrthogonal(void) noexcept {
1946 Matrix t;
1947 t.v0 = normalize(v0);
1948 t.v1 = normalize(v2 ^ v0);
1949 t.v2 = t.v0 ^ t.v1;
1950 v0 = length(v0) * t.v0;
1951 v1 = length(v1) * t.v1;
1952 v2 = length(v2) * t.v2;
1953 }
1954
1955 void makeOrthonormal(void) noexcept {
1956 v0 = normalize(v0);
1957 v1 = normalize(v2 ^ v0);
1958 v2 = normalize(v0 ^ v1);
1959 }
1960 };
1961
1964 inline Matrix inverse(const Matrix &m) noexcept {
1965 Matrix r;
1966 double d = m.v0*(m.v1^m.v2);
1967 r.setRow(0, (m.v1^m.v2)/d);
1968 r.setRow(1, (m.v2^m.v0)/d);
1969 r.setRow(2, (m.v0^m.v1)/d);
1970 return r;
1971 }
1972
1975 inline Vector operator *(const Vector &a, const Matrix &m) noexcept {
1976 return Vector(a*m.v0, a*m.v1, a*m.v2);
1977 }
1978
1981 inline Vector operator *(const Matrix &m, const Vector &a) noexcept {
1982 return a.x*m.v0 + a.y*m.v1 + a.z*m.v2;
1983 }
1984
1987 inline Matrix operator ^(const Matrix &m, const Vector &a) noexcept {
1988 return Matrix(m.v0^a, m.v1^a, m.v2^a);
1989 }
1990
1993 inline Matrix operator ^(const Vector &a, const Matrix &m) noexcept {
1994 return Matrix(a^m.v0, a^m.v1, a^m.v2);
1995 }
1996
1999 inline Matrix operator *(const Matrix &m, float x) noexcept {
2000 return Matrix(m.v0*x, m.v1*x, m.v2*x);
2001 }
2002
2005 inline Matrix operator *(float x, const Matrix &m) noexcept {
2006 return Matrix(x*m.v0, x*m.v1, x*m.v2);
2007 }
2008
2011 inline Matrix operator /(const Matrix &m, float x) noexcept {
2012 return Matrix(m.v0/x, m.v1/x, m.v2/x);
2013 }
2014
2017 inline float operator /(float x, const Matrix &m) noexcept {
2018 return x / float(m.v0*(m.v1^m.v2));
2019 }
2020
2023 inline Matrix operator +(const Matrix &a, const Matrix &b) noexcept {
2024 return Matrix(a.v0 + b.v0, a.v1 + b.v1, a.v2 + b.v2);
2025 }
2026
2029 inline Matrix operator -(const Matrix &a, const Matrix &b) noexcept {
2030 return Matrix(a.v0 - b.v0, a.v1 - b.v1, a.v2 - b.v2);
2031 }
2032
2035 inline Matrix operator *(const Matrix &a, const Matrix &b) noexcept {
2036 Matrix r(
2037 Vector(
2038 a.v0[0]*b.v0[0]+a.v1[0]*b.v0[1]+a.v2[0]*b.v0[2],
2039 a.v0[1]*b.v0[0]+a.v1[1]*b.v0[1]+a.v2[1]*b.v0[2],
2040 a.v0[2]*b.v0[0]+a.v1[2]*b.v0[1]+a.v2[2]*b.v0[2]),
2041 Vector(
2042 a.v0[0]*b.v1[0]+a.v1[0]*b.v1[1]+a.v2[0]*b.v1[2],
2043 a.v0[1]*b.v1[0]+a.v1[1]*b.v1[1]+a.v2[1]*b.v1[2],
2044 a.v0[2]*b.v1[0]+a.v1[2]*b.v1[1]+a.v2[2]*b.v1[2]),
2045 Vector(
2046 a.v0[0]*b.v2[0]+a.v1[0]*b.v2[1]+a.v2[0]*b.v2[2],
2047 a.v0[1]*b.v2[0]+a.v1[1]*b.v2[1]+a.v2[1]*b.v2[2],
2048 a.v0[2]*b.v2[0]+a.v1[2]*b.v2[1]+a.v2[2]*b.v2[2])
2049 );
2050 return r;
2051 }
2052
2055 inline bool operator !=(const Matrix &a, const Matrix &b) noexcept {
2056 return a.v0 != b.v0 || a.v1 != b.v1 || a.v2 != b.v2;
2057 }
2058
2062 inline bool operator ==(const Matrix &a, const Matrix &b) noexcept {
2063 return a.v0 == b.v0 && a.v1 == b.v1 && a.v2 == b.v2;
2064 }
2065
2068 inline Matrix operator -(const Matrix &a) noexcept {
2069 return Matrix(-a.v0, -a.v1, -a.v2);
2070 }
2071
2072 inline Matrix outerProductMatrix(const Vector &a, const Vector &b) noexcept {
2073 return Matrix(a.x*b, a.y*b, a.z*b);
2074 }
2075
2077 inline Matrix transpose(const Matrix &m) noexcept {
2078 return Matrix(
2079 Vector(m.v0[0], m.v1[0], m.v2[0]),
2080 Vector(m.v0[1], m.v1[1], m.v2[1]),
2081 Vector(m.v0[2], m.v1[2], m.v2[2]));
2082 }
2083
2086 inline Matrix rotate(const Matrix &m, const Vector &axis) noexcept {
2087 return Matrix(rotate(m.v0, axis), rotate(m.v1, axis), rotate(m.v2, axis));
2088 }
2089
2092 inline Matrix normalize(const Matrix &m) noexcept {
2093 Vector v0 = normalize(m.v0);
2094 Vector v1 = normalize(m.v2^m.v0);
2095 return Matrix(v0, v1, v0^v1);
2096 }
2097
2100 inline Matrix noScale(const Matrix &m) noexcept {
2101 return Matrix(normalize(m.v0), normalize(m.v1), normalize(m.v2));
2102 }
2103
2106 inline Vector scale(const Matrix &m) noexcept {
2107 return Vector(m[0].length(), m[1].length(), m[2].length());
2108 }
2109
2112 inline Vector rotationAngles(const Matrix& m) noexcept {
2113 const Matrix mns = noScale(m);
2114
2115 /*the 3x3 matrix, starting from identity and given random rotational angles, x,y and z looks like this:
2116 | cy*cz -cy*sz sy |
2117 | sx*sy*cz + cx*cz -sx*sy*sz + cx*cz -sx*cy |
2118 | -cx*sy*cz + sx*sz cx*sy*sz + sx*cz cx*cy |
2119
2120 where the alignment are in V-Ray terms. The Euler angles, with a bit of simplification:
2121 x = atan(-(-sx*cy)/cx*cy) = atan(-a21/a22)
2122 y = asin(sy) = asin(a20)
2123 z = atan(-(-cy*sz)/cy*cz) = atan(-a10/a00)
2124 */
2125
2126 //atan2 will only raise an error if both arguments are 0, which should never happen
2127 //equivalent to a scale of zero
2128 return Vector(
2129 atan2(-mns[2][1], mns[2][2]),
2130 asin(mns[2][0]),
2131 atan2(-mns[1][0], mns[0][0])
2132 );
2133 }
2134
2138 inline Matrix makeRotationMatrixX(float xrot) noexcept {
2139 const float s = sinf(xrot);
2140 const float c = cosf(xrot);
2141 return Matrix(Vector(1.0f, 0.0f, 0.0f), Vector(0, c, s), Vector(0, -s, c));
2142 }
2143
2147 inline Matrix makeRotationMatrixY(float yrot) noexcept {
2148 const float s = sinf(yrot);
2149 const float c = cosf(yrot);
2150 return Matrix(Vector(c, 0, -s), Vector(0.0f, 1.0f, 0.0f), Vector(s, 0, c));
2151 }
2152
2156 inline Matrix makeRotationMatrixZ(float zrot) noexcept {
2157 const float s = sinf(zrot);
2158 const float c = cosf(zrot);
2159 return Matrix(Vector(c, s, 0), Vector(-s, c, 0), Vector(0.0f, 0.0f, 1.0f));
2160 }
2161
2163 inline Matrix normalTransformMatrix(const Matrix &m) noexcept {
2164 return Matrix(m[1]^m[2], m[2]^m[0], m[0]^m[1]);
2165 }
2166
2168 inline Matrix normalTransformMatrixX(const Matrix &m, bool &DlessThanZero ) noexcept {
2169 if((m[0]^m[1])*m[2] < 0){
2170 DlessThanZero = true;
2171 return Matrix(m[2]^m[1], m[0]^m[2], m[1]^m[0]);
2172 }
2173 DlessThanZero = false;
2174 return Matrix(m[1]^m[2], m[2]^m[0], m[0]^m[1]);
2175 }
2176
2177 inline std::ostream& operator <<(std::ostream& stream, const Matrix& matrix) {
2178 stream << "Matrix(" << matrix.v0 << ", " << matrix.v1 << ", " << matrix.v2 << ")";
2179 return stream;
2180 }
2181
2182 inline std::string Matrix::toString() const {
2183 std::ostringstream stream;
2184 stream << *this;
2185 return stream.str();
2186 }
2187
2189 struct Transform {
2190 Matrix matrix;
2191 Vector offset;
2192
2194 Transform() noexcept = default;
2195
2196 Transform(const Transform&) noexcept = default;
2197 Transform(Transform&&) noexcept = default;
2198 Transform& operator=(const Transform&) noexcept = default;
2199 Transform& operator=(Transform&&) noexcept = default;
2200
2204 Transform(const Matrix& matrix, const Vector& offset) noexcept : matrix(matrix), offset(offset) {}
2205
2209 Transform(int i) noexcept {
2210 if (i == 1) makeIdentity();
2211 if (i == 0) makeZero();
2212 }
2213
2215 void makeZero(void) noexcept {
2216 matrix.makeZero();
2217 offset.makeZero();
2218 }
2219
2221 void makeIdentity(void) noexcept {
2222 matrix.makeIdentity();
2223 offset.makeZero();
2224 }
2225
2227 void operator *=(float x) noexcept {
2228 matrix *= x;
2229 offset *= x;
2230 }
2231
2233 void operator +=(const Transform &tm) noexcept {
2234 matrix += tm.matrix;
2235 offset += tm.offset;
2236 }
2237
2239 void operator -=(const Transform &tm) noexcept {
2240 matrix -= tm.matrix;
2241 offset -= tm.offset;
2242 }
2243
2246 Vector transformVec(const Vector &a) const noexcept {
2247 return matrix * a;
2248 }
2249
2251 void makeInverse(void) noexcept {
2252 matrix.makeInverse();
2253 offset = -matrix * offset;
2254 }
2255
2256 std::string toString() const;
2257 };
2258
2261 inline bool operator !=(const Transform &a, const Transform &b) noexcept {
2262 return a.matrix != b.matrix || a.offset != b.offset;
2263 }
2264
2268 inline bool operator ==(const Transform &a, const Transform &b) noexcept {
2269 return a.matrix == b.matrix && a.offset == b.offset;
2270 }
2271
2274 inline Transform operator -(const Transform &tm) noexcept {
2275 return Transform(-tm.matrix, -tm.offset);
2276 }
2277
2280 inline Transform operator *(const Transform &tm, float x) noexcept {
2281 return Transform(tm.matrix * x, tm.offset * x);
2282 }
2283
2286 inline Transform operator *(float x, const Transform &tm) noexcept {
2287 return Transform(x * tm.matrix, x * tm.offset);
2288 }
2289
2292 inline Transform operator /(const Transform &tm, float x) noexcept {
2293 return Transform(tm.matrix / x, tm.offset / x);
2294 }
2295
2298 inline Transform operator +(const Transform &a, const Transform &b) noexcept {
2299 return Transform(a.matrix + b.matrix, a.offset + b.offset);
2300 }
2301
2304 inline Transform operator -(const Transform &a, const Transform &b) noexcept {
2305 return Transform(a.matrix - b.matrix, a.offset - b.offset);
2306 }
2307
2310 inline Transform operator *(const Transform &a, const Transform &b) noexcept {
2311 return Transform(a.matrix * b.matrix, a.matrix * b.offset + a.offset);
2312 }
2313
2316 inline Vector operator *(const Transform &tm, const Vector &a) noexcept {
2317 return tm.matrix * a + tm.offset;
2318 }
2319
2322 inline Vector inverseTransform(const Vector &a, const Transform &tm) noexcept {
2323 return (a - tm.offset) * tm.matrix;
2324 }
2325
2326 inline std::ostream& operator <<(std::ostream& stream, const Transform& transform) {
2327 stream << "Transform(" << transform.matrix << ", " << transform.offset << ")";
2328 return stream;
2329 }
2330
2331 inline std::string Transform::toString() const {
2332 std::ostringstream stream;
2333 stream << *this;
2334 return stream.str();
2335 }
2336
2339 std::vector<Transform> transforms;
2340 std::vector<int> keyFrames;
2341
2342 AnimatedTransform() noexcept = default;
2343 AnimatedTransform(const AnimatedTransform&) = default;
2344 AnimatedTransform(AnimatedTransform&&) noexcept = default;
2345 AnimatedTransform& operator=(const AnimatedTransform&) = default;
2346 AnimatedTransform& operator=(AnimatedTransform&&) noexcept = default;
2347
2348 AnimatedTransform(const std::vector<Transform>& transforms, const std::vector<int>& keyFrames) noexcept
2350 AnimatedTransform(std::vector<Transform>&& transforms, std::vector<int>&& keyFrames) noexcept
2351 : transforms(std::move(transforms)), keyFrames(std::move(keyFrames)) {}
2352 };
2353
2354 typedef int RGB32;
2355
2356 struct RendererOptions;
2357 class PluginMeta;
2358 class PropertyMeta;
2359 class PropertyRuntimeMeta;
2360 class UIGuides;
2361 struct Box;
2362 struct RenderSizeParams;
2363
2364 namespace Internal {
2365 const float DEFAULT_FPS = 24.0f;
2366 const float DEFAULT_POINT_SIZE = 2.2f;
2367 const long long READ_DATA_STRUCT_VERSION = 5; // added numFrames / hasVelocityChannel / hairVelocities / particleVelocities
2368 const long long READ_PARAMS_STRUCT_VERSION = 2; // updated struct layout
2369 const long long CREATE_PARAMS_STRUCT_VERSION = 7; // added bakeTransforms
2370 const long long GEOM_MESH_DATA_STRUCT_VERSION = 2; // added hair / particles
2371 const long long ENABLE_DRCLIENT_PARAMS_STRUCT_VERSION = 0; // initial version
2372 const long long LIVE_LINK_CLIENT_PARAMS_STRUCT_VERSION = 0; // initial version
2373 const long long SCATTER_READ_PARAMS_STRUCT_VERSION = 0; // initial version
2374 class VRayRendererNative;
2375 class BinaryValueParser;
2376 class BinaryValueBuilder;
2377 struct MeshFileDataParser;
2378 }
2379
2386
2388 : doColorCorrect(false)
2389 , stripAlpha(false)
2390 , flipImage(false)
2391 {}
2392 };
2393
2396 friend class RenderElements;
2397
2398 public:
2400 enum Type {
2401 NONE = -1,
2402
2416
2422
2425
2428
2432
2435
2438
2441
2443
2445
2447
2449
2453
2456
2459
2465
2468
2473
2476
2479
2492
2494
2495 USER=1000,
2496
2497 COVERAGE = USER + 5001,
2499 MULTIMATTE = USER + 5004,
2502 EXTRA_TEX = USER + 5007,
2505 COAT = USER + 5010,
2506 SHEEN = USER + 5011,
2507 AMBIENT_OCCLUSION = USER + 5012,
2508 };
2509
2518 };
2519
2522 PF_DEFAULT = -1,
2528
2533
2538 };
2539
2543
2546
2551
2556
2559
2563
2565 struct Info {
2566 const char *name;
2569 };
2570
2571 private:
2572 const VRayRenderer* renderer;
2573 InstanceId pluginID;
2574 std::string name;
2575 Type type;
2576 BinaryFormat binaryFormat;
2577 PixelFormat defaultPixelFormat;
2578
2579 RenderElement(const VRayRenderer* renderer, Type type, const Plugin &plugin);
2580 static PixelFormat binaryFormatToPixelFormat(BinaryFormat binFormat);
2581
2582 size_t getData_internal(
2583 int layer,
2584 InstanceId alphaPluginID,
2585 void** data,
2586 PixelFormat format = PF_DEFAULT,
2588 bool rgbOrder = false,
2589 const ImageRegion* rgn = nullptr
2590 ) const;
2591
2592 public:
2594 RenderElement() : renderer(NULL), pluginID(NO_ID), type(NONE), binaryFormat(BF_FLOAT), defaultPixelFormat(PF_DEFAULT) {}
2595
2598
2600 std::string getName() const {
2601 return name;
2602 }
2603
2605 Type getType() const {
2606 return type;
2607 }
2608
2611 return binaryFormat;
2612 }
2613
2616 return defaultPixelFormat;
2617 }
2618
2622 : alphaChannelPlugin(NULL)
2623 , useDefaultAlpha(false)
2624 , format(PF_DEFAULT)
2625 , rgbOrder(false)
2626 , region(nullptr)
2627 , layerIndex(0)
2628 {}
2629
2636 bool flipImage = false; //<! Flip image top-bottom.
2637 DataIntent intent = DI_INTENT_DISPLAY;
2638 };
2639
2645 size_t getData(void** data, const GetDataOptions &options) const;
2646
2652 size_t getDataIntoBuffer(const GetDataOptions &options, void* data) const;
2653
2655 static void releaseData(void* data);
2656
2662 VRayImage* getImage(const ImageRegion* rgn = NULL, int layerIndex = 0) const;
2663
2669 VRayImage* getImage(const GetImageOptions &options, int layerIndex = 0) const;
2670
2672 std::string getMetadata() const;
2673
2678 operator bool () const {
2679 return pluginID != NO_ID;
2680 }
2681 };
2682
2685 friend class VRayRenderer;
2686
2687 VRayRenderer& renderer;
2688
2689 RenderElements(VRayRenderer& renderer);
2690 RenderElements& operator=(const RenderElements&);
2691
2692 public:
2697 RenderElement add(RenderElement::Type type, const char* displayName = nullptr, const char* instanceName = nullptr);
2698
2702
2709 size_t get(const std::string &name, const RenderElement::GetDataOptions &options, void* buf) const;
2710
2713 std::vector<RenderElement> getAll(RenderElement::Type type) const;
2714 };
2715
2719 std::string pluginType;
2721 std::string fileNameSuffix;
2722 };
2723
2726 int start, end, step;
2727 };
2728
2731 long long deviceHandle;
2732 long long platform;
2733
2734 std::string name;
2735
2737 struct {
2741 };
2742
2744 enum Type {
2746 deviceType_CPU = (1 << 1),
2747 deviceType_GPU = (1 << 2),
2748 deviceType_ACCEL = (1 << 3),
2749 };
2750
2759
2761 int busId;
2765
2767 };
2768
2772 std::vector<ComputeDeviceInfo> getComputeDevicesMetal();
2773
2777 std::vector<ComputeDeviceInfo> getComputeDevicesOptix();
2778
2785 std::vector<ComputeDeviceInfo> getComputeDevicesCUDA();
2786
2790 std::vector<ComputeDeviceInfo> getComputeDevicesDenoiser();
2791
2795 bool setComputeDevicesMetal(const std::vector<int>& indices);
2796
2800 bool setComputeDevicesOptix(const std::vector<int>& indices);
2801
2805 bool setComputeDevicesCUDA(const std::vector<int>& indices);
2806
2810 bool setComputeDevicesDenoiser(const std::vector<int>& indices);
2811
2815 bool setComputeDevicesEnvironmentVariable();
2816
2820 unsigned elapsedTicks;
2824 float currentProgress;
2825
2827 std::string name;
2829 float freeMem;
2830 float totalMem;
2831 };
2832
2833 std::vector<ComputeDeviceStatistics> computeDevices;
2834
2836 const char* name;
2837 unsigned long long usage;
2838 };
2839
2840 std::vector<ComputeDeviceMemoryType> computeDevicesMemUsage;
2841 };
2842
2843 typedef std::vector<int> IntList;
2844 typedef std::vector<float> FloatList;
2845 typedef std::vector<Color> ColorList;
2846 typedef std::vector<Vector> VectorList;
2847 typedef std::vector<Value> ValueList;
2848 typedef std::vector<std::string> StringList;
2849
2851 struct ObjectInfo {
2852 std::string name;
2853 int id;
2855 int vEnd;
2856 };
2857
2859 struct VoxelInfo {
2863 };
2864
2866 struct Box {
2869
2872 void expand(const Vector& point) {
2873 pmin = Vector(
2874 VRAY_MINIMUM2(pmin.x, point.x),
2875 VRAY_MINIMUM2(pmin.y, point.y),
2876 VRAY_MINIMUM2(pmin.z, point.z)
2877 );
2878 pmax = Vector(
2879 VRAY_MAXIMUM2(pmax.x, point.x),
2880 VRAY_MAXIMUM2(pmax.y, point.y),
2881 VRAY_MAXIMUM2(pmax.z, point.z)
2882 );
2883 }
2884
2887 void expand(const Box& box) {
2888 pmin = Vector(
2889 VRAY_MINIMUM2(pmin.x, box.pmin.x),
2890 VRAY_MINIMUM2(pmin.y, box.pmin.y),
2891 VRAY_MINIMUM2(pmin.z, box.pmin.z)
2892 );
2893 pmax = Vector(
2894 VRAY_MAXIMUM2(pmax.x, box.pmax.x),
2895 VRAY_MAXIMUM2(pmax.y, box.pmax.y),
2896 VRAY_MAXIMUM2(pmax.z, box.pmax.z)
2897 );
2898 }
2899
2900 std::string toString() const;
2901 };
2902
2903 inline std::ostream& operator <<(std::ostream& stream, const Box& box) {
2904 stream << "Box(min: " << box.pmin << ", max: " << box.pmax << ")";
2905 return stream;
2906 }
2907
2908 inline std::string Box::toString() const {
2909 std::ostringstream stream;
2910 stream << *this;
2911 return stream.str();
2912 }
2913
2918 friend class GeomUtils;
2919 public:
2921 GaussianReadData(GaussianReadData&& rhs) noexcept;
2922 GaussianReadData& operator=(GaussianReadData&& rhs) noexcept;
2924
2927
2929 Vector getPosition(unsigned index) const;
2930
2932 Color getAverageColor(unsigned index) const;
2933
2935 const Box& getPreviewBoundingBox() const { return previewBBox; }
2936
2937 private:
2938 GaussianReadData(const GaussianReadData&) = delete;
2939 GaussianReadData& operator=(const GaussianReadData&) = delete;
2940
2942 void* handle;
2944 Box previewBBox;
2945 };
2946
2951 public:
2952 enum ReadFlags {
2953 MESH_VERTICES = (1 << 4),
2954 MESH_NORMALS = (1 << 5),
2955 MESH_MTLIDS = (1 << 6),
2956 MESH_VELOCITIES = (1 << 7),
2957 MESH_UVS = (1 << 8),
2958 MESH_SHADERS = (1 << 9),
2959 MESH_OBJECTINFOS = (1 << 10),
2960 MESH_HAIROBJECTINFOS = (1 << 11),
2961 MESH_PARTICLEOBJECTINFOS = (1 << 12),
2962 MESH_HAIRGEOMETRY = (1 << 13),
2963 MESH_PARTICLESGEOMETRY = (1 << 14),
2964 MESH_GEOMETRYMESHESBBOXES = (1 << 15),
2965 MESH_HAIROBJECTBBOXES = (1 << 16),
2966 MESH_PARTICLEOBJECTBBOXES = (1 << 17),
2967 MESH_ALL = MESH_VERTICES | MESH_NORMALS | MESH_VELOCITIES | MESH_MTLIDS | MESH_UVS | MESH_SHADERS |
2968 MESH_OBJECTINFOS | MESH_HAIROBJECTINFOS | MESH_PARTICLEOBJECTINFOS | MESH_HAIRGEOMETRY | MESH_PARTICLESGEOMETRY |
2969 MESH_GEOMETRYMESHESBBOXES | MESH_HAIROBJECTBBOXES | MESH_PARTICLEOBJECTBBOXES,
2970 };
2971
2973 ProxyReadData(int flags=MESH_ALL);
2974
2976 void setFlags(int flags) { d.flags = flags; }
2977
2979 const std::vector<Vector> &getVertices() const { return vertices; }
2980
2982 const std::vector<int> &getVertexIndices() const { return indices; }
2983
2985 const std::vector<Vector> &getNormals() const { return normals; }
2986
2988 const std::vector<int> &getNormalIndices() const { return normalIndices; }
2989
2991 const std::vector<int> &getMaterialIDs() const { return materialIDs; }
2992
2994 const std::vector<int> &getEdgeVisibility() const { return edgeVisibility; }
2995
2997 const std::vector<Vector> &getVelocities() const { return velocities; }
2998
3000 int getUVSetsCount() const;
3001
3003 std::vector<int> getUVOriginalIndices() const;
3004
3006 std::string getUVSetName(int setIndex) const;
3007
3009 size_t getUVValuesCount(int setIndex) const;
3010
3012 size_t getUVValueIndicesCount(int setIndex) const;
3013
3015 const Vector * getUVValues(int setIndex) const;
3016
3018 const int * getUVValueIndices(int setIndex) const;
3019
3021 int getShadersCount() const;
3022
3024 std::string getShaderName(int shaderIndex) const;
3025
3027 int getShaderID(int shaderIndex) const;
3028
3031
3033 ObjectInfo getMeshObjectInfo(int meshIndex) const;
3034
3037
3039 ObjectInfo getHairObjectInfo(int meshIndex) const;
3040
3043
3045 ObjectInfo getParticleObjectInfo(int meshIndex) const;
3046
3048 VoxelInfo getMeshVoxelInfo(int meshIndex) const;
3049
3051 VoxelInfo getHairVoxelInfo(int meshIndex) const;
3052
3054 VoxelInfo getParticleVoxelInfo(int meshIndex) const;
3055
3057 const std::vector<Vector> &getHairVertices() const { return hairVertices; }
3058
3060 const std::vector<int> &getHairVerticesPerStrand() const { return hairVerticesPerStrand; }
3061
3063 const std::vector<float> &getHairWidths() const { return hairWidths; }
3064
3066 const std::vector<Vector> &getParticleVertices() const { return particleVertices; }
3067
3069 const std::vector<float> &getParticleWidths() const { return particleWidths; }
3070
3073
3076
3078 int getNumFrames() const;
3079
3082
3084 std::vector<Vector> getVoxelVertices(int voxelIndex) const;
3085
3087 std::vector<int> getVoxelVertexIndices(int voxelIndex) const;
3088
3090 const std::vector<int> &getVoxelVerticesStartIndices() const { return voxelVerticesStartIndices; }
3091
3093 const std::vector<int> &getVoxelVertexIndicesStartIndices() const { return voxelVertexIndicesStartIndices; }
3094
3096 std::vector<Vector> getVoxelNormals(int voxelIndex) const;
3097
3099 std::vector<int> getVoxelNormalIndices(int voxelIndex) const;
3100
3102 const std::vector<int> &getVoxelNormalsStartIndices() const { return voxelNormalsStartIndices; }
3103
3105 const std::vector<int> &getVoxelNormalIndicesStartIndices() const { return voxelNormalIndicesStartIndices; }
3106
3108 std::vector<int> getVoxelMaterialIDs(int voxelIndex) const;
3109
3111 const std::vector<int> &getVoxelMaterialIDsStartIndices() const { return voxelMaterialIDsStartIndices; }
3112
3114 std::vector<int> getVoxelEdgeVisibility(int voxelIndex) const;
3115
3117 std::vector<Vector> getVoxelVelocities(int voxelIndex) const;
3118
3120 const std::vector<int> &getVoxelVelocitiesStartIndices() const { return voxelVelocitiesStartIndices; }
3121
3123 std::vector<Vector> getVoxelUVValues(int voxelIndex, int setIndex) const;
3124
3126 std::vector<int> getVoxelUVValueIndices(int voxelIndex, int setIndex) const;
3127
3129 const std::vector<int> &getVoxelUVValuesStartIndices() const { return voxelUVValuesStartIndices; }
3130
3132 const std::vector<int> &getVoxelUVValueIndicesStartIndices() const { return voxelUVValueIndicesStartIndices; }
3133
3135 const std::vector<Vector> &getUVValues() const { return uvValues; }
3136
3138 const std::vector<int> &getUVValueIndices() const { return uvValueIndices; }
3139
3142
3145
3147 const std::vector<int> &getHairVerticesStartIndices() const { return hairVerticesStartIndices; }
3148
3150 const std::vector<int> &getHairVerticesPerStrandStartIndices() const { return hairVerticesPerStrandStartIndices; }
3151
3153 const std::vector<int> &getHairWidthsStartIndices() const { return hairWidthsStartIndices; }
3154
3156 const std::vector<int> &getHairVelocitiesStartIndices() const { return hairVelocitiesStartIndices; }
3157
3159 const std::vector<int> &getParticleVerticesStartIndices() const { return particleVerticesStartIndices; }
3160
3162 const std::vector<int> &getParticleWidthsStartIndices() const { return particleWidthsStartIndices; }
3163
3165 const std::vector<int> &getParticleVelocitiesStartIndices() const { return particleVelocitiesStartIndices; }
3166
3168 std::vector<Vector> getHairVoxelVertices(int hairVoxelIndex) const;
3169
3171 std::vector<int> getHairVoxelVerticesPerStrand(int hairVoxelIndex) const;
3172
3174 std::vector<float> getHairVoxelWidths(int hairVoxelIndex) const;
3175
3177 std::vector<Vector> getHairVoxelVelocities(int hairVoxelIndex) const;
3178
3180 std::vector<Vector> getParticleVoxelVertices(int particleVoxelIndex) const;
3181
3183 std::vector<float> getParticleVoxelWidths(int particleVoxelIndex) const;
3184
3186 std::vector<Vector> getParticleVoxelVelocities(int particleVoxelIndex) const;
3187
3192 std::vector<int> getArrayOfLengths(const int* startIndices, int elementsCount, int objectCount) const;
3193
3199 std::vector<int> getArrayOfLengths(const int* startIndices, int elementsCount, int objectCount, int uvSetsCount) const;
3200
3206 int getLengthFromStartIndex(int objectIndex, const int* startIndices, int elementsCount, int objectCount) const;
3207
3215 int getLengthFromStartIndex(int objectIndex, int setIndex, const int* startIndices, int elementsCount, int objectCount, int uvSetsCount) const;
3216
3218 const std::vector<Box> &getGeometryVoxelsBBoxes() const { return geometryVoxelsBBoxes; }
3219
3221 const std::vector<Box> &getHairVoxelsBBoxes() const { return hairVoxelsBBoxes; }
3222
3224 const std::vector<Box> &getParticleVoxelsBBoxes() const { return particleVoxelsBBoxes; }
3225
3227 Box getGeometryVoxelBBox(int voxelIndex) const;
3228
3230 Box getHairVoxelBBox(int hairVoxelIndex) const;
3231
3233 Box getParticleVoxelBBox(int particleVoxelIndex) const;
3234
3236 const std::vector<Color> &getVoxelInfoWireColor() const { return voxelInfoWireColor; }
3237
3239 const std::vector<Bool> &getVoxelInfoSmoothed() const { return voxelInfoSmoothed; }
3240
3242 const std::vector<Bool> &getVoxelInfoFlipNormals() const { return voxelInfoFlipNormals; }
3243
3246
3247 private:
3248 friend class VRayRenderer;
3249 friend class Proxy;
3250 void allocateArrays();
3251 std::vector<Vector> getArrayElement (int objectIndex, const int* startIndices, const VectorList& list, int elementsCount, size_t objectCount) const;
3252 std::vector<int> getArrayElement (int objectIndex, const int* startIndices, const int* primaryStartIndices, const IntList& list, int elementsCount, size_t objectCount) const;
3253 std::vector<int> getArrayElement (int objectIndex, const int* startIndices, const IntList& list, int elementsCount, size_t objectCount) const;
3254 std::vector<float> getArrayElement (int objectIndex, const int* startIndices, const FloatList& list, int elementsCount, size_t objectCount) const;
3255 std::vector<Vector> getArrayElement (int objectIndex, int setIndex, const int* startIndices, const VectorList& list, int elementsCount, size_t objectCount, size_t uvSetsCount) const;
3256 std::vector<int> getArrayElement (int objectIndex, int setIndex, const int* startIndices, const int* primaryStartIndices, const IntList& list, int elementsCount, int primaryElementsCount, size_t objectCount, size_t uvSetsCount) const;
3257
3258 struct Internal {
3259 long long version;
3260 union {
3261 long long int flags;
3262 struct {
3263 bool maxToMayaTM : 1;
3264 bool mayaToMaxTM : 1;
3265 bool reserved_bit2 : 1;
3266 bool reserved_bit3 : 1;
3267 bool use_vertices : 1;
3268 bool use_normals : 1;
3269 bool use_mtlIDs : 1;
3270 bool use_velocities : 1;
3271 bool use_UVs : 1;
3272 bool use_shaders : 1;
3273 bool use_objectInfos : 1;
3274 bool use_hairObjectInfos : 1;
3275 bool use_particleObjectInfos : 1;
3276 bool use_hair : 1;
3277 bool use_particles : 1;
3278 bool use_geometryVoxelsBBoxes : 1;
3279 bool use_hairVoxelsBBoxes : 1;
3280 bool use_particleVoxelsBBoxes : 1;
3281 };
3282 };
3283
3284 float* vertices;
3285 size_t vertices_count;
3286 int* indices;
3287 size_t indices_count;
3288 float* normals;
3289 size_t normals_count;
3290 int* normalIndices;
3291 size_t normalIndices_count;
3292 int* materialIDs;
3293 size_t materialIDs_count;
3294 float* velocities;
3295 size_t velocities_count;
3296
3297 char* uvSetNames;
3298 float* uvValues;
3299 int* uvValueIndices;
3300 size_t uvSets_count;
3301 size_t uvSetNames_length;
3302 int uvSetIndices[100];
3303 size_t uvValues_counts[100];
3304 size_t uvValueIndices_counts[100];
3305
3306 char* shaderNames;
3307 int* shaderIds;
3308 size_t shaders_count;
3309 size_t shaderNames_length;
3310
3311 char* objectInfoNames;
3312 int* objectInfoIds;
3313 int* objectInfoVBegins;
3314 int* objectInfoVEnds;
3315 size_t objectInfos_count;
3316 size_t objectInfoNames_length;
3317
3318 char* hairObjectInfoNames;
3319 int* hairObjectInfoIds;
3320 int* hairObjectInfoVBegins;
3321 int* hairObjectInfoVEnds;
3322 size_t hairObjectInfos_count;
3323 size_t hairObjectInfoNames_length;
3324
3325 char* particleObjectInfoNames;
3326 int* particleObjectInfoIds;
3327 int* particleObjectInfoVBegins;
3328 int* particleObjectInfoVEnds;
3329 size_t particleObjectInfos_count;
3330 size_t particleObjectInfoNames_length;
3331
3332 float* hairVertices;
3333 size_t hairVertices_count;
3334 int* hairVerticesPerStrand;
3335 size_t hairVerticesPerStrand_count;
3336 float* particleVertices;
3337 size_t particlesVertices_count;
3338
3339 int* voxelVerticesStartIndices;
3340 int* voxelVertexIndicesStartIndices;
3341 int* voxelNormalsStartIndices;
3342 int* voxelNormalIndicesStartIndices;
3343 int* voxelMaterialIDsStartIndices;
3344 int* voxelVelocitiesStartIndices;
3345 int* voxelUVValuesStartIndices;
3346 int* voxelUVValueIndicesStartIndices;
3347
3348 float* geometryVoxelsBBoxes;
3349 float* hairVoxelsBBoxes;
3350 float* particleVoxelsBBoxes;
3351
3352 int* hairVerticesStartIndices;
3353 int* hairVerticesPerStrandStartIndices;
3354 int* particleVerticesStartIndices;
3355
3356 size_t geometryVoxels_count;
3357 size_t hairVoxels_count;
3358 size_t particleVoxels_count;
3359
3360 size_t totalUVvalues;
3361 size_t totalUVindices;
3362
3363 int* edgeVisibility;
3364
3365 Color* voxelInfoWireColor;
3366 int* voxelInfoSmoothed;
3367 int* voxelInfoFlipNormals;
3368 size_t voxelInfoObjects_count;
3369
3370 float* hairWidths;
3371 size_t hairWidths_count;
3372 int* hairWidthsStartIndices;
3373 float* particleWidths;
3374 size_t particleWidths_count;
3375 int* particleWidthsStartIndices;
3376
3377 int numFrames;
3378 Bool hasVelocityChannel;
3379
3380 float* hairVelocities;
3381 size_t hairVelocities_count;
3382 int* hairVelocitiesStartIndices;
3383 float* particleVelocities;
3384 size_t particleVelocities_count;
3385 int* particleVelocitiesStartIndices;
3386 } d;
3387
3388 std::vector<Vector> vertices;
3389 std::vector<int> indices;
3390 std::vector<Vector> normals;
3391 std::vector<int> normalIndices;
3392 std::vector<int> materialIDs;
3393 std::vector<Vector> velocities;
3394 std::vector<char> uvSetNames;
3395 std::vector<Vector> uvValues;
3396 std::vector<int> uvValueIndices;
3397 std::vector<char> shaderNames;
3398 std::vector<int> shaderIds;
3399 std::vector<char> objectInfoNames;
3400 std::vector<int> objectInfoIds;
3401 std::vector<int> objectInfoVBegins;
3402 std::vector<int> objectInfoVEnds;
3403 std::vector<char> hairObjectInfoNames;
3404 std::vector<int> hairObjectInfoIds;
3405 std::vector<int> hairObjectInfoVBegins;
3406 std::vector<int> hairObjectInfoVEnds;
3407 std::vector<char> particleObjectInfoNames;
3408 std::vector<int> particleObjectInfoIds;
3409 std::vector<int> particleObjectInfoVBegins;
3410 std::vector<int> particleObjectInfoVEnds;
3411 std::vector<Vector> hairVertices;
3412 std::vector<int> hairVerticesPerStrand;
3413 std::vector<Vector> particleVertices;
3414 std::vector<int> voxelVerticesStartIndices;
3415 std::vector<int> voxelVertexIndicesStartIndices;
3416 std::vector<int> voxelNormalsStartIndices;
3417 std::vector<int> voxelNormalIndicesStartIndices;
3418 std::vector<int> voxelMaterialIDsStartIndices;
3419 std::vector<int> voxelVelocitiesStartIndices;
3420 std::vector<int> voxelUVValuesStartIndices;
3421 std::vector<int> voxelUVValueIndicesStartIndices;
3422 std::vector<Box> geometryVoxelsBBoxes;
3423 std::vector<Box> hairVoxelsBBoxes;
3424 std::vector<Box> particleVoxelsBBoxes;
3425 std::vector<int> hairVerticesStartIndices;
3426 std::vector<int> hairVerticesPerStrandStartIndices;
3427 std::vector<int> particleVerticesStartIndices;
3428 std::vector<int> edgeVisibility;
3429 std::vector<Color> voxelInfoWireColor;
3430 std::vector<Bool> voxelInfoSmoothed;
3431 std::vector<Bool> voxelInfoFlipNormals;
3432 std::vector<float> hairWidths;
3433 std::vector<int> hairWidthsStartIndices;
3434 std::vector<float> particleWidths;
3435 std::vector<int> particleWidthsStartIndices;
3436 std::vector<Vector> hairVelocities;
3437 std::vector<int> hairVelocitiesStartIndices;
3438 std::vector<Vector> particleVelocities;
3439 std::vector<int> particleVelocitiesStartIndices;
3440 };
3441
3444 union TiMe {
3445 private:
3446 int64_t asInt;
3447 double asDouble;
3448 explicit TiMe(int64_t time) : asInt(time) {}
3449 public:
3451 TiMe() : asInt(-1) {}
3453 explicit TiMe(double time) : asDouble(time) {}
3455 operator double() { return asDouble; }
3459 static double Default() { return TiMe(int64_t(-1)).asDouble; }
3463 static double None() { return TiMe(int64_t(-2)).asDouble; }
3464 };
3465
3489
3491
3492 std::string destination;
3500
3501 std::vector<std::string> objectNames;
3502 std::vector<int> objectIDs;
3503 std::string customPreviewFile;
3504 std::vector<Color> voxelInfoWireColor;
3505 std::vector<Bool> voxelInfoSmoothed;
3506 std::vector<Bool> voxelInfoFlipNormals;
3507
3513 };
3514
3517 std::string file;
3518 std::string object_path;
3528 float fps;
3538
3540 };
3541
3545 std::string outputFileName;
3546
3549
3554
3559
3562 {}
3563 };
3564
3566 enum FlagVal : byte {
3567 Disabled = 0,
3569 Default = 0xFF
3571
3578
3581
3582 DenoiserOptions(const DenoiserOptions& options) = default;
3583 DenoiserOptions& operator=(const DenoiserOptions& options) = default;
3584 };
3585
3586 class LightUtils;
3587
3591 friend LightUtils;
3592 public:
3593 LuminaireFieldReadPreviewData() : luminaireFieldHandle(nullptr) {}
3595
3597 bool isValid() const;
3600 bool useConvexHull() const;
3604 float getScale() const;
3606 std::vector<Vector> getConvexHullVertices() const;
3608 std::vector<int> getConvexHullTriangles() const;
3609 private:
3610 void* luminaireFieldHandle;
3611 };
3612
3614 struct {
3615 unsigned char revision;
3616 unsigned char minor;
3617 unsigned short major;
3618 };
3619 unsigned allFields;
3620
3621 #ifdef _MSC_VER
3622 #pragma warning(disable : 4996)
3623 #endif
3624 std::string toString() const {
3625 std::string str;
3626 str.resize(15);
3627 int n = std::snprintf(&str[0], str.size() - 1, "%u.%02u.%02u", major, minor, revision);
3628 str.resize(n);
3629 return str;
3630 }
3631 #ifdef _MSC_VER
3632 #pragma warning(default : 4996)
3633 #endif
3634 };
3635 typedef VersionUnion VRayVersion;
3636 typedef VersionUnion APIVersion;
3637
3638 inline std::ostream& operator <<(std::ostream& stream, const VRayVersion& version) {
3639 stream << version.toString();
3640 return stream;
3641 }
3642
3645 static const int useParentTimes = (1 << 0);
3646 static const int useObjectID = (1 << 1);
3647 static const int usePrimaryVisibility = (1 << 2);
3648 static const int useUserAttributes = (1 << 3);
3649 static const int useParentTimesAtleastForGeometry = (1 << 4);
3651 static const int useMaterial = (1 << 5);
3652 static const int useGeometry = (1 << 6);
3653 static const int useMapChannels = (1 << 7);
3654 static const int useSkipCryptomatte = (1 << 8);
3655 static const int useRenderIDOverride = (1 << 9);
3656 static const int useUserAttributesBin = (1 << 10);
3657 static const int useObjectProperties = (1<<11);
3658 };
3659
3660 struct ScannedMaterialParams;
3661 struct ScannedMaterialPreset;
3662
3667 float ISO;
3669 };
3670} // namespace VRay
3671
3672// internal function declarations
3673#include "_vraysdk_import.hpp"
3674
3675namespace VRay {
3676 namespace Language {
3677 constexpr const char* EN_US = "en-US";
3678 constexpr const char* ZH_CN = "zh-CN";
3679 }
3680
3683
3686 ThemeStyleAuto = 0,
3687 ThemeStyleStandalone,
3688 ThemeStyle3dsMax,
3689 ThemeStyle3dsMaxQt,
3690 ThemeStyleMaya,
3691 };
3692
3694
3695 union {
3696 int flags;
3697 struct {
3707 bool useVfbLog : 1;
3716 bool forwardProgressToVfbProgressBar : 1; // true to forward progress messages to VFB progress bar
3717 };
3718 };
3719
3722 void* parentWindowHandle;
3723
3724 std::string pluginLibraryPath;
3725
3726 std::string vfbLanguage;
3727
3729 : vfbDrawStyle(ThemeStyleAuto)
3730 , flags(0)
3731 , parentWindowHandle()
3732 {
3733 enableFrameBuffer = true;
3734 showFrameBuffer = true;
3735 useDefaultVfbTheme = true;
3736 useVfbLog = true;
3737 }
3738
3739 RendererOptions(const RendererOptions& options) = default;
3740 RendererOptions(RendererOptions&& options) = default;
3741
3742 RendererOptions& operator=(const RendererOptions& options) = default;
3743 RendererOptions& operator=(RendererOptions&& options) = default;
3744
3745 void swap(RendererOptions& options);
3746 };
3747
3750 std::string dispatcher;
3751 std::string httpProxy;
3752 union {
3753 int flags;
3754 struct {
3759 bool immediatelyForwardReadySplitBucketSubunits : 1;
3760 };
3761 };
3765
3767 : flags(0)
3768 , connectTimeout(10)
3769 , upstreamChannels(3)
3770 , verboseLevel(3) {
3771 pipelinedUpstream = true;
3773 }
3774 };
3775
3777 std::string hosts; // can either be an empty string or host[:port]
3778 std::string vantageFile; // absolute path to .vantage file
3779 };
3780
3783 enum class Mode {
3784 Off = 0,
3785 Simple,
3786 Full,
3787 Process,
3788 };
3789
3792 enum FileType : int {
3795 };
3796
3799 std::string outputDirectory;
3800 std::string htmlTemplatePath;
3801 std::string productName;
3802 std::string productVersion;
3803 std::string sceneName;
3804
3806 mode = Mode::Off;
3807 maxDepth = 1;
3808 }
3809 };
3810
3811
3812#if !defined(VRAY_RUNTIME_LOAD_PRIMARY) && !defined(VRAY_RUNTIME_LOAD_SECONDARY)
3815 class VRayInit {
3816 VRayInit(VRayInit&); // copy construction disabled
3817
3818 public:
3819 VRayInit() {
3820 Internal::VRay_incrementModuleReferenceCounter();
3821 }
3822
3824 explicit VRayInit(bool enableFrameBuffer) {
3825 Internal::VRay_incrementModuleReferenceCounter();
3826 Internal::VRay_enableFrameBuffer(enableFrameBuffer);
3827 }
3828
3829#ifdef _WIN32
3832 void setUseParentEventLoop() {
3833 Internal::VRay_blendFrameBuffer();
3834 }
3835#endif // _WIN32
3836
3840 void setGUIMessageProcessing(bool enableMessageProcessing) {
3841 Internal::VRay_GUIMessageProcessing(enableMessageProcessing);
3842 }
3843
3848 void setOSMessageDispatching(bool enableMessageDispatching) {
3849 Internal::VRay_OSMessageDispatching(enableMessageDispatching);
3850 }
3851
3852 ~VRayInit() {
3853 Internal::VRay_LicenseManager_releaseLicense();
3854 }
3855 };
3856
3857#elif defined(VRAY_RUNTIME_LOAD_PRIMARY)
3860 class VRayInit {
3861 VRayInit(VRayInit&); // copy construction disabled
3862
3863 public:
3867 explicit VRayInit(const char* const libraryFileName) {
3868 initialize(libraryFileName);
3869 if (Internal::VRay_incrementModuleReferenceCounter) Internal::VRay_incrementModuleReferenceCounter();
3870 }
3871
3876 VRayInit(const char* const libraryFileName, bool enableFrameBuffer) {
3877 initialize(libraryFileName);
3878 if (Internal::VRay_incrementModuleReferenceCounter) Internal::VRay_incrementModuleReferenceCounter();
3879 if (Internal::VRay_enableFrameBuffer) Internal::VRay_enableFrameBuffer(enableFrameBuffer);
3880 }
3881
3882#ifdef _WIN32
3885 void setUseParentEventLoop() {
3886 Internal::VRay_blendFrameBuffer();
3887 }
3888#endif // _WIN32
3889
3893 void setGUIMessageProcessing(bool enableMessageProcessing) {
3894 Internal::VRay_GUIMessageProcessing(enableMessageProcessing);
3895 }
3896
3901 void setOSMessageDispatching(bool enableMessageDispatching) {
3902 Internal::VRay_OSMessageDispatching(enableMessageDispatching);
3903 }
3904
3905 ~VRayInit() {
3906 if (Internal::VRay_LicenseManager_releaseLicense)
3907 Internal::VRay_LicenseManager_releaseLicense();
3908 release();
3909 }
3910
3911 operator bool () const {
3912 return !!hLib;
3913 }
3914
3916 std::string getSDKLibraryErrorString() const {
3917 return errString;
3918 }
3919
3920 protected:
3921 VRayInit() {}
3922
3923 Internal::HModule hLib;
3924 std::string errString;
3925
3926#ifdef VRAY_NOTHROW
3927 void makeError(const std::string &errMsg) {
3928 errString = errMsg;
3929 hLib = nullptr;
3930 }
3931#endif // VRAY_NOTHROW
3932
3933 void initialize(const char* libraryFileName);
3934 void importFunctions();
3935
3936 void release() {
3937 if (hLib)
3938#ifdef _WIN32
3939 Internal::FreeLibrary(hLib);
3940#else
3941 Internal::dlclose(hLib);
3942#endif // _WIN32
3943 }
3944 };
3945#endif // #if !defined(VRAY_RUNTIME_LOAD_PRIMARY) && !defined(VRAY_RUNTIME_LOAD_SECONDARY)
3946
3949 inline bool isDR2() {
3950 return !!Internal::VRay_isDR2();
3951 }
3952
3954 inline APIVersion getAPIVersion() {
3955 APIVersion ver;
3956 ver.allFields = Internal::VRay_getSDKVersion();
3957 return ver;
3958 }
3959
3961 inline VRayVersion getVRayVersion() {
3962 VRayVersion ver;
3963 ver.allFields = Internal::VRay_getVRayVersion();
3964 return ver;
3965 }
3966
3968 inline const char* getVRayVersionDetails() {
3969 return Internal::VRay_getVRayVersionDetails();
3970 }
3971
3974 inline const char* getMaterialLibraryPath() {
3975 return Internal::VRay_getMaterialLibraryPath();
3976 }
3977
3980 std::string serverName;
3982 std::string proxyName;
3983 int proxyPort;
3984 std::string username;
3985 std::string password;
3986
3987 std::string serverName1;
3988 int serverPort1;
3989
3990 std::string serverName2;
3991 int serverPort2;
3992
3993 std::string proxyUserName;
3994 std::string proxyPassword;
3995
3996 LicenseServerSettings(void) {
3997 serverPort = 0;
3998 proxyPort = 0;
3999 serverPort1 = 0;
4000 serverPort2 = 0;
4001 }
4002 };
4003
4009 inline int setLicenseServers(const LicenseServerSettings& settings);
4010
4014 inline void setUSDProvider(const char* usdProvider);
4015
4016 class Error {
4017
4018 protected:
4019 ErrorCode errorCode;
4020
4021 public:
4022 Error(int errorCode = SUCCESS) : errorCode(static_cast<ErrorCode>(errorCode)) {
4023 }
4024
4025 Error(ErrorCode errorCode) : errorCode(errorCode) {
4026 }
4027
4028 bool error() const {
4029 return errorCode != SUCCESS;
4030 }
4031
4032 ErrorCode getCode() const {
4033 return errorCode;
4034 }
4035
4036 const char* toString() const {
4037 return Internal::VRay_getErrorTextStringFromErrorCode(errorCode);
4038 }
4039
4040 friend inline bool operator==(const Error& err0, const Error& err1) {
4041 return err0.errorCode == err1.errorCode;
4042 }
4043
4044 friend inline bool operator!=(const Error& err0, const Error& err1) {
4045 return err0.errorCode != err1.errorCode;
4046 }
4047
4048 friend inline bool operator==(const Error& err, ErrorCode errCode) {
4049 return err.errorCode == errCode;
4050 }
4051
4052 friend inline bool operator==(ErrorCode errCode, const Error& err) {
4053 return errCode == err.errorCode;
4054 }
4055
4056 friend inline bool operator!=(const Error& err, ErrorCode errCode) {
4057 return err.errorCode != errCode;
4058 }
4059
4060 friend inline bool operator!=(ErrorCode errCode, const Error& err) {
4061 return errCode != err.errorCode;
4062 }
4063
4064 };
4065
4066 inline std::ostream& operator <<(std::ostream& stream, const Error& err) {
4067 stream << err.toString();
4068 return stream;
4069 }
4070
4073 std::string fileName;
4074 std::string errorText;
4075 int fileLine;
4076 };
4077
4080 LicenseError::VRLAuthError errorCode;
4081
4082 ScannedMaterialLicenseError(LicenseError::VRLAuthError errorCode = LicenseError::vrlauth_noError)
4083 : errorCode(errorCode) {}
4084
4085 bool error() const {
4086 return errorCode != LicenseError::vrlauth_noError;
4087 }
4088
4089 const char* toString() const;
4090 };
4091
4092
4095 enum Plain {
4096 PL_NONE = 0,
4099 PL_TRIPLANAR = 3
4101
4103 VRSM_PAINT = 0,
4105 VRSM_CCMULT = 2
4107
4110 CH_PAINT_MASK = 1 << VRSM_PAINT,
4111 CH_FILTER_MASK = 1 << VRSM_FILTER,
4112 CH_CCMULT_MASK = 1 << VRSM_CCMULT
4113 };
4114
4116 CS_SRGB = 0,
4118 CS_PP = 2
4120
4122 TP_ENABLED = 1,
4125 };
4126
4127 Plain plain;
4128 float invgamma;
4130 float depthMul;
4135 float bumpmul;
4138 float cutoff;
4140 int dome;
4141 float multdirect, multrefl, multgi;
4145 float ccior;
4147 float ccbump;
4152 float retrace;
4161 float ccmul;
4165 float ccglossy;
4167 float sssmul;
4168
4170 };
4171
4176 bool encodeScannedMaterialParams(const ScannedMaterialParams& mtlParams, IntList& paramBlock);
4177
4183 bool encodeScannedMaterialParams(const ScannedMaterialParams& mtlParams, IntList& paramBlock, ScannedMaterialLicenseError& licError);
4184
4188 unsigned getScannedMaterialUILicense();
4189
4194 unsigned getScannedMaterialUILicense(ScannedMaterialLicenseError& licError);
4195
4199 unsigned releaseScannedMaterialUILicense();
4200
4210 SMF_PS = 4
4212
4213 float ccior;
4214 int plain;
4215 float bumpmul;
4217 float depthmul;
4218 float ccbump;
4219 float orggls;
4222 float free4, free5, free6;
4223 float ccmul;
4224 float shdhmul;
4225 float shdmul;
4228 float specbell;
4229 float specmul;
4230 float free7;
4231 float scratchdens;
4232 float fuzzy;
4233 float topvLs_A;
4234 float topvLs_B;
4236 float indmul;
4238 float thickness;
4240 float transpf;
4241 float lfsizecm;
4242
4244 };
4245
4247 union {
4248 void* handle;
4249 int err;
4250 } u;
4251
4252 void createThis(const char* pluginLibPath);
4253
4254 public:
4255 enum Error {
4256 NO_ERR = 0,
4257 BAD_LIBRARY_FILE = 1,
4258 SDK_BROKEN = 3
4259 };
4260
4261 explicit ScannedMaterialInfo(const char* pluginLibPath = NULL);
4262 explicit ScannedMaterialInfo(const std::string& pluginLibPath);
4264
4268 Error getError() const;
4269
4273 operator bool() const;
4274
4277 bool operator!() const;
4278
4283 bool getInfo(const char* filename, std::string& info) const;
4284
4286 bool getInfo(const std::string& filename, std::string& info) const;
4287
4288
4293 bool getPreset(const char* filename, ScannedMaterialPreset& result) const;
4294
4296 bool getPreset(const std::string& filename, ScannedMaterialPreset& result) const;
4297 };
4298
4299 namespace VUtils {
4300 class Value;
4301 }
4302 namespace Internal {
4303 class Access;
4304 class BinaryValueParser;
4305 }
4306
4307 enum PluginCategory {
4308 category_bitmap = 0,
4309 category_bsdf,
4310 category_geometric_object,
4311 category_geometry_source,
4312 category_light,
4313 category_material,
4314 category_render_channel,
4315 category_render_view,
4316 category_settings,
4317 category_texture,
4318 category_texture_float,
4319 category_texture_int,
4320 category_texture_matrix,
4321 category_texture_transform,
4322 category_texture_vector,
4323 category_uvwgen,
4324 category_volumetric,
4325
4326 category_last //used for enumerating all possible plugin categories
4327 };
4328
4331 unsigned long long pluginCategoryField;
4332
4333 bool operator==(const PluginCategories& categories) const noexcept {
4334 return pluginCategoryField == categories.pluginCategoryField;
4335 }
4336
4337 bool operator!=(const PluginCategories& categories) const noexcept {
4338 return pluginCategoryField != categories.pluginCategoryField;
4339 }
4340
4342 bool hasBitmapCategory() const noexcept { return (pluginCategoryField & (1ull << category_bitmap)) != 0; }
4343 void setBitmapCategory() noexcept { pluginCategoryField |= 1ull << category_bitmap; }
4344 void resetBitmapCategory() noexcept { pluginCategoryField &= ~(1ull << category_bitmap); }
4345
4347 bool hasBsdfCategory() const noexcept { return (pluginCategoryField & (1ull << category_bsdf)) != 0; }
4348 void setBsdfCategory() noexcept { pluginCategoryField |= 1ull << category_bsdf; }
4349 void resetBsdfCategory() noexcept { pluginCategoryField &= ~(1ull << category_bsdf); }
4350
4352 bool hasGeometricObjectCategory() const noexcept { return (pluginCategoryField & (1ull << category_geometric_object)) != 0; }
4353 void setGeometricObjectCategory() noexcept { pluginCategoryField |= 1ull << category_geometric_object; }
4354 void resetGeometricObjectCategory() noexcept { pluginCategoryField &= ~(1ull << category_geometric_object); }
4355
4357 bool hasGeometrySourceCategory() const noexcept { return (pluginCategoryField & (1ull << category_geometry_source)) != 0; }
4358 void setGeometrySourceCategory() noexcept { pluginCategoryField |= 1ull << category_geometry_source; }
4359 void resetGeometrySourceCategory() noexcept { pluginCategoryField &= ~(1ull << category_geometry_source); }
4360
4362 bool hasLightCategory() const noexcept { return (pluginCategoryField & (1ull << category_light)) != 0; }
4363 void setLightCategory() noexcept { pluginCategoryField |= 1ull << category_light; }
4364 void resetLightCategory() noexcept { pluginCategoryField &= ~(1ull << category_light); }
4365
4367 bool hasMaterialCategory() const noexcept { return (pluginCategoryField & (1ull << category_material)) != 0; }
4368 void setMaterialCategory() noexcept { pluginCategoryField |= 1ull << category_material; }
4369 void resetMaterialCategory() noexcept { pluginCategoryField &= ~(1ull << category_material); }
4370
4372 bool hasRenderChannelCategory() const noexcept { return (pluginCategoryField & (1ull << category_render_channel)) != 0; }
4373 void setRenderChannelCategory() noexcept { pluginCategoryField |= 1ull << category_render_channel; }
4374 void resetRenderChannelCategory() noexcept { pluginCategoryField &= ~(1ull << category_render_channel); }
4375
4377 bool hasRenderViewCategory() const noexcept { return (pluginCategoryField & (1ull << category_render_view)) != 0; }
4378 void setRenderViewCategory() noexcept { pluginCategoryField |= 1ull << category_render_view; }
4379 void resetRenderViewCategory() noexcept { pluginCategoryField &= ~(1ull << category_render_view); }
4380
4382 bool hasSettingsCategory() const noexcept { return (pluginCategoryField & (1ull << category_settings)) != 0; }
4383 void setSettingsCategory() noexcept { pluginCategoryField |= 1ull << category_settings; }
4384 void resetSettingsCategory() noexcept { pluginCategoryField &= ~(1ull << category_settings); }
4385
4387 bool hasTextureCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture)) != 0; }
4388 void setTextureCategory() noexcept { pluginCategoryField |= 1ull << category_texture; }
4389 void resetTextureCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture); }
4390
4392 bool hasTextureFloatCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_float)) != 0; }
4393 void setTextureFloatCategory() noexcept { pluginCategoryField |= 1ull << category_texture_float; }
4394 void resetTextureFloatCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_float); }
4395
4397 bool hasTextureIntCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_int)) != 0; }
4398 void setTextureIntCategory() noexcept { pluginCategoryField |= 1ull << category_texture_int; }
4399 void resetTextureIntCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_int); }
4400
4402 bool hasTextureMatrixCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_matrix)) != 0; }
4403 void setTextureMatrixCategory() noexcept { pluginCategoryField |= 1ull << category_texture_matrix; }
4404 void resetTextureMatrixCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_matrix); }
4405
4407 bool hasTextureTransformCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_transform)) != 0; }
4408 void setTextureTransformCategory() noexcept { pluginCategoryField |= 1ull << category_texture_transform; }
4409 void resetTextureTransformCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_transform); }
4410
4412 bool hasTextureVectorCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_vector)) != 0; }
4413 void setTextureVectorCategory() noexcept { pluginCategoryField |= 1ull << category_texture_vector; }
4414 void resetTextureVectorCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_vector); }
4415
4417 bool hasUvwgenCategory() const noexcept { return (pluginCategoryField & (1ull << category_uvwgen)) != 0; }
4418 void setUvwgenCategory() noexcept { pluginCategoryField |= 1ull << category_uvwgen; }
4419 void resetUvwgenCategory() noexcept { pluginCategoryField &= ~(1ull << category_uvwgen); }
4420
4422 bool hasVolumetricCategory() const noexcept { return (pluginCategoryField & (1ull << category_volumetric)) != 0; }
4423 void setVolumetricCategory() noexcept { pluginCategoryField |= 1ull << category_volumetric; }
4424 void resetVolumetricCategory() noexcept { pluginCategoryField &= ~(1ull << category_volumetric); }
4425
4426 PluginCategories() noexcept : pluginCategoryField() {}
4427
4428 explicit PluginCategories(PluginCategory category) noexcept
4429 : pluginCategoryField(1ull << category) {}
4430
4431 PluginCategories(PluginCategory category0, PluginCategory category1) noexcept
4432 : pluginCategoryField((1ull << category0) || (1ull << category1)) {}
4433
4434 PluginCategories(PluginCategory category0, PluginCategory category1, PluginCategory category2) noexcept
4435 : pluginCategoryField((1ull << category0) || (1ull << category1) || (1ull << category2)) {}
4436
4437 PluginCategories(PluginCategory category0, PluginCategory category1, PluginCategory category2, PluginCategory category3) noexcept
4438 : pluginCategoryField((1ull << category0) || (1ull << category1) || (1ull << category2) || (1ull << category3)) {}
4439
4440 void clear() noexcept { pluginCategoryField = 0; }
4441
4442 bool hasCategory(PluginCategory category) const noexcept {
4443 return (pluginCategoryField & (1ull << category)) != 0;
4444 }
4445
4446 void setCategory(PluginCategory category, bool value) noexcept {
4447 const long long msk = 1ll << category;
4448 const long long val = -static_cast<long long>(value);
4449 pluginCategoryField = (pluginCategoryField | (msk & val)) & (~msk | val);
4450 }
4451
4453 std::vector<PluginCategory> getAll() const;
4454 };
4455
4456 template<class T>
4457 class PluginRefT;
4458
4462 class Plugin {
4463 friend class VRayRenderer;
4464 friend class PropertyRuntimeMeta;
4465 friend class VUtils::Value;
4466 friend class Internal::Access;
4467 friend class Internal::BinaryValueParser;
4468 friend class Internal::BinaryValueBuilder;
4469
4470 protected:
4471 const VRayRenderer* pRenderer;
4472 InstanceId internalId;
4473 InstanceId id() const {
4474 constexpr int shift = sizeof(InstanceId) * 8 - Internal::INSTANCE_ID_BITS;
4475 return static_cast<signed long long>(internalId << shift) >> shift;
4476 }
4477
4478 Plugin(VRayRenderer& renderer, const char* name);
4479 Plugin(VRayRenderer& renderer, InstanceId id) noexcept;
4480 Plugin(VRayRenderer& renderer, InstanceId id, PluginTypeId typeId) noexcept;
4481 Plugin(VRayRenderer& renderer, InstanceId id, int typeIdIdx) noexcept;
4482
4483 template<typename T, int TYPE>
4484 bool setValueAtTimeTemplate(const char* propertyName, const T& value, double time);
4485
4486 template<typename T, int TYPE>
4487 bool setArrayAtTimeTemplate(const char* propertyName, size_t count, const T& value, double time);
4488
4489 template<typename LengthFn, typename PointerFn>
4490 bool setStringArrayTemplate(const char *propertyName, size_t count, LengthFn lengthAt, PointerFn pointerAt, double time);
4491
4492 public:
4493 enum class PropertyState : int {
4494 Invalid = 0,
4495 Default = 1,
4496 NotAnimated = 2,
4497 Animated = 3
4498 };
4499
4501 Plugin() noexcept : pRenderer(), internalId(NO_ID) {}
4502
4504 Plugin(const Plugin &plugin) noexcept;
4505
4507 Plugin& operator=(const Plugin &plugin) noexcept;
4508
4510 bool operator==(const Plugin &plugin) const noexcept;
4511
4513 bool operator!=(const Plugin &plugin) const noexcept;
4514
4515 bool operator<(const Plugin& plugin) const noexcept;
4516 bool operator<=(const Plugin& plugin) const noexcept;
4517 bool operator>(const Plugin& plugin) const noexcept;
4518 bool operator>=(const Plugin& plugin) const noexcept;
4519
4521 void swap(Plugin &plugin) noexcept;
4522
4525 bool isEmpty() const noexcept;
4526
4529 bool isNotEmpty() const noexcept;
4530
4535 bool isValid() const;
4536
4538 VRayRenderer* getRenderer() const noexcept;
4539
4541 unsigned long long getIntegerID() const noexcept;
4542
4546 const char* getName() const;
4547
4551 bool setName(const char* newName);
4552
4554 bool setName(const std::string& newName);
4555
4557 const char* getType() const;
4558
4560 PluginTypeId getTypeId() const noexcept;
4561
4563 std::string toString() const;
4564
4568
4572
4575 PropertyRuntimeMeta getPropertyRuntimeMeta(const char* propertyName) const;
4577 PropertyRuntimeMeta getPropertyRuntimeMeta(const std::string& propertyName) const;
4578
4581 std::string getValueAsString(const char* propertyName, double time = TiMe::Default()) const;
4583 std::string getValueAsString(const std::string& propertyName, double time = TiMe::Default()) const;
4584
4588 std::string getValueAsString(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4590 std::string getValueAsString(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4591
4596 bool setValueAsString(const char* propertyName, const char* value);
4598 bool setValueAsString(const char* propertyName, const std::string& value);
4599
4601 bool setValueAsString(const std::string& propertyName, const char* value);
4603 bool setValueAsString(const std::string& propertyName, const std::string& value);
4604
4606 bool getBool(const char* propertyName, double time = TiMe::Default()) const;
4608 bool getBool(const std::string& propertyName, double time = TiMe::Default()) const;
4609
4613 bool getBool(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4615 bool getBool(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4616
4619 int getInt(const char* propertyName, double time = TiMe::Default()) const;
4621 int getInt(const std::string& propertyName, double time = TiMe::Default()) const;
4622
4626 int getInt(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4628 int getInt(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4629
4631 float getFloat(const char* propertyName, double time = TiMe::Default()) const;
4633 float getFloat(const std::string& propertyName, double time = TiMe::Default()) const;
4634
4638 float getFloat(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4640 float getFloat(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4641
4643 double getDouble(const char* propertyName, double time = TiMe::Default()) const;
4645 double getDouble(const std::string& propertyName, double time = TiMe::Default()) const;
4646
4650 double getDouble(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4652 double getDouble(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4653
4655 Color getColor(const char* propertyName, double time = TiMe::Default()) const;
4657 Color getColor(const std::string& propertyName, double time = TiMe::Default()) const;
4658
4662 Color getColor(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4664 Color getColor(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4665
4667 AColor getAColor(const char* propertyName, double time = TiMe::Default()) const;
4669 AColor getAColor(const std::string& propertyName, double time = TiMe::Default()) const;
4670
4674 AColor getAColor(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4676 AColor getAColor(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4677
4679 Vector getVector(const char* propertyName, double time = TiMe::Default()) const;
4681 Vector getVector(const std::string& propertyName, double time = TiMe::Default()) const;
4682
4686 Vector getVector(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4688 Vector getVector(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4689
4691 Matrix getMatrix(const char* propertyName, double time = TiMe::Default()) const;
4693 Matrix getMatrix(const std::string& propertyName, double time = TiMe::Default()) const;
4694
4698 Matrix getMatrix(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4700 Matrix getMatrix(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4701
4703 Transform getTransform(const char* propertyName, double time = TiMe::Default()) const;
4705 Transform getTransform(const std::string& propertyName, double time = TiMe::Default()) const;
4706
4710 Transform getTransform(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4712 Transform getTransform(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4713
4715 PluginRefT<Plugin> getPlugin(const char* propertyName, double time = TiMe::Default()) const;
4717 PluginRefT<Plugin> getPlugin(const std::string& propertyName, double time = TiMe::Default()) const;
4718
4722 PluginRefT<Plugin> getPlugin(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4724 PluginRefT<Plugin> getPlugin(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4725
4727 std::string getString(const char* propertyName, double time = TiMe::Default()) const;
4729 std::string getString(const std::string& propertyName, double time = TiMe::Default()) const;
4730
4734 std::string getString(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4736 std::string getString(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4737
4739 IntList getIntList(const char* propertyName, double time = TiMe::Default()) const;
4741 IntList getIntList(const std::string& propertyName, double time = TiMe::Default()) const;
4742
4746 IntList getIntList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4748 IntList getIntList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4749
4751 FloatList getFloatList(const char* propertyName, double time = TiMe::Default()) const;
4753 FloatList getFloatList(const std::string& propertyName, double time = TiMe::Default()) const;
4754
4758 FloatList getFloatList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4760 FloatList getFloatList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4761
4763 ColorList getColorList(const char* propertyName, double time = TiMe::Default()) const;
4765 ColorList getColorList(const std::string& propertyName, double time = TiMe::Default()) const;
4766
4770 ColorList getColorList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4772 ColorList getColorList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4773
4775 VectorList getVectorList(const char* propertyName, double time = TiMe::Default()) const;
4777 VectorList getVectorList(const std::string& propertyName, double time = TiMe::Default()) const;
4778
4782 VectorList getVectorList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4784 VectorList getVectorList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4785
4787 TransformList getTransformList(const char* propertyName, double time = TiMe::Default()) const;
4789 TransformList getTransformList(const std::string& propertyName, double time = TiMe::Default()) const;
4790
4794 TransformList getTransformList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4796 TransformList getTransformList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4797
4799 ValueList getValueList(const char* propertyName, double time = TiMe::Default()) const;
4801 ValueList getValueList(const std::string& propertyName, double time = TiMe::Default()) const;
4802
4806 ValueList getValueList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4808 ValueList getValueList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4809
4811 StringList getStringList(const char* propertyName, double time = TiMe::Default()) const;
4813 StringList getStringList(const std::string& propertyName, double time = TiMe::Default()) const;
4814
4818 StringList getStringList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4820 StringList getStringList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4821
4823 PluginList getPluginList(const char* propertyName, double time = TiMe::Default()) const;
4825 PluginList getPluginList(const std::string& propertyName, double time = TiMe::Default()) const;
4826
4830 PluginList getPluginList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4832 PluginList getPluginList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4833
4836 Value getValue(const char* propertyName, double time = TiMe::Default()) const;
4838 Value getValue(const std::string& propertyName, double time = TiMe::Default()) const;
4839
4844 Value getValue(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4846 Value getValue(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4847
4850 bool isPropertyAnimated(const char* propertyName) const;
4852 bool isPropertyAnimated(const std::string& propertyName) const;
4853
4857 PropertyState getPropertyState(const char* propertyName) const;
4859 PropertyState getPropertyState(const std::string& propertyName) const;
4860
4863 std::vector<double> getKeyframeTimes(const char* propertyName) const;
4865 std::vector<double> getKeyframeTimes(const std::string& propertyName) const;
4866
4870 std::vector<double> getKeyframeTimes(const char* propertyName, bool& ok) const;
4872 std::vector<double> getKeyframeTimes(const std::string& propertyName, bool& ok) const;
4873
4876 bool setValue(const char* propertyName, const bool value, double time = TiMe::Default());
4878 bool setValue(const std::string& propertyName, const bool value, double time = TiMe::Default());
4879
4882 bool setValue(const char* propertyName, const int value, double time = TiMe::Default());
4884 bool setValue(const std::string& propertyName, const int value, double time = TiMe::Default());
4885
4888 bool setValue(const char* propertyName, const float value, double time = TiMe::Default());
4890 bool setValue(const std::string& propertyName, const float value, double time = TiMe::Default());
4891
4894 bool setValue(const char* propertyName, const double value, double time = TiMe::Default());
4896 bool setValue(const std::string& propertyName, const double value, double time = TiMe::Default());
4897
4900 bool setValue(const char* propertyName, const Color& value, double time = TiMe::Default());
4902 bool setValue(const std::string& propertyName, const Color& value, double time = TiMe::Default());
4903
4906 bool setValue(const char* propertyName, const AColor& value, double time = TiMe::Default());
4908 bool setValue(const std::string& propertyName, const AColor& value, double time = TiMe::Default());
4909
4912 bool setValue(const char* propertyName, const Vector& value, double time = TiMe::Default());
4914 bool setValue(const std::string& propertyName, const Vector& value, double time = TiMe::Default());
4915
4918 bool setValue(const char* propertyName, const Matrix& value, double time = TiMe::Default());
4920 bool setValue(const std::string& propertyName, const Matrix& value, double time = TiMe::Default());
4921
4924 bool setValue(const char* propertyName, const Transform& transform, double time = TiMe::Default());
4926 bool setValue(const std::string& propertyName, const Transform& transform, double time = TiMe::Default());
4927
4930 bool setValue(const char* propertyName, const PluginRefT<Plugin>& pluginRef, double time = TiMe::Default());
4932 bool setValue(const std::string& propertyName, const PluginRefT<Plugin>& pluginRef, double time = TiMe::Default());
4933
4936 bool setValue(const char* propertyName, const char* str, double time = TiMe::Default());
4938 bool setValue(const std::string& propertyName, const char* str, double time = TiMe::Default());
4939
4942 bool setValue(const char* propertyName, const std::string& str, double time = TiMe::Default());
4944 bool setValue(const std::string& propertyName, const std::string& str, double time = TiMe::Default());
4945
4948 bool setValue(const char* propertyName, const Value& value, double time = TiMe::Default());
4950 bool setValue(const std::string& propertyName, const Value& value, double time = TiMe::Default());
4952 bool setValue(const char* propertyName, Value&& value, double time = TiMe::Default());
4954 bool setValue(const std::string& propertyName, Value&& value, double time = TiMe::Default());
4955
4958 bool setValue(const char* propertyName, const ValueList& value, double time = TiMe::Default());
4960 bool setValue(const std::string& propertyName, const ValueList& value, double time = TiMe::Default());
4962 bool setValue(const char* propertyName, ValueList&& value, double time = TiMe::Default());
4964 bool setValue(const std::string& propertyName, ValueList&& value, double time = TiMe::Default());
4966 template<size_t count> bool setValue(const char* propertyName, const Value(&arr)[count], double time = TiMe::Default());
4968 template<size_t count> bool setValue(const std::string& propertyName, const Value(&arr)[count], double time = TiMe::Default());
4970 template<size_t count> bool setValue(const char* propertyName, Value(&&arr)[count], double time = TiMe::Default());
4972 template<size_t count> bool setValue(const std::string& propertyName, Value(&&arr)[count], double time = TiMe::Default());
4973
4976 bool setValue(const char* propertyName, const IntList& value, double time = TiMe::Default());
4978 bool setValue(const std::string& propertyName, const IntList& value, double time = TiMe::Default());
4980 bool setValue(const char* propertyName, IntList&& value, double time = TiMe::Default());
4982 bool setValue(const std::string& propertyName, IntList&& value, double time = TiMe::Default());
4983
4986 bool setValue(const char* propertyName, const FloatList& value, double time = TiMe::Default());
4988 bool setValue(const std::string& propertyName, const FloatList& value, double time = TiMe::Default());
4990 bool setValue(const char* propertyName, FloatList&& value, double time = TiMe::Default());
4992 bool setValue(const std::string& propertyName, FloatList&& value, double time = TiMe::Default());
4993
4996 bool setValue(const char* propertyName, const VectorList& value, double time = TiMe::Default());
4998 bool setValue(const std::string& propertyName, const VectorList& value, double time = TiMe::Default());
5000 bool setValue(const char* propertyName, VectorList&& value, double time = TiMe::Default());
5002 bool setValue(const std::string& propertyName, VectorList&& value, double time = TiMe::Default());
5003
5006 bool setValue(const char* propertyName, const ColorList& value, double time = TiMe::Default());
5008 bool setValue(const std::string& propertyName, const ColorList& value, double time = TiMe::Default());
5010 bool setValue(const char* propertyName, ColorList&& value, double time = TiMe::Default());
5012 bool setValue(const std::string& propertyName, ColorList&& value, double time = TiMe::Default());
5013
5016 bool setValue(const char* propertyName, const TransformList& value, double time = TiMe::Default());
5018 bool setValue(const std::string& propertyName, const TransformList& value, double time = TiMe::Default());
5019
5022 bool setValue(const char* propertyName, const StringList& value, double time = TiMe::Default());
5024 bool setValue(const std::string& propertyName, const StringList& value, double time = TiMe::Default());
5025
5028 bool setValue(const char* propertyName, const PluginList& value, double time = TiMe::Default());
5030 bool setValue(const std::string& propertyName, const PluginList& value, double time = TiMe::Default());
5031
5034 bool setArray(const char* propertyName, const int data[], size_t count, double time = TiMe::Default());
5036 bool setArray(const std::string& propertyName, const int data[], size_t count, double time = TiMe::Default());
5037
5041 bool setArray(const char* propertyName, const float data[], size_t count, double time = TiMe::Default());
5043 bool setArray(const std::string& propertyName, const float data[], size_t count, double time = TiMe::Default());
5044
5049 bool setArray(const char* propertyName, const double data[], size_t count, double time = TiMe::Default());
5051 bool setArray(const std::string& propertyName, const double data[], size_t count, double time = TiMe::Default());
5052
5055 bool setArray(const char* propertyName, const Vector data[], size_t count, double time = TiMe::Default());
5057 bool setArray(const std::string& propertyName, const Vector data[], size_t count, double time = TiMe::Default());
5058
5061 bool setArray(const char* propertyName, const Color data[], size_t count, double time = TiMe::Default());
5063 bool setArray(const std::string& propertyName, const Color data[], size_t count, double time = TiMe::Default());
5064
5067 bool setArray(const char* propertyName, const Transform data[], size_t count, double time = TiMe::Default());
5069 bool setArray(const std::string& propertyName, const Transform data[], size_t count, double time = TiMe::Default());
5070
5073 bool setArray(const char* propertyName, const std::string data[], size_t count, double time = TiMe::Default());
5075 bool setArray(const std::string& propertyName, const std::string data[], size_t count, double time = TiMe::Default());
5077 bool setArray(const char* propertyName, const char* const data[], size_t count, double time = TiMe::Default());
5079 bool setArray(const std::string& propertyName, const char* const data[], size_t count, double time = TiMe::Default());
5080
5083 bool setArray(const char* propertyName, const Plugin plugins[], size_t count, double time = TiMe::Default());
5085 bool setArray(const std::string& propertyName, const Plugin plugins[], size_t count, double time = TiMe::Default());
5086
5089 bool setArray(const char* propertyName, const Value values[], size_t count, double time = TiMe::Default());
5091 bool setArray(const std::string& propertyName, const Value values[], size_t count, double time = TiMe::Default());
5092
5096 bool setArray(const char* propertyName, Value valuesToMove[], size_t count, double time = TiMe::Default());
5098 bool setArray(const std::string& propertyName, Value valuesToMove[], size_t count, double time = TiMe::Default());
5099
5103 bool setValue(const char* propertyName, const void* data, size_t size, double time = TiMe::Default());
5105 bool setValue(const std::string& propertyName, const void* data, size_t size, double time = TiMe::Default());
5106
5107 friend std::ostream& operator <<(std::ostream& stream, const Plugin& plugin);
5108
5109#ifdef VRAY_SDK_INTEROPERABILITY
5110 bool setValueAsStringAtTime(const char* propertyName, const char* value, double time);
5111 bool setValueAsStringAtTime(const char* propertyName, const std::string& value, double time);
5112 bool setValueAsStringAtTime(const std::string& propertyName, const char* value, double time);
5113 bool setValueAsStringAtTime(const std::string& propertyName, const std::string& value, double time);
5114 bool setValueAtTime(const char* propertyName, const bool value, double time);
5115 bool setValueAtTime(const std::string& propertyName, const bool value, double time);
5116 bool setValueAtTime(const char* propertyName, const int value, double time);
5117 bool setValueAtTime(const std::string& propertyName, const int value, double time);
5118 bool setValueAtTime(const char* propertyName, const float value, double time);
5119 bool setValueAtTime(const std::string& propertyName, const float value, double time);
5120 bool setValueAtTime(const char* propertyName, const double value, double time);
5121 bool setValueAtTime(const std::string& propertyName, const double value, double time);
5122 bool setValueAtTime(const char* propertyName, const Color& value, double time);
5123 bool setValueAtTime(const std::string& propertyName, const Color& value, double time);
5124 bool setValueAtTime(const char* propertyName, const AColor& value, double time);
5125 bool setValueAtTime(const std::string& propertyName, const AColor& value, double time);
5126 bool setValueAtTime(const char* propertyName, const Vector& value, double time);
5127 bool setValueAtTime(const std::string& propertyName, const Vector& value, double time);
5128 bool setValueAtTime(const char* propertyName, const Matrix& value, double time);
5129 bool setValueAtTime(const std::string& propertyName, const Matrix& value, double time);
5130 bool setValueAtTime(const char* propertyName, const Transform& transform, double time);
5131 bool setValueAtTime(const std::string& propertyName, const Transform& transform, double time);
5132 bool setValueAtTime(const char* propertyName, const PluginRefT<Plugin>& pluginRef, double time);
5133 bool setValueAtTime(const std::string& propertyName, const PluginRefT<Plugin>& pluginRef, double time);
5134 bool setValueAtTime(const char* propertyName, const char* str, double time);
5135 bool setValueAtTime(const std::string& propertyName, const char* str, double time);
5136 bool setValueAtTime(const char* propertyName, const std::string& str, double time);
5137 bool setValueAtTime(const std::string& propertyName, const std::string& str, double time);
5138 bool setValueAtTime(const char* propertyName, const Value& value, double time);
5139 bool setValueAtTime(const std::string& propertyName, const Value& value, double time);
5140 bool setValueAtTime(const char* propertyName, const ValueList& value, double time);
5141 bool setValueAtTime(const std::string& propertyName, const ValueList& value, double time);
5142 bool setValueAtTime(const char* propertyName, const IntList& value, double time);
5143 bool setValueAtTime(const std::string& propertyName, const IntList& value, double time);
5144 bool setValueAtTime(const char* propertyName, const FloatList& value, double time);
5145 bool setValueAtTime(const std::string& propertyName, const FloatList& value, double time);
5146 bool setValueAtTime(const char* propertyName, const VectorList& value, double time);
5147 bool setValueAtTime(const std::string& propertyName, const VectorList& value, double time);
5148 bool setValueAtTime(const char* propertyName, const ColorList& value, double time);
5149 bool setValueAtTime(const std::string& propertyName, const ColorList& value, double time);
5150 bool setValueAtTime(const char* propertyName, const PluginList& value, double time);
5151 bool setValueAtTime(const std::string& propertyName, const PluginList& value, double time);
5152 bool setValueAtTime(const char* propertyName, const StringList& value, double time);
5153 bool setValueAtTime(const std::string& propertyName, const StringList& value, double time);
5154 bool setArrayAtTime(const char* propertyName, const int data[], size_t count, double time);
5155 bool setArrayAtTime(const std::string& propertyName, const int data[], size_t count, double time);
5156 bool setArrayAtTime(const char* propertyName, const float data[], size_t count, double time);
5157 bool setArrayAtTime(const std::string& propertyName, const float data[], size_t count, double time);
5158 bool setArrayAtTime(const char* propertyName, const double data[], size_t count, double time);
5159 bool setArrayAtTime(const std::string& propertyName, const double data[], size_t count, double time);
5160 bool setArrayAtTime(const char* propertyName, const Vector data[], size_t count, double time);
5161 bool setArrayAtTime(const std::string& propertyName, const Vector data[], size_t count, double time);
5162 bool setArrayAtTime(const char* propertyName, const Color data[], size_t count, double time);
5163 bool setArrayAtTime(const std::string& propertyName, const Color data[], size_t count, double time);
5164 bool setArrayAtTime(const char* propertyName, const Plugin data[], size_t count, double time);
5165 bool setArrayAtTime(const std::string& propertyName, const Plugin data[], size_t count, double time);
5166 bool setArrayAtTime(const char* propertyName, const std::string data[], size_t count, double time);
5167 bool setArrayAtTime(const std::string& propertyName, const std::string data[], size_t count, double time);
5168 bool setValueAtTime(const char* propertyName, const void* data, size_t size, double time);
5169 bool setValueAtTime(const std::string& propertyName, const void* data, size_t size, double time);
5170
5171
5172 VUtils::IntRefList getIntRefList(const char* propertyName);
5173 VUtils::IntRefList getIntRefList(const char* propertyName, bool& ok);
5174 VUtils::IntRefList getIntRefListAtTime(const char* propertyName, double time);
5175 VUtils::IntRefList getIntRefListAtTime(const char* propertyName, double time, bool& ok);
5176 VUtils::IntRefList getIntRefList(const std::string& propertyName);
5177 VUtils::IntRefList getIntRefList(const std::string& propertyName, bool& ok);
5178 VUtils::IntRefList getIntRefListAtTime(const std::string& propertyName, double time);
5179 VUtils::IntRefList getIntRefListAtTime(const std::string& propertyName, double time, bool& ok);
5180
5181 VUtils::FloatRefList getFloatRefList(const char* propertyName);
5182 VUtils::FloatRefList getFloatRefList(const char* propertyName, bool& ok);
5183 VUtils::FloatRefList getFloatRefListAtTime(const char* propertyName, double time);
5184 VUtils::FloatRefList getFloatRefListAtTime(const char* propertyName, double time, bool& ok);
5185 VUtils::FloatRefList getFloatRefList(const std::string& propertyName);
5186 VUtils::FloatRefList getFloatRefList(const std::string& propertyName, bool& ok);
5187 VUtils::FloatRefList getFloatRefListAtTime(const std::string& propertyName, double time);
5188 VUtils::FloatRefList getFloatRefListAtTime(const std::string& propertyName, double time, bool& ok);
5189
5190 VUtils::VectorRefList getVectorRefList(const char* propertyName);
5191 VUtils::VectorRefList getVectorRefList(const char* propertyName, bool& ok);
5192 VUtils::VectorRefList getVectorRefListAtTime(const char* propertyName, double time);
5193 VUtils::VectorRefList getVectorRefListAtTime(const char* propertyName, double time, bool& ok);
5194 VUtils::VectorRefList getVectorRefList(const std::string& propertyName);
5195 VUtils::VectorRefList getVectorRefList(const std::string& propertyName, bool& ok);
5196 VUtils::VectorRefList getVectorRefListAtTime(const std::string& propertyName, double time);
5197 VUtils::VectorRefList getVectorRefListAtTime(const std::string& propertyName, double time, bool& ok);
5198
5199 VUtils::ColorRefList getColorRefList(const char* propertyName);
5200 VUtils::ColorRefList getColorRefList(const char* propertyName, bool& ok);
5201 VUtils::ColorRefList getColorRefListAtTime(const char* propertyName, double time);
5202 VUtils::ColorRefList getColorRefListAtTime(const char* propertyName, double time, bool& ok);
5203 VUtils::ColorRefList getColorRefList(const std::string& propertyName);
5204 VUtils::ColorRefList getColorRefList(const std::string& propertyName, bool& ok);
5205 VUtils::ColorRefList getColorRefListAtTime(const std::string& propertyName, double time);
5206 VUtils::ColorRefList getColorRefListAtTime(const std::string& propertyName, double time, bool& ok);
5207
5208 VUtils::ValueRefList getValueRefList(const char* propertyName);
5209 VUtils::ValueRefList getValueRefList(const char* propertyName, bool& ok);
5210 VUtils::ValueRefList getValueRefListAtTime(const char* propertyName, double time);
5211 VUtils::ValueRefList getValueRefListAtTime(const char* propertyName, double time, bool& ok);
5212 VUtils::ValueRefList getValueRefList(const std::string& propertyName);
5213 VUtils::ValueRefList getValueRefList(const std::string& propertyName, bool& ok);
5214 VUtils::ValueRefList getValueRefListAtTime(const std::string& propertyName, double time);
5215 VUtils::ValueRefList getValueRefListAtTime(const std::string& propertyName, double time, bool& ok);
5216
5217 VUtils::CharStringRefList getStringRefList(const char* propertyName);
5218 VUtils::CharStringRefList getStringRefList(const char* propertyName, bool& ok);
5219 VUtils::CharStringRefList getStringRefListAtTime(const char* propertyName, double time);
5220 VUtils::CharStringRefList getStringRefListAtTime(const char* propertyName, double time, bool& ok);
5221 VUtils::CharStringRefList getStringRefList(const std::string& propertyName);
5222 VUtils::CharStringRefList getStringRefList(const std::string& propertyName, bool& ok);
5223 VUtils::CharStringRefList getStringRefListAtTime(const std::string& propertyName, double time);
5224 VUtils::CharStringRefList getStringRefListAtTime(const std::string& propertyName, double time, bool& ok);
5225
5226 VUtils::CharString getCharString(const char* propertyName);
5227 VUtils::CharString getCharString(const char* propertyName, bool& ok);
5228 VUtils::CharString getCharStringAtTime(const char* propertyName, double time);
5229 VUtils::CharString getCharStringAtTime(const char* propertyName, double time, bool& ok);
5230 VUtils::CharString getCharString(const std::string& propertyName);
5231 VUtils::CharString getCharString(const std::string& propertyName, bool& ok);
5232 VUtils::CharString getCharStringAtTime(const std::string& propertyName, double time);
5233 VUtils::CharString getCharStringAtTime(const std::string& propertyName, double time, bool& ok);
5234
5235 bool setValue(const char* propertyName, const VUtils::IntRefList& intList);
5236 bool setValueAtTime(const char* propertyName, const VUtils::IntRefList& intList, double time);
5237 bool setValue(const std::string& propertyName, const VUtils::IntRefList& intList);
5238 bool setValueAtTime(const std::string& propertyName, const VUtils::IntRefList& intList, double time);
5239
5240 bool setValue(const char* propertyName, const VUtils::FloatRefList& floatList);
5241 bool setValueAtTime(const char* propertyName, const VUtils::FloatRefList& floatList, double time);
5242 bool setValue(const std::string& propertyName, const VUtils::FloatRefList& floatList);
5243 bool setValueAtTime(const std::string& propertyName, const VUtils::FloatRefList& floatList, double time);
5244
5245 bool setValue(const char* propertyName, const VUtils::VectorRefList& vectorList);
5246 bool setValueAtTime(const char* propertyName, const VUtils::VectorRefList& vectorList, double time);
5247 bool setValue(const std::string& propertyName, const VUtils::VectorRefList& vectorList);
5248 bool setValueAtTime(const std::string& propertyName, const VUtils::VectorRefList& vectorList, double time);
5249
5250 bool setValue(const char* propertyName, const VUtils::ColorRefList& colorList);
5251 bool setValueAtTime(const char* propertyName, const VUtils::ColorRefList& colorList, double time);
5252 bool setValue(const std::string& propertyName, const VUtils::ColorRefList& colorList);
5253 bool setValueAtTime(const std::string& propertyName, const VUtils::ColorRefList& colorList, double time);
5254
5255 bool setValue(const char* propertyName, const VUtils::TransformRefList& transformList);
5256 bool setValueAtTime(const char* propertyName, const VUtils::TransformRefList& transformList, double time);
5257 bool setValue(const std::string& propertyName, const VUtils::TransformRefList& transformList);
5258 bool setValueAtTime(const std::string& propertyName, const VUtils::TransformRefList& transformList, double time);
5259
5260 bool setValue(const char* propertyName, const VUtils::CharStringRefList& stringList);
5261 bool setValueAtTime(const char* propertyName, const VUtils::CharStringRefList& stringList, double time);
5262 bool setValue(const std::string& propertyName, const VUtils::CharStringRefList& stringList);
5263 bool setValueAtTime(const std::string& propertyName, const VUtils::CharStringRefList& stringList, double time);
5264
5265 bool setValue(const char* propertyName, const VUtils::ValueRefList& valueList);
5266 bool setValueAtTime(const char* propertyName, const VUtils::ValueRefList& valueList, double time);
5267 bool setValue(const std::string& propertyName, const VUtils::ValueRefList& valueList);
5268 bool setValueAtTime(const std::string& propertyName, const VUtils::ValueRefList& valueList, double time);
5269
5270 bool setValue(const char* propertyName, const VUtils::CharString& str);
5271 bool setValueAtTime(const char* propertyName, const VUtils::CharString& str, double time);
5272 bool setValue(const std::string& propertyName, const VUtils::CharString& str);
5273 bool setValueAtTime(const std::string& propertyName, const VUtils::CharString& str, double time);
5274#endif // VRAY_SDK_INTEROPERABILITY
5275 };
5276
5279 template<>
5280 class PluginRefT<Plugin> : public Plugin {
5281 friend class VRayRenderer;
5282 template<class T> friend class PluginRefT;
5283 friend class Value;
5284 friend class Internal::BinaryValueBuilder;
5285 friend class UVTextureSampler;
5286
5287 int outPropIdx;
5288
5289 protected:
5290 PluginRefT(VRayRenderer& renderer, InstanceId id, const char* outPropertyName);
5291 PluginRefT(VRayRenderer& renderer, InstanceId id, int outPropertyIndex) noexcept;
5292
5293 int getOutputIndex() const noexcept { return outPropIdx; }
5294
5295 public:
5297 PluginRefT() noexcept : outPropIdx(0) {}
5298
5300 PluginRefT(const Plugin &plugin) noexcept : Plugin(plugin), outPropIdx(0) {}
5301
5303 PluginRefT(const PluginRefT &plugin) noexcept : Plugin(plugin), outPropIdx(plugin.outPropIdx) {}
5304
5306 template<class T>
5307 PluginRefT(const PluginRefT<T> &plugin) noexcept : Plugin(plugin), outPropIdx(plugin.outPropIdx) {}
5308
5310 PluginRefT(const Plugin &plugin, const char* outPropertyName);
5311
5313 template<class T>
5314 PluginRefT& operator=(const PluginRefT<T> &plugin) noexcept;
5315
5317 template<class T>
5318 bool operator==(const PluginRefT<T> &plugin) const noexcept;
5319
5321 bool operator==(const Plugin &plugin) const noexcept;
5322
5323 template<class T> bool operator<(const PluginRefT<T>& plugin) const noexcept;
5324 template<class T> bool operator<=(const PluginRefT<T>& plugin) const noexcept;
5325 template<class T> bool operator>(const PluginRefT<T>& plugin) const noexcept;
5326 template<class T> bool operator>=(const PluginRefT<T>& plugin) const noexcept;
5327
5329 void swap(PluginRefT &plugin) noexcept;
5330
5332 bool isOutputValid() const noexcept {
5333 return outPropIdx >= 0;
5334 }
5335
5338 const char* getOutputName() const;
5339
5341 std::string toString() const;
5342
5343 friend std::ostream& operator <<(std::ostream& stream, const PluginRefT& pluginRef);
5344 };
5345
5347
5357 template<class T>
5358 class PluginRefT : public T {
5359 friend class VRayRenderer;
5360 friend class PluginRefT<Plugin>;
5361
5362 int outPropIdx;
5363
5364 PluginRefT(VRayRenderer& renderer, InstanceId id, const char* outPropertyName);
5365
5366 public:
5368 PluginRefT() noexcept : outPropIdx(0) {}
5369
5371 PluginRefT(const T &plugin) noexcept : T(plugin), outPropIdx(0) {}
5372
5374 PluginRefT(const PluginRefT &plugin) noexcept : T(plugin), outPropIdx(plugin.outPropIdx) {}
5375
5377 PluginRefT(const T &plugin, const char* outPropertyName);
5378
5379 template<class X>
5380 PluginRefT(const PluginRefT<X> &plugin) noexcept : T(static_cast<X>(plugin)), outPropIdx(static_cast<PluginRef>(plugin).outPropIdx) {}
5381
5382 template<class X>
5383 PluginRefT(const X &plugin) noexcept : T(static_cast<X>(plugin)), outPropIdx(0) {}
5384
5386 PluginRefT& operator=(const PluginRefT &plugin) noexcept;
5387
5389 bool operator==(const PluginRefT &plugin) const noexcept;
5390
5392 bool operator==(const PluginRefT<Plugin> &plugin) const noexcept;
5393
5395 bool operator==(const Plugin &plugin) const noexcept;
5396
5397 bool operator<(const PluginRefT& plugin) const noexcept;
5398 bool operator<(const PluginRefT<Plugin>& plugin) const noexcept;
5399 bool operator<=(const PluginRefT& plugin) const noexcept;
5400 bool operator<=(const PluginRefT<Plugin>& plugin) const noexcept;
5401 bool operator>(const PluginRefT& plugin) const noexcept;
5402 bool operator>(const PluginRefT<Plugin>& plugin) const noexcept;
5403 bool operator>=(const PluginRefT& plugin) const noexcept;
5404 bool operator>=(const PluginRefT<Plugin>& plugin) const noexcept;
5405
5407 void swap(PluginRefT &plugin) noexcept;
5408
5410 bool isOutputValid() const noexcept {
5411 return outPropIdx >= 0;
5412 }
5413
5416 const char* getOutputName() const;
5417
5419 std::string toString() const;
5420
5421 template<class U>
5422 friend std::ostream& operator <<(std::ostream& stream, const PluginRefT<U>& pluginRef);
5423 };
5424
5426 class Value {
5427 friend class Internal::BinaryValueParser;
5428 friend class Internal::BinaryValueBuilder;
5429 friend struct Internal::MeshFileDataParser;
5430 friend std::ostream& operator<<(std::ostream& stream, const Value& value);
5431
5432 protected:
5433 union {
5434 char val[VRAY_MAXIMUM4(sizeof(Transform), sizeof(std::string), sizeof(ValueList), sizeof(PluginRef))];
5435 void* alignment;
5436 };
5437 Type type;
5438
5439 explicit Value(Type type) noexcept;
5440
5441 void copyValue(const Value& value);
5442 void moveValue(Value&& value) noexcept;
5443 void swapValue(Value& value) noexcept;
5444 void destroyValue() noexcept;
5445 template<typename T, Type TYPE> void constructOnly_() noexcept;
5446 template<typename T, Type TYPE> void constructListWithIterators_(const T* first, const T* last);
5447 template<typename T, Type TYPE, bool noExcept> void constructWithValue_(T&& value) noexcept(noExcept);
5448 template<typename T, Type TYPE> void setToValue_(T&& value);
5449 template<typename T> T& interpretAs_();
5450 template<typename T> const T& interpretAs_() const;
5451 template<typename T, Type TYPE> T& viewAs_();
5452 template<typename T, Type TYPE> const T& viewAs_() const;
5453 template<typename T, Type TYPE> T getValue_() const;
5454 Value(VRayRenderer* renderer, InstanceId id, int outIdx) noexcept;
5455
5456 public:
5458 Value() noexcept;
5459
5460 Value(const Value& value);
5461 Value(Value&& value) noexcept;
5462
5463 explicit Value(int value) noexcept;
5464 explicit Value(float value) noexcept;
5465 explicit Value(double value) noexcept;
5466 explicit Value(bool value) noexcept;
5467 explicit Value(const Color& value) noexcept;
5468 explicit Value(const AColor& value) noexcept;
5469 explicit Value(const Vector& value) noexcept;
5470 explicit Value(const Matrix& value) noexcept;
5471 explicit Value(const Transform& value) noexcept;
5472 explicit Value(const IntList& value);
5473 explicit Value(IntList&& value) noexcept;
5474 explicit Value(const FloatList& value);
5475 explicit Value(FloatList&& value) noexcept;
5476 explicit Value(const VectorList& value);
5477 explicit Value(VectorList&& value) noexcept;
5478 explicit Value(const ColorList& value);
5479 explicit Value(ColorList&& value) noexcept;
5480 explicit Value(TransformList&& value) noexcept;
5481 explicit Value(const TransformList& value);
5482 explicit Value(const ValueList& value);
5483 explicit Value(ValueList&& value) noexcept;
5484 explicit Value(const StringList& value);
5485 explicit Value(StringList&& value) noexcept;
5486 explicit Value(const PluginList& value);
5487 explicit Value(PluginList&& value) noexcept;
5488 explicit Value(const char* value);
5489 explicit Value(const std::string& value);
5490 explicit Value(std::string&& value) noexcept;
5491 explicit Value(const PluginRef& value) noexcept;
5492 Value(const int* values, size_t count);
5493 Value(const float* values, size_t count);
5494 Value(const Vector* values, size_t count);
5495 Value(const Color* values, size_t count);
5496 Value(const Transform* values, size_t count);
5497 Value(const Plugin* values, size_t count);
5498 Value(const Value* values, size_t count);
5499 template<size_t count> explicit Value(const int(&arr)[count]);
5500 template<size_t count> explicit Value(const float(&arr)[count]);
5501 template<size_t count> explicit Value(const Vector(&arr)[count]);
5502 template<size_t count> explicit Value(const Color(&arr)[count]);
5503 template<size_t count> explicit Value(const Transform(&arr)[count]);
5504 template<size_t count> explicit Value(const Plugin(&arr)[count]);
5505 template<size_t count> explicit Value(const Value(&arr)[count]);
5506 template<size_t count> explicit Value(Value(&&arr)[count]);
5507
5509 static Value Unspecified() noexcept;
5510
5511 ~Value() noexcept;
5512
5513 void swap(Value& value) noexcept;
5514
5515 Value& operator=(const Value& value);
5516 Value& operator=(Value&& value) noexcept;
5517 bool operator==(const Value& value) const noexcept;
5518 bool operator!=(const Value& value) const noexcept;
5519
5521 Type getType() const noexcept;
5522
5524 size_t getCount() const;
5525
5527 bool isList() const;
5528
5530 void set(int value);
5531
5533 void set(float value);
5534
5536 void set(double value);
5537
5539 void set(bool value);
5540
5542 void set(const Color& value);
5543
5545 void set(const AColor& value);
5546
5548 void set(const Vector& value);
5549
5551 void set(const Matrix& value);
5552
5554 void set(const Transform& value);
5555
5557 void set(const Plugin& value);
5558
5560 void set(const PluginRef& value);
5561
5563 void set(const char* value);
5564
5566 void set(const std::string& value);
5567
5569 void set(std::string&& value);
5570
5572 void set(const IntList& value);
5573
5575 void set(IntList&& value);
5576
5578 void set(const FloatList& value);
5579
5581 void set(FloatList&& value);
5582
5584 void set(const ColorList& value);
5585
5587 void set(ColorList&& value);
5588
5590 void set(const VectorList& value);
5591
5593 void set(VectorList&& value);
5594
5596 void set(const TransformList& value);
5597
5599 void set(TransformList&& value);
5600
5602 void set(const ValueList& value);
5603
5605 void set(ValueList&& value);
5606
5608 void set(const StringList& value);
5609
5611 void set(StringList&& value);
5612
5614 void set(const PluginList& value);
5615
5617 void set(PluginList&& value);
5618
5620 void set(const int* values, size_t count);
5621
5623 void set(const float* values, size_t count);
5624
5626 void set(const Vector* values, size_t count);
5627
5629 void set(const Color* values, size_t count);
5630
5632 void set(const Transform* values, size_t count);
5633
5635 void set(const std::string* values, size_t count);
5636
5639 template<typename T> T& as();
5640
5643 template<typename T> const T& as() const;
5644
5648 template<typename T> T get() const;
5649
5651 int getInt() const;
5652
5654 float getFloat() const;
5655
5657 double getDouble() const;
5658
5660 bool getBool() const;
5661
5664
5667
5670
5673
5676
5679 IntList getIntList() const;
5680
5683 FloatList getFloatList() const;
5684
5687 ColorList getColorList() const;
5688
5691 VectorList getVectorList() const;
5692
5695 TransformList getTransformList() const;
5696
5699 ValueList getValueList() const;
5700
5703 StringList getStringList() const;
5704
5707 PluginList getPluginList() const;
5708
5710 std::string getString() const;
5711
5714
5717
5720 Value& operator[](int i);
5721
5724 const Value operator[](int i) const;
5725
5727 bool isOK() const;
5728
5730 bool isBad() const;
5731
5733 const char* getStringType() const;
5734
5736 std::string toString() const;
5737
5738 private:
5740 std::ostream& toString(std::ostream& stream) const;
5741 };
5742
5743 std::ostream& operator <<(std::ostream& stream, const IntList& list);
5744 std::ostream& operator <<(std::ostream& stream, const FloatList& list);
5745 std::ostream& operator <<(std::ostream& stream, const VectorList& list);
5746 std::ostream& operator <<(std::ostream& stream, const ColorList& list);
5747 std::ostream& operator <<(std::ostream& stream, const TransformList& list);
5748 std::ostream& operator <<(std::ostream& stream, const ValueList& list);
5749 std::ostream& operator <<(std::ostream& stream, const StringList& list);
5750 std::ostream& operator <<(std::ostream& stream, const PluginList& list);
5751 std::ostream& operator <<(std::ostream& stream, const Value& value);
5752
5765
5774
5776 std::vector<SubFileInfo> subFileInfos;
5777
5779 std::vector<Plugin> pluginExportList;
5780
5782 std::vector<std::string> additionalIncludeFiles;
5783
5785 std::string hostAppString;
5786
5793
5797 std::string sceneBasePath;
5800
5802 : compressed(true)
5803 , hexArrays(true)
5804 , hexArraysHash(false)
5805 , hexTransforms(false)
5806 , renderElementsSeparateFolders(false)
5807 , printHeader(true)
5808 , currentFrameOnly(false)
5809 , incremental(false)
5810 , appendFrameSuffix(false)
5811 , stripPaths(false)
5812 , leftInterval(0.0)
5813 , rightInterval(0.0)
5814 , vrdataExport(false)
5815 , vrdataSmallBufferSizeLimit(2048)
5816 , vrdataFileSizeLimitMiB(0)
5817 , vrfilesExport(false)
5818 , vrfilesComputeHashes(false)
5819 {}
5820 };
5821
5824 ValueList vertices;
5825 ValueList faces;
5826 ValueList normals;
5827 ValueList faceNormals;
5828 ValueList velocities;
5829 ValueList faceMtlIDs;
5830 ValueList mapChannels;
5831 ValueList mapChNames;
5832 ValueList shaderNames;
5833 ValueList edgeVisibility;
5834 ValueList hairVertices;
5836 ValueList hairWidths;
5838 ValueList particleWidths;
5839 };
5840
5843 Plugin plugin;
5844 double distance;
5845 int mtlID;
5846 };
5847
5848 enum VFBMenuItemType {
5849 normal,
5850 checkbox
5851 };
5852
5855 int id;
5856 VFBMenuItemType type;
5858 bool enabled;
5859 std::string text;
5860 };
5861
5863 // Crop region
5870
5871 // Image size
5874
5875 // Render region
5880
5881 enum RenderSizesBitmask {
5882 RS_NONE = 0,
5883 RS_IMG_SIZE = 1 << 0,
5884 RS_RENDER_RGN = 1 << 1,
5885 RS_CROP_RGN = 1 << 2
5886 };
5888 };
5889
5891 Plugin plugin;
5894 bool enabled;
5895 mutable bool isApplied;
5896 };
5897
5898 namespace Util {
5899 enum ReasonsForAutoRename {
5901 NO_AUTO_RENAME = 0,
5904 NO_OVERWRITE_NO_EXISTING_PLUGIN_BUT_INVALID_PLUGIN_NAME,
5907 NO_OVERWRITE_BUT_EXISTING_PLUGIN_WITH_NAME,
5910 OVERWRITE_EXISTING_PLUGIN_WITH_NAME_BUT_DIFFERENT_TYPE
5911 };
5912
5917 std::string name;
5918
5923
5927
5934
5936 this->skipOnlyCurrentPlugin = false;
5937 this->skipAllSuccessorsOfCurrentPlugin = false;
5938 this->overwriteExistingPlugin = false;
5939 }
5940
5941 PreCreateCallbackOptions(const char* name, const bool skipOnlyCurrentPlugin = false, const bool skipAllSuccessorsOfCurrentPlugin = false, const bool overwriteExistingPlugin = false) {
5942 if (name) {
5943 this->name = name;
5944 }
5945 this->skipOnlyCurrentPlugin = skipOnlyCurrentPlugin;
5946 this->skipAllSuccessorsOfCurrentPlugin = skipAllSuccessorsOfCurrentPlugin;
5947 this->overwriteExistingPlugin = overwriteExistingPlugin;
5948 }
5949
5950 PreCreateCallbackOptions(const std::string& name, const bool skipOnlyCurrentPlugin = false, const bool skipAllSuccessorsOfCurrentPlugin = false, const bool overwriteExistingPlugin = false) {
5951 if (!name.empty()) {
5952 this->name = name;
5953 }
5954 this->skipOnlyCurrentPlugin = skipOnlyCurrentPlugin;
5955 this->skipAllSuccessorsOfCurrentPlugin = skipAllSuccessorsOfCurrentPlugin;
5956 this->overwriteExistingPlugin = overwriteExistingPlugin;
5957 }
5958 };
5959
5992 int copyPlugins(
5993 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
5994 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
5995 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
5996 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
5997 const void* userData = nullptr);
5998
6030 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6031 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6032 int copyPlugins(
6033 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6034 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6035 T& obj,
6036 const void* userData = nullptr);
6037
6063 int copyPlugins(
6064 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6065 const char* pluginType,
6066 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6067 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6068 const void* userData = nullptr);
6069
6071 int copyPlugins(
6072 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6073 const std::string& pluginType,
6074 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6075 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6076 const void* userData = nullptr);
6077
6079 int copyPlugins(
6080 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6081 const PluginTypeId& pluginTypeId,
6082 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6083 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6084 const void* userData = nullptr);
6085
6087 template<class PluginType>
6088 int copyPlugins(
6089 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6090 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6091 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6092 const void* userData = nullptr);
6093
6117 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6118 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6119 int copyPlugins(
6120 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6121 const char* pluginType,
6122 T& obj,
6123 const void* userData = nullptr);
6124
6126 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6127 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6128 int copyPlugins(
6129 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6130 const std::string& pluginType,
6131 T& obj,
6132 const void* userData = nullptr);
6133
6135 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6136 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6137 int copyPlugins(
6138 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6139 const PluginTypeId& pluginTypeId,
6140 T& obj,
6141 const void* userData = nullptr);
6142
6144 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6145 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6146 class PluginType>
6147 int copyPlugins(
6148 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6149 T& obj,
6150 const void* userData = nullptr);
6151 }
6152
6164 friend class Plugin;
6165 template<class P> friend class PluginRefT;
6166 friend class PluginMeta;
6167 friend class PropertyMeta;
6168 friend class PropertyRuntimeMeta;
6169 friend class UIGuides;
6170 friend class RenderElement;
6171 friend class RenderElements;
6172 friend class LocalPng;
6173 friend class LocalJpeg;
6174 friend class LocalBmp;
6175 friend class Internal::Access;
6176
6177 friend int Util::copyPlugins(
6178 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6179 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6180 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6181 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6182 const void* userData);
6183
6184 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6185 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6186 friend int Util::copyPlugins(
6187 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6188 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6189 T& obj,
6190 const void* userData);
6191
6192 friend int Util::copyPlugins(
6193 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6194 const char* pluginType,
6195 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6196 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6197 const void* userData);
6198
6199 friend int Util::copyPlugins(
6200 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6201 const std::string& pluginType,
6202 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6203 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6204 const void* userData);
6205
6206 friend int Util::copyPlugins(
6207 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6208 const PluginTypeId& pluginTypeId,
6209 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6210 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6211 const void* userData);
6212
6213 template<class PluginType>
6214 friend int Util::copyPlugins(
6215 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6216 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6217 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6218 const void* userData);
6219
6220 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6221 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6222 friend int Util::copyPlugins(
6223 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6224 const char* pluginType,
6225 T& obj,
6226 const void* userData);
6227
6228 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6229 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6230 friend int Util::copyPlugins(
6231 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6232 const std::string& pluginType,
6233 T& obj,
6234 const void* userData);
6235
6236 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6237 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6238 friend int Util::copyPlugins(
6239 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6240 const PluginTypeId& pluginTypeId,
6241 T& obj,
6242 const void* userData);
6243
6244 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6245 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6246 class PluginType>
6247 friend int Util::copyPlugins(
6248 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6249 T& obj,
6250 const void* userData);
6251
6252 // We need to keep these methods private and they need also access to protected renderer methods
6253 static void pluginCopyParamsPreCreateCallback(const InstanceId srcPluginID, Internal::PreCreateCallbackOptions* opts, void* info);
6254 static void pluginCopyParamsPostCreateCallback(
6255 const InstanceId dstPluginID, const char* srcPluginName,
6256 Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName,
6257 void* info);
6258
6259 class PluginCopyParamsCreateDelegate {
6260 typedef Util::PreCreateCallbackOptions(*tstubPre)(void* pobject, VRayRenderer& dstRenderer, Plugin& srcPlugin, void* userObj);
6261 typedef Util::PreCreateCallbackOptions(*tfuncPre)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void* userObj);
6262
6263 typedef void (*tstubPost)(void* pobject, Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* userObj);
6264 typedef void (*tfuncPost)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* userObj);
6265
6266 void* pobject;
6267 union tmethodPre {
6268 tstubPre pstubPre;
6269 tfuncPre pfuncPre;
6270 tmethodPre() : pstubPre() {}
6271 tmethodPre(tstubPre pstubPre) : pstubPre(pstubPre) {}
6272 tmethodPre(tfuncPre pfuncPre) : pfuncPre(pfuncPre) {}
6273 } pmethodPre;
6274
6275 union tmethodPost {
6276 tstubPost pstubPost;
6277 tfuncPost pfuncPost;
6278 tmethodPost() : pstubPost() {}
6279 tmethodPost(tstubPost pstubPost) : pstubPost(pstubPost) {}
6280 tmethodPost(tfuncPost pfuncPost) : pfuncPost(pfuncPost) {}
6281 } pmethodPost;
6282
6283 void* puserObj;
6284 VRayRenderer* srcRenderer;
6285 VRayRenderer* dstRenderer;
6286
6287 template <class T, Util::PreCreateCallbackOptions(T::* PreCreateTMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void* puserObj)>
6288 static Util::PreCreateCallbackOptions method_stubPre(void* pobject, VRayRenderer& dstRenderer, Plugin& srcPlugin, void* puserObj) {
6289 T* p = static_cast<T*>(pobject);
6290 return (p->*PreCreateTMethod)(dstRenderer, srcPlugin, puserObj);
6291 }
6292
6293 template <class T, void(T::* PostCreateTMethod)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* puserObj)>
6294 static void method_stubPost(void* pobject, Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* puserObj) {
6295 T* p = static_cast<T*>(pobject);
6296 (p->*PostCreateTMethod)(dstPlugin, srcPluginName, autoRenamedResult, preCreateCallbackReturnedName, puserObj);
6297 }
6298
6299 PluginCopyParamsCreateDelegate(tfuncPre pfuncPre, tfuncPost pfuncPost, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) :
6300 pobject(), pmethodPre(pfuncPre), pmethodPost(pfuncPost), puserObj(puserObj), srcRenderer(srcRenderer), dstRenderer(dstRenderer) {}
6301 PluginCopyParamsCreateDelegate(void* pobject, tstubPre pstubPre, tstubPost pstubPost, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) :
6302 pobject(pobject), pmethodPre(pstubPre), pmethodPost(pstubPost), puserObj(puserObj), srcRenderer(srcRenderer), dstRenderer(dstRenderer) {}
6303
6304 public:
6305 template <class T, Util::PreCreateCallbackOptions(T::* PreCreateTMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6306 void(T::* PostCreateTMethod)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6307 static PluginCopyParamsCreateDelegate from_method(T* pobject, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) {
6308 return PluginCopyParamsCreateDelegate(pobject, &method_stubPre<T, PreCreateTMethod>, &method_stubPost<T, PostCreateTMethod>, puserObj, srcRenderer, dstRenderer);
6309 }
6310
6311 static PluginCopyParamsCreateDelegate from_function(tfuncPre pfuncPre, tfuncPost pfuncPost, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) {
6312 return PluginCopyParamsCreateDelegate(pfuncPre, pfuncPost, puserObj, srcRenderer, dstRenderer);
6313 }
6314
6315 Util::PreCreateCallbackOptions operator()(const InstanceId& srcPluginID) const {
6316 Plugin srcPlugin = srcRenderer->getPlugin_internal(srcPluginID);
6317 return pobject ? (*pmethodPre.pstubPre)(pobject, *dstRenderer, srcPlugin, puserObj) : (*pmethodPre.pfuncPre)(*dstRenderer, srcPlugin, puserObj);
6318 }
6319
6320 void operator()(const InstanceId& dstPluginID, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName) const {
6321 Plugin dstPlugin = dstRenderer->getPlugin_internal(dstPluginID);
6322 pobject ? (*pmethodPost.pstubPost)(pobject, dstPlugin, srcPluginName, autoRenamedResult, preCreateCallbackReturnedName, puserObj) :
6323 (*pmethodPost.pfuncPost)(dstPlugin, srcPluginName, autoRenamedResult, preCreateCallbackReturnedName, puserObj);
6324 }
6325 };
6326
6330 VRayRenderer(const VRayRenderer&);
6331 VRayRenderer& operator=(const VRayRenderer&);
6332
6333 class PluginFilterDelegate {
6334 typedef bool (*tstub)(void* pobject, VRayRenderer& renderer, const char* type, std::string& name, void* userObj);
6335 typedef bool (*tfunc)(VRayRenderer& renderer, const char* type, std::string& name, void* userObj);
6336
6337 void *pobject;
6338 union tmethod {
6339 tstub pstub;
6340 tfunc pfunc;
6341 tmethod() : pstub() {}
6342 tmethod(tstub pstub) : pstub(pstub) {}
6343 tmethod(tfunc pfunc) : pfunc(pfunc) {}
6344 } pmethod;
6345 void *puserObj;
6346 VRayRenderer &renderer;
6347
6348 template <class T, bool (T::*TMethod)(VRayRenderer&, const char* type, std::string& name, void* puserObj)>
6349 static bool method_stub(void* pobject, VRayRenderer& renderer, const char* type, std::string& name, void *puserObj) {
6350 T* p = static_cast<T*>(pobject);
6351 return (p->*TMethod)(renderer, type, name, puserObj);
6352 }
6353
6354 PluginFilterDelegate(tfunc pfunc, void *puserObj, VRayRenderer& renderer) : pobject(), pmethod(pfunc), puserObj(puserObj), renderer(renderer) {}
6355 PluginFilterDelegate(void *pobject, tstub pstub, void *puserObj, VRayRenderer& renderer) : pobject(pobject), pmethod(pstub), puserObj(puserObj), renderer(renderer) {}
6356
6357 public:
6358 template <class T, bool (T::*TMethod)(VRayRenderer&, const char*, std::string&, void*)>
6359 static PluginFilterDelegate from_method(T* pobject, void *puserObj, VRayRenderer& renderer) {
6360 return PluginFilterDelegate(pobject, &method_stub<T, TMethod>, puserObj, renderer);
6361 }
6362
6363 static PluginFilterDelegate from_function(tfunc pfunc, void *puserObj, VRayRenderer& renderer) {
6364 return PluginFilterDelegate(pfunc, puserObj, renderer);
6365 }
6366
6367 bool operator()(const char* type, std::string& name) const {
6368 return pobject ? (*pmethod.pstub)(pobject, renderer, type, name, puserObj) : (*pmethod.pfunc)(renderer, type, name, puserObj);
6369 }
6370 };
6371
6372 template<class T, void (T::*TMethod)(VRayRenderer&, RendererState oldState, RendererState newState, double instant, void* userData)>
6373 static void stateChangedCallbackT(const Internal::StateChangedParams* params);
6374 static void stateChangedCallback(const Internal::StateChangedParams* params);
6375
6376 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
6377 static void rendererCloseCallbackT(const Internal::CallbackParamsBase* params);
6378 static void rendererCloseCallback(const Internal::CallbackParamsBase* params);
6379
6380 template<class T, void (T::*TMethod)(VRayRenderer&, VRayImage* img, unsigned long long changeIndex, ImagePassType pass, double instant, void* userData)>
6381 static void progressiveImageUpdatedCallbackT(const Internal::ImageUpdatedParams* params);
6382 static void progressiveImageUpdatedCallback(const Internal::ImageUpdatedParams* params);
6383
6384 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, MessageLevel level, double instant, void* userData)>
6385 static void logMessageCallbackT(const Internal::LogMessageParams* params);
6386 static void logMessageCallback(const Internal::LogMessageParams* params);
6387
6388 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, int errorCode, LicenseUserStatus userStatus, double instant, void* userData)>
6389 static void licenseErrorCallbackT(const Internal::LicenseErrorParams* params);
6390 static void licenseErrorCallback(const Internal::LicenseErrorParams* params);
6391
6392 template<class T, void (T::*TMethod)(VRayRenderer& renderer, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
6393 static void bucketInitCallbackT(const Internal::BucketInitParams* params);
6394 static void bucketInitCallback(const Internal::BucketInitParams* params);
6395
6396 template<class T, void (T::*TMethod)(VRayRenderer& renderer, int x, int y, const char* host, VRayImage* image, ImagePassType pass, double instant, void* userData)>
6397 static void bucketReadyCallbackT(const Internal::BucketReadyParams* params);
6398 template<class T, void (T::*TMethod)(VRayRenderer& renderer, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
6399 static void bucketReadyCallback1T(const Internal::BucketReadyParams* params);
6400 static void bucketReadyCallback(const Internal::BucketReadyParams* params);
6401 static void bucketReadyCallback1(const Internal::BucketReadyParams* params);
6402
6403 template<class T, void (T::*TMethod)(VRayRenderer&, const char* msg, int elementNumber, int elementsCount, double instant, void* userData)>
6404 static void progressCallbackT(const Internal::ProgressParams* params);
6405 static void progressCallback(const Internal::ProgressParams* params);
6406
6407 template<class T, void (T::*TMethod)(VRayRenderer&, const char* propName, double instant, void* userData)>
6408 static void renderViewChangedCallbackT(const Internal::RenderViewChangedParams* params);
6409 static void renderViewChangedCallback(const Internal::RenderViewChangedParams* params);
6410
6411 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
6412 static void vfbRenderLastCallbackT(const Internal::RenderLastParams* params);
6413 static void vfbRenderLastCallback(const Internal::RenderLastParams* params);
6414
6415 template<class T, void (T::*TMethod)(VRayRenderer&, const char* hostName, double instant, void* userData)>
6416 static void drHostConnectedCallbackT(const Internal::ConnectParams* params);
6417 static void drHostConnectedCallback(const Internal::ConnectParams* params);
6418
6419 template<class T, void(T::*TMethod)(VRayRenderer&, int commandId, int x, int y, void* userData)>
6420 static void vfbContextMenuSelectedCallbackT(const Internal::VFBContextMenuSelectedParams* params);
6421 static void vfbContextMenuSelectedCallback(const Internal::VFBContextMenuSelectedParams* params);
6422
6423 static char* pluginFilterCallback(const char* pluginType, const char* pluginName, void* userObject);
6424 static void deleteTempStringCallback(char*, size_t, std::string* str);
6425
6426
6427 template<class T, void(T::*TMethod)(VRayRenderer&, VRayImage* img, void* userData)>
6428 static void manualDenoiseCallbackT(VRayImage* img, void* info);
6429 static void manualDenoiseCallback(VRayImage* img, void* info);
6430
6431 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<LightMixChange>& lightMixChanges, double instant, void* userData)>
6432 static int lightMixTransferToSceneCallbackT(Internal::LightMixCallbackParams* params);
6433 static int lightMixTransferToSceneCallback(Internal::LightMixCallbackParams* params);
6434 void transferToScenePreCallback(std::vector<LightMixChange>& changes, const Internal::LightMixCallbackParams* params);
6435 void transferToScenePostCallback(const std::vector<LightMixChange>& changes, Internal::LightMixCallbackParams* params);
6436
6437 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
6438 static int uploadToCollaborationCallbackT(Internal::UploadToCollaborationParams* params);
6439 static int uploadToCollaborationCallback(Internal::UploadToCollaborationParams* params);
6440 void uploadToCollaborationPreCallback(std::vector<std::string>& fileList, const Internal::UploadToCollaborationParams* params);
6441
6442 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
6443 static int enhanceOnCollaborationCallbackT(Internal::UploadToCollaborationParams* params);
6444 static int enhanceOnCollaborationCallback(Internal::UploadToCollaborationParams* params);
6445 void enhanceOnCollaborationPreCallback(std::vector<std::string>& fileList, const Internal::UploadToCollaborationParams* params);
6446
6447 template<class T, void (T::* TMethod)(VRayRenderer&, int enabled, int mode, int selectionLocked, double instant, void* userData)>
6448 static void debugShadingCallbackT(const Internal::DebugShadingCallbackParams* params);
6449 static void debugShadingCallback(const Internal::DebugShadingCallbackParams* params);
6450
6451 template<class T, void(T::*TMethod)(VRayRenderer&, const std::string &outputFile, int fileType, double instant, void* userData)>
6452 static void vrayProfilerWriteCallbackT(const Internal::VRayProfilerWriteParams* params);
6453 static void vrayProfilerWriteCallback(const Internal::VRayProfilerWriteParams* params);
6454
6455 template<class T, bool (T::*TMethod)(VRayRenderer&, VFBRenderElementType type, double instant, void* userData)>
6456 static int vfbAddRenderElementToSceneT(const Internal::AddRenderElementToSceneParams* params);
6457 static int vfbAddRenderElementToScene(const Internal::AddRenderElementToSceneParams* params);
6458
6459 template<class T, void (T::*TMethod)(VRayRenderer&, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void* userData)>
6460 static void vfbClickT(const Internal::VFBClickParams* params);
6461 static void vfbClick(const Internal::VFBClickParams* params);
6462
6463 public:
6464 typedef void* InstanceHandleType;
6465
6467 class VFB {
6468 friend class UVTextureSampler;
6469
6470 Internal::VRayRendererNative *rendererNative;
6471 bool autoCommit;
6472 friend class VRayRenderer;
6473 friend class LayerManager;
6474 friend class HistoryManager;
6475 friend class ToolbarManager;
6476 VFB() : autoCommit(true),
6477 layerManager(*this),
6478 historyManager(*this),
6479 toolbarManager(*this) {}
6480 VFB(const VFB&);
6481 VFB& operator=(const VFB&);
6482 public:
6486 void show(bool show, bool setFocus = true);
6487
6489 bool isShown() const;
6490
6493
6495 void enableInteractivity(bool enable = true);
6496
6499
6501 void enableConfirmation(bool enable = true);
6502
6505
6507 void setPosition(int x, int y);
6508
6510 void setPositionAndSize(int x, int y, int w, int h);
6511
6513 bool getPositionAndSize(int& x, int& y, int& w, int& h) const;
6514
6522 VFBState* getState(size_t& dataSize, bool includeMain = true, bool includeHistory = true) const;
6523
6531 void setState(const void* vfbStateData, size_t dataSize, bool setMain = true, bool setHistory = true);
6532
6535 std::string getSettings() const;
6536
6540 int setSettings(const char *json);
6541
6544 std::string getLayers() const;
6545
6549 int setLayers(const char *json);
6550
6551 // Forward declaration.
6552 class LayerManager;
6553
6555 class Layer {
6556 friend class LayerManager;
6557 public:
6558
6562 int getIntegerID() const;
6563
6566
6569 bool isValid() const;
6570
6575 int getUniqueTreePathID(std::string& treePathUID) const;
6576
6580 int getClass(std::string& layerClass) const;
6581
6585 int getEnabled(bool& isEnabled) const;
6589 int setEnabled(const bool enabled);
6590
6594 int canDelete(bool& isDeletable) const;
6595
6599
6603 int getUserName(std::string& layerName) const;
6604
6608 int setUserName(const char* layerName);
6610 int setUserName(const std::string& layerName);
6611
6615 int getChildrenCount(int& childrenCount) const;
6618 std::vector<Layer> getChildren() const;
6622 Layer getChild(const int childIndex) const;
6623
6627 int getOpacity(float& opacity) const;
6631 int setOpacity(const float opacity) const;
6632
6636 int canBlend(bool& isBlendable) const;
6644 int setBlendMode(const VFBLayerProperty::BlendMode blendMode) const;
6645
6649 int getLayerPropertiesCount(int& propsCount) const;
6653 int getLayerPropertyNames(std::vector<std::string>& propNames) const;
6654
6659 int getLayerPropertyDisplayName(const char* propName, std::string& displayName) const;
6661 int getLayerPropertyDisplayName(const std::string& propName, std::string& displayName) const;
6662
6666 int resetLayerPropertyToDefault(const char* propName);
6668 int resetLayerPropertyToDefault(const std::string& propName);
6669
6673 int getLayerPropertiesReadOnly(std::vector<std::string>& values) const;
6674
6679 int isLayerPropertyReadOnly(const char* propName, bool& isReadOnly) const;
6681 int isLayerPropertyReadOnly(const std::string& propName, bool& isReadOnly) const;
6682
6687 int getLayerPropertiesOfType(const VFBLayerProperty::Type type, std::vector<std::string>& values) const;
6688
6693 int getLayerPropertyType(const char* propName, VFBLayerProperty::Type& type) const;
6695 int getLayerPropertyType(const std::string& propName, VFBLayerProperty::Type& type) const;
6696
6698
6703 int getLayerPropertyFlags(const char* propName, int& flags) const;
6705 int getLayerPropertyFlags(const std::string& propName, int& flags) const;
6706
6708
6713 int getLayerPropertyBoolValue(const char* propName, bool& value) const;
6715 int getLayerPropertyBoolValue(const std::string& propName, bool& value) const;
6716
6721 int setLayerPropertyBoolValue(const char* propName, const bool value);
6723 int setLayerPropertyBoolValue(const std::string& propName, const bool value);
6724
6729 int getLayerPropertyIntValue(const char* propName, int& value) const;
6731 int getLayerPropertyIntValue(const std::string& propName, int& value) const;
6732
6737 int setLayerPropertyIntValue(const char* propName, const int value);
6739 int setLayerPropertyIntValue(const std::string& propName, const int value);
6740
6742
6746 int getLayerEnumProperties(std::vector<std::string>& values) const;
6747
6752 int getLayerPropertyIntEnumValues(const char* propName, std::vector<std::string>& values) const;
6754 int getLayerPropertyIntEnumValues(const std::string& propName, std::vector<std::string>& values) const;
6755
6760 int getLayerPropertyIntEnumLabel(const char* propName, std::string& valueLabel) const;
6762 int getLayerPropertyIntEnumLabel(const std::string& propName, std::string& valueLabel) const;
6763
6768 int setLayerPropertyIntByEnumLabel(const char* propName, const char* label);
6770 int setLayerPropertyIntByEnumLabel(const char* propName, const std::string& label);
6772 int setLayerPropertyIntByEnumLabel(const std::string& propName, const char* label);
6774 int setLayerPropertyIntByEnumLabel(const std::string& propName, const std::string& label);
6775
6780 int getLayerPropertyIntEnumIndex(const char* propName, int& enumIndex) const;
6782 int getLayerPropertyIntEnumIndex(const std::string& propName, int& enumIndex) const;
6783
6788 int setLayerPropertyIntByEnumIndex(const char* propName, const int enumIndex);
6790 int setLayerPropertyIntByEnumIndex(const std::string& propName, const int enumIndex);
6791
6793
6798 int getLayerPropertyFloatValue(const char* propName, float& value) const;
6800 int getLayerPropertyFloatValue(const std::string& propName, float& value) const;
6801
6806 int setLayerPropertyFloatValue(const char* propName, const float value);
6808 int setLayerPropertyFloatValue(const std::string& propName, const float value);
6809
6814 int getLayerPropertyStringValue(const char* propName, std::string& value) const;
6816 int getLayerPropertyStringValue(const std::string& propName, std::string& value) const;
6817
6822 int setLayerPropertyStringValue(const char* propName, const char* value);
6824 int setLayerPropertyStringValue(const std::string& propName, const char* value);
6825
6830 int getLayerPropertyColorValue(const char* propName, Color& value) const;
6832 int getLayerPropertyColorValue(const std::string& propName, Color& value) const;
6833
6838 int setLayerPropertyColorValue(const char* propName, const Color& value);
6840 int setLayerPropertyColorValue(const std::string& propName, const Color& value);
6841
6846 int getLayerPropertyStampRawStringValue(const char* propName, std::string& value) const;
6848 int getLayerPropertyStampRawStringValue(const std::string& propName, std::string& value) const;
6849
6854 int setLayerPropertyStampRawStringValue(const char* propName, const char* value);
6856 int setLayerPropertyStampRawStringValue(const char* propName, const std::string& value);
6858 int setLayerPropertyStampRawStringValue(const std::string& propName, const char* value);
6860 int setLayerPropertyStampRawStringValue(const std::string& propName, const std::string& value);
6861
6868 int getLayerPropertyStampFontDescValue(const std::string& propName, VFBLayerProperty::StampFontDesc& value) const;
6869
6876 int setLayerPropertyStampFontDescValue(const std::string& propName, const VFBLayerProperty::StampFontDesc& value);
6877
6878 Layer() = delete;
6879
6880 Layer& operator=(const Layer& rhs) {
6881 if (this != &rhs) {
6882 if (&myLayerManager == &rhs.myLayerManager) {
6883 layerUID = rhs.layerUID;
6884 }
6885 }
6886 return *this;
6887 }
6888
6889 bool operator==(const Layer& rhs) const {
6890 return layerUID == rhs.layerUID && &myLayerManager == &rhs.myLayerManager;
6891 }
6892 protected:
6893 Layer(const int& layerUID, const LayerManager& layerManager) :
6894 layerUID(layerUID), myLayerManager(layerManager){
6895 };
6896
6897 void invalidateLayer() const {
6898 layerUID = NO_LAYER_ID;
6899 }
6900 private:
6901 const LayerManager& myLayerManager;
6902 mutable LayerUID layerUID;
6903 };
6904
6920 friend class Layer;
6921 friend class VFB;
6922 public:
6924
6926 VFB& getVFB() const;
6927
6932 void reset();
6933
6936 int getLayersCount() const;
6937
6940 std::vector<Layer> getAllLayersAsLayerObjects() const;
6941
6944 std::vector<std::string> getCreatableLayerClasses() const;
6945
6951 int loadAllLayers(const char* filename);
6953 int loadAllLayers(const std::string& filename);
6954
6958 int saveAllLayers(const char* filename) const;
6960 int saveAllLayers(const std::string& filename) const;
6961
6965 int bakeLayersToLUT(const char* filename) const;
6967 int bakeLayersToLUT(const std::string& filename) const;
6968
6971 std::string getAllLayers() const;
6972
6978 int setAllLayers(const char* json);
6980 int setAllLayers(const std::string& json);
6981
7007 Layer createLayer(const char* layerClass, const Layer& parent);
7009 Layer createLayer(const std::string& layerClass, const Layer& parent);
7010
7016 int deleteLayer(Layer& layer);
7017
7019
7044
7046
7050 std::vector<Layer> findAllLayersWithLayerClass(const char* layerClass) const;
7052 std::vector<Layer> findAllLayersWithLayerClass(const std::string& layerClass) const;
7053
7057 std::vector<Layer> findAllLayersWithUserName(const char* userName) const;
7059 std::vector<Layer> findAllLayersWithUserName(const std::string& userName) const;
7060
7063 std::vector<Layer> getAllEnabledLayers() const;
7064
7067 std::vector<Layer> getAllBlendableLayers() const;
7068
7070
7074
7079
7083
7084 LayerManager() = delete;
7085
7086 LayerManager(const LayerManager& rhs) = delete;
7087
7088 LayerManager& operator=(const LayerManager& rhs) = delete;
7089
7090 ~LayerManager() {
7091 void* original = errMsgHandle.exchange(nullptr);
7092 if (original) {
7093 Internal::releaseCharString(&original);
7094 }
7095 }
7096
7098 std::string getLastError() const {
7099 void* original = (void*)errMsgHandle;
7100 return Internal::getCharStringContent(&original);
7101 }
7102 protected:
7103 LayerManager(VRayRenderer::VFB& vfb) : myVfb(vfb), errMsgHandle(nullptr) {}
7104
7105 Internal::VRayRendererNative* getNativeRenderer() const {
7106 return myVfb.rendererNative;
7107 }
7108
7109#ifndef VRAY_NOTHROW
7110 void handleError(void*& errorMsgHandlePtr, const bool throwException = true) const {
7111 const char* errstr = nullptr;
7112 if (throwException) {
7113 errstr = Internal::getCharStringContent(&errorMsgHandlePtr);
7114 }
7115 void* oldErr = errMsgHandle.exchange(errorMsgHandlePtr);
7116 Internal::releaseCharString(&oldErr);
7117 if (throwException) {
7118 throw VFBLayerErr(errstr);
7119 }
7120 }
7121#else
7122 void handleError(void*& errorMsgHandlePtr, const bool throwException = false) const {
7123 void* oldErr = errMsgHandle.exchange(errorMsgHandlePtr);
7124 Internal::releaseCharString(&oldErr);
7125 }
7126#endif
7127
7128 void getLayerListAndReleaseIDs(std::vector<Layer>& layers, LayerUID*& layerIDs, const int len) const {
7129 layers.reserve(len);
7130 for (int i = 0; i < len; i++) {
7131 layers.push_back(Layer(layerIDs[i], *this));
7132 }
7133 Internal::C_memory_free(layerIDs);
7134 }
7135
7136 static void getStringListAndReleaseCharStars(std::vector<std::string>& words, char*& cStyleWords, const int len) {
7137 words.reserve(len);
7138 const char* curr = cStyleWords;
7139 for (int i = 0; i < len; i++) {
7140 words.emplace_back(curr);
7141 curr += words[i].size() + 1;
7142 }
7143 Internal::C_memory_free(cStyleWords);
7144 }
7145
7146 Layer getCommonLayer(int (*layerLoader)(Internal::VRayRendererNative* renderer, LayerUID* layerID, void** errorMsgHandlePtr)) const {
7147 LayerUID layerID = NO_LAYER_ID;
7148 void* errorMsgHandlePtr = nullptr;
7149 int err = layerLoader(myVfb.rendererNative, &layerID, &errorMsgHandlePtr);
7150 if (err != 0) {
7151 handleError(errorMsgHandlePtr);
7152 return Layer(NO_LAYER_ID, *this);
7153 }
7154 return Layer(layerID, *this);
7155 }
7156
7157 private:
7158 const VRayRenderer::VFB& myVfb;
7159 mutable std::atomic<void*> errMsgHandle;
7160 } layerManager;
7161
7164 friend class VFB;
7165 public:
7168 bool getWindowStatus() const;
7169
7172 void setWindowStatus(const bool status);
7173
7176 bool getPanelStatus() const;
7177
7180 void setPanelStatus(const bool status);
7181
7184 int getMaximumSize() const;
7185
7188 void setMaximumSize(const int maxSize);
7189
7192 std::string getTemporaryPath() const;
7193
7196 void setTemporaryPath(const char* path);
7198 void setTemporaryPath(const std::string& path);
7199
7200 HistoryManager() = delete;
7201
7202 HistoryManager(const HistoryManager& rhs) = delete;
7203
7204 HistoryManager& operator=(const HistoryManager& rhs) = delete;
7205 protected:
7206 HistoryManager(VRayRenderer::VFB& vfb) : myVfb(vfb) {}
7207
7208 Internal::VRayRendererNative* getNativeRenderer() const {
7209 return myVfb.rendererNative;
7210 }
7211 private:
7212 const VRayRenderer::VFB& myVfb;
7213 } historyManager;
7214
7217 friend class VFB;
7218 public:
7221 red = 1,
7222 green,
7223 blue,
7224 alpha,
7225 monochrome
7226 };
7227
7231 resolution_10p = 0,
7232 resolution_25p,
7233 resolution_50p,
7234 resolution_75p,
7235 resolution_100p,
7236 resolution_110p,
7237 resolution_125p,
7238 resolution_150p
7239 };
7240
7244 bool getChannelButtonStatus(const ChannelButton whichChannel) const;
7245
7249 void setChannelButtonStatus(const ChannelButton whichChannel, const bool status);
7250
7254
7257 void setTestResolutionButtonStatus(const bool status);
7258
7262
7265 void setTestResolution(const Resolution resolution);
7266
7272
7277 void setTrackMouseButtonStatus(const bool status);
7278
7284 void getBucketLockPoint(int& left, int& top) const;
7285
7291 void setBucketLockPoint(const int left, const int top);
7292
7305
7317 void setBucketLockButtonStatus(const bool status);
7318
7322 StringList getChannelNames() const;
7323
7332
7339 void setCurrentChannel(const int channelIdx);
7340
7344
7347 void setRenderRegionButtonStatus(const bool status);
7348
7349 ToolbarManager() = delete;
7350
7351 ToolbarManager(const ToolbarManager& rhs) = delete;
7352
7353 ToolbarManager& operator=(const ToolbarManager& rhs) = delete;
7354 protected:
7355 ToolbarManager(VRayRenderer::VFB& vfb) : myVfb(vfb) {}
7356
7357 Internal::VRayRendererNative* getNativeRenderer() const {
7358 return myVfb.rendererNative;
7359 }
7360 private:
7361 const VRayRenderer::VFB& myVfb;
7362 } toolbarManager;
7363
7367
7373 VFBState* getPersistentState(size_t& dataSize) const;
7374
7379 void setPersistentState(const void* vfbPersistentStateData, size_t dataSize);
7380
7386 VRAY_DEPRECATED("getWindowHandle in unsafe and deprecated - use getNativeHandle or getQWidget instead")
7387 void* getWindowHandle() const;
7388
7394 NativeWidgetHandle getNativeHandle() const;
7395
7397 APPSDK_QT_NAMESPACE::QWidget* getQWidget() const;
7398
7403 VRAY_DEPRECATED("setParentWindow in unsafe and deprecated - use setNativeParentWindow or setQWidgetParent instead")
7404 void setParentWindow(void* hWnd);
7405
7411 void setNativeParentWindow(NativeWindowHandle handle);
7412
7415 void setQWidgetParent(APPSDK_QT_NAMESPACE::QWidget* parentWidget);
7416
7421 bool getMinimumSize(int& w, int& h) const;
7422
7426 bool loadColorCorrectionsPreset(const char* filename);
7427
7429 bool loadColorCorrectionsPreset(const std::string& filename);
7430
7434 bool saveColorCorrectionsPreset(const char* filename) const;
7435
7437 bool saveColorCorrectionsPreset(const std::string& filename) const;
7438
7442 bool setTitlePrefix(const char* prefix);
7443
7445 bool setTitlePrefix(const std::string& prefix);
7446
7450 bool setProjectPath(const char *projectPath);
7451
7453 bool setProjectPath(const std::string& projectPath);
7454
7457 void enableProgressBar(bool enable = true);
7458
7462 void setProgressText(const char* text);
7463
7465 void setProgressText(const std::string& text);
7466
7470 void setProgressValue(float value = -1.0f);
7471
7476 void setProgressTextAndValue(const char* text, float value);
7477
7479 void setProgressTextAndValue(const std::string& text, float value);
7480
7485 bool fillSettingsVFB(const char* instanceName = NULL);
7486
7488 bool fillSettingsVFB(const std::string& instanceName);
7489
7493 bool applySettingsVFB();
7494
7498 bool loadImage(const char* filename);
7499
7501 bool loadImage(const std::string& filename);
7502
7505 bool saveImage(const char* fileName) const;
7506
7508 bool saveImage(const std::string& fileName) const;
7509
7513 bool saveImage(const char* fileName, const ImageWriterOptions& options) const;
7514
7516 bool saveImage(const std::string& fileName, const ImageWriterOptions& options) const;
7517
7519 void clearImage();
7520
7523 void setUpdateAvailable(bool available);
7524
7528 void logMessage(MessageLevel level, const char* message);
7529
7531 void logMessage(MessageLevel level, const std::string& message);
7532
7538 void appendAdditionalStyleSheet(const char *styleSheet);
7539
7540 } vfb;
7541
7542 enum RenderMode {
7543 RENDER_MODE_PRODUCTION = -1,
7544 RENDER_MODE_INTERACTIVE = 0,
7545 RENDER_MODE_INTERACTIVE_CUDA = 4,
7546 RENDER_MODE_INTERACTIVE_OPTIX = 7,
7547 RENDER_MODE_INTERACTIVE_METAL = 8,
7548 RENDER_MODE_PRODUCTION_CUDA = 104,
7549 RENDER_MODE_PRODUCTION_OPTIX = 107,
7550 RENDER_MODE_PRODUCTION_METAL = 108,
7551 };
7552
7554 static bool isInactiveState(RendererState value) { return value <= IDLE_DONE; }
7555
7557 static bool isActiveState(RendererState value) { return !isInactiveState(value); }
7558
7562 return Internal::VRay_VRayRenderer_halfResolutionMode
7563 (getNativeRenderer());
7564 }
7565 private:
7566 LicenseError licErr;
7567 PluginTypeId* pluginTypeIds; // PluginTypeId LUT allocated in the VRayRenderer constructor, freed in the VRayRenderer destructor
7568 int pluginTypeIdsCount; // Number of plugin classes and the size of the pluginTypeIds LUT
7569
7570 void createInstance(const Internal::RendererOptions_internal* options);
7571 int findPluginIdIndex(PluginTypeId typeId) const;
7572
7573 public:
7577
7580 VRayRenderer(const RendererOptions &rendererOptions);
7581
7586 explicit VRayRenderer(InstanceHandleType handle);
7587
7590
7594 InstanceHandleType getInstanceHandle() const;
7595
7598 operator bool() const;
7599
7602 bool operator!() const;
7603
7606
7609
7611 LicenseError getLicenseError() const;
7612
7615
7619 bool setRenderMode(RenderMode mode);
7620
7622 RenderMode getRenderMode() const;
7623
7626
7632 int setBitmapCache(bool onOff);
7633
7637 bool setInteractiveSampleLevel(int samplesPerPixel);
7638
7642 bool setInteractiveNoiseThreshold(float threshold);
7643
7647 bool setInteractiveTimeout(int timeoutMsec);
7648
7652 void setKeepInteractiveRunning(bool keepRunning);
7653
7656
7664
7667
7675 bool setDREnabled(bool drEnabled, bool enableBroadcastListener = true);
7676
7679 bool getDREnabled() const;
7680
7682 int getNumThreads() const;
7683
7688 bool setNumThreads(int numThreads);
7689
7694 bool enableDRClient(const EnableDRClientParams& enableParams);
7695
7700
7703 bool isDRClientEnabled() const;
7704
7710
7713 UPType_int = 0,
7714 UPType_bool = 1,
7715 UPType_double = 2,
7716 UPType_float = 3,
7717 UPType_string = 4,
7718 UPType_vector = 5,
7719 UPType_color = 6
7720 };
7721
7724 const char* propName;
7725 UserPropertyType type;
7726 union {
7727 int vint;
7728 bool vbool;
7729 double vdouble;
7730 float vfloat;
7731 const char* vstring;
7732 float vvector[3];
7733 };
7734 };
7735
7736 // Information passed with userCameraChanged
7738 // Name of the VRay plugin whose property was changed. Can be nullptr if
7739 // the property changed comes from a Vantage default and is not associated
7740 // with an existing scene plugin, e.g. a scene without a physical camera plugin
7741 const char* camName;
7742 // Information about the actual parameter that was changed and its new value
7743 const UserPropertyChanged* prop;
7744 };
7745
7746 // Information passed with userLightChanged
7748 // Name of the VRay plugin whose property was changed. Can be nullptr if
7749 // the property changed comes from a Vantage default and is not associated
7750 // with an existing scene plugin
7751 const char* lightName;
7752 // Information about the actual parameter that was changed and its new value
7753 const UserPropertyChanged* prop;
7754 };
7755
7756 enum UserSceneManipType { USMType_Transform_Set = 0, USMType_Show = 1, USMType_Hide = 2 };
7757
7758 enum UserSceneNodeObjectType { USNOType_Node = 0, USNOType_Camera = 1, USNOType_Light = 2 };
7759
7760 // Information passed with userNodeChanged
7762 // Name of the VRay plugin whose property is changed with this operation.
7763 // This can be one of the light plugins, the render view, one of the camera
7764 // plugins, or a geometry node
7765 const char* objName;
7766 // Type of manipulation that occurred
7767 UserSceneManipType umt;
7768 // The general kind of object passed with objName
7769 UserSceneNodeObjectType objType;
7770 // If the type of manipulation is transform, the matrix and vector that describe
7771 // the transformation (i.e. the 'transform' plugin parameter). This should be
7772 // regarded as an offset to the current position/rotation and is in Vantage
7773 // world coordinates
7774 Transform moveTm;
7775 };
7776
7783 void setUserCameraChangedCB(void(*cb) (const UserCameraChanged* info, void* userData), void* userData);
7784
7791 void setUserLightChangedCB(void(*cb) (const UserLightChanged* info, void* userData), void* userData);
7792
7800 void setUserNodeChangedCB(void(*cb) (const UserNodeChanged* info, void* userData), void* userData);
7801
7804 bool getInProcess() const;
7805
7811 bool setInProcess(bool inProcess);
7812
7818 bool setImprovedDefaultSettings(DefaultsPreset preset=quality_medium);
7819
7822 int getCurrentFrame() const;
7823
7828 bool setCurrentFrame(int frame);
7829
7832 double getCurrentTime() const;
7833
7836 bool setCurrentTime(double time);
7837
7840
7842 bool clearPropertyValuesUpToTime(double time, PluginCategories categories);
7843
7846 void useAnimatedValues(bool on);
7847
7850
7853
7855 Box getBoundingBox(bool& ok) const;
7856
7859 bool setCamera(const Plugin& plugin);
7860
7863
7865 void setCameraName(const char* name);
7866
7868 const char* getCameraName() const;
7869
7872
7875 bool pause() const;
7876
7879 bool resume() const;
7880
7882 bool getImageSize(int& width, int& height) const;
7883
7886 bool setImageSize(int width, int height, bool resetCropRegion = true, bool resetRenderRegion = true);
7887
7890 bool getRenderRegion(int& rgnLeft, int& rgnTop, int& rgnWidth, int& rgnHeight) const;
7891
7897 bool setRenderRegion(int rgnLeft, int rgnTop, int rgnWidth, int rgnHeight);
7898
7900 bool getCropRegion(int& srcWidth, int& srcHeight, float& rgnLeft, float& rgnTop, float& rgnWidth, float& rgnHeight) const;
7901
7907 bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop);
7908
7914 bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop, float rgnWidth, float rgnHeight);
7915
7919 bool setRenderSizes(const RenderSizeParams& sizes, bool regionButtonState);
7920
7924 bool getRenderSizes(RenderSizeParams& sizes, bool& regionButtonState) const;
7925
7930 int load(const char* fileName);
7931
7933 int load(const std::string& fileName);
7934
7939 int loadAsText(const char* text);
7940
7942 int loadAsText(const std::string& text);
7943
7945 int loadAsText(std::string&& text);
7946
7955 template<typename T = void>
7956 int loadAsText(const char* text, size_t length, void(*freeFn)(char* text, size_t size, T* holderObject) = NULL, T* holderObject = NULL);
7957
7962 int append(const char* fileName, bool drSendNameOnly = false);
7963
7965 int append(const std::string& fileName, bool drSendNameOnly = false);
7966
7972 int append(const std::vector<const char*> &fileNames);
7973
7975 int append(const std::vector<std::string> &fileNames);
7976
7979 int appendAsText(const char* text);
7980
7982 int appendAsText(const std::string& text);
7983
7985 int appendAsText(std::string&& text);
7986
7992 int appendAsText(const std::vector<const char*> &sceneTexts);
7993
7995 int appendAsText(const std::vector<std::string> &sceneTexts);
7996
8005 template<typename T = void>
8006 int appendAsText(const char* text, size_t length, void(*freeFn)(char* text, size_t size, T* holderObject) = NULL, T* holderObject = NULL);
8007
8017 int loadFiltered(const char* fileName, bool (*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8018
8020 int loadFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8021
8033 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8034 int loadFiltered(const char* fileName, T& obj, const void* userData = NULL);
8035
8037 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8038 int loadFiltered(const std::string& fileName, T& obj, const void* userData = NULL);
8039
8049 int appendFiltered(const char* fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8050
8052 int appendFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8053
8065 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8066 int appendFiltered(const char* fileName, T& obj, const void* userData = NULL);
8067
8069 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8070 int appendFiltered(const std::string& fileName, T& obj, const void* userData = NULL);
8071
8084 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8085 int appendFiltered(const std::vector<const char*> &fileNames, T& obj, const void* userData = NULL);
8086
8088 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8089 int appendFiltered(const std::vector<std::string> &fileNames, T& obj, const void* userData = NULL);
8090
8101 int appendFiltered(const std::vector<const char*> &fileNames, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8102
8104 int appendFiltered(const std::vector<std::string> &fileNames, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8105
8106
8109 int loadAsTextFiltered(const char* fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8110
8112 int loadAsTextFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8113
8116 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8117 int loadAsTextFiltered(const char* fileName, T& obj, const void* userData = NULL);
8118
8120 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8121 int loadAsTextFiltered(const std::string& fileName, T& obj, const void* userData = NULL);
8122
8125 int appendAsTextFiltered(const char* fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8126
8128 int appendAsTextFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8129
8132 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8133 int appendAsTextFiltered(const char* fileName, T& obj, const void* userData = NULL);
8134
8136 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8137 int appendAsTextFiltered(const std::string& fileName, T& obj, const void* userData = NULL);
8138
8151 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8152 int appendAsTextFiltered(const std::vector<const char*> &sceneTexts, T& obj, const void* userData = NULL);
8153
8155 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8156 int appendAsTextFiltered(const std::vector<std::string> &sceneTexts, T& obj, const void* userData = NULL);
8157
8168 int appendAsTextFiltered(const std::vector<const char*> &sceneTexts, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8169
8171 int appendAsTextFiltered(const std::vector<std::string> &sceneTexts, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = NULL);
8172
8175 void start() const;
8176
8179 int startSync() const;
8180
8182 void renderSequence() const;
8183
8187 void renderSequence(SubSequenceDesc descriptions[], size_t count) const;
8188
8190 void continueSequence() const;
8191
8193 void abort() const;
8194
8196 void stop() const;
8197
8203 int exportScene(const char* filePath) const;
8204
8206 int exportScene(const std::string& filePath) const;
8207
8214 int exportScene(const char* filePath, const VRayExportSettings& settings) const;
8215
8217 int exportScene(const std::string& filePath, const VRayExportSettings& settings) const;
8218
8222 std::string exportSceneToBuffer() const;
8223
8228 std::string exportSceneToBuffer(const VRayExportSettings& settings) const;
8229
8235 void bucketRenderNearest(int x, int y) const;
8236
8240 AddHostsResult addHosts(const char* hosts) const;
8241
8243 AddHostsResult addHosts(const std::string& hosts) const;
8244
8248 int removeHosts(const char* hosts) const;
8249
8251 int removeHosts(const std::string& hosts) const;
8252
8256 int resetHosts(const char* hosts = NULL) const;
8257
8259 int resetHosts(const std::string& hosts) const;
8260
8263 std::string getAllHosts() const;
8264
8267 std::string getActiveHosts() const;
8268
8271 std::string getInactiveHosts() const;
8272
8275 unsigned long long commit();
8276
8279 unsigned long long getChangeIndex() const;
8280
8286
8290
8298
8303
8308 VRayImage* getImage(const GetImageOptions &options) const;
8309
8315 size_t getImageIntoBuffer(const GetImageOptions &options, void *buf) const;
8316
8321 RendererState getState() const;
8322
8326 bool isRenderEnded() const;
8327
8330 bool isAborted() const;
8331
8334 bool isFrameSkipped() const;
8335
8338 bool isSequenceEnded() const;
8339
8341 enum class WaitTime : int {
8344 AwaitingOrIdle = -1,
8345
8348 Idle = -2
8349 };
8350
8356 bool waitForRenderEnd(const WaitTime time = WaitTime::AwaitingOrIdle) const;
8357
8362 bool waitForRenderEnd(const int timeout) const;
8363
8367
8371 bool waitForSequenceEnd(const int timeout) const;
8372
8375 bool waitForVFBClosed() const;
8376
8380 bool waitForVFBClosed(const int timeout) const;
8381
8383 std::vector<Plugin> getPlugins() const;
8384
8388 template <class T, class RetT = T> std::vector<RetT> getPlugins() const;
8389
8391 std::vector<Plugin> getPlugins(const char* pluginClassName) const;
8392
8394 std::vector<Plugin> getPlugins(const std::string& pluginClassName) const;
8395
8397 std::vector<Plugin> getPluginsOfCategory(PluginCategory category) const;
8398
8400 std::vector<Plugin> getPluginsOfCategories(const PluginCategories& categories) const;
8401
8404 std::vector<Plugin> getPluginsOfCategories(const std::vector<PluginCategories>& categories) const;
8405
8407 std::vector<std::string> getAllPluginTypes() const;
8408
8412 std::vector<std::string> getPluginTypesOfCategory(PluginCategory category) const;
8413
8417 std::vector<std::string> getPluginTypesOfCategories(PluginCategories categories) const;
8418
8423 std::vector<std::string> getPluginTypesOfCategories(const std::vector<PluginCategories>& categories) const;
8424
8429 Plugin getInstanceOf(const char* pluginType) const;
8430
8435 Plugin getInstanceOf(PluginTypeId pluginTypeId) const;
8436
8438 Plugin getInstanceOf(const std::string& pluginType) const;
8439
8441 template<class T> T getInstanceOf() const;
8442
8449 Plugin getInstanceOrCreate(const char* pluginType);
8450
8457 Plugin getInstanceOrCreate(PluginTypeId pluginTypeId);
8458
8460 Plugin getInstanceOrCreate(const std::string& pluginType);
8461
8463 template<class T> T getInstanceOrCreate();
8464
8472 Plugin getInstanceOrCreate(const char* pluginName, const char* pluginType);
8473
8475 Plugin getInstanceOrCreate(const std::string& pluginName, const char* pluginType);
8476
8478 Plugin getInstanceOrCreate(const char* pluginName, const std::string& pluginType);
8479
8481 Plugin getInstanceOrCreate(const std::string& pluginName, const std::string& pluginType);
8482
8484 Plugin getInstanceOrCreate(const char* pluginName, PluginTypeId pluginTypeId);
8485
8487 Plugin getInstanceOrCreate(const std::string& pluginName, PluginTypeId pluginTypeId);
8488
8490 template<class T> T getInstanceOrCreate(const char* pluginName);
8491
8493 template<class T> T getInstanceOrCreate(const std::string& pluginName);
8494
8496 double getCurrentEventTime() const;
8497
8504 void setOnStateChanged(void(*callback)(VRayRenderer&, RendererState oldState, RendererState newState, double instant, void*), const void* userData = NULL);
8506 template<class T, void (T::*TMethod)(VRayRenderer&, RendererState oldState, RendererState newState, double instant, void* userData)>
8507 void setOnStateChanged(T& object, const void* userData = NULL);
8508
8513 void setOnRendererClose(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8515 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8516 void setOnRendererClose(T& object, const void* userData = NULL);
8517
8525 void setOnProgressiveImageUpdated(void(*callback)(VRayRenderer&, VRayImage* img, unsigned long long changeIndex, ImagePassType pass, double instant, void* userData), const void* userData = NULL);
8527 template<class T, void (T::*TMethod)(VRayRenderer&, VRayImage* img, unsigned long long changeIndex, ImagePassType pass, double instant, void* userData)>
8528 void setOnProgressiveImageUpdated(T& object, const void* userData = NULL);
8529
8536 void setOnLogMessage(void(*callback)(VRayRenderer&, const char* msg, MessageLevel level, double instant, void* userData), MessageLevel minLevel=MessageInfo, const void* userData = NULL);
8538 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, MessageLevel level, double instant, void* userData)>
8539 void setOnLogMessage(T& object, MessageLevel minLevel = MessageInfo, const void* userData = NULL);
8540
8548 void setOnLicenseError(void(*callback)(VRayRenderer&, const char* msg, int errorCode, LicenseUserStatus userStatus, double instant, void* userData), const void* userData = NULL);
8550 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, int errorCode, LicenseUserStatus userStatus, double instant, void* userData)>
8551 void setOnLicenseError(T& object, const void* userData = NULL);
8552
8563 void setOnBucketInit(void(*callback)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData), const void* userData = NULL);
8565 template<class T, void (T::*TMethod)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
8566 void setOnBucketInit(T& object, const void* userData = NULL);
8567
8577 void setOnBucketReady(void(&callback)(VRayRenderer&, int x, int y, const char* host, VRayImage* img, ImagePassType pass, double instant, void* userData), const void* userData = NULL);
8579 template<class T, void (T::*TMethod)(VRayRenderer&, int x, int y, const char* host, VRayImage* img, ImagePassType pass, double instant, void* userData)>
8580 void setOnBucketReady(T& object, const void* userData = NULL);
8581
8592 void setOnBucketReady(void(&callback)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData), const void* userData = NULL);
8594 template<class T, void (T::* TMethod)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
8595 void setOnBucketReady(T& object, const void* userData = NULL);
8597 void setOnBucketReady(std::nullptr_t null);
8598
8609 void setOnBucketFailed(void(*callback)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData), const void* userData = NULL);
8611 template<class T, void (T::*TMethod)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
8612 void setOnBucketFailed(T& object, const void* userData = NULL);
8613
8622 void setOnProgress(void(*callback)(VRayRenderer&, const char* msg, int elementNumber, int elementsCount, double instant, void* userData), const void* userData = NULL);
8624 template<class T, void (T::*TMethod)(VRayRenderer&, const char* msg, int elementNumber, int elementsCount, double instant, void* userData)>
8625 void setOnProgress(T& object, const void* userData = NULL);
8626
8632 void setOnRenderViewChanged(void(*callback)(VRayRenderer&, const char* propName, double instant, void* userData), const void* userData = NULL);
8634 template<class T, void (T::*TMethod)(VRayRenderer&, const char* propName, double instant, void* userData)>
8635 void setOnRenderViewChanged(T& object, const void* userData = NULL);
8636
8642 void setOnVFBRenderLast(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = NULL);
8644 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double, void* userData)>
8645 void setOnVFBRenderLast(T& object, const void* userData = NULL);
8646
8652 void setOnVFBInteractiveStart(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = NULL);
8654 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
8655 void setOnVFBInteractiveStart(T& object, const void* userData = NULL);
8656
8661 void setOnVFBClosed(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8663 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8664 void setOnVFBClosed(T& object, const void* userData = NULL);
8665
8670 void setOnPostEffectsUpdated(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8672 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8673 void setOnPostEffectsUpdated(T& object, const void* userData = NULL);
8674
8680 void setOnVFBLayersChanged(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8682 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8683 void setOnVFBLayersChanged(T& object, const void* userData = NULL);
8684
8689 void setOnVFBShowMessagesWindow(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8691 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8692 void setOnVFBShowMessagesWindow(T& object, const void* userData = NULL);
8693
8699 void setOnHostConnected(void(*callback)(VRayRenderer&, const char* hostName, double instant, void* userData), const void* userData = NULL);
8701 template<class T, void (T::*TMethod)(VRayRenderer&, const char* hostName, double instant, void* userData)>
8702 void setOnHostConnected(T& object, const void* userData = NULL);
8703
8709 void setOnHostDisconnected(void(*callback)(VRayRenderer&, const char* hostName, double instant, void* userData), const void* userData = NULL);
8711 template<class T, void (T::*TMethod)(VRayRenderer&, const char* hostName, double instant, void* userData)>
8712 void setOnHostDisconnected(T& object, const void* userData = NULL);
8713
8718 void setOnVFBOpenUpdateNotify(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8720 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8721 void setOnVFBOpenUpdateNotify(T& object, const void* userData = NULL);
8722
8726 void setOnVFBSaveSettingsNotify(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8728 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8729 void setOnVFBSaveSettingsNotify(T& object, const void* userData = NULL);
8730
8731
8733 enum class DebugShadingMode : int {
8734 isolateSelect,
8735 globalLighting,
8736 globalAO,
8737 globalWireframe,
8738 globalNormal,
8739 globalUV,
8740 globalBarycentric,
8741 };
8742
8749 void setOnVFBDebugShadingNotify(void(*callback)(VRayRenderer&, int enabled, DebugShadingMode mode, int selectionLocked, double instant, void* userData), const void* userData = NULL);
8751 template<class T, void (T::*TMethod)(VRayRenderer&, int enabled, int mode, int selectionLocked, double instant, void* userData)>
8752 void setOnVFBDebugShadingNotify(T& object, const void* userData = NULL);
8753
8760 void setVFBContextMenuSelectedCallback(void(*callback)(VRayRenderer&, int commandId, int x, int y, void* userData), const void* userData = NULL);
8762 template<class T, void(T::*TMethod)(VRayRenderer&, int commandId, int x, int y, void* userData)>
8763 void setVFBContextMenuSelectedCallback(T& object, const void* userData = NULL);
8764
8768 void setOnVFBCopyToHostFrameBufferNotify(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = NULL);
8770 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8771 void setOnVFBCopyToHostFrameBufferNotify(T& object, const void* userData = NULL);
8772
8779 void setOnLightMixTransferToScene(int(*callback)(VRayRenderer&, const std::vector<LightMixChange>& changes, double instant, void*), const void* userData = NULL);
8781 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<LightMixChange>& lightMixChanges, double instant, void* userData)>
8782 void setOnLightMixTransferToScene(T& object, const void* userData = NULL);
8783
8790 void setOnUploadToCollaboration(int(*callback)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void*), const void* userData = NULL);
8792 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
8793 void setOnUploadToCollaboration(T& object, const void* userData = NULL);
8794
8801 void setOnEnhanceOnCollaboration(int(*callback)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void*), const void* userData = NULL);
8803 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
8804 void setOnEnhanceOnCollaboration(T& object, const void* userData = NULL);
8805
8812 void setOnVFBPauseIPR(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = NULL);
8814 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
8815 void setOnVFBPauseIPR(T& object, const void* userData = NULL);
8816
8823 void setOnVFBUpdateIPR(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = NULL);
8825 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
8826 void setOnVFBUpdateIPR(T& object, const void* userData = NULL);
8827
8835 void setOnVFBAddRenderElementToScene(bool(*callback)(VRayRenderer&, VFBRenderElementType type, double instant, void* userData), const void* userData = NULL);
8837 template<class T, bool (T::*TMethod)(VRayRenderer&, VFBRenderElementType type, double instant, void* userData)>
8838 void setOnVFBAddRenderElementToScene(T& object, const void* userData = NULL);
8839
8848 void setOnVFBClick(void(*callback)(VRayRenderer&, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void* userData), const void* userData = NULL);
8850 template<class T, void (T::* TMethod)(VRayRenderer&, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void* userData)>
8851 void setOnVFBClick(T& object, const void* userData = NULL);
8852
8853
8855 void setVFBContextMenuItems(const std::vector<VFBContextMenuItem> &items);
8856
8861 bool getVFBContextMenuItemValue(int commandId, int& value) const;
8862
8867 bool setVFBContextMenuItemValue(int commandId, int value);
8868
8873
8877 unsigned long setProgressiveImageUpdateTimeout(unsigned long timeout);
8878
8881
8884
8886 void setBucketReadyHasBuffer(bool hasBuffer);
8887
8890
8893
8896
8898 void setVisualDebuggerEnabled(bool enable);
8899
8902
8905 Plugin getPlugin(const char *pluginName) const;
8906
8908 Plugin getPlugin(const std::string &pluginName) const;
8909
8911 template<class T> T getPlugin(const char *pluginName) const;
8912
8914 template<class T> T getPlugin(const std::string &pluginName) const;
8915
8917 PluginMeta getPluginMeta(const char *pluginClassName) const;
8918
8920 PluginMeta getPluginMeta(const std::string& pluginClassName) const;
8921
8923 PluginMeta getPluginMeta(const PluginTypeId pluginTypeId) const;
8924
8929 Plugin newPlugin(const char* pluginName, const char* pluginType);
8930
8932 Plugin newPlugin(const char* pluginName, PluginTypeId pluginTypeId);
8933
8935 Plugin newPlugin(const std::string& pluginName, const std::string& pluginType);
8936
8938 Plugin newPlugin(const char* pluginName, const std::string& pluginType);
8939
8941 Plugin newPlugin(const std::string& pluginName, const char* pluginType);
8942
8944 template<class T> T newPlugin(const char* pluginName);
8945
8947 template<class T> T newPlugin(const std::string& pluginName);
8948
8950 template<class T> T newPlugin();
8951
8955 Plugin newPlugin(const char* pluginType);
8956
8958 Plugin newPlugin(const std::string &pluginType);
8959
8961 Plugin newPlugin(PluginTypeId pluginTypeId);
8962
8972 Plugin getOrCreatePlugin(const char* pluginName, const char* pluginType);
8973
8975 Plugin getOrCreatePlugin(const std::string& pluginName, const char* pluginType);
8976
8978 Plugin getOrCreatePlugin(const char* pluginName, const std::string& pluginType);
8979
8981 Plugin getOrCreatePlugin(const std::string& pluginName, const std::string& pluginType);
8982
8984 Plugin getOrCreatePlugin(const char* pluginName, PluginTypeId pluginTypeId);
8985
8987 Plugin getOrCreatePlugin(const std::string& pluginName, PluginTypeId pluginTypeId);
8988
8990 template<class T> T getOrCreatePlugin(const char* pluginName);
8991
8993 template<class T> T getOrCreatePlugin(const std::string& pluginName);
8994
8998 Plugin pickPlugin(int x, int y) const;
8999
9004 Plugin pickPlugin(int x, int y, int timeout) const;
9005
9011 std::vector<PickedPluginInfo> pickPlugins(double x, double y, int maxcount = 0, int timeout = -1) const;
9012
9015 bool deletePlugin(const Plugin& plugin);
9016
9019 bool deletePlugin(const std::string& pluginName);
9020
9023 bool deletePlugin(const char* pluginName);
9024
9028 bool deletePlugins(const char* names[], size_t namesCount);
9029
9033 bool deletePlugins(const std::vector<std::string> &names);
9034
9038 bool deletePlugins(const std::vector<VRay::Plugin> &plugins);
9039
9048 bool replacePlugin(const Plugin& oldPlugin, const Plugin& newPlugin);
9049
9056 bool optimizeMaterialGraph(const Plugin& topPlugin);
9057
9059 bool getAutoCommit() const;
9060
9063 void setAutoCommit(bool autoCommit);
9064
9067
9069 size_t getIrradianceMapSize() const;
9072 bool saveIrradianceMapFile(const std::string &fileName);
9074 bool saveIrradianceMapFile(const char* fileName);
9075
9077 size_t getLightCacheSize() const;
9080 bool saveLightCacheFile(const std::string &fileName);
9082 bool saveLightCacheFile(const char* fileName);
9083
9085 size_t getPhotonMapSize() const;
9088 bool savePhotonMapFile(const std::string &fileName);
9090 bool savePhotonMapFile(const char* fileName);
9091
9093 size_t getCausticsSize() const;
9096 bool saveCausticsFile(const std::string &fileName);
9098 bool saveCausticsFile(const char* fileName);
9099
9103 std::vector<ComputeDeviceInfo> getComputeDevicesMetal() const;
9104
9108 std::vector<ComputeDeviceInfo> getComputeDevicesOptix() const;
9109
9116 std::vector<ComputeDeviceInfo> getComputeDevicesCUDA() const;
9117
9121 std::vector<ComputeDeviceInfo> getComputeDevicesDenoiser() const;
9122
9126 std::vector<ComputeDeviceInfo> getComputeDevicesCurrentEngine() const;
9127
9131 bool setComputeDevicesMetal(const std::vector<int> &indices);
9132
9136 bool setComputeDevicesOptix(const std::vector<int> &indices);
9137
9141 bool setComputeDevicesCUDA(const std::vector<int> &indices);
9142
9146 bool setComputeDevicesDenoiser(const std::vector<int> &indices);
9147
9152
9156 bool setComputeDevicesCurrentEngine(const std::vector<int> &indices);
9157
9162 bool setResumableRendering(bool enable, const ResumableRenderingOptions* options);
9163
9166 void setDenoiserOptions(const DenoiserOptions& denoiserOptions);
9167
9177 bool denoiseNow(void(*userCb)(VRayRenderer&, VRayImage*, void*) = 0, bool shouldPassImage = true, const void* userData = NULL);
9178
9180 template<class T, void (T::*TMethod)(VRayRenderer&, VRayImage*, void*)>
9181 bool denoiseNow(T& object, bool shouldPassImage = true, const void* userData = NULL);
9182
9191
9195 void setIncludePaths(const char* includePaths, bool overwrite = true);
9196
9198 void setIncludePaths(const std::string &includePaths, bool overwrite = true);
9199
9202
9205 float getIESPrescribedIntensity(const char* iesLightFileName) const;
9206
9208 float getIESPrescribedIntensity(const std::string &iesLightFileName) const;
9209
9215
9217 bool isManual();
9218
9221
9227 void startDurationEvent(const char* name, int threadIndex = 0);
9228
9234 void endDurationEvent(const char* name, int threadIndex = 0);
9235
9236 private:
9237 VRayProfiler(VRayRenderer& renderer) : owner(renderer) {}
9238 VRayRenderer& owner;
9239 friend class VRayRenderer;
9240 } profiler{ *this };
9241
9248
9255 bool addVRayProfilerMetadata(const char* category, const char* key, const char* value);
9256
9258 bool addVRayProfilerMetadata(const std::string& category, const std::string& key, const std::string& value);
9259
9262 void setUserSceneName(const char* sceneName);
9263
9265 void setUserSceneName(const std::string& sceneName);
9266
9269 std::string getUserSceneName();
9270
9277 void setOnVRayProfilerWrite(void(*callback)(VRayRenderer&, const std::string& outputFile, int fileType, double instant, void*), const void* userData = nullptr);
9279 template<class T, void(T::*TMethod)(VRayRenderer&, const std::string &outputFile, int fileType, double instant, void* userData)>
9280 void setOnVRayProfilerWrite(T& object, const void* userData = nullptr);
9281
9284 void setDebugShadingSelection(const std::vector<Plugin>& selection);
9285
9286 protected:
9287 Internal::VRayRendererNative* getNativeRenderer() const;
9288 static VRayRenderer* getVRayRenderer(void* rendererNative);
9289
9290 InstanceId getPluginId_internal(const char* pluginName, PluginTypeId& outTypeId) const;
9291 PluginTypeId getPluginTypeId_internal(const char* pluginType) const;
9292 PluginTypeId getPluginTypeId_internal(InstanceId pluginID) const;
9293 const char* getPluginTypeString(PluginTypeId pluginTypeId) const;
9294 Plugin getPlugin_internal(InstanceId pluginID) const;
9295 template<class T> T getPlugin_internal(InstanceId pluginID) const;
9296 const char* getPluginName_internal(InstanceId pluginID) const;
9297 bool pluginExists_internal(InstanceId pluginID) const;
9298
9299 int getPropertyIndexFromName(InstanceId pluginID, const char* propertyName) const;
9300 const char* getPropertyNameFromIndex(InstanceId pluginID, int idx) const;
9301 template<class T> static std::vector<T> getPluginsOfType(VRayRenderer& renderer, const char* pluginType);
9302 template<class T> static std::vector<T> getPluginsOfTypeId(VRayRenderer& renderer, PluginTypeId typeId);
9303 static std::vector<std::string> getStringVector(void *pvector);
9304 static std::vector<const char*> getCharPtrVector(const std::vector<std::string> &strVector);
9305 std::vector<std::string> getPluginPropertyNames(const char* pluginClassName) const; // Returns the names of all properties of a plugin.
9306 const char* getPluginType(const char* name) const;
9307 const char* getPluginType(InstanceId pluginID) const;
9308 bool setPluginName(InstanceId pluginID, const char* name) const;
9309 Type getPluginPropertyRuntimeType(const char* pluginName, const char* propertyName) const;
9310 Type getPluginPropertyRuntimeType(InstanceId pluginID, const char* propertyName) const;
9311 int getPluginPropertyElementsCount(InstanceId pluginID, const char* propertyName) const;
9312 const void* getPluginPropertyDefinition(const char* pluginName, const char* propertyName) const;
9313 const void* getPluginPropertyDefinition(InstanceId pluginID, const char* propertyName) const;
9314 const void* getPluginPropertyDefinitionFromClass(const char* pluginClassName, const char* propertyName) const;
9315 std::string getPluginPropertyValueAsString(const char* pluginName, const char* propertyName, double time) const;
9316 std::string getPluginPropertyValueAsString(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9317 bool setPluginPropertyValueAsString(InstanceId pluginID, const char* propertyName, const char* value) const;
9318 bool setPluginPropertyValueAsStringAtTime(InstanceId pluginID, const char* propertyName, const char* value, double time) const;
9319 bool getPluginPropertyBool(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9320 bool getPluginPropertyBool(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9321 int getPluginPropertyInt(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9322 int getPluginPropertyInt(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9323 float getPluginPropertyFloat(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9324 float getPluginPropertyFloat(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9325 double getPluginPropertyDouble(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9326 Color getPluginPropertyColor(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9327 Color getPluginPropertyColor(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9328 AColor getPluginPropertyAColor(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9329 AColor getPluginPropertyAColor(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9330 Vector getPluginPropertyVector(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9331 Vector getPluginPropertyVector(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9332 Matrix getPluginPropertyMatrix(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9333 Matrix getPluginPropertyMatrix(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9334 Transform getPluginPropertyTransform(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9335 Transform getPluginPropertyTransform(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9336 PluginRef getPluginPropertyPluginRef(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9337 Value getPluginPropertyValue(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9338 template<typename T> T getPluginPropertyTyped(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9339 int getPropertyState(InstanceId pluginID, const char* propertyName) const;
9340 int getKeyframeTimes(InstanceId pluginID, const char* propertyName, double* &times) const;
9341 bool setPluginPropertyValueAtTime(InstanceId pluginID, const char* propertyName, const void *pval, double time) const;
9342 bool setPluginPropertyValueRawAtTime(InstanceId pluginID, const char* propertyName, const void *pval, size_t count, double time) const;
9343
9344#ifdef VRAY_SDK_INTEROPERABILITY
9345 bool getPluginPropertyValueSDKInterop(InstanceId pluginID, const char* propertyName, void *pval, int type) const;
9346 bool getPluginPropertyValueAtTimeSDKInterop(InstanceId pluginID, const char* propertyName, void *pval, int type, double time) const;
9347 bool setPluginPropertyValueSDKInterop(InstanceId pluginID, const char* propertyName, const void* pval, int type) const;
9348 bool setPluginPropertyValueAtTimeSDKInterop(InstanceId pluginID, const char* propertyName, const void* pval, int type, double time) const;
9349#endif // VRAY_SDK_INTEROPERABILITY
9350
9351 Plugin newRenderElementPlugin(int type, const char *instanceName, const char *displayName);
9352 Plugin getRenderElementPlugin(int type) const;
9353 std::vector<Plugin> getRenderElementPluginsList(int type) const;
9354 bool getRenderElementInfo(InstanceId pluginID, int type, RenderElement::Info& chInfo) const;
9355 size_t getRenderElementData(
9356 InstanceId pluginID,
9357 InstanceId alphaPluginID,
9358 int type,
9359 int layer,
9361 int intent,
9362 bool rgbOrder,
9363 const ImageRegion* rgn,
9364 void** buf
9365 ) const;
9366 size_t getRenderElementDataIntoBuffer(
9367 InstanceId pluginID,
9368 InstanceId alphaPluginID,
9369 int type,
9370 int layer,
9372 int intent,
9373 bool rgbOrder,
9374 const ImageRegion* rgn,
9375 bool flipImage,
9376 void *buf
9377 ) const;
9378 VRayImage* getRenderElementAsImage(InstanceId pluginID, int type, int layer, const GetImageOptions &options, const bool isDoColorCorrectionsUSerSet = false) const;
9379 std::string getRenderElementMetadata(InstanceId pluginID, int type) const;
9380 };
9381
9385 public:
9386 ProfilerDurationScope(VRayRenderer& renderer, std::string eventName, int threadIndex = 0) :
9387 renderer(renderer),
9388 eventName(eventName),
9389 threadIndex(threadIndex) {
9390 if (renderer.profiler.isManual()) {
9391 renderer.profiler.startDurationEvent(eventName.c_str(), threadIndex);
9392 }
9393 }
9394
9396 if (renderer.profiler.isManual()) {
9397 renderer.profiler.endDurationEvent(eventName.c_str(), threadIndex);
9398 }
9399
9400 }
9401 private:
9402 VRayRenderer& renderer;
9403 std::string eventName;
9404 int threadIndex;
9405 };
9406
9409 std::string fileName;
9413
9415 };
9416
9419 private:
9420 template<class T, Plugin(T::* TMethod)(VRayRenderer&, const char* assetId, Vector importPosition, void* userData)>
9421 static InstanceId importScatterPresetCallbackT(const char* assetId, Vector* importPosition, void* info);
9422 static InstanceId importScatterPresetCallback(const char* assetId, Vector* importPosition, void* info);
9423
9424 public:
9429 static bool readScatterData(const Plugin& scatterPlugin, std::vector<Transform>& transforms, IntList& topo);
9430
9434 static bool readGaussianData(const Plugin& gaussianPlugin, GaussianReadData& readData);
9435
9439 static bool readGaussianData(const std::string& fileName, GaussianReadData& readData);
9440
9449 static bool readScatterPreset(const ScatterReadParams& params, Plugin(*callback)(VRayRenderer&, const char* assetId, Vector importPosition, void* userData) = 0, const void* userData = nullptr);
9451 template<class T, Plugin(T::* TMethod)(VRayRenderer&, const char* assetId, Vector importPosition, void* userData)>
9452 static bool readScatterPreset(const ScatterReadParams& params, T& object, const void* userData = nullptr);
9453
9460 static bool readGeomHairData(const Plugin& nodePlugin, VectorList& vertices, IntList& lengths, int countHint = 0);
9461 };
9462
9465 public:
9469 static bool readLuminaireFieldPreviewData(const Plugin& luminairePlugin, LuminaireFieldReadPreviewData& readData);
9470
9474 static bool readLuminaireFieldPreviewData(const std::string& fileName, LuminaireFieldReadPreviewData& readData);
9475
9480 static bool readIESPreviewData(const Plugin& lightPlugin, VectorList& vertices, IntList& indices);
9481
9486 static bool readIESPreviewData(const std::string& fileName, VectorList& vertices, IntList& indices);
9487 };
9488
9491
9493 class Proxy {
9494 public:
9500 static bool readPreviewGeometry(const Plugin &proxyPlugin, VectorList &vertices, IntList &indices, int countHint = 0);
9501
9507 static bool readPreviewHair(const Plugin &proxyPlugin, VectorList &vertices, IntList &lengths, int countHint = 0);
9508
9513 static bool readPreviewParticles(const Plugin &proxyPlugin, VectorList &positions, int countHint = 0);
9514
9518 static bool readPreviewData(const Plugin &proxyPlugin, ProxyReadData &readData);
9519
9523 static bool readFullData(const Plugin &proxyPlugin, ProxyReadData &readData);
9524
9532 static bool createMeshFile(const Plugin &geomMeshPlugin, const Transform *transform, const ProxyCreateParams &params);
9533
9541 static bool createMeshFile(const Plugin &geomMeshPlugin, const AnimatedTransform &animTransform, const ProxyCreateParams &params);
9542
9550 static bool createCombinedMeshFile(const std::vector<Plugin> &geomMeshPlugins, const std::vector<Transform> *transforms, const ProxyCreateParams &params);
9551
9559 static bool createCombinedMeshFile(const std::vector<Plugin> &geomMeshPlugins, const std::vector<AnimatedTransform> &animTransforms, const ProxyCreateParams &params);
9560
9566 static bool readPreviewGeometry(const ProxyReadParams &params, VectorList &vertices, IntList &indices, int countHint = 0);
9567
9573 static bool readPreviewHair(const ProxyReadParams &params, VectorList &vertices, IntList &lengths, int countHint = 0);
9574
9579 static bool readPreviewParticles(const ProxyReadParams &params, VectorList &positions, int countHint = 0);
9580
9584 static bool readPreviewData(const ProxyReadParams &params, ProxyReadData &readData);
9585
9589 static bool readFullData(const ProxyReadParams &params, ProxyReadData &readData);
9590
9595 static bool createMeshFile(const MeshFileData &data, const Transform *transform, const ProxyCreateParams &params);
9596
9601 static bool createMeshFile(const MeshFileData &data, const AnimatedTransform &animTransform, const ProxyCreateParams &params);
9602
9607 static bool createCombinedMeshFile(const std::vector<MeshFileData> &data, const std::vector<Transform> *transforms, const ProxyCreateParams &params);
9608
9613 static bool createCombinedMeshFile(const std::vector<MeshFileData> &data, const std::vector<AnimatedTransform> &animTransforms, const ProxyCreateParams &params);
9614 };
9615
9617 enum GPUParamSupport {
9618 GPUParamSupport_Full,
9619 GPUParamSupport_Partial,
9620 GPUParamSupport_None,
9621 GPUParamSupport_Unknown,
9622 };
9623
9624 inline std::ostream& operator <<(std::ostream& stream, const GPUParamSupport val) {
9625 switch (val) {
9626 case GPUParamSupport_Full:
9627 stream << "Full";
9628 break;
9629 case GPUParamSupport_Partial:
9630 stream << "Partial";
9631 break;
9632 case GPUParamSupport_None:
9633 stream << "None";
9634 break;
9635 default:
9636 stream << "Unknown";
9637 }
9638 return stream;
9639 }
9640
9641 class UIGuides {
9642 friend class PropertyMeta;
9643
9644 private:
9645 const void* pParamDef;
9646
9647 protected:
9648 UIGuides(const void* pParamDef) : pParamDef(pParamDef) {}
9649
9650 const void* getParamDef() const {
9651 return pParamDef;
9652 }
9653
9654 public:
9732 MaxGuides
9734
9737 Unknown,
9751 LocalSubdivs
9753
9757 DefaultUnits,
9758 Radians,
9759 Degrees,
9760 Millimeters,
9761 Centimeters,
9762 Meters
9763 };
9764
9771 Load,
9772 Save,
9773 LoadAndSave
9774 };
9775
9778 None = 0,
9780 ObjectSet = 1,
9784 TextureSlot = 2,
9786 LightSet = 4,
9788 PartOf3dsMaxTriple = 8,
9790 BitSet = 16,
9794 Boolean = 32
9796
9802 Basic = 0,
9803 DefaultTier = 1,
9804 Advanced = 2
9805 };
9806
9807 UIGuides(const UIGuides& uiGuides) : pParamDef(uiGuides.pParamDef) {}
9808
9809 UIGuides& operator=(const UIGuides& uiGuides) {
9810 pParamDef = uiGuides.pParamDef;
9811 return *this;
9812 }
9813
9816 bool isEnum() const;
9817
9821 bool hasType(const GuideType type) const;
9822
9826 float getFloat(const GuideType type) const;
9827
9831 std::vector<float> getFloats(const GuideType type) const;
9832
9835 std::string getDisplayName() const;
9836
9838 struct EnumItem {
9839 int value;
9840 std::string name;
9841 };
9842
9845 std::vector<EnumItem> getEnumStrings() const;
9846
9850
9854
9857 std::vector<std::string> getFileAssetExts() const;
9858
9861 std::vector<std::string> getFileAssetNames() const;
9862
9866
9870 bool hasAttribute(const AttributesType attributeType) const;
9871
9874 std::vector<std::string> getStringEnumStrings() const;
9875
9878 bool isStringEnum() const;
9879
9882 std::string getRolloutName() const;
9883
9886 std::string getTabName() const;
9887
9890 bool hasOverriddenBy() const;
9891
9894 std::string getValueOfOverriddenBy() const;
9895
9899
9902 bool hasOverride() const;
9903
9907
9911 std::string getValueOfOverride(const int index) const;
9912
9916
9919 std::vector<std::string> getEnableDepends() const;
9920
9923 GPUParamSupport getGPUSupportStatus() const;
9924
9928
9931 std::vector<std::string> getHideDepends() const;
9932 };
9933
9934 class RuntimeUIGuides : public UIGuides {
9935 friend class PropertyRuntimeMeta;
9936 private:
9937 const Internal::VRayRendererNative* renderer;
9938 InstanceId id;
9939 protected:
9940 RuntimeUIGuides(const void* pParamDef, const Internal::VRayRendererNative* renderer, InstanceId id) :
9941 UIGuides(pParamDef), renderer(renderer), id(id) {}
9942
9943 public:
9946 bool isEnabled() const;
9947
9950 bool isHidden() const;
9951 };
9952
9955 friend class PluginMeta;
9956
9957 protected:
9958 const void* pParamDef;
9959 GPUParamSupport gpuSupport;
9960
9961 PropertyMeta(const VRayRenderer *pRenderer, const char* pluginClassName, const char* propertyName)
9962 {
9963 pParamDef = pRenderer->getPluginPropertyDefinitionFromClass(pluginClassName, propertyName);
9964 gpuSupport = (GPUParamSupport)Internal::VRay_PluginUtils_getPropertyGpuSupport(pRenderer->getNativeRenderer(), pluginClassName, pParamDef);
9965 }
9966
9967 public:
9968 PropertyMeta(const PropertyMeta &propertyMeta)
9969 : pParamDef(propertyMeta.pParamDef), gpuSupport(propertyMeta.gpuSupport) {}
9970
9971 PropertyMeta& operator=(const PropertyMeta &propertyMeta) {
9972 pParamDef = propertyMeta.pParamDef;
9973 gpuSupport = propertyMeta.gpuSupport;
9974 return *this;
9975 }
9976
9977 void swap(PropertyMeta &propertyMeta) {
9978 std::swap(pParamDef, propertyMeta.pParamDef);
9979 std::swap(gpuSupport, propertyMeta.gpuSupport);
9980 }
9981
9983 operator bool () const {
9984 return !!pParamDef;
9985 }
9986
9988 int getElementsCount() const {
9989 return Internal::VRay_PluginUtils_getPropertyElementsCount(pParamDef);
9990 }
9991
9993 const char* getName() const {
9994 return Internal::VRay_PluginUtils_getPropertyName(pParamDef);
9995 }
9996
9998 StringList getAliases() const;
9999
10002 Type getType() const {
10003 return Internal::VRay_PluginUtils_getPropertyType(pParamDef);
10004 }
10005
10007 Type getElementType() const {
10008 return Internal::VRay_PluginUtils_getPropertyElementType(pParamDef);
10009 }
10010
10015
10017 std::string getDescription() const {
10018 const char* const description = Internal::VRay_PluginUtils_getPropertyDescription(pParamDef);
10019 return description ? description : "";
10020 }
10021
10023 const char* getDeprecation() const {
10024 return Internal::VRay_PluginUtils_getPropertyDeprecation(pParamDef);
10025 }
10026
10029 std::string getUIGuides() const {
10030 const char* const uiGuides = Internal::VRay_PluginUtils_getPropertyUIGuides(pParamDef);
10031 return uiGuides ? uiGuides : "";
10032 }
10033
10036 return UIGuides(pParamDef);
10037 }
10038
10039 static const char* typeToString(const Type type);
10040
10041 const char* getTypeAsString() const {
10042 return typeToString(getType());
10043 }
10044
10046 GPUParamSupport getGPUSupport() const {
10047 return gpuSupport;
10048 }
10049 };
10050
10053 friend class Plugin;
10054
10055 const VRayRenderer* renderer;
10056 InstanceId id;
10057
10058 protected:
10059 PropertyRuntimeMeta(const Plugin& plugin, const char* propertyName)
10060 : PropertyMeta(plugin.pRenderer, plugin.getType(), propertyName), renderer(plugin.pRenderer), id(plugin.id()) {
10061 }
10062
10063 public:
10064 PropertyRuntimeMeta(const PropertyRuntimeMeta& propertyRuntimeMeta)
10065 : PropertyMeta(propertyRuntimeMeta), renderer(propertyRuntimeMeta.renderer), id(propertyRuntimeMeta.id) {
10066 }
10067
10068 PropertyRuntimeMeta& operator=(const PropertyRuntimeMeta &propertyRuntimeMeta) {
10069 PropertyMeta::operator=(propertyRuntimeMeta);
10070 renderer = propertyRuntimeMeta.renderer;
10071 id = propertyRuntimeMeta.id;
10072 return *this;
10073 }
10074
10077 return renderer->getPluginPropertyElementsCount(id, getName());
10078 }
10079
10081 Type getRuntimeType() const {
10082 return renderer->getPluginPropertyRuntimeType(id, getName());
10083 }
10084
10085 const char* getRuntimeTypeAsString() const {
10086 return typeToString(getRuntimeType());
10087 }
10088
10089 void swap(PropertyRuntimeMeta &propertyRuntimeMeta) {
10090 PropertyMeta::swap(propertyRuntimeMeta);
10091 std::swap(renderer, propertyRuntimeMeta.renderer);
10092 std::swap(id, id);
10093 }
10094
10097 return RuntimeUIGuides(pParamDef, renderer->getNativeRenderer(), id);
10098 }
10099 };
10100
10102 enum GPUPluginSupport {
10103 GPUPluginSupport_Full,
10104 GPUPluginSupport_Partial,
10105 GPUPluginSupport_Bake,
10106 GPUPluginSupport_None,
10107 GPUPluginSupport_Unknown,
10108 };
10109
10110 inline std::ostream& operator <<(std::ostream& stream, const GPUPluginSupport val) {
10111 switch (val) {
10112 case GPUPluginSupport_Full:
10113 stream << "Full";
10114 break;
10115 case GPUPluginSupport_Partial:
10116 stream << "Partial";
10117 break;
10118 case GPUPluginSupport_Bake:
10119 stream << "Bake";
10120 break;
10121 case GPUPluginSupport_None:
10122 stream << "None";
10123 break;
10124 default:
10125 stream << "Unknown";
10126 }
10127 return stream;
10128 }
10129
10132 friend class VRayRenderer;
10133 friend class Plugin;
10134
10135 PluginTypeId typeId;
10136 const char* type;
10137 const VRayRenderer* pRenderer;
10138
10139 protected:
10140 PluginMeta(const Plugin& plugin)
10141 : typeId(plugin.getTypeId())
10142 , type(plugin.getType())
10143 , pRenderer(plugin.getRenderer())
10144 { }
10145
10146 PluginMeta(const VRayRenderer* renderer, const char* typeStr) {
10147 typeId = renderer->getPluginTypeId_internal(typeStr);
10148 type = renderer->getPluginTypeString(typeId);
10149 pRenderer = renderer;
10150 }
10151
10152 PluginMeta(const VRayRenderer* renderer, PluginTypeId pluginTypeId) {
10153 typeId = pluginTypeId;
10154 type = renderer->getPluginTypeString(pluginTypeId);
10155 pRenderer = renderer;
10156 }
10157
10158 public:
10159 PluginMeta(const PluginMeta& pluginMeta) = default;
10160 PluginMeta& operator=(const PluginMeta& pluginMeta) = default;
10161
10162 bool operator==(const PluginMeta& pluginMeta) const {
10163 return typeId == pluginMeta.typeId && pRenderer == pluginMeta.pRenderer;
10164 }
10165
10166 void swap(PluginMeta& pluginMeta) {
10167 std::swap(typeId, pluginMeta.typeId);
10168 std::swap(type, pluginMeta.type);
10169 std::swap(pRenderer, pluginMeta.pRenderer);
10170 }
10171
10173 bool isValid() const {
10174 return !!type;
10175 }
10176
10178 const char* getType() const {
10179 return type;
10180 }
10181
10183 PluginTypeId getTypeId() const {
10184 return typeId;
10185 }
10186
10188 std::vector<std::string> getPropertyNames() const {
10189 return pRenderer->getPluginPropertyNames(type);
10190 }
10191
10193 std::string getDescription() const;
10194
10196 const char* getDeprecation() const;
10197
10199 PropertyMeta getPropertyMeta(const char* propertyName) const {
10200 return PropertyMeta(pRenderer, type, propertyName);
10201 }
10202
10204 PropertyMeta getPropertyMeta(const std::string &propertyName) const {
10205 return PropertyMeta(pRenderer, type, propertyName.c_str());
10206 }
10207
10212 bool checkPluginUIGuides(std::string& errMsg) const;
10213
10215 GPUPluginSupport getGPUSupport() const;
10216
10219 };
10220
10221 class CompressImage;
10222
10223 namespace Internal {
10225 friend class VRay::CompressImage;
10226
10227 std::ofstream ofs;
10228
10229 FileSaveWriteHelper(const char* fileName) : ofs(fileName, std::ofstream::binary) {}
10230
10232 ofs.close();
10233 }
10234 };
10235 }
10236
10239 CompressImage(const CompressImage& ci);
10240 CompressImage& operator=(const CompressImage& ci);
10241
10242 protected:
10243 byte* bufAddr;
10244 size_t bufSize;
10245
10246 CompressImage() : bufAddr(), bufSize() {}
10247
10248 public:
10249 void swap(CompressImage& ci);
10250
10251 operator size_t () const {
10252 return bufSize;
10253 }
10254
10256 void* getBuf() const {
10257 return bufAddr;
10258 }
10259
10261 size_t getLen() const {
10262 return bufSize;
10263 }
10264
10266 bool saveToFile(const char* fileName) const;
10267
10269 bool saveToFile(const std::string &fileName) const {
10270 return saveToFile(fileName.c_str());
10271 }
10272
10273 ~CompressImage() {
10274 if (bufSize)
10275 Internal::C_memory_free(bufAddr);
10276 }
10277 };
10278
10280 class LocalJpeg : public CompressImage {
10281
10282 public:
10286 LocalJpeg(const VRayImage* img, int quality = 0) {
10287 bufSize = Internal::VRayImage_compressToJpeg(img, quality, &bufAddr, nullptr);
10288 }
10289
10291 LocalJpeg(const VRayImage* img, const VRayRenderer& renderer, int quality = 0) {
10292 bufSize = Internal::VRayImage_compressToJpeg(img, quality, &bufAddr, renderer.getNativeRenderer());
10293 }
10294 };
10295
10296 class LocalPng : public CompressImage {
10297
10298 public:
10302 LocalPng(const VRayImage* img, bool preserveAlpha = false) {
10303 bufSize = Internal::VRayImage_compressToPng(img, preserveAlpha, &bufAddr, nullptr);
10304 }
10305
10307 LocalPng(const VRayImage* img, const VRayRenderer& renderer, bool preserveAlpha = false) {
10308 bufSize = Internal::VRayImage_compressToPng(img, preserveAlpha, &bufAddr, renderer.getNativeRenderer());
10309 }
10310 };
10311
10312 class LocalBmp : public CompressImage {
10313
10314 public:
10319 LocalBmp(const VRayImage* img, bool preserveAlpha = false, bool swapChannels = false) {
10320 bufSize = Internal::VRayImage_convertToBmp(img, preserveAlpha, &bufAddr, NULL, swapChannels ? 1 : 0);
10321 }
10322
10324 LocalBmp(const VRayImage* img, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) {
10325 bufSize = Internal::VRayImage_convertToBmp(img, preserveAlpha, &bufAddr, renderer.getNativeRenderer(), swapChannels ? 1 : 0);
10326 }
10327 };
10328
10330 template<class T>
10331 T plugin_cast(Plugin plugin) {
10332 return *static_cast<T*>(&plugin);
10333 }
10334
10336 template<class T>
10337 PluginRefT<T> plugin_cast(PluginRef pluginRef) {
10338 // won't compile if T doesn't inherit from Plugin
10339 return *static_cast<PluginRefT<T>*>(static_cast<T*>(static_cast<Plugin*>(&pluginRef)));
10340 }
10341
10344 template<class T>
10345 T plugin_checked_cast(Plugin plugin) {
10346 return plugin_cast<T>(plugin.getTypeId() != T::getTypeId() ? Plugin() : plugin);
10347 }
10348
10351 template<class T>
10352 PluginRefT<T> plugin_checked_cast(PluginRef pluginRef) {
10353 return plugin_cast<T>(pluginRef.getTypeId() != T::getTypeId() ? PluginRef() : pluginRef);
10354 }
10355
10356 namespace Internal {
10357 template<typename PluginType>
10358 inline bool _isPluginOfTypes(PluginTypeId typeId) {
10359 return typeId == PluginType::getTypeId();
10360 }
10361
10362 template<typename PluginType0, typename PluginType1, typename... RemainingTypes>
10363 inline bool _isPluginOfTypes(PluginTypeId typeId) {
10364 return typeId == PluginType0::getTypeId() || _isPluginOfTypes<PluginType1, RemainingTypes...>(typeId);
10365 }
10366 }
10367
10373 template<typename PluginType>
10374 inline bool isPluginOfType(const Plugin& plugin) {
10375 return plugin.getTypeId() == PluginType::getTypeId();
10376 }
10377
10383 template<typename PluginType, typename... Types>
10384 inline bool isPluginOfTypes(const Plugin& plugin) {
10385 return Internal::_isPluginOfTypes<PluginType, Types...>(plugin.getTypeId());
10386 }
10387
10393 inline bool isPluginOfType(const Plugin& plugin, const char* type) {
10394 return plugin.isNotEmpty() && strcmp(plugin.getType(), type) == 0;
10395 }
10396
10404 template <size_t N>
10405 inline bool isPluginOfTypes(const Plugin& plugin, const char* const (&types)[N]) {
10406 if (plugin.isNotEmpty()) {
10407 const char* type = plugin.getType();
10408 for (size_t i = 0; i < N; ++i) {
10409 if (strcmp(type, types[i]) == 0)
10410 return true;
10411 }
10412 }
10413 return false;
10414 }
10415
10423 template <size_t N>
10424 inline bool isPluginOfTypes(const Plugin& plugin, const PluginTypeId (&types)[N]) {
10425 PluginTypeId typeId = plugin.getTypeId();
10426 for (size_t i = 0; i < N; ++i) {
10427 if (typeId == types[i])
10428 return true;
10429 }
10430 return false;
10431 }
10432
10433 namespace OCIO {
10435 enum SourceMode : int {
10437 Automatic = 0,
10439 Environment,
10441 File,
10443 Internal,
10444 };
10445
10449 std::vector<std::string> colorSpaces;
10451 std::vector<std::string> colorSpaceFamilies;
10453 std::vector<std::string> roles;
10455 std::vector<std::string> roleColorSpaces;
10457 std::vector<std::string> looks;
10459 std::vector<std::string> devices;
10461 std::vector<std::string> viewTransforms;
10464
10469 OCIOConfigurationData(const char* fileName = NULL, SourceMode vraySourceType = SourceMode::Automatic)
10470 : errorCode(OCIOResult::Result_OK) {
10471
10472 Internal::OCIOData internalOCIOData;
10473 errorCode = (OCIOResult)Internal::VRay_OCIO_initData(&internalOCIOData, fileName, (int)vraySourceType);
10474 if (errorCode != OCIOResult::Result_OK) {
10475 const char* ending = internalOCIOData.status ? internalOCIOData.status : "<unknown>";
10476 errorString = std::string("Failed initializing OCIO configuration: ") + ending;
10477 Internal::VRay_OCIO_freeData(&internalOCIOData);
10478#ifndef VRAY_NOTHROW
10479 throw VRayException(errorString);
10480#endif
10481 return;
10482 }
10483
10484 familySeparator = char(internalOCIOData.familySeparator);
10485
10486 convertRawData(colorSpaces, internalOCIOData.colorSpaces, internalOCIOData.colorSpacesCount);
10487 if (internalOCIOData.colorSpaceFamilies) {
10488 convertRawData(colorSpaceFamilies, internalOCIOData.colorSpaceFamilies, internalOCIOData.colorSpacesCount);
10489 }
10490 convertRawData(roles, internalOCIOData.roles, internalOCIOData.rolesCount);
10491 convertRawData(roleColorSpaces, internalOCIOData.roleColorSpaces, internalOCIOData.rolesCount);
10492
10493 convertRawData(looks, internalOCIOData.looks, internalOCIOData.looksCount);
10494 convertRawData(devices, internalOCIOData.devices, internalOCIOData.devicesCount);
10495 convertRawData(viewTransforms, internalOCIOData.viewTransforms, internalOCIOData.viewTransformsCount);
10496
10497 Internal::VRay_OCIO_freeData(&internalOCIOData);
10498 }
10499
10501 std::string getErrorString() const {
10502 return errorString;
10503 }
10504
10505 private:
10507 enum OCIOResult : int {
10508 Result_OK = 0,
10509 Result_FileNotFound,
10510 Result_OCIOException,
10511 Result_EmptyConfiguration,
10512 Result_InternalException = -1
10513 } errorCode;
10514
10516 std::string errorString;
10517
10518 void convertRawData(std::vector<std::string>& output, char const* const* input, const int inputCount) {
10519 output.clear();
10520 output.reserve(inputCount);
10521 for (int i = 0; i < inputCount; ++i) {
10522 output.emplace_back(input[i]);
10523 }
10524 }
10525 };
10526 }
10527
10532 bool setEnvVar(const char* name, const char* value);
10533
10537 const char* getEnvVar(const char* name);
10538
10539 enum OSLParameterType {
10540 OSL_TYPE_UNSUPPORTED,
10541 OSL_TYPE_INT,
10542 OSL_TYPE_BOOL,
10543 OSL_TYPE_FLOAT,
10544 OSL_TYPE_STRING,
10545 OSL_TYPE_TEXTURE,
10546 OSL_TYPE_COLOR,
10547 OSL_TYPE_VECTOR,
10548 OSL_TYPE_OUTPUT_CLOSURE,
10549 OSL_TYPE_OUTPUT_COLOR,
10550 OSL_TYPE_OUTPUT_FLOAT,
10551 OSL_TYPE_MENU
10552 };
10553
10555 std::string name;
10556 OSLParameterType type;
10558 };
10559
10561 std::vector<std::string> outputColorParams;
10562 std::vector<std::string> outputFloatParams;
10563 std::vector<std::string> outputClosureParams;
10564 std::vector<OSLInputParameter> inputParams;
10565 };
10566
10570 Error getOSLParameters(const char* fileName, OSLParameters& params);
10571
10573 Error getOSLParameters(const std::string& fileName, OSLParameters& params);
10574
10575 enum OSLSourceType {
10576 OSL_SOURCE_TYPE_OSL = 1,
10577 OSL_SOURCE_TYPE_OSO = 2,
10578 };
10579
10580 enum OSLSourceEncoding {
10581 OSL_SOURCE_ENC_TXT,
10582 OSL_SOURCE_ENC_BASE64,
10583 };
10584
10590 Error getOSLParameters(const char* src, OSLSourceType type, OSLSourceEncoding encoding, OSLParameters& params);
10591
10593 Error getOSLParameters(const std::string& src, OSLSourceType type, OSLSourceEncoding encoding, OSLParameters& params);
10594
10596 void* vrsceneDesc;
10597 void createThis(const char* filename, const void* settings);
10598 ScenePreview(const ScenePreview&);
10599
10600 public:
10601 struct Settings;
10602 class Object;
10603 struct Particle;
10604
10605 enum ObjectType {
10606 ObjectTypeAll = 0,
10607 ObjectTypeNode,
10608 ObjectTypeNodeParticle,
10609 ObjectTypeLight,
10610 ObjectTypeInstancer,
10611 ObjectTypeVolume,
10612 ObjectTypeVRayScene,
10613 ObjectTypeMaterial,
10614 ObjectTypeDecal,
10615 ObjectTypeClipper,
10616 };
10617
10618 enum DataType {
10619 DataTypeAll = -1,
10620 DataTypeNoData = 0,
10621 DataTypeMesh = (1 << 0),
10622 DataTypeHair = (1 << 1),
10623 DataTypeParticles = (1 << 2),
10624 DataTypeVolume = (1 << 3),
10625 DataTypeInfinitePlane = (1 << 4),
10626 DataTypeInstancer2 = (1 << 5),
10627 DataTypeVRayProxy = (1 << 6),
10628 DataTypeRayserverInstancer = (1 << 7),
10629 DataTypeStaticMesh = (1 << 8),
10630 DataTypePerfectSphere = (1 << 9),
10631 DataTypeGeomInstancer = (1 << 10),
10632
10633 DataTypeHasInstances = DataTypeInstancer2 | DataTypeRayserverInstancer | DataTypeGeomInstancer,
10634
10635 ObjectDataTypeAll = DataTypeAll,
10636 ObjectDataTypeNoData = DataTypeNoData,
10637 ObjectDataTypeMesh = DataTypeMesh,
10638 ObjectDataTypeHair = DataTypeHair,
10639 ObjectDataTypeParticles = DataTypeParticles,
10640 ObjectDataTypeVolume = DataTypeVolume,
10641 ObjectDataTypeInfinitePlane = DataTypeInfinitePlane,
10642 ObjectDataTypeInstancer2 = DataTypeInstancer2,
10643 ObjectDataTypeVRayProxy = DataTypeVRayProxy,
10644 ObjectDataTypeRayserverInstancer = DataTypeRayserverInstancer,
10645 ObjectDataTypeStaticMesh = DataTypeStaticMesh,
10646 ObjectDataTypePerfectSphere = DataTypePerfectSphere,
10647 ObjectDataTypeGeomInstancer = DataTypeGeomInstancer,
10648
10649 ObjectDataTypeHasInstances = DataTypeHasInstances,
10650 };
10651
10652 enum LightType {
10653 LightTypeUnsupported = 0,
10654 LightTypeOmni,
10655 LightTypeRectangle,
10656 LightTypeSphere,
10657 LightTypeDirect,
10658 LightTypeSpot,
10659 LightTypeSun,
10660 LightTypeIES,
10661 LightTypeDome,
10662 LightTypeMesh,
10663 };
10664
10665 enum UpAxis {
10666 UpAxisUnknown = -1,
10667 UpAxisZ = 0,
10668 UpAxisY,
10669 };
10670
10671 struct Sizes2D {
10672 float width;
10673 float length;
10674 };
10675
10676 struct Sizes3D {
10677 float width;
10678 float height;
10679 float length;
10680 };
10681
10685 explicit ScenePreview(const char* filename);
10686
10691 ScenePreview(const char* filename, const Settings& settings);
10692
10693 ~ScenePreview();
10694
10701 std::vector<Object> getObjects(ObjectType objectType = ObjectTypeAll, DataType dataType = DataTypeAll) const;
10702
10706 Object getObject(const char* name) const;
10707
10710 operator bool() const {
10711 return !!vrsceneDesc;
10712 }
10713
10716 bool operator!() const {
10717 return !vrsceneDesc;
10718 }
10719
10721 UpAxis getUpAxis() const;
10722
10724 float getMetersScale() const;
10725
10727 float getPhotometricScale() const;
10728
10730 float getSecondsScale() const;
10731
10733 float getFramesScale() const;
10734
10736 int getFrameStart() const;
10737
10739 int getFrameEnd() const;
10740
10742 int getFPS() const;
10743
10745 size_t getTotalFaces() const;
10746 };
10747
10752 CacheTypeSingle=0,
10754 CacheTypeNone=1,
10757 CacheTypeRam=2
10759
10763 CoordinateSystemRightHanded=0,
10765 CoordinateSystemLeftHanded=1
10767
10768 Settings() :
10769 usePreview(true),
10770 previewFacesCount(100000),
10771 minPreviewFaces(64),
10772 maxPreviewFaces(10000),
10773 cacheType(CacheType::CacheTypeSingle),
10774 coordinateSystem(CoordinateSystem::CoordinateSystemRightHanded) {
10775 }
10776
10777 Bool usePreview;
10778 int previewFacesCount;
10779 int minPreviewFaces;
10780 int maxPreviewFaces;
10781 CacheType cacheType;
10782 CoordinateSystem coordinateSystem;
10783 };
10784
10786 friend class ScenePreview;
10787
10788 void* objectBase;
10789
10790 static void addDataTypeStringHelperPrivate(std::string& currentString, DataType types, DataType dataType, const char* typeString);
10791
10792 explicit Object(void* objectBase) : objectBase(objectBase) {}
10793 Object(void* vrsceneDesc, const char* name);
10794
10795 public:
10796 Object() : objectBase() {}
10797
10800 const char* getName() const;
10801
10804 bool isValid() const {
10805 return !!objectBase;
10806 }
10807
10810 ObjectType getType() const;
10811
10814 const char* getTypeAsString() const;
10815
10819 Transform getTransform(double time = 0) const;
10820
10824 bool getVisibility(double time = 0) const;
10825
10828 const char* getNodeDataName() const;
10829
10832 DataType getDataType() const;
10833
10836 std::string getDataTypeAsString() const;
10837
10843
10848
10849#ifndef VRAY_SDK_INTEROPERABILITY
10853 VectorList getMeshVertices(double time = 0);
10854
10858 IntList getMeshFaces(double time = 0);
10859
10864 VectorList getHairVertices(double time = 0);
10865
10870 IntList getHairNumVertices(double time = 0);
10871
10877 int getMeshVerticesFast(const Vector* &vertices, double time = 0);
10878
10884 int getMeshFacesFast(const int* &faces, double time = 0);
10885
10892 int getHairVerticesFast(const Vector* &vertices, double time = 0);
10893
10900 int getHairNumVerticesFast(const int* &lengths, double time = 0);
10901#else
10905 VUtils::VectorRefList getMeshVertices(double time = 0);
10906
10910 VUtils::IntRefList getMeshFaces(double time = 0);
10911
10916 VUtils::VectorRefList getHairVertices(double time = 0);
10917
10922 VUtils::IntRefList getHairNumVertices(double time = 0);
10923#endif
10924
10925 std::vector<Particle> getInstancerParticles(double time = 0);
10926
10927 Sizes3D getDecalSize(double time = 0);
10928 Sizes2D getClipperSize(double time = 0);
10929 };
10930
10932 friend class Object;
10933
10936
10939
10942
10943 int particleId;
10944
10945 bool isValid() const {
10946 return node.isValid();
10947 }
10948
10949 //char* getUserAttributes() const;
10950 //~Particle();
10951 //private:
10952 //void* userAttributes;
10953 };
10954
10959 void *internalTextureSampler;
10960
10961 public:
10963 UVTextureSampler(const UVTextureSampler &r) = delete;
10964 UVTextureSampler& operator=(const UVTextureSampler &rhs) = delete;
10965 UVTextureSampler(UVTextureSampler &&r) noexcept;
10966 UVTextureSampler& operator=(UVTextureSampler &&rhs) noexcept;
10968
10969 public:
10977
10984
10993 bool sample(const PluginRef &pluginRef, float u, float v, AColor &result);
10994
10996 bool sample(const PluginRef &pluginRef, float u, float v, float &result);
10997
10999 bool sample(const PluginRef &pluginRef, float u, float v, int &result);
11000
11011 VRayImage* sampleArea(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height);
11012
11024 FloatList sampleAreaFloat(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height);
11025
11028 IntList sampleAreaInt(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height);
11029
11030 private:
11032 template<typename ListType, typename SampleFunction>
11033 static std::vector<ListType> sampleAreaAsListResult(int width, int height, SampleFunction &&sampleArea);
11034 };
11035
11036 namespace Util {
11037
11039 struct PluginLink {
11041 std::string fromProperty;
11043
11044 bool operator==(const PluginLink& other) const noexcept {
11045 return fromPlugin == other.fromPlugin && fromProperty == other.fromProperty && toPlugin == other.toPlugin;
11046 }
11047
11048 bool operator!=(const PluginLink& other) const noexcept {
11049 return fromPlugin != other.fromPlugin || fromProperty != other.fromProperty || toPlugin != other.toPlugin;
11050 }
11051
11052 bool operator<(const PluginLink& other) const noexcept {
11053 if (fromPlugin != other.fromPlugin)
11054 return fromPlugin < other.fromPlugin;
11055 if (fromProperty != other.fromProperty)
11056 return fromProperty < other.fromProperty;
11057 return toPlugin < other.toPlugin;
11058 }
11059
11060 bool operator<=(const PluginLink& other) const noexcept {
11061 if (fromPlugin < other.fromPlugin) return true;
11062 if (fromPlugin > other.fromPlugin) return false;
11063 if (fromProperty < other.fromProperty) return true;
11064 if (fromProperty > other.fromProperty) return false;
11065 return toPlugin < other.toPlugin;
11066 }
11067 };
11068
11074 std::vector<PluginLink> getChildPlugins(Plugin root, bool recursive);
11075
11079 std::vector<PluginLink> getParentPlugins(Plugin child, bool recursive = false);
11080
11083 float getIESPrescribedIntensity(const char* iesLightFileName);
11084
11086 float getIESPrescribedIntensity(const std::string& iesLightFileName);
11087 }
11088
11090 enum Status {
11092 ErrorMemory = -4,
11093
11095 ErrorResolve = -3,
11096
11098 ErrorConnect = -2,
11099
11101 ErrorTimeout = -1,
11102
11104 ServerReady = 0,
11105
11107 ServerUnknown = 1,
11108
11110 ServerError = 2,
11111
11113 ServerBusy = 3
11114 } status;
11115
11118
11121
11123 std::string hostResolved;
11124
11126 std::string hostConnectedTo; // valid only if ServerBusy
11127
11129 std::string revisionTime;
11130 };
11131
11135 CheckDRHostResult checkDRHost(const char* host);
11136
11138 CheckDRHostResult checkDRHost(const std::string& host);
11139
11142
11143 BinUserAttributesWriter() : index() {}
11144
11155 binUserAttributeType_int = 0,
11156 binUserAttributeType_float,
11157 binUserAttributeType_vector,
11158 binUserAttributeType_acolor,
11159 binUserAttributeType_string,
11160 binUserAttributeType_last,
11161 };
11162
11166 binUserAttributeFlag_small = 1 << 3,
11167
11169 binUserAttributeFlag_smallY = 1 << 2,
11170
11172 binUserAttributeFlag_smallZ = 1 << 1,
11173
11175 binUserAttributeFlag_smallA = 1 << 0,
11176 };
11177
11181 template<size_t count>
11182 void add(const char(&name)[count], int value) {
11183 add(name, count - 1, value);
11184 }
11185
11189 template<size_t count>
11190 void add(const char(&name)[count], float value) {
11191 add(name, count - 1, value);
11192 }
11193
11197 template<size_t count>
11198 void add(const char(&name)[count], const Vector& value) {
11199 add(name, count - 1, value);
11200 }
11201
11205 template<size_t count>
11206 void add(const char(&name)[count], const AColor& value) {
11207 add(name, count - 1, value);
11208 }
11209
11214 template<size_t nameLen>
11215 void add(const char(&name)[nameLen], const char* value, size_t valueLen) {
11216 add(name, nameLen - 1, value, valueLen);
11217 }
11218
11222 template<size_t nameLen, size_t valueLen>
11223 void add(const char(&name)[nameLen], const char(&value)[valueLen]) {
11224 add(name, nameLen - 1, value, valueLen - 1);
11225 }
11226
11230 template<size_t nameLen>
11231 void add(const char(&name)[nameLen], const std::string& value) {
11232 add(name, nameLen - 1, value.c_str(), value.length());
11233 }
11234
11238 void add(const std::string& name, int value) {
11239 add(name.c_str(), name.length(), value);
11240 }
11241
11245 void add(const std::string& name, float value) {
11246 add(name.c_str(), name.length(), value);
11247 }
11248
11252 void add(const std::string& name, const Vector& value) {
11253 add(name.c_str(), name.length(), value);
11254 }
11255
11259 void add(const std::string& name, const AColor& value) {
11260 add(name.c_str(), name.length(), value);
11261 }
11262
11267 void add(const std::string& name, const char* value, size_t valueLen) {
11268 add(name.c_str(), name.length(), value, valueLen);
11269 }
11270
11274 template<size_t valueLen>
11275 void add(const std::string& name, const char(&value)[valueLen]) {
11276 add(name.c_str(), name.length(), value, valueLen - 1);
11277 }
11278
11282 void add(const std::string& name, const std::string& value) {
11283 add(name.c_str(), name.length(), value.c_str(), value.length());
11284 }
11285
11290 void add(const char* name, size_t nameLen, int value) {
11291 appendString(name, nameLen);
11292
11293 if (value >= -128 && value <= 127) {
11294 const byte attrType = binUserAttributeType_int | (binUserAttributeFlag_small << 4);
11295 resize(2);
11296 write(attrType);
11297 write(sbyte(value));
11298 } else {
11299 resize(1 + sizeof(int));
11300 write(binUserAttributeType_int);
11301 write(value);
11302 }
11303 }
11304
11309 void add(const char* name, size_t nameLen, float value) {
11310 appendString(name, nameLen);
11311
11312 byte attrType = binUserAttributeType_float;
11313 byte writeSize = 1;
11314
11315 const SmallFloat smallValue(value, attrType, binUserAttributeFlag_small, writeSize);
11316 resize(writeSize);
11317 write(attrType);
11318 smallValue.write(*this);
11319 }
11320
11325 void add(const char* name, size_t nameLen, const Vector& value) {
11326 appendString(name, nameLen);
11327
11328 byte attrType = binUserAttributeType_vector;
11329 byte writeSize = sizeof(byte);
11330
11331 const SmallFloat smallX(value.x, attrType, binUserAttributeFlag_small, writeSize);
11332 const SmallFloat smallY(value.y, attrType, binUserAttributeFlag_smallY, writeSize);
11333 const SmallFloat smallZ(value.z, attrType, binUserAttributeFlag_smallZ, writeSize);
11334
11335 resize(writeSize);
11336 write(attrType);
11337
11338 smallX.write(*this);
11339 smallY.write(*this);
11340 smallZ.write(*this);
11341 }
11342
11347 void add(const char* name, size_t nameLen, const AColor& value) {
11348 appendString(name, nameLen);
11349
11350 byte attrType = binUserAttributeType_acolor;
11351 byte writeSize = sizeof(byte);
11352
11353 const SmallFloat smallR(value.color.r, attrType, binUserAttributeFlag_small, writeSize);
11354 const SmallFloat smallG(value.color.g, attrType, binUserAttributeFlag_smallY, writeSize);
11355 const SmallFloat smallB(value.color.b, attrType, binUserAttributeFlag_smallZ, writeSize);
11356 const SmallFloat smallA(value.alpha, attrType, binUserAttributeFlag_smallA, writeSize);
11357
11358 resize(writeSize);
11359
11360 write(attrType);
11361
11362 smallR.write(*this);
11363 smallG.write(*this);
11364 smallB.write(*this);
11365 smallA.write(*this);
11366 }
11367
11373 void add(const char* name, size_t nameLen, const char* value, size_t valueLen) {
11374 appendString(name, nameLen);
11375
11376 resize(1);
11377 write(binUserAttributeType_string);
11378
11379 appendString(value, valueLen);
11380 }
11381
11384 void close() {
11385 resize(1);
11386 write('\0');
11387 }
11388
11390 size_t getNumBytes() const {
11391 return index;
11392 }
11393
11395 bool hasData() const {
11396 // Close will write one termination char '\0'.
11397 // Having only name also doesn't make sense.
11398 return index > 2;
11399 }
11400
11403 IntList toIntList() {
11404 resize(1);
11405 write('\0'); // finalize attributes
11406
11407 index = 0;
11408 IntList temp;
11409 temp.swap(data);
11410 return temp;
11411 }
11412
11415 std::string toString() const {
11416 const byte* bytes = reinterpret_cast<const byte*>(data.data());
11417 size_t count = getNumBytes();
11418 std::string chars(count * 3 + 2, '\0');
11419
11420 for (size_t i = 0; i < count; ++i) {
11421 byte b = bytes[i];
11422 chars[3 * i + 0] = getHexChar(b >> 4);
11423 chars[3 * i + 1] = getHexChar(b & 0xf);
11424 chars[3 * i + 2] = ' ';
11425 };
11426 chars[3 * count + 0] = '0';
11427 chars[3 * count + 1] = '0';
11428
11429 return chars;
11430 }
11431
11432 private:
11433 // If float value could be represented as an int (values like 0.0, 1.0, 42.0)
11434 // and fits in int8 [SCHAR_MIN, SCHAR_MAX] it'll be written as a single byte
11435 // setting one of BinUserAttributeTypeFlags "small" flags.
11436 struct SmallFloat {
11437 SmallFloat(float value, byte& attrType, byte smallFlag, byte& writeSize)
11438 : value(value)
11439 , smallFloat(0)
11440 , isSmall(false)
11441 {
11442 const float roundValue = roundf(value);
11443 const bool almostInt = std::abs(value - roundValue) < 1e-6f;
11444 isSmall = almostInt && roundValue >= -128 && roundValue <= 127;
11445 if (!isSmall) {
11446 writeSize += sizeof(float);
11447 }
11448 else {
11449 smallFloat = sbyte(roundValue);
11450 attrType |= (smallFlag << 4);
11451 writeSize += sizeof(sbyte);
11452 }
11453 }
11454
11455 // Get original float value.
11456 float getFloat() const { return value; }
11457
11458 // Get value that fits in int8.
11459 sbyte getSmallFloat() const { return smallFloat; }
11460
11461 // Check if value could be stored as int8.
11462 bool getIsSmall() const { return isSmall; }
11463
11464 // Write value to buffer.
11465 void write(BinUserAttributesWriter& buf) const {
11466 if (isSmall)
11467 buf.write(smallFloat);
11468 else
11469 buf.write(value);
11470 }
11471
11472 private:
11473 const float value;
11474 sbyte smallFloat;
11475 bool isSmall;
11476 };
11477
11478 inline static char getHexChar(byte b) {
11479 return b < 10 ? b + '0' : b - 10 + 'A';
11480 }
11481
11482 // Append string bytes along with null-terminator.
11483 // @param name String value.
11484 // @param nameLen String value length (without null-terminator).
11485 void appendString(const char* name, size_t nameLen) {
11486 // We'll write name along with '\0' terminator.
11487 resize(nameLen + 1);
11488 memcpy(ptr(), name, nameLen);
11489 index += nameLen;
11490 *(ptr()) = 0;
11491 ++index;
11492 }
11493
11494 // Resize container, write bytes_count bytes, increment index.
11495 void append(const void* bytes, size_t bytes_count) {
11496 resize(bytes_count);
11497 memcpy(ptr(), bytes, bytes_count);
11498 index += bytes_count;
11499 }
11500
11501 // Resize container, write data, increment index.
11502 template<typename T>
11503 void append(const T& value) {
11504 resize(sizeof(T));
11505 write(value);
11506 }
11507
11508 // Write data, increment index. Container must have been resized beforehand.
11509 template<typename T>
11510 void write(const T& value) {
11511 *reinterpret_cast<T*>(ptr()) = value;
11512 index += sizeof(T);
11513 }
11514
11515 // Resize serialization buffer to fit extra bytes.
11516 // @param bytesToAdd Bytes count to accomodate.
11517 void resize(size_t bytesToAdd) {
11518 size_t newSize = index + bytesToAdd;
11519 if (newSize > data.size() * sizeof(int)) {
11520 data.resize((newSize + sizeof(int) - 1) / sizeof(int));
11521 }
11522 }
11523
11524 // Return the current data byte pointer.
11525 byte* ptr() {
11526 return reinterpret_cast<byte*>(data.data()) + index;
11527 }
11528
11529 // Serialization storage.
11530 std::vector<int> data;
11531
11532 // Byte index inside data, size in bytes.
11533 size_t index;
11534 };
11535
11536 inline std::ostream& operator <<(std::ostream& stream, const BinUserAttributesWriter& writer) {
11537 stream << writer.toString();
11538 return stream;
11539 }
11540} // namespace VRay
11541
11542#ifdef VRAY_SDK_INTEROPERABILITY
11543#include "vrayinterop.hpp"
11544#endif
11545
11546#include "_vraysdk_implementation.hpp"
11547
11548#ifdef _MSC_VER
11549# pragma warning(pop) // 4201
11550#endif // _MSC_VER
11551
11552#endif // _VRAY_SDK_HPP_
The raw memory contents of a BMP image.
Definition: vraysdk.hpp:555
Base class for LocalJpeg, LocalPng, LocalBmp. Can't be instantiated.
Definition: vraysdk.hpp:10238
bool saveToFile(const char *fileName) const
Write the data to disk.
size_t getLen() const
Returns size of image data in bytes.
Definition: vraysdk.hpp:10261
bool saveToFile(const std::string &fileName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: vraysdk.hpp:10269
void * getBuf() const
Returns a pointer to the image data.
Definition: vraysdk.hpp:10256
Definition: vraysdk.hpp:4016
Definition: vraysdk.hpp:2917
unsigned getGaussianPrimitivesCount() const
Get the number of Gaussian primitives - this is the unit Gaussian (mean [0,0,0], sd [1,...
Color getAverageColor(unsigned index) const
Get the average Color of the Gaussian primitive with the given index.
Vector getPosition(unsigned index) const
Get the position of the Gaussian primitive with the given index.
const Box & getPreviewBoundingBox() const
Get the preview bounding box of the model, calculated using the Gaussian primitive positions only.
Definition: vraysdk.hpp:2935
A group of utility methods related to variuos geometry source plugins.
Definition: vraysdk.hpp:9418
static bool readGaussianData(const Plugin &gaussianPlugin, GaussianReadData &readData)
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 o...
static bool readScatterData(const Plugin &scatterPlugin, std::vector< Transform > &transforms, IntList &topo)
static bool readGaussianData(const std::string &fileName, GaussianReadData &readData)
static bool readScatterPreset(const ScatterReadParams &params, Plugin(*callback)(VRayRenderer &, const char *assetId, Vector importPosition, void *userData)=0, const void *userData=nullptr)
static bool readGeomHairData(const Plugin &nodePlugin, VectorList &vertices, IntList &lengths, int countHint=0)
Definition: vraysdk.hpp:10224
The raw memory contents of a JPEG image.
Definition: vraysdk.hpp:502
A group of utility methods related to variuos light source plugins.
Definition: vraysdk.hpp:9464
static bool readLuminaireFieldPreviewData(const Plugin &luminairePlugin, LuminaireFieldReadPreviewData &readData)
static bool readLuminaireFieldPreviewData(const std::string &fileName, LuminaireFieldReadPreviewData &readData)
static bool readIESPreviewData(const Plugin &lightPlugin, VectorList &vertices, IntList &indices)
static bool readIESPreviewData(const std::string &fileName, VectorList &vertices, IntList &indices)
Definition: vraysdk.hpp:10312
LocalBmp(const VRayImage *img, bool preserveAlpha=false, bool swapChannels=false)
Definition: vraysdk.hpp:10319
LocalBmp(const VRayImage *img, const VRayRenderer &renderer, bool preserveAlpha=false, bool swapChannels=false)
Same as the other constructor. The renderer is used to log error messages.
Definition: vraysdk.hpp:10324
A wrapper around JPEG data in memory. It's meant to be stack allocated to free the data when done.
Definition: vraysdk.hpp:10280
LocalJpeg(const VRayImage *img, const VRayRenderer &renderer, int quality=0)
Same as the other constructor. The renderer is used to log error messages.
Definition: vraysdk.hpp:10291
LocalJpeg(const VRayImage *img, int quality=0)
Definition: vraysdk.hpp:10286
Definition: vraysdk.hpp:10296
LocalPng(const VRayImage *img, bool preserveAlpha=false)
Definition: vraysdk.hpp:10302
LocalPng(const VRayImage *img, const VRayRenderer &renderer, bool preserveAlpha=false)
Same as the other constructor. The renderer is used to log error messages.
Definition: vraysdk.hpp:10307
A variation of VRayImage to be created on the stack so that the image gets auto-deleted.
Definition: vraysdk.hpp:777
Definition: vraysdk.hpp:3590
std::vector< int > getConvexHullTriangles() const
Get the full array of the vertex indices of the convex hull in consecutive triplets.
std::vector< Vector > getConvexHullVertices() const
Get the full array of the vertices of light's convex hull.
float getScale() const
Get the relative scale of the luminaire geometry upon export. Should be 1.0 for cm.
Box getBoundingBox() const
Get the bounding box of the luminaire.
bool isValid() const
Checks if the object is valid.
Wrapper around a piece of heap memory. Takes care of calling the proper deallocating function.
Definition: vraysdk.hpp:483
Definition: vraysdk.hpp:4462
bool setArray(const char *propertyName, const int data[], size_t count, double time=TiMe::Default())
void swap(Plugin &plugin) noexcept
Swaps the underlying scene object instance reference and associated renderer reference.
Transform getTransform(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as Transform.
AColor getAColor(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as AColor.
double getDouble(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as double.
const char * getName() const
VectorList getVectorList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as VectorList.
bool isEmpty() const noexcept
Color getColor(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as Color.
PropertyState getPropertyState(const char *propertyName) const
Matrix getMatrix(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as Matrix.
Value getValue(const char *propertyName, double time=TiMe::Default()) const
PluginRefT< Plugin > getPlugin(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as a Plugin reference.
std::string getValueAsString(const char *propertyName, double time=TiMe::Default()) const
PluginMeta getMeta() const
unsigned long long getIntegerID() const noexcept
Returns the ID of the plugin instance. The ID is unique per scene contained in a VRayRenderer instanc...
std::string toString() const
Returns a string representation of the plugin which currently is the name of the plugin.
PluginCategories getCategories() const
TransformList getTransformList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as TransformList.
bool setValue(const char *propertyName, const bool value, double time=TiMe::Default())
FloatList getFloatList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as FloatList.
bool operator==(const Plugin &plugin) const noexcept
Returns true if both Plugins belong to the same renderer and point to the same scene object instance.
bool isNotEmpty() const noexcept
PluginTypeId getTypeId() const noexcept
Returns the type id of this plugin as long.
const char * getType() const
Returns the type of this plugin as string.
bool getBool(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as bool.
StringList getStringList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as StringList.
PropertyState
Definition: vraysdk.hpp:4493
@ Animated
Non-animated user value is explicitly set, even if its value coincides with the default one.
@ Default
Wrong property name or invalid plugin.
@ NotAnimated
Not set, V-Ray will use the default value.
bool operator!=(const Plugin &plugin) const noexcept
Returns false if both Plugins belong to the same renderer and point to the same scene object instance...
PropertyRuntimeMeta getPropertyRuntimeMeta(const char *propertyName) const
std::string getString(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as string.
Vector getVector(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as Vector.
ValueList getValueList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as ValueList. Works only if it really is a generic list.
int getInt(const char *propertyName, double time=TiMe::Default()) const
PluginList getPluginList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as PluginList.
bool isPropertyAnimated(const char *propertyName) const
Plugin() noexcept
Default construct an invalid Plugin - not referencing a V-Ray scene object.
Definition: vraysdk.hpp:4501
ColorList getColorList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as ColorList.
std::vector< double > getKeyframeTimes(const char *propertyName) const
IntList getIntList(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as IntList.
bool setName(const char *newName)
Plugin & operator=(const Plugin &plugin) noexcept
Assign from another Plugin. They both point to the same underlying object. This is like having T& a=x...
VRayRenderer * getRenderer() const noexcept
Return the renderer this Plugin is associated with, can be null on empty plugins.
float getFloat(const char *propertyName, double time=TiMe::Default()) const
Returns the value of a property as float.
Plugin(const Plugin &plugin) noexcept
Copy construct from another Plugin. They both point to the same underlying object....
bool setValueAsString(const char *propertyName, const char *value)
bool isValid() const
Provides static meta information about a specific Plugin type.
Definition: vraysdk.hpp:10131
std::string getDescription() const
Returns a description for this render plugin type. May be empty.
PluginCategories getCategories() const
Returns all the plugin categories this plugin type belongs to, such as being a Light or a Material,...
bool isValid() const
Checks if the object is valid.
Definition: vraysdk.hpp:10173
PluginTypeId getTypeId() const
Returns the type id of the plugin.
Definition: vraysdk.hpp:10183
PropertyMeta getPropertyMeta(const char *propertyName) const
Returns an object used to obtain meta information about a plugin property.
Definition: vraysdk.hpp:10199
std::vector< std::string > getPropertyNames() const
Returns the names of all properties.
Definition: vraysdk.hpp:10188
GPUPluginSupport getGPUSupport() const
Returns to what extent the plugin is supported by V-Ray GPU.
const char * getType() const
Returns the type (name of the class) of the plugin or nullptr on ivalid type.
Definition: vraysdk.hpp:10178
bool checkPluginUIGuides(std::string &errMsg) const
PropertyMeta getPropertyMeta(const std::string &propertyName) const
Returns an object used to obtain meta information about a plugin property.
Definition: vraysdk.hpp:10204
const char * getDeprecation() const
Returns a deprecation string for this render plugin type. May be nullptr!
Definition: vraysdk.hpp:5280
bool operator==(const Plugin &plugin) const noexcept
Returns true if both Plugins point to the same scene object instance.
PluginRefT(const PluginRefT< T > &plugin) noexcept
Copy construct from another PluginRef type.
Definition: vraysdk.hpp:5307
PluginRefT(const PluginRefT &plugin) noexcept
Copy construct from another PluginRef.
Definition: vraysdk.hpp:5303
PluginRefT() noexcept
Default construct an invalid PluginRef - not referencing a V-Ray scene object.
Definition: vraysdk.hpp:5297
bool isOutputValid() const noexcept
Returns true if this PluginRef references a valid Plugin output (including the default one).
Definition: vraysdk.hpp:5332
PluginRefT(const Plugin &plugin, const char *outPropertyName)
Construct from Plugin and output property.
PluginRefT(const Plugin &plugin) noexcept
Construct from another Plugin.
Definition: vraysdk.hpp:5300
void swap(PluginRefT &plugin) noexcept
Swaps the underlying scene object instance reference along with its output and associated renderer re...
PluginRefT & operator=(const PluginRefT< T > &plugin) noexcept
Assign from another PluginRef type. They both point to the same underlying object....
const char * getOutputName() const
std::string toString() const
Returns a string representation of the plugin reference of the form "pluginName::outputPropertyName".
bool operator==(const PluginRefT< T > &plugin) const noexcept
Returns true if both PluginRefs point to the same scene object instance and reference the same output...
Definition: vraysdk.hpp:5358
PluginRefT(const T &plugin, const char *outPropertyName)
Construct from Plugin and output property.
bool operator==(const PluginRefT< Plugin > &plugin) const noexcept
Returns true if both PluginRefTs point to the same scene object instance and reference the same outpu...
std::string toString() const
Returns a string representation of the plugin reference of the form "pluginName::outputPropertyName".
bool isOutputValid() const noexcept
Returns true if this PluginRef references a valid Plugin output (including the default one).
Definition: vraysdk.hpp:5410
PluginRefT & operator=(const PluginRefT &plugin) noexcept
Assign from another PluginRefT. They both point to the same underlying object. This is like having T&...
PluginRefT(const T &plugin) noexcept
Construct from another Plugin.
Definition: vraysdk.hpp:5371
bool operator==(const PluginRefT &plugin) const noexcept
Returns true if both PluginRefTs point to the same scene object instance and reference the same outpu...
const char * getOutputName() const
PluginRefT() noexcept
Default construct an invalid PluginRef - not referencing a V-Ray scene object.
Definition: vraysdk.hpp:5368
bool operator==(const Plugin &plugin) const noexcept
Returns true if both Plugins point to the same scene object instance.
PluginRefT(const PluginRefT &plugin) noexcept
Copy construct from another PluginRef.
Definition: vraysdk.hpp:5374
void swap(PluginRefT &plugin) noexcept
Swaps the underlying scene object instance reference along with its output and associated renderer re...
The raw memory contents of a PNG image.
Definition: vraysdk.hpp:500
Definition: vraysdk.hpp:9384
Static meta information about a plugin property.
Definition: vraysdk.hpp:9954
Type getElementType() const
Returns the type of the property by definition or the type of the list elements when it's a typed lis...
Definition: vraysdk.hpp:10007
Type getType() const
Definition: vraysdk.hpp:10002
std::string getDescription() const
Returns a short description of this property. May be empty.
Definition: vraysdk.hpp:10017
GPUParamSupport getGPUSupport() const
Returns to what extent the property is supported by V-Ray GPU.
Definition: vraysdk.hpp:10046
std::string getUIGuides() const
Definition: vraysdk.hpp:10029
const char * getName() const
Returns the primary name of this property.
Definition: vraysdk.hpp:9993
int getElementsCount() const
Returns the number of elements for the property if it is a list and -1 otherwise.
Definition: vraysdk.hpp:9988
StringList getAliases() const
Returns a list of alias names of this property.
const char * getDeprecation() const
Returns a deprecation string for this property. May be nullptr!
Definition: vraysdk.hpp:10023
UIGuides getUIGuidesObject() const
Returns an object used to obtain meta information about a plugin property uiGuides.
Definition: vraysdk.hpp:10035
Value getDefaultValue() const
Extends PropertyMeta with type information only available at runtime for a specific property instance...
Definition: vraysdk.hpp:10052
RuntimeUIGuides getRuntimeUIGuidesObject() const
Returns an object used to obtain meta and dynamic information about a plugin property uiGuides.
Definition: vraysdk.hpp:10096
Type getRuntimeType() const
Get the current type of the property value. This can differ from the result of getType().
Definition: vraysdk.hpp:10081
int getRuntimeElementsCount() const
Return the current number of elements in a list property.
Definition: vraysdk.hpp:10076
A group of methods for reading data and creating V-Ray geometry proxies.
Definition: vraysdk.hpp:9493
static bool createMeshFile(const Plugin &geomMeshPlugin, const AnimatedTransform &animTransform, const ProxyCreateParams &params)
static bool readPreviewGeometry(const Plugin &proxyPlugin, VectorList &vertices, IntList &indices, int countHint=0)
static bool readPreviewHair(const Plugin &proxyPlugin, VectorList &vertices, IntList &lengths, int countHint=0)
static bool createMeshFile(const MeshFileData &data, const AnimatedTransform &animTransform, const ProxyCreateParams &params)
static bool readPreviewParticles(const Plugin &proxyPlugin, VectorList &positions, int countHint=0)
static bool readFullData(const ProxyReadParams &params, ProxyReadData &readData)
static bool createCombinedMeshFile(const std::vector< MeshFileData > &data, const std::vector< Transform > *transforms, const ProxyCreateParams &params)
static bool createCombinedMeshFile(const std::vector< MeshFileData > &data, const std::vector< AnimatedTransform > &animTransforms, const ProxyCreateParams &params)
static bool readPreviewData(const Plugin &proxyPlugin, ProxyReadData &readData)
static bool createMeshFile(const Plugin &geomMeshPlugin, const Transform *transform, const ProxyCreateParams &params)
static bool readPreviewParticles(const ProxyReadParams &params, VectorList &positions, int countHint=0)
static bool readPreviewGeometry(const ProxyReadParams &params, VectorList &vertices, IntList &indices, int countHint=0)
static bool readFullData(const Plugin &proxyPlugin, ProxyReadData &readData)
static bool createCombinedMeshFile(const std::vector< Plugin > &geomMeshPlugins, const std::vector< AnimatedTransform > &animTransforms, const ProxyCreateParams &params)
static bool readPreviewData(const ProxyReadParams &params, ProxyReadData &readData)
static bool createMeshFile(const MeshFileData &data, const Transform *transform, const ProxyCreateParams &params)
static bool createCombinedMeshFile(const std::vector< Plugin > &geomMeshPlugins, const std::vector< Transform > *transforms, const ProxyCreateParams &params)
static bool readPreviewHair(const ProxyReadParams &params, VectorList &vertices, IntList &lengths, int countHint=0)
Definition: vraysdk.hpp:2950
const std::vector< int > & getMaterialIDs() const
Get material IDs for each consecutive triangle in the full mesh.
Definition: vraysdk.hpp:2991
const std::vector< int > & getParticleVerticesStartIndices() const
Get the array of indices, where the particle vertices data starts - the i-th particle voxel starts at...
Definition: vraysdk.hpp:3159
std::vector< Vector > getHairVoxelVelocities(int hairVoxelIndex) const
Get velocities array of the voxel 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 vox...
Definition: vraysdk.hpp:3132
ObjectInfo getMeshObjectInfo(int meshIndex) const
Get the object info of the geometry 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 vo...
const int * getUVValueIndices(int setIndex) const
Get an index array for the coordinates returned by getUVValues(). The data is owned and freed by this...
std::vector< int > getArrayOfLengths(const int *startIndices, int elementsCount, int objectCount, int uvSetsCount) const
const std::vector< Box > & getParticleVoxelsBBoxes() const
Get the array of bounding boxes of all particle voxels.
Definition: vraysdk.hpp:3224
Box getHairVoxelBBox(int hairVoxelIndex) const
Get bounding box of the hair voxel with the given index.
int getShadersCount() const
Get the number of available shader (material) name/ID pairs.
int getHairObjectInfosCount() const
Get the number of hair objects with object info. A hair object contains 1 or more hair voxels.
const std::vector< Box > & getGeometryVoxelsBBoxes() const
Get the array of bounding boxes of all geometry voxels.
Definition: vraysdk.hpp:3218
const std::vector< int > & getVoxelVerticesStartIndices() const
Get the array of indices, where the voxel vertices data starts - the i-th voxel starts at vertices[vo...
Definition: vraysdk.hpp:3090
const std::vector< Vector > & getUVValues() const
Get the full array of UVW 3-tuples.
Definition: vraysdk.hpp:3135
const std::vector< float > & getHairWidths() const
Get the full array of the hair geometry widths.
Definition: vraysdk.hpp:3063
std::vector< int > getVoxelMaterialIDs(int voxelIndex) const
Get materialIDs array of the voxel with the given index.
int getVoxelInfoObjectsCount() const
Get the number of geometry + hair + particle objects, which have voxel info.
const std::vector< Bool > & getVoxelInfoFlipNormals() const
Get an array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be f...
Definition: vraysdk.hpp:3242
VoxelInfo getParticleVoxelInfo(int meshIndex) const
Get the voxel info of the particle object with the given index.
const std::vector< Box > & getHairVoxelsBBoxes() const
Get the array of bounding boxes of all hair voxels.
Definition: vraysdk.hpp:3221
std::vector< Vector > getVoxelVelocities(int voxelIndex) const
Get velocities array of the voxel with the given index.
VoxelInfo getMeshVoxelInfo(int meshIndex) const
Get the voxel info of the geometry object with the given index.
int getGeometryVoxelsCount() const
Get the number of all geometry voxels. A geometry object contains 1 or more geometry voxels.
const std::vector< int > & getHairVerticesPerStrand() const
Get the full array of the hair strands length data (The i-th strand has hairVerticesPerStrand[i] cons...
Definition: vraysdk.hpp:3060
const std::vector< Vector > & getNormals() const
Get full mesh normal vectors array.
Definition: vraysdk.hpp:2985
const std::vector< Color > & getVoxelInfoWireColor() const
Get an array of diffuse (wire) colors - 1 Color per mesh object.
Definition: vraysdk.hpp:3236
const std::vector< int > & getHairVelocitiesStartIndices() const
Get the array of indices, where the hair velocities data starts - the i-th hair voxel starts at hairV...
Definition: vraysdk.hpp:3156
const std::vector< Vector > & getVelocities() const
Get velocity vectors for each vertex in the vertex array.
Definition: vraysdk.hpp:2997
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 star...
Definition: vraysdk.hpp:3129
int getLengthFromStartIndex(int objectIndex, int setIndex, const int *startIndices, int elementsCount, int objectCount, int uvSetsCount) const
const std::vector< int > & getParticleWidthsStartIndices() const
Get the array of indices, where the particle widths data starts - the i-th particle voxel starts at p...
Definition: vraysdk.hpp:3162
std::vector< float > getParticleVoxelWidths(int particleVoxelIndex) const
Get widths array of the particle voxel with the given index.
std::string getUVSetName(int setIndex) const
Get the name of the UV set with the given index.
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...
const std::vector< int > & getHairVerticesStartIndices() const
Get the array of indices, where the hair vertices data starts - the i-th hair voxel starts at hairVer...
Definition: vraysdk.hpp:3147
VoxelInfo getHairVoxelInfo(int meshIndex) const
Get the voxel info of the hair object with the given index.
size_t getUVValuesCount(int setIndex) const
Get the length of the array returned by getUVValues().
int getHairVoxelsCount() const
Get the number of all hair voxels. A hair object contains 1 or more hair voxels.
const std::vector< int > & getVoxelVertexIndicesStartIndices() const
Get the array of indices, where the voxel vertex indices data starts - the i-th voxel starts at indic...
Definition: vraysdk.hpp:3093
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 t...
std::vector< int > getVoxelNormalIndices(int voxelIndex) const
Get normal indices array of the voxel 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).
Definition: vraysdk.hpp:2988
size_t getUVValueIndicesCount(int setIndex) const
Get the length of the array returned by getUVValueIndices().
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 ha...
int getMeshObjectInfosCount() const
Get the number of geometry objects with object info. A geometry object contains 1 or more geometry vo...
ObjectInfo getHairObjectInfo(int meshIndex) const
Get the object info of the hair object with the given index.
std::string getShaderName(int shaderIndex) const
Get the name of the shader (material) with the given index.
int getShaderID(int shaderIndex) const
Get the ID of the shader (material) with the given index. Returns -1 if unavailable.
std::vector< Vector > getVoxelUVValues(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 > & getHairVerticesPerStrandStartIndices() const
Get the array of indices, where the hair strands data starts - the strands data of the i-th hair voxe...
Definition: vraysdk.hpp:3150
ObjectInfo getParticleObjectInfo(int meshIndex) const
Get the object info of the particle object with the given index.
Box getGeometryVoxelBBox(int voxelIndex) const
Get bounding box of the geometry voxel with the given index.
int getParticleVoxelsCount() const
Get the number of all particle voxels. A particle object contains 1 or more particle voxels.
const std::vector< int > & getVoxelNormalsStartIndices() const
Get the array of indices, where the voxel normals data starts - the i-th voxel starts at normals[voxe...
Definition: vraysdk.hpp:3102
std::vector< Vector > getVoxelNormals(int voxelIndex) const
Get normals array of the voxel with the given index.
const std::vector< int > & getUVValueIndices() const
Get the full array of UVW per-vertex indices.
Definition: vraysdk.hpp:3138
std::vector< Vector > getHairVoxelVertices(int hairVoxelIndex) const
Get vertex array of the hair voxel with the given index.
int getLengthFromStartIndex(int objectIndex, const int *startIndices, int elementsCount, int objectCount) const
const std::vector< float > & getParticleWidths() const
Get the full array of the particle geometry widths.
Definition: vraysdk.hpp:3069
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 sm...
Definition: vraysdk.hpp:3239
int getAllVoxelsCount() const
Get the number of all voxels (geometry + hair + particle). Useful when the proxy file contains voxels...
const std::vector< int > & getParticleVelocitiesStartIndices() const
Get the array of indices, where the particle velocities data starts - the i-th particle voxel starts ...
Definition: vraysdk.hpp:3165
std::vector< Vector > getVoxelVertices(int voxelIndex) const
Get the vertex 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 normal...
Definition: vraysdk.hpp:3105
const std::vector< int > & getHairWidthsStartIndices() const
Get the array of indices, where the hair widths data starts - the i-th hair voxel starts at hairWidth...
Definition: vraysdk.hpp:3153
std::vector< int > getVoxelVertexIndices(int voxelIndex) const
Get the vertex indices array of the voxel with the given index.
const std::vector< Vector > & getParticleVertices() const
Get the full array of the particle geometry vertices.
Definition: vraysdk.hpp:3066
const std::vector< int > & getVoxelVelocitiesStartIndices() const
Get the array of indices, where the voxel velocities data starts - the i-th voxel starts at velocitie...
Definition: vraysdk.hpp:3120
std::vector< Vector > getParticleVoxelVertices(int particleVoxelIndex) const
Get vertex array of the particle voxel with the given index.
std::vector< Vector > getParticleVoxelVelocities(int particleVoxelIndex) const
Get velocities array of the particle voxel with the given index.
const std::vector< int > & getVertexIndices() const
Get indices in the vertex array for each triangle (every 3 consecutive ints are one triangle).
Definition: vraysdk.hpp:2982
Box getParticleVoxelBBox(int particleVoxelIndex) const
Get bounding box of the particle voxel with the given index.
ProxyReadData(int flags=MESH_ALL)
Pass different flags (or call setFlags later) if you want to limit the read data.
void setFlags(int flags)
Pass a combination of ReadFlags for the parts of the proxy data you need to read.
Definition: vraysdk.hpp:2976
const std::vector< Vector > & getVertices() const
Get full mesh vertex positions array.
Definition: vraysdk.hpp:2979
const std::vector< int > & getVoxelMaterialIDsStartIndices() const
Get the array of indices, where the voxel materialIDs data starts - the i-th voxel starts at material...
Definition: vraysdk.hpp:3111
std::vector< int > getHairVoxelVerticesPerStrand(int hairVoxelIndex) const
Get the hair strands length data of the hair voxel with the given index.
const Vector * getUVValues(int setIndex) const
Get an array of UVW mapping coordinates for the given mapping channel index. The data is owned and fr...
std::vector< int > getArrayOfLengths(const int *startIndices, int elementsCount, int objectCount) const
const std::vector< int > & getEdgeVisibility() const
Get an array of edge visibility flags, each integer in the array has edge visibility information for ...
Definition: vraysdk.hpp:2994
const std::vector< Vector > & getHairVertices() const
Get the full array of the hair geometry vertices.
Definition: vraysdk.hpp:3057
int getUVSetsCount() const
Get the number of available UV data sets (mapping channels).
int getNumFrames() const
Get the number of all frames in the proxy file. Useful when checking whether the proxy file contains ...
Bool hasVelocityChannel() const
True, in case the currently read frame contains at least one of geometry/hair/particle velocity data....
std::vector< float > getHairVoxelWidths(int hairVoxelIndex) const
Get widths array of the hair voxel with the given index.
Helper class that wraps a plugin instance enabling a certain render element.
Definition: vraysdk.hpp:2395
PixelFormat
This describes the desired data format for getData().
Definition: vraysdk.hpp:2521
@ PF_RGBA_BIT16
4x2 bytes RGBA.
Definition: vraysdk.hpp:2535
@ PF_BW_BIT8
1-byte greyscale/integer.
Definition: vraysdk.hpp:2523
@ PF_RGBA_FLOAT
4x4 bytes float RGBA.
Definition: vraysdk.hpp:2537
@ PF_RGB_FLOAT
3x4 bytes float RGB.
Definition: vraysdk.hpp:2532
@ PF_BW_BIT16
2-byte greyscale/integer.
Definition: vraysdk.hpp:2524
@ PF_RGBA_HALF
4x2 bytes half-float RGBA.
Definition: vraysdk.hpp:2536
@ PF_RGB_BIT16
3x2 bytes RGB.
Definition: vraysdk.hpp:2530
@ PF_BW_BIT32
4-byte greyscale/integer.
Definition: vraysdk.hpp:2525
@ PF_BW_FLOAT
4-byte float greyscale.
Definition: vraysdk.hpp:2527
@ PF_RGB_BIT8
3x1 bytes RGB.
Definition: vraysdk.hpp:2529
@ PF_RGBA_BIT8
4x1 bytes RGBA.
Definition: vraysdk.hpp:2534
@ PF_RGB_HALF
3x2 bytes half-float RGB.
Definition: vraysdk.hpp:2531
@ PF_BW_HALF
2-byte half-float greyscale.
Definition: vraysdk.hpp:2526
Plugin getPlugin() const
Get the plugin instance in the scene that enables this render element. Might be invalid for special c...
VRayImage * getImage(const ImageRegion *rgn=NULL, int layerIndex=0) const
RenderElement()
Default construct an invalid object.
Definition: vraysdk.hpp:2594
size_t getDataIntoBuffer(const GetDataOptions &options, void *data) const
DataIntent
Definition: vraysdk.hpp:2540
@ DI_INTENT_FILE
The data will be saved in a file, so we don't want color corrections applied.
Definition: vraysdk.hpp:2545
@ DI_INTENT_VIEWPORT_IPR
Image will be displayed in viewport, color corrections should be applied with the exception of sRGB a...
Definition: vraysdk.hpp:2561
@ DI_INTENT_FILE_SRGB
Same as IntentFile, but with forced sRGB/Gamma correction.
Definition: vraysdk.hpp:2558
@ DI_INTENT_DISPLAY
The data will be shown on a display, so we want color corrections to be applied.
Definition: vraysdk.hpp:2542
@ DI_INTENT_FILE_NO_COLOR_CORRECTIONS
Definition: vraysdk.hpp:2555
@ DI_INTENT_RAW
Definition: vraysdk.hpp:2550
static void releaseData(void *data)
Call this to release data allocated by the getData method.
BinaryFormat
Render channel binary format / storage data type.
Definition: vraysdk.hpp:2511
@ BF_FLOAT
A single float number (e.g. z-depth).
Definition: vraysdk.hpp:2512
@ BF_3FLOAT_SIGNED
3 signed float numbers (e.g. surface normals).
Definition: vraysdk.hpp:2516
@ BF_4FLOAT
4 float numbers (e.g. RGBA color).
Definition: vraysdk.hpp:2517
@ BF_3FLOAT
3 float numbers (e.g. RGB color).
Definition: vraysdk.hpp:2513
@ BF_2FLOAT
2 signed float numbers (e.g. uv coordinates or pixel screen velocity).
Definition: vraysdk.hpp:2514
@ BF_INT
A single integer number (e.g. render ID, material ID etc).
Definition: vraysdk.hpp:2515
PixelFormat getDefaultPixelFormat() const
Get the default format used by the getData method for this render element.
Definition: vraysdk.hpp:2615
size_t getData(void **data, const GetDataOptions &options) const
std::string getMetadata() const
Get render element metadata. Currently works only for Cryptomatte render element and returns manifest...
VRayImage * getImage(const GetImageOptions &options, int layerIndex=0) const
std::string getName() const
Get the display name of this render element.
Definition: vraysdk.hpp:2600
BinaryFormat getBinaryFormat() const
Get the binary format of pixels in this render element.
Definition: vraysdk.hpp:2610
Type
The render channal types/aliases are used to identify some common channels.
Definition: vraysdk.hpp:2400
@ REFLECT_ALPHA
Used by matte materials to store the alpha of the reflections.
Definition: vraysdk.hpp:2455
@ VRMTL_SHEEN_GLOSSINESS
VRayMtl sheen glossiness parameter.
Definition: vraysdk.hpp:2483
@ REALCOLOR
Real color VFB channel.
Definition: vraysdk.hpp:2429
@ COLOR
RGB VFB channel. This is always created by V-Ray and there can't be multiple instances....
Definition: vraysdk.hpp:2434
@ CRYPTOMATTE
Used for Cryptomatte render channel output.
Definition: vraysdk.hpp:2470
@ NODEID
Node ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2420
@ RAW_COAT_REFLECTION
Raw coat indirect reflection VFB channel.
Definition: vraysdk.hpp:2487
@ REFLECT
Reflection VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2405
@ VRMTL_COAT_COLOR
VRayMtl coat highlight color (coat filter uninfluenced by Fresnel weight, reflection and refraction c...
Definition: vraysdk.hpp:2486
@ EXTRA_TEX_FLOAT
A single texture override is applied to the whole scene (e.g. Dirt)
Definition: vraysdk.hpp:2504
@ LAST
not a type, just a delimiter
Definition: vraysdk.hpp:2493
@ RENDERTIME
Per-pixel render time.
Definition: vraysdk.hpp:2469
@ DRBUCKET
A channel that keeps track of which DR server rendered a particular bucket (it is a Color buffer that...
Definition: vraysdk.hpp:2448
@ NOISE_LEVEL
The noise level as estimated by the Adaptive and Progressive image samplers. Used for denoising purpo...
Definition: vraysdk.hpp:2460
@ RAW_REFLECTION
Raw reflection VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2424
@ BACKGROUND
Background VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2431
@ VRMTL_REFRACTGLOSS
A VRayMtl reflection glossiness VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2452
@ ZDEPTH
Z-Depth VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2421
@ SHEEN_FILTER
Sheen filter VFB channel.
Definition: vraysdk.hpp:2482
@ COAT_FILTER
Coat filter VFB channel.
Definition: vraysdk.hpp:2488
@ TOON
Toon effect channel.
Definition: vraysdk.hpp:2467
@ MTLRENDERID
Mtl render ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2458
@ DENOISED
A denoised version of the image. Adding this render element enables denoising.
Definition: vraysdk.hpp:2462
@ MATERIAL_SELECT
Material select.
Definition: vraysdk.hpp:2498
@ REFRACTION_FILTER
Refraction filter VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2426
@ COAT_REFL_ALPHA
Used by matte materials to store the alpha of the coat reflections.
Definition: vraysdk.hpp:2485
@ NONE
Unspecified channel.
Definition: vraysdk.hpp:2401
@ NORMALS
Normals VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2430
@ LIGHT_SELECT
Link this in the channels parameters of your lights.
Definition: vraysdk.hpp:2472
@ SAMPLERATE
The sample rate for the image samplers.
Definition: vraysdk.hpp:2444
@ SHEEN_REFLECTION
Sheen indirect reflection VFB channel.
Definition: vraysdk.hpp:2490
@ RAWGI
Raw GI VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2413
@ COAT_REFLECTION
Raw coat indirect reflection VFB channel.
Definition: vraysdk.hpp:2491
@ COVERAGE
Pixel coverage.
Definition: vraysdk.hpp:2497
@ RAW_REFRACTION
Raw refraction VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2427
@ OBJECT_SELECT
Selects by object/material ID.
Definition: vraysdk.hpp:2501
@ LIGHTING_ANALYSIS
The lighting analysis overlay.
Definition: vraysdk.hpp:2471
@ BUMPNORMALS
The normals modified with bump map. This channel must be generated by shaders.
Definition: vraysdk.hpp:2442
@ LIGHT_MIX
Channel for Interactive Light Mix.
Definition: vraysdk.hpp:2475
@ MULTIMATTE_ID
RGB matte using material IDs.
Definition: vraysdk.hpp:2500
@ SHADEMAP_EXPORT
A channel that keeps the fragment coordinates in camera space.
Definition: vraysdk.hpp:2454
@ VRMTL_METALNESS
VRayMtl metalness parameter.
Definition: vraysdk.hpp:2474
@ SHADOW
Shadow VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2408
@ REFLECTION_FILTER
Reflection filter VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2423
@ SPECULAR
Specular VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2409
@ MATTESHADOW
Matte shadow channel where full shadows are white and areas not in shadow are black; essentially this...
Definition: vraysdk.hpp:2437
@ ALPHA
Alpha VFB channel. This is always created by V-Ray and there can't be multiple instances....
Definition: vraysdk.hpp:2433
@ EXTRA_TEX_INT
A single texture override is applied to the whole scene (e.g. Dirt)
Definition: vraysdk.hpp:2503
@ CAUSTICS
Caustics VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2412
@ SHEEN_REFL_ALPHA
Used by matte materials to store the alpha of the sheen reflections.
Definition: vraysdk.hpp:2484
@ VRMTL_REFLECTHIGLOSS
A VRayMtl reflection hilight glossiness VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2451
@ GI
GI VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2411
@ RAWTOTALLIGHT
The raw total diffuse lighting (direct+indirect) falling on a surface. This channel is generated by V...
Definition: vraysdk.hpp:2440
@ VRMTL_REFLECTGLOSS
A VRayMtl reflection glossiness VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2450
@ VELOCITY
Velocity VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2417
@ WORLD_POSITION
The position in world space. Used for denoising purposes.
Definition: vraysdk.hpp:2461
@ RENDERID
Render ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2418
@ TOON_LIGHTING
Direct toon diffuse lighting.
Definition: vraysdk.hpp:2477
@ EXTRA_TEX
A single texture override is applied to the whole scene (e.g. Dirt)
Definition: vraysdk.hpp:2502
@ USER
User defined channel indices start from here.
Definition: vraysdk.hpp:2495
@ TOTALLIGHT
The total diffuse lighting (direct+indirect) falling on a surface. This channel is generated by V-Ray...
Definition: vraysdk.hpp:2439
@ MTLID
Mtl ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2419
@ TOON_SPECULAR
Direct toon specular lighting.
Definition: vraysdk.hpp:2478
@ DIFFUSE
Diffuse filter VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2404
@ WIRECOLOR
Wire color channel where each object appears with a solid color. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2436
@ VRMTL_COAT_GLOSSINESS
VRayMtl coat glossiness parameter.
Definition: vraysdk.hpp:2489
@ RAW_SHEEN_REFLECTION
Raw sheen indirect reflection VFB channel.
Definition: vraysdk.hpp:2481
@ SELFILLUM
Self-illumination VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2407
@ DEFOCUS_AMOUNT
Pixel blur, combination of DOF and moblur. Used for denoising purposes.
Definition: vraysdk.hpp:2464
@ MULTIMATTE
RGB matte for up to 3 objects.
Definition: vraysdk.hpp:2499
@ VRMTL_SHEEN_COLOR
VRayMtl sheen color parameter (sheen filter uninfluenced by Fresnel weight, reflection and refraction...
Definition: vraysdk.hpp:2480
@ LIGHTING
Lighting VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2410
@ RAWLIGHT
Raw light VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2414
@ EFFECTS_RESULT
Channel for all post effects.
Definition: vraysdk.hpp:2466
@ REFRACT
Refraction VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2406
@ RAWSHADOW
Raw shadow VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2415
@ ATMOSPHERE
Atmospheric effects channel.
Definition: vraysdk.hpp:2403
@ VRMTL_REFLECTIOR
A VRayMtl reflection IOR VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2457
@ SSS
A channel used for VRayFastSSS2 material sub-surface portion.
Definition: vraysdk.hpp:2446
@ WORLD_BUMPNORMAL
Normal with bump mapping in world space.
Definition: vraysdk.hpp:2463
Type getType() const
Get the type of the render element.
Definition: vraysdk.hpp:2605
This class groups methods related to management of render elements in the scene.
Definition: vraysdk.hpp:2684
RenderElement add(RenderElement::Type type, const char *displayName=nullptr, const char *instanceName=nullptr)
RenderElement get(RenderElement::Type type) const
size_t get(const std::string &name, const RenderElement::GetDataOptions &options, void *buf) const
std::vector< RenderElement > getAll(RenderElement::Type type) const
Definition: vraysdk.hpp:9934
bool isEnabled() const
bool isHidden() const
Definition: vraysdk.hpp:4246
bool getPreset(const char *filename, ScannedMaterialPreset &result) const
bool getInfo(const std::string &filename, std::string &info) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getPreset(const std::string &filename, ScannedMaterialPreset &result) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getInfo(const char *filename, std::string &info) const
Definition: vraysdk.hpp:10785
DataType getDataType() const
bool isValid() const
Definition: vraysdk.hpp:10804
VectorList getHairVertices(double time=0)
VRay::Box getMeshBoundingBox(double time=0)
Transform getTransform(double time=0) const
bool getVisibility(double time=0) const
int getMeshVerticesFast(const Vector *&vertices, double time=0)
std::string getDataTypeAsString() const
VRay::Box getWorldBoundingBox(double time=0)
const char * getTypeAsString() const
const char * getName() const
ObjectType getType() const
VectorList getMeshVertices(double time=0)
int getHairNumVerticesFast(const int *&lengths, double time=0)
const char * getNodeDataName() const
int getMeshFacesFast(const int *&faces, double time=0)
IntList getMeshFaces(double time=0)
int getHairVerticesFast(const Vector *&vertices, double time=0)
IntList getHairNumVertices(double time=0)
Definition: vraysdk.hpp:10595
float getMetersScale() const
Returns scene meters scale.
ScenePreview(const char *filename)
int getFrameEnd() const
Returns animation end frame.
UpAxis getUpAxis() const
Returns scene up axis.
bool operator!() const
Definition: vraysdk.hpp:10716
int getFrameStart() const
Returns animation start frame.
size_t getTotalFaces() const
Returns the total number of faces.
float getFramesScale() const
Returns scene frames scale.
int getFPS() const
Returns FPS.
float getPhotometricScale() const
Returns scene photometric scale.
float getSecondsScale() const
Returns scene seconds scale.
Object getObject(const char *name) const
ScenePreview(const char *filename, const Settings &settings)
std::vector< Object > getObjects(ObjectType objectType=ObjectTypeAll, DataType dataType=DataTypeAll) const
Definition: vraysdk.hpp:9641
bool hasOverriddenBy() const
bool hasOverride() const
bool hasAttribute(const AttributesType attributeType) const
UnitsType
Definition: vraysdk.hpp:9756
QuantityTypeEnum
Defines the quantity type that the parameter represents.
Definition: vraysdk.hpp:9736
@ Angle
Definition: vraysdk.hpp:9748
@ Distance
Definition: vraysdk.hpp:9743
std::string getValueOfOverriddenBy() const
bool isStringEnum() const
std::vector< std::string > getFileAssetNames() const
std::string getValueOfOverride(const int index) const
std::vector< std::string > getEnableDepends() const
std::vector< std::string > getStringEnumStrings() const
bool hasEnabledCondition() const
std::vector< EnumItem > getEnumStrings() const
std::string getRolloutName() const
GuideType
UIGuides supported property types.
Definition: vraysdk.hpp:9656
@ StartRollout
Definition: vraysdk.hpp:9692
@ Tier
Definition: vraysdk.hpp:9721
@ Hide
Indicates when the control should be hidden (not shown at all), depending on other plugin parameter v...
Definition: vraysdk.hpp:9723
@ GPUSupport
To what extent the property is supported by V-Ray GPU.
Definition: vraysdk.hpp:9718
@ QuantityType
Definition: vraysdk.hpp:9702
@ Enum
Definition: vraysdk.hpp:9659
@ Overrides
Definition: vraysdk.hpp:9716
@ MinValue
Limits the min value of the control.
Definition: vraysdk.hpp:9666
@ StringEnum
Definition: vraysdk.hpp:9682
@ SoftMinValue
Limits the max value of the control initially (the user can override it).
Definition: vraysdk.hpp:9697
@ StartTab
Definition: vraysdk.hpp:9695
@ Enable
Indicates when the control should be active (not grayed out), depending on other plugin parameter val...
Definition: vraysdk.hpp:9661
@ FileAssetNames
Definition: vraysdk.hpp:9685
@ SoftMaxValue
Limits the min value of the control initially (the user can override it).
Definition: vraysdk.hpp:9699
@ FileAssetOp
It is used to specify whether the file asset is going to be loaded or saved (or both) by V-Ray.
Definition: vraysdk.hpp:9687
@ Attributes
Definition: vraysdk.hpp:9679
@ Units
Definition: vraysdk.hpp:9673
@ FileAsset
Definition: vraysdk.hpp:9676
@ OverridenBy
Definition: vraysdk.hpp:9709
@ DisplayName
Definition: vraysdk.hpp:9664
@ SpinStep
Add a step hint to a slider.
Definition: vraysdk.hpp:9670
@ MaxValue
Limits the max value of the control.
Definition: vraysdk.hpp:9668
@ DefaultValue
Definition: vraysdk.hpp:9730
FileAssetOpType
Definition: vraysdk.hpp:9770
std::string getDisplayName() const
FileAssetOpType getFileAssetOp() const
bool hasHiddenCondition() const
std::vector< std::string > getHideDepends() const
TierType getTier() const
std::vector< float > getFloats(const GuideType type) const
int getCountOfOverrides() const
std::string getTabName() const
QuantityTypeEnum getQuantityType() const
float getFloat(const GuideType type) const
bool hasType(const GuideType type) const
UnitsType getUnits() const
std::vector< std::string > getFileAssetExts() const
GPUParamSupport getGPUSupportStatus() const
AttributesType
Used to specify some additional attributes for the parameter.
Definition: vraysdk.hpp:9777
TierType
Definition: vraysdk.hpp:9801
bool isEnum() const
Definition: vraysdk.hpp:10958
bool sample(const PluginRef &pluginRef, float u, float v, float &result)
This method is an overload of sample(). It should be used with plugins whose output is a floating poi...
bool setupRenderer(VRayRenderer &renderer)
IntList sampleAreaInt(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height)
bool releaseRenderer(VRayRenderer &renderer)
bool sample(const PluginRef &pluginRef, float u, float v, AColor &result)
FloatList sampleAreaFloat(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height)
VRayImage * sampleArea(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height)
bool sample(const PluginRef &pluginRef, float u, float v, int &result)
This method is an overload of sample(). It should be used with plugins whose output is an integer(int...
The raw memory contents of a serialized VFB state.
Definition: vraysdk.hpp:504
Definition: vraythrow.hpp:9
Definition: vraysdk.hpp:3815
void setOSMessageDispatching(bool enableMessageDispatching)
Definition: vraysdk.hpp:3848
void setGUIMessageProcessing(bool enableMessageProcessing)
Definition: vraysdk.hpp:3840
VRayInit(bool enableFrameBuffer)
Definition: vraysdk.hpp:3824
This class groups all VFB history related methods.
Definition: vraysdk.hpp:7163
void setTemporaryPath(const char *path)
void setWindowStatus(const bool status)
void setTemporaryPath(const std::string &path)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setPanelStatus(const bool status)
void setMaximumSize(const int maxSize)
This class encapsulates all VFB per-layer related methods.
Definition: vraysdk.hpp:6555
int setUserName(const std::string &layerName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyNames(std::vector< std::string > &propNames) const
int canDelete(bool &isDeletable) const
int setLayerPropertyBoolValue(const char *propName, const bool value)
int getUserName(std::string &layerName) const
int setLayerPropertyIntValue(const char *propName, const int value)
int setBlendMode(const VFBLayerProperty::BlendMode blendMode) const
LayerManager & getLayerManager() const
Return the layer manager this layer is associated with.
int setLayerPropertyColorValue(const char *propName, const Color &value)
int resetLayerPropertyToDefault(const char *propName)
int getLayerPropertyDisplayName(const char *propName, std::string &displayName) const
int getLayerPropertyDisplayName(const std::string &propName, std::string &displayName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyIntByEnumLabel(const char *propName, const char *label)
int getLayerPropertyStampRawStringValue(const std::string &propName, std::string &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyFloatValue(const std::string &propName, const float value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyStampRawStringValue(const char *propName, const char *value)
int isLayerPropertyReadOnly(const std::string &propName, bool &isReadOnly) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyFloatValue(const char *propName, float &value) const
Other type properties ------------------------------------—.
int getLayerPropertyStampFontDescValue(const char *propName, VFBLayerProperty::StampFontDesc &value) const
int setLayerPropertyIntByEnumLabel(const std::string &propName, const std::string &label)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyIntByEnumIndex(const std::string &propName, const int enumIndex)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyStringValue(const std::string &propName, const char *value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyFlags(const std::string &propName, int &flags) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getEnabled(bool &isEnabled) const
int setLayerPropertyStampRawStringValue(const std::string &propName, const char *value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setOpacity(const float opacity) const
int setLayerPropertyIntByEnumLabel(const std::string &propName, const char *label)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyColorValue(const std::string &propName, Color &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyBoolValue(const std::string &propName, const bool value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyStringValue(const std::string &propName, std::string &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyFloatValue(const std::string &propName, float &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyStringValue(const char *propName, const char *value)
int getLayerPropertyType(const std::string &propName, VFBLayerProperty::Type &type) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setUserName(const char *layerName)
int getLayerPropertyBoolValue(const std::string &propName, bool &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyFloatValue(const char *propName, const float value)
int getLayerPropertiesOfType(const VFBLayerProperty::Type type, std::vector< std::string > &values) const
int getLayerPropertyIntValue(const char *propName, int &value) const
int getLayerPropertyIntValue(const std::string &propName, int &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyColorValue(const char *propName, Color &value) const
int getLayerPropertyFlags(const char *propName, int &flags) const
Methods for manipulating the flags of a property ------------------------------------—.
int getClass(std::string &layerClass) const
int getLayerPropertyStampFontDescValue(const std::string &propName, VFBLayerProperty::StampFontDesc &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyIntEnumValues(const std::string &propName, std::vector< std::string > &values) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getChildrenCount(int &childrenCount) const
int getLayerPropertyBoolValue(const char *propName, bool &value) const
Integer properties ------------------------------------—.
int resetLayerPropertyToDefault(const std::string &propName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getBlendMode(VFBLayerProperty::BlendMode &blendMode) const
int getLayerPropertiesCount(int &propsCount) const
int isLayerPropertyReadOnly(const char *propName, bool &isReadOnly) const
int setLayerPropertyIntByEnumLabel(const char *propName, const std::string &label)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyStringValue(const char *propName, std::string &value) const
int getLayerPropertiesReadOnly(std::vector< std::string > &values) const
int getLayerPropertyIntEnumLabel(const std::string &propName, std::string &valueLabel) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyStampFontDescValue(const std::string &propName, const VFBLayerProperty::StampFontDesc &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setLayerPropertyStampRawStringValue(const std::string &propName, const std::string &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyIntEnumIndex(const std::string &propName, int &enumIndex) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyStampRawStringValue(const char *propName, std::string &value) const
int setLayerPropertyStampRawStringValue(const char *propName, const std::string &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Layer getChild(const int childIndex) const
int setEnabled(const bool enabled)
int getLayerEnumProperties(std::vector< std::string > &values) const
Some methods for Enum integer properties ------------------------------------—.
int setLayerPropertyColorValue(const std::string &propName, const Color &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getLayerPropertyIntEnumValues(const char *propName, std::vector< std::string > &values) const
int getLayerPropertyIntEnumIndex(const char *propName, int &enumIndex) const
int setLayerPropertyIntValue(const std::string &propName, const int value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getOpacity(float &opacity) const
int setLayerPropertyIntByEnumIndex(const char *propName, const int enumIndex)
int canBlend(bool &isBlendable) const
int getUniqueTreePathID(std::string &treePathUID) const
int getLayerPropertyIntEnumLabel(const char *propName, std::string &valueLabel) const
std::vector< Layer > getChildren() const
int setLayerPropertyStampFontDescValue(const char *propName, const VFBLayerProperty::StampFontDesc &value)
int getLayerPropertyType(const char *propName, VFBLayerProperty::Type &type) const
Definition: vraysdk.hpp:6919
void lockLayers()
Synchronized batch manipulations on layers ------------------------------------—.
int setAllLayers(const char *json)
int loadAllLayers(const char *filename)
std::vector< Layer > findAllLayersWithUserName(const std::string &userName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Layer createLayer(const std::string &layerClass, const Layer &parent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< Layer > findAllLayersWithUserName(const char *userName) const
std::vector< Layer > findAllLayersWithLayerClass(const std::string &layerClass) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Layer getRootLayer() const
Common layers access ------------------------------------—.
int bakeLayersToLUT(const std::string &filename) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< Layer > findAllLayersWithLayerClass(const char *layerClass) const
Accumulation of layers ----------------------------------—.
int saveAllLayers(const std::string &filename) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int bakeLayersToLUT(const char *filename) const
int setAllLayers(const std::string &json)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< Layer > getAllLayersAsLayerObjects() const
VFB & getVFB() const
Tree management -----------------------------—.
int loadAllLayers(const std::string &filename)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< std::string > getCreatableLayerClasses() const
std::vector< Layer > getAllBlendableLayers() const
int saveAllLayers(const char *filename) const
std::vector< Layer > getAllEnabledLayers() const
std::string getLastError() const
Returns the last error that occurred when a method of layerManager or Layer was called....
Definition: vraysdk.hpp:7098
Layer createLayer(const char *layerClass, const Layer &parent)
This class groups all VFB toolbar related methods.
Definition: vraysdk.hpp:7216
void setTestResolutionButtonStatus(const bool status)
void setBucketLockPoint(const int left, const int top)
ChannelButton
The UI visible channel buttons.
Definition: vraysdk.hpp:7220
void getBucketLockPoint(int &left, int &top) const
void setCurrentChannel(const int channelIdx)
bool getChannelButtonStatus(const ChannelButton whichChannel) const
void setBucketLockButtonStatus(const bool status)
void setChannelButtonStatus(const ChannelButton whichChannel, const bool status)
void setRenderRegionButtonStatus(const bool status)
void setTestResolution(const Resolution resolution)
Resolution
Definition: vraysdk.hpp:7230
void setTrackMouseButtonStatus(const bool status)
This class groups all VFB related methods.
Definition: vraysdk.hpp:6467
void setState(const void *vfbStateData, size_t dataSize, bool setMain=true, bool setHistory=true)
void setAlwaysOnTop(bool set)
Toggles the always-on-top behavior of the VFB window (disabled by default)
bool isInteractivityEnabled() const
Check if camera control from the VFB is enabled.
void setPosition(int x, int y)
Set the top-left coordinate of the VFB window in screen coordinates.
bool isShown() const
Check if the VFB window is currently shown.
std::string getLayers() const
void setPersistentState(const void *vfbPersistentStateData, size_t dataSize)
void show(bool show, bool setFocus=true)
VFBState * getState(size_t &dataSize, bool includeMain=true, bool includeHistory=true) const
void enableConfirmation(bool enable=true)
Enables the confirmation dialog when the VFB "Clear image" button is pressed.
VFBState * getPersistentState(size_t &dataSize) const
int setLayers(const char *json)
void setPositionAndSize(int x, int y, int w, int h)
Set the top-left coordinate and size of the VFB window in screen coordinates.
int setSettings(const char *json)
bool getPositionAndSize(int &x, int &y, int &w, int &h) const
Get the top-left coordinate of the VFB window in screen coordinates.
bool isConfirmationEnabled() const
Check if the confirmation dialog when clearing an image is enabled.
void enableInteractivity(bool enable=true)
Enables camera control using mouse and keyboard from the VFB image area.
std::string getSettings() const
Definition: vraysdk.hpp:6163
static bool isActiveState(RendererState value)
Convenience function for checking if a state value is in the rendering subset (including preparing).
Definition: vraysdk.hpp:7557
bool isRenderEnded() const
void start() const
Box getBoundingBox(bool &ok) const
Returns the current bounding box of the scene.
void setOnVFBSaveSettingsNotify(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
InstanceHandleType getInstanceHandle() const
void setOnBucketFailed(void(*callback)(VRayRenderer &, int x, int y, int width, int height, const char *host, ImagePassType pass, double instant, void *userData), const void *userData=NULL)
int loadAsTextFiltered(const char *fileName, T &obj, const void *userData=NULL)
void setOnVFBShowMessagesWindow(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T getOrCreatePlugin(const std::string &pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOf(const std::string &pluginType) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setCameraName(const char *name)
Camera name override. Current camera is selected internally using the scene_name property of the came...
int resetHosts(const std::string &hosts) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnRenderViewChanged(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnHostConnected(void(*callback)(VRayRenderer &, const char *hostName, double instant, void *userData), const void *userData=NULL)
void setOnVRayProfilerWrite(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setRenderMode(RenderMode mode)
void setOnUploadToCollaboration(int(*callback)(VRayRenderer &, const std::vector< std::string > &fileList, double instant, void *), const void *userData=NULL)
void setBucketReadyHasBuffer(bool hasBuffer)
Sets if an image passed in the BucketReady event parameters is needed. If not, no unnecessary copies ...
bool setInteractiveNoiseThreshold(float threshold)
void setOnHostDisconnected(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T getOrCreatePlugin(const char *pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getUseAnimatedValuesState() const
Returns true if setting parameter values adds keyframes and false if it overwrites.
void setOnVFBInteractiveStart(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=NULL)
int getNumThreads() const
Return the number of threads that will be used for rendering. 0 means all CPU logical threads.
void setOnVFBShowMessagesWindow(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
bool setCurrentTime(double time)
void setOnVFBClick(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBOpenUpdateNotify(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T getInstanceOrCreate(const std::string &pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool savePhotonMapFile(const char *fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int appendAsTextFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string getAllHosts() const
void setOnVFBClosed(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setInProcess(bool inProcess)
std::string exportSceneToBuffer() const
std::vector< std::string > getPluginTypesOfCategories(PluginCategories categories) const
void setOnProgressiveImageUpdated(void(*callback)(VRayRenderer &, VRayImage *img, unsigned long long changeIndex, ImagePassType pass, double instant, void *userData), const void *userData=NULL)
int loadAsTextFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
bool getDREnabled() const
void setOnVFBCopyToHostFrameBufferNotify(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string getActiveHosts() const
Plugin getInstanceOrCreate(const char *pluginName, const char *pluginType)
bool setComputeDevicesMetal(const std::vector< int > &indices)
std::vector< PickedPluginInfo > pickPlugins(double x, double y, int maxcount=0, int timeout=-1) const
void setOnRendererClose(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOf(const char *pluginType) const
int appendFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
bool clearAllPropertyValuesUpToTime(double time)
Removes all keyframe values at times less than 'time'.
void setOnVFBInteractiveStart(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBClick(void(*callback)(VRayRenderer &, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void *userData), const void *userData=NULL)
bool deletePlugin(const Plugin &plugin)
bool resume() const
RenderElements getRenderElements()
Returns an object that groups render element management methods.
bool deletePlugin(const char *pluginName)
void setOnVFBPauseIPR(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=NULL)
bool getInProcess() const
Plugin pickPlugin(int x, int y, int timeout) const
int appendFiltered(const std::vector< std::string > &fileNames, T &obj, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T getInstanceOf() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
WaitTime
Used with waitForRenderEnd()
Definition: vraysdk.hpp:8341
bool enableDRClient(const EnableDRClientParams &enableParams)
int appendAsTextFiltered(const char *fileName, T &obj, const void *userData=NULL)
AddHostsResult addHosts(const char *hosts) const
Plugin newPlugin(const char *pluginType)
bool setRenderSizes(const RenderSizeParams &sizes, bool regionButtonState)
bool waitForSequenceEnd() const
std::vector< Plugin > getPlugins() const
Returns all plugin instances in the current scene.
void setOnStateChanged(void(*callback)(VRayRenderer &, RendererState oldState, RendererState newState, double instant, void *), const void *userData=NULL)
void setOnVFBDebugShadingNotify(void(*callback)(VRayRenderer &, int enabled, DebugShadingMode mode, int selectionLocked, double instant, void *userData), const void *userData=NULL)
Plugin newPlugin(const char *pluginName, const char *pluginType)
bool saveCausticsFile(const char *fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int load(const std::string &fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool waitForVFBClosed(const int timeout) const
unsigned long long commit()
T getInstanceOrCreate(const char *pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int loadAsTextFiltered(const std::string &fileName, T &obj, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setBitmapCache(bool onOff)
float getIESPrescribedIntensity(const std::string &iesLightFileName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
ParserError getLastParserError() const
Returns the parser error that occurred when a scene was last loaded or appended.
bool addVRayProfilerMetadata(const std::string &category, const std::string &key, const std::string &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setUserSceneName(const std::string &sceneName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getOrCreatePlugin(const char *pluginName, const char *pluginType)
AutoExposureResult getAutoExposureResult() const
Returns the auto-exposure and auto-white balance values computed during the last light cache calculat...
void setUserCameraChangedCB(void(*cb)(const UserCameraChanged *info, void *userData), void *userData)
void setKeepInteractiveRunning(bool keepRunning)
bool isFrameSkipped() const
bool clearPropertyValuesUpToTime(double time, PluginCategories categories)
Removes all keyframe values at times less than 'time' only from plugins of given categories.
int appendAsText(std::string &&text)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setComputeDevicesDenoiser(const std::vector< int > &indices)
const RendererOptions getOptions() const
Return the options used to construct this renderer.
void setOnVFBUpdateIPR(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=NULL)
int append(const std::vector< std::string > &fileNames)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool saveCausticsFile(const std::string &fileName)
int appendAsText(const std::string &text)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnBucketFailed(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnLogMessage(void(*callback)(VRayRenderer &, const char *msg, MessageLevel level, double instant, void *userData), MessageLevel minLevel=MessageInfo, const void *userData=NULL)
int loadAsTextFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
size_t getIrradianceMapSize() const
VRayRenderer(InstanceHandleType handle)
int appendAsTextFiltered(const std::vector< const char * > &sceneTexts, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
bool getImageSize(int &width, int &height) const
Returns the frame buffer width and height.
bool updateLightingAnalysis()
void setOnProgressiveImageUpdated(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setProgresiveImageUpdatedHasBuffer(bool hasBuffer)
Sets if an image passed in the ProgressiveImageUpdated event parameters is needed....
bool saveLightCacheFile(const std::string &fileName)
static bool isInactiveState(RendererState value)
Convenience function for checking if a state value is in the idle subset (including IDLE_FRAME_DONE a...
Definition: vraysdk.hpp:7554
int append(const std::string &fileName, bool drSendNameOnly=false)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int resetHosts(const char *hosts=NULL) const
void setDebugShadingSelection(const std::vector< Plugin > &selection)
void setOnBucketInit(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnProgress(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
~VRayRenderer()
Destructor.
Plugin getPlugin(const char *pluginName) const
void setOnBucketReady(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T newPlugin(const char *pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
AddHostsResult addHosts(const std::string &hosts) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
T getPlugin(const char *pluginName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getCropRegion(int &srcWidth, int &srcHeight, float &rgnLeft, float &rgnTop, float &rgnWidth, float &rgnHeight) const
Gets the virtual crop region (RgnLeft, RgnTop, RgnWidth, RgnHeigt) within a virtual source image spac...
bool denoiseNow(T &object, bool shouldPassImage=true, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBPauseIPR(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isRenderingInHalfResolution() const
Definition: vraysdk.hpp:7561
void renderSequence() const
Begins rendering an animation sequence in a separate thread. A non-blocking call.
int appendFiltered(const std::vector< std::string > &fileNames, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int loadAsText(const char *text)
std::vector< Plugin > getPluginsOfCategories(const std::vector< PluginCategories > &categories) const
void setOnEnhanceOnCollaboration(int(*callback)(VRayRenderer &, const std::vector< std::string > &fileList, double instant, void *), const void *userData=NULL)
Plugin getCamera() const
Gets the current camera plugin. Don't use this unless you need to use setCamera() - see the comments ...
int loadAsText(const char *text, size_t length, void(*freeFn)(char *text, size_t size, T *holderObject)=NULL, T *holderObject=NULL)
Plugin getInstanceOrCreate(const char *pluginType)
Plugin getInstanceOrCreate(const char *pluginName, PluginTypeId pluginTypeId)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Box getBoundingBox() const
Returns the current bounding box of the scene.
int appendAsText(const char *text, size_t length, void(*freeFn)(char *text, size_t size, T *holderObject)=NULL, T *holderObject=NULL)
void setDenoiserOptions(const DenoiserOptions &denoiserOptions)
void setVFBContextMenuItems(const std::vector< VFBContextMenuItem > &items)
Set menu items for the VFB's context menu.
void setOnHostConnected(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnLogMessage(T &object, MessageLevel minLevel=MessageInfo, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool waitForSequenceEnd(const int timeout) const
void setIncludePaths(const char *includePaths, bool overwrite=true)
Plugin newPlugin(const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getCurrentTime() const
VRayImage * getImage(const GetImageOptions &options) const
int load(const char *fileName)
std::vector< std::string > getAllPluginTypes() const
Returns the class names of all available V-Ray plugin classes loaded from dynamic libraries.
bool setInteractiveSampleLevel(int samplesPerPixel)
int appendFiltered(const std::string &fileName, T &obj, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getOrCreatePlugin(const std::string &pluginName, PluginTypeId pluginTypeId)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getVisualDebuggerEnabled() const
Returns whether the Visual Debugger is enabled.
Plugin getInstanceOrCreate(const std::string &pluginName, const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int appendFiltered(const std::vector< const char * > &fileNames, T &obj, const void *userData=NULL)
std::vector< ComputeDeviceInfo > getComputeDevicesCurrentEngine() const
void setOnPostEffectsUpdated(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnLightMixTransferToScene(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void bucketRenderNearest(int x, int y) const
void setOnVFBLayersChanged(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
void setOnLicenseError(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clearLastError()
Clears the last error code.
size_t getLightCacheSize() const
void setOnVFBRenderLast(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOrCreate(const char *pluginName, const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getAutoCommit() const
Get the current state of the autoCommit flag.
Plugin newPlugin(PluginTypeId pluginTypeId)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool clearScene()
Wipes the scene contents (all plugin instances). This implicitly calls stop() if necessary.
bool enableLiveLinkClient(const LiveLinkClientParameters &params)
void setVFBContextMenuSelectedCallback(void(*callback)(VRayRenderer &, int commandId, int x, int y, void *userData), const void *userData=NULL)
size_t getCausticsSize() const
std::vector< RetT > getPlugins() const
bool setImageSize(int width, int height, bool resetCropRegion=true, bool resetRenderRegion=true)
int loadAsText(const std::string &text)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool deletePlugins(const char *names[], size_t namesCount)
void setUserLightChangedCB(void(*cb)(const UserLightChanged *info, void *userData), void *userData)
bool getKeepInteractiveRunning() const
Get the current state of the keepInteractiveRunning flag.
PluginMeta getPluginMeta(const char *pluginClassName) const
Return static meta information about a given plugin type.
RenderMode getRenderMode() const
Get the current render mode.
int appendAsTextFiltered(const std::vector< std::string > &sceneTexts, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
InteractiveStatistics getInteractiveStatistics() const
Returns some performance statistics from the Interactive (RT) engine.
bool denoiseNow(void(*userCb)(VRayRenderer &, VRayImage *, void *)=0, bool shouldPassImage=true, const void *userData=NULL)
bool setInteractiveTimeout(int timeoutMsec)
void setOnVFBLayersChanged(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool addVRayProfilerMetadata(const char *category, const char *key, const char *value)
bool waitForRenderEnd(const int timeout) const
VRayImage * getImage() const
unsigned long setProgressiveImageUpdateTimeout(unsigned long timeout)
std::vector< std::string > getPluginTypesOfCategory(PluginCategory category) const
Plugin getInstanceOrCreate(const std::string &pluginName, const char *pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setUserSceneName(const char *sceneName)
bool setDREnabled(bool drEnabled, bool enableBroadcastListener=true)
std::vector< ComputeDeviceInfo > getComputeDevicesOptix() const
float getIESPrescribedIntensity(const char *iesLightFileName) const
void setUserNodeChangedCB(void(*cb)(const UserNodeChanged *info, void *userData), void *userData)
void setIncludePaths(const std::string &includePaths, bool overwrite=true)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int loadFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
int append(const std::vector< const char * > &fileNames)
void setOnVFBOpenUpdateNotify(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop, float rgnWidth, float rgnHeight)
void setVRayProfiler(const VRayProfilerSettings &settings)
bool savePhotonMapFile(const std::string &fileName)
bool setNumThreads(int numThreads)
void setOnBucketReady(void(&callback)(VRayRenderer &, int x, int y, const char *host, VRayImage *img, ImagePassType pass, double instant, void *userData), const void *userData=NULL)
std::vector< Plugin > getPlugins(const std::string &pluginClassName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnLicenseError(void(*callback)(VRayRenderer &, const char *msg, int errorCode, LicenseUserStatus userStatus, double instant, void *userData), const void *userData=NULL)
void setOnStateChanged(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnBucketReady(std::nullptr_t null)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool replacePlugin(const Plugin &oldPlugin, const Plugin &newPlugin)
int appendAsTextFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
std::vector< ComputeDeviceInfo > getComputeDevicesMetal() const
T getPlugin(const std::string &pluginName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool saveLightCacheFile(const char *fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBCopyToHostFrameBufferNotify(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
Plugin getOrCreatePlugin(const std::string &pluginName, const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int loadAsText(std::string &&text)
This is an overloaded member function, provided for convenience. It differs from the above function o...
VRayRenderer(const RendererOptions &rendererOptions)
int appendAsTextFiltered(const std::vector< std::string > &sceneTexts, T &obj, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setComputeDevicesCurrentEngine(const std::vector< int > &indices)
void abort() const
Flags the image rendering thread to abort and returns immediately (without waiting for it to join)
int appendFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin newPlugin(const std::string &pluginName, const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin newPlugin(const std::string &pluginName, const char *pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool waitForRenderEnd(const WaitTime time=WaitTime::AwaitingOrIdle) const
int loadFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int appendAsTextFiltered(const std::vector< const char * > &sceneTexts, T &obj, const void *userData=NULL)
int appendFiltered(const std::vector< const char * > &fileNames, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=NULL)
int exportScene(const char *filePath, const VRayExportSettings &settings) const
void continueSequence() const
When rendering a sequence this starts the next frame after the previous one has completed....
void setOnUploadToCollaboration(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int exportScene(const std::string &filePath, const VRayExportSettings &settings) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOrCreate(PluginTypeId pluginTypeId)
bool setCurrentFrame(int frame)
bool deletePlugins(const std::vector< std::string > &names)
bool getRenderSizes(RenderSizeParams &sizes, bool &regionButtonState) const
int appendAsTextFiltered(const std::string &fileName, T &obj, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
UserPropertyType
Property types for UserPropertyChanged.
Definition: vraysdk.hpp:7712
bool saveIrradianceMapFile(const std::string &fileName)
int exportScene(const char *filePath) const
void setOnVFBClosed(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
T getInstanceOrCreate()
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< ComputeDeviceInfo > getComputeDevicesCUDA() const
std::vector< Plugin > getPluginsOfCategory(PluginCategory category) const
Returns all plugin instances that belong to the passed category.
void setOnVFBAddRenderElementToScene(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator!() const
void setOnVFBAddRenderElementToScene(bool(*callback)(VRayRenderer &, VFBRenderElementType type, double instant, void *userData), const void *userData=NULL)
void setAutoCommit(bool autoCommit)
Plugin newPlugin(const char *pluginName, PluginTypeId pluginTypeId)
This is an overloaded member function, provided for convenience. It differs from the above function o...
PluginMeta getPluginMeta(const std::string &pluginClassName) const
Return static meta information about a given plugin type.
bool isSequenceEnded() const
Error getLastError() const
Returns the last error that occurred when a method was called. Use this to understand why a method re...
std::string getInactiveHosts() const
float setProgressiveImageUpdateDifference(float difference)
int removeHosts(const std::string &hosts) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOf(PluginTypeId pluginTypeId) const
void setOnRendererClose(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
void setOnLightMixTransferToScene(int(*callback)(VRayRenderer &, const std::vector< LightMixChange > &changes, double instant, void *), const void *userData=NULL)
bool pause() const
Plugin getOrCreatePlugin(const char *pluginName, const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int loadFiltered(const char *fileName, T &obj, const void *userData=NULL)
std::string getUserSceneName()
T newPlugin()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnProgress(void(*callback)(VRayRenderer &, const char *msg, int elementNumber, int elementsCount, double instant, void *userData), const void *userData=NULL)
bool deletePlugin(const std::string &pluginName)
bool deletePlugins(const std::vector< VRay::Plugin > &plugins)
void setKeepBucketsInCallback(bool keep)
This method allows you to change the default behavior of keeping an image copy in a BucketReady callb...
std::string exportSceneToBuffer(const VRayExportSettings &settings) const
void stop() const
Flags the image rendering thread to stop and waits for it to join.
std::vector< Plugin > getPluginsOfCategories(const PluginCategories &categories) const
Returns all plugin instances that belong to all passed categories.
double getCurrentEventTime() const
Get the current value (in seconds) of the relative time used in event callbacks.
bool saveIrradianceMapFile(const char *fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOrCreate(const std::string &pluginName, PluginTypeId pluginTypeId)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBUpdateIPR(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setImprovedDefaultSettings(DefaultsPreset preset=quality_medium)
bool setRenderRegion(int rgnLeft, int rgnTop, int rgnWidth, int rgnHeight)
bool waitForVFBClosed() const
int append(const char *fileName, bool drSendNameOnly=false)
void setOnEnhanceOnCollaboration(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const char * getCameraName() const
Gets the camera name override previously set by setCameraName().
bool getVFBContextMenuItemValue(int commandId, int &value) const
bool setVFBContextMenuItemValue(int commandId, int value)
Plugin newPlugin(const char *pluginName, const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool getProgresiveImageUpdatedHasBuffer() const
Gets if an image will be passed in the ProgressiveImageUpdated callback parameters.
bool isAborted() const
int appendAsText(const std::vector< std::string > &sceneTexts)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setComputeDevicesEnvironmentVariable()
void setOnHostDisconnected(void(*callback)(VRayRenderer &, const char *hostName, double instant, void *userData), const void *userData=NULL)
void setVFBContextMenuSelectedCallback(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getInstanceOrCreate(const std::string &pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int appendFiltered(const char *fileName, T &obj, const void *userData=NULL)
void setOnBucketReady(void(&callback)(VRayRenderer &, int x, int y, int width, int height, const char *host, ImagePassType pass, double instant, void *userData), const void *userData=NULL)
void setOnPostEffectsUpdated(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=NULL)
Plugin getOrCreatePlugin(const std::string &pluginName, const char *pluginType)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool optimizeMaterialGraph(const Plugin &topPlugin)
LicenseError getLicenseError() const
Returns the license error (if any) that occurred when the renderer was constructed or when rendering ...
void setVisualDebuggerEnabled(bool enable)
Enables/Disables the Visual Debugger functionality.
T newPlugin(const std::string &pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin getPlugin(const std::string &pluginName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBDebugShadingNotify(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnBucketInit(void(*callback)(VRayRenderer &, int x, int y, int width, int height, const char *host, ImagePassType pass, double instant, void *userData), const void *userData=NULL)
std::vector< std::string > getPluginTypesOfCategories(const std::vector< PluginCategories > &categories) const
Plugin pickPlugin(int x, int y) const
std::vector< ComputeDeviceInfo > getComputeDevicesDenoiser() const
bool getRenderRegion(int &rgnLeft, int &rgnTop, int &rgnWidth, int &rgnHeight) const
int exportScene(const std::string &filePath) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setComputeDevicesCUDA(const std::vector< int > &indices)
int removeHosts(const char *hosts) const
bool setCamera(const Plugin &plugin)
void setOnVFBSaveSettingsNotify(T &object, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setKeepProgressiveFramesInCallback(bool keep)
This method allows you to change the default behavior of keeping an image copy in a progressiveImageU...
size_t getImageIntoBuffer(const GetImageOptions &options, void *buf) const
void setOnRenderViewChanged(void(*callback)(VRayRenderer &, const char *propName, double instant, void *userData), const void *userData=NULL)
bool setComputeDevicesOptix(const std::vector< int > &indices)
bool isDRClientEnabled() const
void setOnVRayProfilerWrite(void(*callback)(VRayRenderer &, const std::string &outputFile, int fileType, double instant, void *), const void *userData=nullptr)
unsigned long long getChangeIndex() const
int getCurrentFrame() const
int loadFiltered(const std::string &fileName, T &obj, const void *userData=NULL)
This is an overloaded member function, provided for convenience. It differs from the above function o...
RendererState getState() const
void setOnVFBRenderLast(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=NULL)
int appendAsText(const char *text)
bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop)
void renderSequence(SubSequenceDesc descriptions[], size_t count) const
void useAnimatedValues(bool on)
bool setResumableRendering(bool enable, const ResumableRenderingOptions *options)
int appendAsText(const std::vector< const char * > &sceneTexts)
bool getBucketReadyHasBuffer() const
Gets if an image will be passed in the BucketReady callback parameters.
Plugin getOrCreatePlugin(const char *pluginName, PluginTypeId pluginTypeId)
This is an overloaded member function, provided for convenience. It differs from the above function o...
DebugShadingMode
Enum with the different debug shading modes.
Definition: vraysdk.hpp:8733
std::vector< Plugin > getPlugins(const char *pluginClassName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int startSync() const
PluginMeta getPluginMeta(const PluginTypeId pluginTypeId) const
Return static meta information about a given plugin type.
size_t getPhotonMapSize() const
A generic value holder used by Plugin parameters.
Definition: vraysdk.hpp:5426
PluginRef getPluginRef() const
Returns invalid PluginRef if the value is not Plugin. Keep in mind the value can be a Plugin and stil...
PluginList getPluginList() const
std::string toString() const
Returns the value as string.
Matrix getMatrix() const
Returns default constructed (uninitialized) Matrix if the value is not Matrix.
ValueList getValueList() const
int getInt() const
Works if the value is int, float, double or boolean. Otherwise returns 0.
bool isOK() const
True if the value can be used. Checks against TYPE_ERROR and TYPE_UNSPECIFIED.
void set(int value)
Stores the passed value and sets the appropriate type.
T get() const
bool getBool() const
Works if the value is int, float, double or boolean. Otherwise returns false.
VectorList getVectorList() const
size_t getCount() const
Returns number of list elements if the value is a list type.
Transform getTransform() const
Returns default constructed (uninitialized) Transform if the value is not Transform.
bool isBad() const
True if there was an error and the value can't be used. Checks against TYPE_ERROR.
std::string getString() const
Returns empty string if the value is not string. Keep in mind the value can be a string and still be ...
AColor getAColor() const
Returns zero AColor if the value is not AColor. Keep in mind the value can be an AColor and still be ...
IntList getIntList() const
bool isList() const
False if this holds a single value.
float getFloat() const
Works if the value is int, float, double or boolean. Otherwise returns 0.0f.
Value() noexcept
Default constructor initializes Value to TYPE_ERROR.
FloatList getFloatList() const
TransformList getTransformList() const
Color getColor() const
Works if the value is Color or AColor. Otherwise returns zero color.
Type getType() const noexcept
Get the actual type of the stored value.
double getDouble() const
Works if the value is int, float, double or boolean. Otherwise returns 0.0.
Vector getVector() const
Returns zero Vector if the value is not Vector. Keep in mind the value can be a Vector and still be z...
const char * getStringType() const
Returns a string representation of the type.
Plugin getPlugin() const
Returns invalid Plugin if the value is not Plugin. Keep in mind the value can be a Plugin and still b...
StringList getStringList() const
ColorList getColorList() const
static Value Unspecified() noexcept
Static constructor initializes Value to TYPE_UNSPECIFIED.
StampFontWeight
Describes the weight of a UI font.
Definition: vraysdk.hpp:402
@ stampFontWeight_light
Light font.
Definition: vraysdk.hpp:404
@ stampFontWeight_bold
Bold font.
Definition: vraysdk.hpp:405
@ stampFontWeight_normal
Normal weight.
Definition: vraysdk.hpp:403
StampFontStyle
Describes the style of a UI font.
Definition: vraysdk.hpp:396
@ stampFontStyle_italic
Italic style.
Definition: vraysdk.hpp:398
@ stampFontStyle_normal
Normal style.
Definition: vraysdk.hpp:397
BlendMode
Definition: vraysdk.hpp:421
@ BlendMode_Saturation
Uses the saturation from the FG, while the value and hue are taken from the BG.
Definition: vraysdk.hpp:444
@ BlendMode_LinearBurn
Same as Color Burn but with less contrast.
Definition: vraysdk.hpp:429
@ BlendMode_Last
Last element.
Definition: vraysdk.hpp:456
@ BlendMode_SplotlightBlend
Also known as 'Spotlight Blend (8bit)'. Same as Spotlight, but additionally brightens the BG.
Definition: vraysdk.hpp:435
@ BlendMode_FgWhiteMask
Definition: vraysdk.hpp:454
@ BlendMode_Add
Adds the FG to the BG.
Definition: vraysdk.hpp:424
@ BlendMode_Subtract
Subtracts the FG from the BG. Does not affect completely black areas.
Definition: vraysdk.hpp:425
@ BlendMode_Hardlight
Also known as 'Hard Light (8bit)'. Spotlight is applied to pixels where the FG is dark and Screen is ...
Definition: vraysdk.hpp:438
@ BlendMode_Hardmix
Also known as 'Hard Mix (8bit)'. Adds the FG to the BG and for each color component returns a value o...
Definition: vraysdk.hpp:440
@ BlendMode_Exclusion
Same as Difference but with less contrast.
Definition: vraysdk.hpp:442
@ BlendMode_ColorDodge
Also known as 'Color Dodge (8bit)'. The color of the FG is applied to lighter pixels in the BG.
Definition: vraysdk.hpp:432
@ BlendMode_Background
Use as background.
Definition: vraysdk.hpp:449
@ BlendMode_Lighten
Compares the FG to the BG and takes the lighter of the two.
Definition: vraysdk.hpp:430
@ BlendMode_Overlay
Also known as 'Overlay (8bit)'. Darker pixels become darker where the BG is dark and brighter pixels ...
Definition: vraysdk.hpp:436
@ BlendMode_Multiply
Multiplies the FG by the BG.
Definition: vraysdk.hpp:427
@ BlendMode_Spotlight
Also known as 'Spotlight (8bit)'. Same as Multiply, but with twice the brightness.
Definition: vraysdk.hpp:434
@ BlendMode_Hue
Uses the hue from the FG , while the value and saturation are taken from the BG.
Definition: vraysdk.hpp:443
@ BlendMode_ColorBurn
The color of the FG is applied to darker pixels in the BG.
Definition: vraysdk.hpp:428
@ BlendMode_Average
The average of the current layer (FG) and the result from the layers below it (BG).
Definition: vraysdk.hpp:423
@ BlendMode_Darken
Compares the FG to the BG and takes the darker pixel values of the two.
Definition: vraysdk.hpp:426
@ BlendMode_Difference
Compares the pixels in the BG and FG and subtracts the darker pixels from the brighter ones.
Definition: vraysdk.hpp:441
@ BlendMode_Value
Uses the value from the FG, while the hue and saturation are taken from the BG.
Definition: vraysdk.hpp:446
@ BlendMode_Softlight
Also known as 'Soft Light (8bit)'. Darker pixels become darker where the FG is dark and brighter pixe...
Definition: vraysdk.hpp:437
@ BlendMode_LinearDodge
Also known as 'Linear Dodge (8bit)'. Same as Color Dodge but with less contrast.
Definition: vraysdk.hpp:433
@ BlendMode_Pinlight
Replaces the BG colors depending on the brightness of the FG color. If the FG color is lighter than m...
Definition: vraysdk.hpp:439
@ BlendMode_Screen
Makes both light and dark areas lighter.
Definition: vraysdk.hpp:431
@ BlendMode_Color
Uses the hue and saturation from the FG, while the value is taken from the BG.
Definition: vraysdk.hpp:445
@ BlendMode_Foreground
Use as foreground.
Definition: vraysdk.hpp:450
@ BlendMode_Divide
Subtracts the BG from the FG. Dark areas of the render are brightened, while bright areas of the rend...
Definition: vraysdk.hpp:447
@ BlendMode_Overwrite
Displays the current layer (FG) on top of all layers (BG) without blending. This is the default.
Definition: vraysdk.hpp:422
@ BlendMode_Normal
Blends the alpha of the VRayMtlSelect render element's material and other layers.
Definition: vraysdk.hpp:448
Flags
Definition: vraysdk.hpp:347
@ EnumRadioButtons
Specific to Int properties, the UI should use radio buttons.
Definition: vraysdk.hpp:351
@ Stretched
Specifies that when a widget is added it has to be stretched.
Definition: vraysdk.hpp:381
@ NonResettable
Properties with this flag won't be reset by calls to resetPropsToDefaults (e.g. Layer name).
Definition: vraysdk.hpp:367
@ WithoutLineEdit
Definition: vraysdk.hpp:378
@ HorizontalRolloutControls
Definition: vraysdk.hpp:360
@ Hidden
If this flag is raised the property should be temporarily hidden from its "Properties" UI.
Definition: vraysdk.hpp:350
@ Advanced
Indicate a property only visible when toggling advanced properties visibility/export mode or whatever...
Definition: vraysdk.hpp:369
@ ReadOnly
Properties with this flag should be shown with a read only UI.
Definition: vraysdk.hpp:363
@ EnumComboBox
Specific to Int properties, the UI should use a combo box.
Definition: vraysdk.hpp:352
@ Command
Definition: vraysdk.hpp:356
@ ScrollableVerticalRollout
Scrollable rollouts will have their contents in a scroll area.
Definition: vraysdk.hpp:365
@ CollapsibleVerticalRollout
Collapsible rollouts have buttons to collapse/expand them.
Definition: vraysdk.hpp:364
@ NoCustomStyleTag
Properties with this flag will not have Q_PROPERTY for custom styling (e.g. horizontal_rollout_groupb...
Definition: vraysdk.hpp:366
@ HasPipetteTool
Specific to Color property, add an additional pipette tool next to the color swatch button.
Definition: vraysdk.hpp:371
@ Transient
Parameter that is not stored in files.
Definition: vraysdk.hpp:362
@ Internal
No UI should be created in its "Properties" UI.
Definition: vraysdk.hpp:349
@ NoUndo
Properties with this flag don't need undo on changes. Example calculated images, curves for now.
Definition: vraysdk.hpp:368
@ Const
Properties marked as "Const" cannot have their internal value modified (i.e. const).
Definition: vraysdk.hpp:374
StampFontFamily
Describes the family of a UI font.
Definition: vraysdk.hpp:385
@ stampFontFamily_monospaced
Monospaced font.
Definition: vraysdk.hpp:392
@ stampFontFamily_sansSerif
A sans serif font.
Definition: vraysdk.hpp:390
@ stampFontFamily_default
Default family.
Definition: vraysdk.hpp:386
@ stampFontFamily_script
Script font (handwriting).
Definition: vraysdk.hpp:389
@ stampFontFamily_modern
Modern font.
Definition: vraysdk.hpp:391
@ stampFontFamily_roman
Roman (serif) font.
Definition: vraysdk.hpp:388
@ stampFontFamily_decorated
Decorated font.
Definition: vraysdk.hpp:387
Type
Definition: vraysdk.hpp:325
@ Rollout
Not in use!
Definition: vraysdk.hpp:335
@ Double
Not in use!
Definition: vraysdk.hpp:336
@ StampString
Holds two strings - raw string with user entered text and one string with fields replaced.
Definition: vraysdk.hpp:343
@ Image
Not in use!
Definition: vraysdk.hpp:339
@ Stream
Not in use! Binary stream holder.
Definition: vraysdk.hpp:344
@ IntEnum
It is an Int with a fixed number of values.
Definition: vraysdk.hpp:326
@ Curve
Not in use!
Definition: vraysdk.hpp:338
@ CustomPopup
Not in use! Holds a pointer to a CustomPopupMenuCallback, can be nullptr.
Definition: vraysdk.hpp:340
@ UInt32
Not in use!
Definition: vraysdk.hpp:337
@ MaskItemList
Not in use! Holds a list of items used for masking - each item is represented with some id,...
Definition: vraysdk.hpp:341
@ StampFont
Holds a StampFontDesc structure describing a font.
Definition: vraysdk.hpp:342
RGBA color, float32.
Definition: vraysdk.hpp:1479
AColor toSRGB() const noexcept
Creates the copy of this AColor with the values converted from linear to sRGB.
Definition: vraysdk.hpp:1612
void operator-=(const AColor &c) noexcept
Definition: vraysdk.hpp:1513
void operator*=(const AColor &c) noexcept
Definition: vraysdk.hpp:1520
void operator/=(const AColor &c) noexcept
Definition: vraysdk.hpp:1548
void makeWhiteComplement() noexcept
Definition: vraysdk.hpp:1591
void operator+=(const AColor &c) noexcept
Definition: vraysdk.hpp:1506
AColor getWhiteComplement() const noexcept
Returns the white complement of the AColor.
Definition: vraysdk.hpp:1585
float getLength() const noexcept
Returns the length of the RGBA components.
Definition: vraysdk.hpp:1575
float getLengthSquared() const noexcept
Returns the squared sum of the RGBA components.
Definition: vraysdk.hpp:1580
float maxComponentValue() const noexcept
Calculates the magnitude of the greatest color component (the alpha is not taken into account)
Definition: vraysdk.hpp:1597
AColor fromSRGB() const noexcept
Creates the copy of this AColor with the values converted from sRGB to linear.
Definition: vraysdk.hpp:1602
Used in Proxy::createMeshFile() and Proxy::createCombinedMeshFile()
Definition: vraysdk.hpp:2338
std::vector< Transform > transforms
List of transformations contained in the animation. The size must be equal to the size of the keyFram...
Definition: vraysdk.hpp:2339
std::vector< int > keyFrames
List of keyFrames contained in the animation. The size must be equal to the size of the transformatio...
Definition: vraysdk.hpp:2340
Contains the auto-exposure and auto-white balance values computed during the last light cache calcula...
Definition: vraysdk.hpp:3664
float autoWhiteBalance
The auto-white balance (in Kelvin). 0 means that autoWhiteBalance calculations are not enabled.
Definition: vraysdk.hpp:3666
float ISO
Definition: vraysdk.hpp:3667
float autoExposure
The auto-exposure multiplier. 0 means that autoExposure calculations are not enabled.
Definition: vraysdk.hpp:3665
Attributes storage format: [attrName\0|type{uint8}|value{some_bytes}][...][...]\0.
Definition: vraysdk.hpp:11141
void add(const char(&name)[nameLen], const std::string &value)
Definition: vraysdk.hpp:11231
void add(const std::string &name, const AColor &value)
Definition: vraysdk.hpp:11259
void add(const char *name, size_t nameLen, float value)
Definition: vraysdk.hpp:11309
void add(const std::string &name, const char(&value)[valueLen])
Definition: vraysdk.hpp:11275
void add(const std::string &name, const std::string &value)
Definition: vraysdk.hpp:11282
void add(const char(&name)[count], const AColor &value)
Definition: vraysdk.hpp:11206
BinUserAttributeTypeFlags
Definition: vraysdk.hpp:11163
bool hasData() const
Checks if we've written any attributes.
Definition: vraysdk.hpp:11395
void close()
Definition: vraysdk.hpp:11384
void add(const std::string &name, const Vector &value)
Definition: vraysdk.hpp:11252
IntList toIntList()
Definition: vraysdk.hpp:11403
void add(const char *name, size_t nameLen, const AColor &value)
Definition: vraysdk.hpp:11347
void add(const char *name, size_t nameLen, const char *value, size_t valueLen)
Definition: vraysdk.hpp:11373
void add(const std::string &name, float value)
Definition: vraysdk.hpp:11245
void add(const std::string &name, const char *value, size_t valueLen)
Definition: vraysdk.hpp:11267
std::string toString() const
Definition: vraysdk.hpp:11415
BinUserAttributeType
Definition: vraysdk.hpp:11154
void add(const char *name, size_t nameLen, int value)
Definition: vraysdk.hpp:11290
void add(const char(&name)[nameLen], const char *value, size_t valueLen)
Definition: vraysdk.hpp:11215
void add(const char(&name)[count], float value)
Definition: vraysdk.hpp:11190
void add(const char *name, size_t nameLen, const Vector &value)
Definition: vraysdk.hpp:11325
void add(const char(&name)[nameLen], const char(&value)[valueLen])
Definition: vraysdk.hpp:11223
void add(const char(&name)[count], const Vector &value)
Definition: vraysdk.hpp:11198
void add(const std::string &name, int value)
Definition: vraysdk.hpp:11238
size_t getNumBytes() const
Get number of written bytes.
Definition: vraysdk.hpp:11390
void add(const char(&name)[count], int value)
Definition: vraysdk.hpp:11182
Equivalent to the Windows API BITMAPFILEHEADER struct.
Definition: vraysdk.hpp:509
unsigned bfOffBits
Offset of raw pixel data in bytes relative to the start of this header.
Definition: vraysdk.hpp:513
Equivalent to the Windows API BITMAPINFOHEADER struct.
Definition: vraysdk.hpp:517
Wrapper around BMP metainfo with pixel accessor method.
Definition: vraysdk.hpp:532
Axis-aligned bounding box.
Definition: vraysdk.hpp:2866
Vector pmax
The upper bounds for the box along the three axes.
Definition: vraysdk.hpp:2868
void expand(const Box &box)
Definition: vraysdk.hpp:2887
void expand(const Vector &point)
Definition: vraysdk.hpp:2872
Vector pmin
The lower bounds for the box along the three axes.
Definition: vraysdk.hpp:2867
Definition: vraysdk.hpp:11089
int cpuCount
Only ServerReady means no error.
Definition: vraysdk.hpp:11117
int vrayVersion
Server V-Ray version number.
Definition: vraysdk.hpp:11120
Status
Definition: vraysdk.hpp:11090
std::string hostConnectedTo
Server is busy connected to ip. Valid only when status is ServerReady.
Definition: vraysdk.hpp:11126
std::string hostResolved
hostName:port translated to ip:port.
Definition: vraysdk.hpp:11123
std::string revisionTime
The time the server revision is built.
Definition: vraysdk.hpp:11129
RGB color, float32.
Definition: vraysdk.hpp:1151
Color getWhiteComplement() const noexcept
Returns the white complement of the Color.
Definition: vraysdk.hpp:1240
float getIntensity() const noexcept
Returns the intensity of the color (also called chroma or saturation) which is the brightness or dull...
Definition: vraysdk.hpp:1192
void makeWhiteComplement() noexcept
Definition: vraysdk.hpp:1246
float getClosestTemperatureAndColor(Color &closestColor, RGBColorSpace colorSpace=sRGB) const
Find the black body color that is closest to the given color and returns it and its temperature in Ke...
float maxComponentValue() const noexcept
Calculates the magnitude of the greatest component.
Definition: vraysdk.hpp:1339
static Color fromTemperature(float temperature, RGBColorSpace colorSpace=sRGB)
Return the normalized RGB color of a black body with the given temperature in Kelvin.
float getLength() const noexcept
Returns the length of the color.
Definition: vraysdk.hpp:1210
static Matrix getRGBtoRGBmatrix(RGBColorSpace srcColorSpace, RGBColorSpace dstColorSpace)
void operator*=(const Color &c) noexcept
Definition: vraysdk.hpp:1272
Color fromSRGB()
Creates the copy of this Color with the values converted from sRGB to linear.
Definition: vraysdk.hpp:1345
float getLuminance() const noexcept
Returns the luminance of the color which is a measure of the intensity of light that reaches the eye.
Definition: vraysdk.hpp:1197
RGBColorSpace
These color space do not include their corresponding gamma corrections!
Definition: vraysdk.hpp:1171
float getLengthSquared() const noexcept
Returns the squared length of the color.
Definition: vraysdk.hpp:1205
void operator/=(const Color &c) noexcept
Definition: vraysdk.hpp:1306
Color toSRGB()
Creates the copy of this Color with the values converted from linear to sRGB.
Definition: vraysdk.hpp:1354
void operator-=(const Color &c) noexcept
Definition: vraysdk.hpp:1264
void operator+=(const Color &c) noexcept
Definition: vraysdk.hpp:1256
void setContrast(float k, float middle=0.5f) noexcept
Definition: vraysdk.hpp:1232
void setSaturation(float k) noexcept
Definition: vraysdk.hpp:1221
float getPower() const
Returns the sum of all color components.
Definition: vraysdk.hpp:1215
float getClosestTemperature(RGBColorSpace colorSpace=sRGB) const
Find the black body color that is closest to the given color and returns its temperature in Kelvin.
Used for GPU device selection by VRayRenderer::getComputeDevicesCurrentEngine() & co.
Definition: vraysdk.hpp:2730
long long deviceHandle
Device handle.
Definition: vraysdk.hpp:2731
int ccMajor
CUDA Compute Capability Major version number.
Definition: vraysdk.hpp:2756
int rtCoreVersion
The version of the raytracing cores (if supported). 0 if the GPU does not support RT Cores.
Definition: vraysdk.hpp:2758
int numConnectedDisplays
Number of displays (monitors) attached to this device. -1 if this information is unavailable.
Definition: vraysdk.hpp:2753
Type
Definition: vraysdk.hpp:2744
@ deviceType_CPU
CPU device.
Definition: vraysdk.hpp:2746
@ deviceType_GPU
GPU device.
Definition: vraysdk.hpp:2747
@ deviceType_default
Default.
Definition: vraysdk.hpp:2745
@ deviceType_ACCEL
Accelerated device.
Definition: vraysdk.hpp:2748
int isCpuEmulation
Is device CPU emulated.
Definition: vraysdk.hpp:2766
std::string name
Non-unique displayable name. Device index is its unique identifier.
Definition: vraysdk.hpp:2734
int cudaOrdinalIndex
Cuda ordinal index.
Definition: vraysdk.hpp:2763
int useForRendering
Device is used for rendering.
Definition: vraysdk.hpp:2738
int tccMode
TCC mode.
Definition: vraysdk.hpp:2764
Type deviceType
Device type.
Definition: vraysdk.hpp:2751
int busId
Bus ID.
Definition: vraysdk.hpp:2761
int totalMemoryMB
MegaBytes.
Definition: vraysdk.hpp:2752
int localIndex
Local index.
Definition: vraysdk.hpp:2762
long long platform
Platform.
Definition: vraysdk.hpp:2732
int ccMinor
CUDA Compute Capability Minor version number.
Definition: vraysdk.hpp:2757
int shaderProcessorsCount
Shader processors count.
Definition: vraysdk.hpp:2760
int useForDenoising
Device is used for denoising.
Definition: vraysdk.hpp:2739
int frequencyMHz
Base clock frequency or -1 if not available.
Definition: vraysdk.hpp:2754
int isSupported
Is device supported.
Definition: vraysdk.hpp:2740
int gFlops
Theoretical GFLOPS. 0 or -1 if not available.
Definition: vraysdk.hpp:2755
Definition: vraysdk.hpp:3565
FlagVal skipAlpha
True if the alpha channel should NOT be denoised.
Definition: vraysdk.hpp:3574
FlagVal
Definition: vraysdk.hpp:3566
@ Enabled
Will reset the flag.
Definition: vraysdk.hpp:3568
@ Default
Will set the flag.
Definition: vraysdk.hpp:3569
FlagVal panorama
True if denoised image is wrapped around the left/right border.
Definition: vraysdk.hpp:3573
FlagVal hideDest
Hide destination channel in VFB.
Definition: vraysdk.hpp:3572
FlagVal optixUpscale
True if the optix denoiser should use the upscaling mode. Does nothing for other engines.
Definition: vraysdk.hpp:3575
FlagVal allowInSingleChannelFiles
True to allow writing to single channel files too. Off by default.
Definition: vraysdk.hpp:3576
FlagVal skipAuxElementsInFiles
True to skip writing the additional channels to files.
Definition: vraysdk.hpp:3577
The necessary parameters passed to the VRayRenderer::enableDRClient interface.
Definition: vraysdk.hpp:3749
bool withBroadcastListener
True if a broadcast listener socket was created.
Definition: vraysdk.hpp:3756
std::string httpProxy
server:port connection parameter for http connections via proxy
Definition: vraysdk.hpp:3751
int connectTimeout
Initial connection timeout in seconds.
Definition: vraysdk.hpp:3762
std::string dispatcher
can either be an empty string or host[:port]
Definition: vraysdk.hpp:3750
int verboseLevel
Numeric progress verbosity level from 0 (none) to 4 (all, incl. debug)
Definition: vraysdk.hpp:3764
bool enableAssigningWUsAsBackups
TransferrableDrOptions.
Definition: vraysdk.hpp:3758
bool localRendering
True if, when local dispatcher selected, it's configured to spawn a local render server.
Definition: vraysdk.hpp:3755
int upstreamChannels
Number of upstream connections, which the client side will use, when pipelining is not enabled.
Definition: vraysdk.hpp:3763
bool pipelinedUpstream
Whether to use pipelining. Note pipelining will be disabled internally (even if requested),...
Definition: vraysdk.hpp:3757
Used by VRayRenderer::getImage() and RenderElement::getImage()
Definition: vraysdk.hpp:2381
ImageRegion region
Optional crop rectangle.
Definition: vraysdk.hpp:2382
bool flipImage
Flip image top-bottom.
Definition: vraysdk.hpp:2385
bool doColorCorrect
Whether to apply VFB color corrections.
Definition: vraysdk.hpp:2383
bool stripAlpha
Set alpha to 1.
Definition: vraysdk.hpp:2384
A rectangle defined by top-left and bottom-right frame coordinates.
Definition: vraysdk.hpp:253
Options passed to VRayRenderer::saveImage.
Definition: vraysdk.hpp:809
enum VRay::ImageWriterOptions::CompressionType compressionType
for EXR format only
int bitsPerChannel
for EXR format only - either 16 or 32
Definition: vraysdk.hpp:844
Additional parameter flags for Instancer and Instancer2 plugins.
Definition: vraysdk.hpp:3644
static const int useUserAttributesBin
Use binary user attributes.
Definition: vraysdk.hpp:3656
static const int useObjectProperties
Use object properties.
Definition: vraysdk.hpp:3657
static const int useParentTimesAtleastForGeometry
Definition: vraysdk.hpp:3649
static const int useSkipCryptomatte
Skip registering Node for the Cryptomatte.
Definition: vraysdk.hpp:3654
static const int useMaterial
Use material override.
Definition: vraysdk.hpp:3651
static const int useGeometry
Use geometry override.
Definition: vraysdk.hpp:3652
static const int useMapChannels
Use additional map channels.
Definition: vraysdk.hpp:3653
static const int useRenderIDOverride
Use renderIDOverride.
Definition: vraysdk.hpp:3655
unsigned long long usage
The name of the memory type category.
Definition: vraysdk.hpp:2837
Current rendering progress.
Definition: vraysdk.hpp:2826
std::string name
name of the device
Definition: vraysdk.hpp:2827
float totalMem
total mem in mega bytes
Definition: vraysdk.hpp:2830
float utilization
usage (from 0.0f to 100.0f)
Definition: vraysdk.hpp:2828
float freeMem
free mem in mega bytes
Definition: vraysdk.hpp:2829
Returned by VRayRenderer::getInteractiveStatistics when rendering in interactive mode.
Definition: vraysdk.hpp:2818
float currentNoiseThreshold
Current noise threshold. Useful when dynamic noise threshold is enabled.
Definition: vraysdk.hpp:2823
unsigned elapsedTicks
Time since start.
Definition: vraysdk.hpp:2820
std::vector< ComputeDeviceStatistics > computeDevices
array of statistics for each device with valid data
Definition: vraysdk.hpp:2833
std::vector< ComputeDeviceMemoryType > computeDevicesMemUsage
Memory usage by memory type.
Definition: vraysdk.hpp:2840
double pathsPerSecond
Number of camera rays traced per second.
Definition: vraysdk.hpp:2819
int sampleLevel
Number of samples per pixel accumulated.
Definition: vraysdk.hpp:2821
int numPasses
Number of sampling passes done.
Definition: vraysdk.hpp:2822
Parameters for setLicenseServer(). Only serverName is obligatory.
Definition: vraysdk.hpp:3979
std::string proxyUserName
Optional http proxy server.
Definition: vraysdk.hpp:3993
std::string serverName1
Optional alternative server if the primary doesn't work.
Definition: vraysdk.hpp:3987
std::string serverName2
Optional second alternative server.
Definition: vraysdk.hpp:3990
int serverPort
default port is 30304
Definition: vraysdk.hpp:3981
std::string proxyName
Optional http proxy server.
Definition: vraysdk.hpp:3982
std::string username
Optional login.
Definition: vraysdk.hpp:3984
std::string serverName
Primary license server - hostname or IP address.
Definition: vraysdk.hpp:3980
std::string proxyPassword
Login for the optional proxy server.
Definition: vraysdk.hpp:3994
std::string password
For the optional login.
Definition: vraysdk.hpp:3985
Definition: vraysdk.hpp:5890
bool isApplied
[In] Is the channel enabled.
Definition: vraysdk.hpp:5895
Color colorMult
[In] Can be empty for the rest channel.
Definition: vraysdk.hpp:5892
float intensityMult
[In] Color multiplier.
Definition: vraysdk.hpp:5893
bool enabled
[In] Intensity multiplier.
Definition: vraysdk.hpp:5894
3x3 column-major matrix, float32
Definition: vraysdk.hpp:1761
void setRow(const int i, const Vector &a) noexcept
Definition: vraysdk.hpp:1833
void makeTranspose(void) noexcept
Make the matrix to be the transpose of its currrent value.
Definition: vraysdk.hpp:1866
Vector & operator[](const int index) noexcept
Return the i-th column of the matrix (i=0,1,2).
Definition: vraysdk.hpp:1767
void operator+=(const Matrix &m) noexcept
Definition: vraysdk.hpp:1924
Matrix inverse(const Matrix &m) noexcept
Definition: vraysdk.hpp:1964
Matrix makeRotationMatrixX(float xrot) noexcept
Definition: vraysdk.hpp:2138
Matrix makeRotationMatrixY(float yrot) noexcept
Definition: vraysdk.hpp:2147
Matrix noScale(const Matrix &m) noexcept
Definition: vraysdk.hpp:2100
void makeIdentity(void) noexcept
Make the matrix the identity matrix.
Definition: vraysdk.hpp:1845
bool makeInverse(void) noexcept
Definition: vraysdk.hpp:1876
void makeDiagonal(const Vector &a) noexcept
Definition: vraysdk.hpp:1853
Matrix() noexcept=default
Constructor - initializes all components to zero.
void setCol(const int i, const Vector &a) noexcept
Definition: vraysdk.hpp:1826
Matrix makeRotationMatrixZ(float zrot) noexcept
Definition: vraysdk.hpp:2156
void rotate(const Vector &axis) noexcept
Applies a rotation along the given axis. The length of the axis is the tangent of the angle of rotati...
Definition: vraysdk.hpp:1939
void operator/=(float x) noexcept
Divide all elements in the matrix by the given number. Does not perform a check for divide by zero.
Definition: vraysdk.hpp:1918
Matrix(Vector diagonal) noexcept
Constructor to diagonal matrix.
Definition: vraysdk.hpp:1788
void makeZero(void) noexcept
Make the matrix the zero matrix (all elements are zeroes).
Definition: vraysdk.hpp:1838
void set(float value) noexcept
Make diagonal matrix.
Definition: vraysdk.hpp:1809
Matrix normalize(const Matrix &m) noexcept
Definition: vraysdk.hpp:2092
void operator-=(const Matrix &m) noexcept
Definition: vraysdk.hpp:1932
Vector rotationAngles(const Matrix &m) noexcept
Definition: vraysdk.hpp:2112
void set(const Matrix &other) noexcept
Definition: vraysdk.hpp:1817
Vector scale(const Matrix &m) noexcept
Definition: vraysdk.hpp:2106
Matrix(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:1794
void operator*=(float x) noexcept
Multiply all elements in the matrix by the given number.
Definition: vraysdk.hpp:1913
Matrix rotate(const Matrix &m, const Vector &axis) noexcept
Definition: vraysdk.hpp:2086
void set(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:1804
A container for the data necessary to a export vrmesh with geometry, hair or particles....
Definition: vraysdk.hpp:5823
ValueList hairVertices
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:5834
ValueList vertices
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:5824
ValueList mapChannels
ValueList( ValueList(int, VectorList, IntList) )
Definition: vraysdk.hpp:5830
ValueList hairWidths
ValueList( FloatList ) (single frame) OR ValueList( ValueList(int, FloatList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5836
ValueList hairVerticesPerStrand
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5835
ValueList particleWidths
ValueList( FloatList ) (single frame) OR ValueList( ValueList(int, FloatList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5838
ValueList faces
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5825
ValueList mapChNames
ValueList( StringList )
Definition: vraysdk.hpp:5831
ValueList shaderNames
ValueList( ValueList(int, string) )
Definition: vraysdk.hpp:5832
ValueList faceNormals
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5827
ValueList normals
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:5826
ValueList velocities
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:5828
ValueList faceMtlIDs
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5829
ValueList edgeVisibility
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:5833
ValueList particleVertices
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:5837
Helper structure storing the relevant configuration entries as they were read from the configuration ...
Definition: vraysdk.hpp:10447
char familySeparator
The separator that is used to distinguish different families for UI separation.
Definition: vraysdk.hpp:10463
std::string getErrorString() const
Get whether there was any error with the loading of the OCIO configuration.
Definition: vraysdk.hpp:10501
std::vector< std::string > roles
List of the stored roles in the configuration.
Definition: vraysdk.hpp:10453
std::vector< std::string > looks
List of the looks in the configuration.
Definition: vraysdk.hpp:10457
std::vector< std::string > viewTransforms
List of unique view transformations from the configuration.
Definition: vraysdk.hpp:10461
std::vector< std::string > colorSpaces
List of the stored color spaces in the configuration.
Definition: vraysdk.hpp:10449
OCIOConfigurationData(const char *fileName=NULL, SourceMode vraySourceType=SourceMode::Automatic)
Definition: vraysdk.hpp:10469
std::vector< std::string > devices
List of devices as read from the configuration.
Definition: vraysdk.hpp:10459
std::vector< std::string > roleColorSpaces
List of corresponding color spaces for each role. Size will match the roles size.
Definition: vraysdk.hpp:10455
std::vector< std::string > colorSpaceFamilies
List of stored color space families for the configuration. May be empty.
Definition: vraysdk.hpp:10451
Definition: vraysdk.hpp:10554
std::string name
Name of the parameter.
Definition: vraysdk.hpp:10555
OSLParameterType type
Type of the parameter.
Definition: vraysdk.hpp:10556
Value defaultValue
Default value defined in the shader file.
Definition: vraysdk.hpp:10557
Definition: vraysdk.hpp:10560
std::vector< OSLInputParameter > inputParams
Input parameters defined in the shader file.
Definition: vraysdk.hpp:10564
std::vector< std::string > outputColorParams
Output color parameters defined in the shader file.
Definition: vraysdk.hpp:10561
std::vector< std::string > outputFloatParams
Output float parameters defined in the shader file.
Definition: vraysdk.hpp:10562
std::vector< std::string > outputClosureParams
Output closure parameters defined in the shader file.
Definition: vraysdk.hpp:10563
The info contained in geometry, hair or particle objects.
Definition: vraysdk.hpp:2851
std::string name
the name of the object
Definition: vraysdk.hpp:2852
int id
the id of the object
Definition: vraysdk.hpp:2853
int vEnd
the end of the voxel range of the object (vEnd is excluded from the range)
Definition: vraysdk.hpp:2855
int vBegin
the begin of the voxel range of the object (vBegin is included in the range)
Definition: vraysdk.hpp:2854
Returned by VRayRenderer::getLastParserError. Use to diagnose problems when loading vrscene files.
Definition: vraysdk.hpp:4072
See VRayRenderer::pickPlugins.
Definition: vraysdk.hpp:5842
This struct is used to determine if a plugin type is of certain category.
Definition: vraysdk.hpp:4330
bool hasGeometricObjectCategory() const noexcept
Is the plugin of category_geometric_object.
Definition: vraysdk.hpp:4352
unsigned long long pluginCategoryField
bitfield of the plugin categories
Definition: vraysdk.hpp:4331
bool hasTextureFloatCategory() const noexcept
Is the plugin of category_texture_float.
Definition: vraysdk.hpp:4392
bool hasUvwgenCategory() const noexcept
Is the plugin of category_uvwgen.
Definition: vraysdk.hpp:4417
bool hasBsdfCategory() const noexcept
Is the plugin of category_bsdf.
Definition: vraysdk.hpp:4347
bool hasRenderChannelCategory() const noexcept
Is the plugin of category_render_channel.
Definition: vraysdk.hpp:4372
bool hasSettingsCategory() const noexcept
Is the plugin of category_settings.
Definition: vraysdk.hpp:4382
bool hasMaterialCategory() const noexcept
Is the plugin of category_material.
Definition: vraysdk.hpp:4367
bool hasBitmapCategory() const noexcept
Is the plugin of category_bitmap.
Definition: vraysdk.hpp:4342
bool hasRenderViewCategory() const noexcept
Is the plugin of category_render_view.
Definition: vraysdk.hpp:4377
bool hasGeometrySourceCategory() const noexcept
Is the plugin of category_geometry_source.
Definition: vraysdk.hpp:4357
bool hasLightCategory() const noexcept
Is the plugin of category_light.
Definition: vraysdk.hpp:4362
bool hasVolumetricCategory() const noexcept
Is the plugin of category_volumetric.
Definition: vraysdk.hpp:4422
bool hasTextureIntCategory() const noexcept
Is the plugin of category_texture_int.
Definition: vraysdk.hpp:4397
std::vector< PluginCategory > getAll() const
Returns the bitfield as vector of enum values.
bool hasTextureVectorCategory() const noexcept
Is the plugin of category_texture_vector.
Definition: vraysdk.hpp:4412
bool hasTextureCategory() const noexcept
Is the plugin of category_texture.
Definition: vraysdk.hpp:4387
bool hasTextureMatrixCategory() const noexcept
Is the plugin of category_texture_matrix.
Definition: vraysdk.hpp:4402
bool hasTextureTransformCategory() const noexcept
Is the plugin of category_texture_transform.
Definition: vraysdk.hpp:4407
Used by VRay::Proxy::createMeshFile()
Definition: vraysdk.hpp:3467
std::string customPreviewFile
file name to read and use its vertices and faces for the preview voxel
Definition: vraysdk.hpp:3503
int previewType
Definition: vraysdk.hpp:3495
std::string destination
destination file name
Definition: vraysdk.hpp:3492
int startFrame
used if animOn is true
Definition: vraysdk.hpp:3497
std::vector< std::string > objectNames
array of names to associate with respective meshes. This can be used to identify the pieces when read...
Definition: vraysdk.hpp:3501
PreviewTypes
Definition: vraysdk.hpp:3468
@ SIMPLIFY_FACE_SAMPLING
Definition: vraysdk.hpp:3472
@ SIMPLIFY_COMBINED
Definition: vraysdk.hpp:3487
@ SIMPLIFY_CLUSTERING
Definition: vraysdk.hpp:3476
@ SIMPLIFY_EDGE_COLLAPSE
Definition: vraysdk.hpp:3480
int endFrame
used if animOn is true
Definition: vraysdk.hpp:3498
Bool exportPointCloud
when enabled, adds a point cloud representation of the mesh separated into different levels of detail...
Definition: vraysdk.hpp:3508
float pointSize
determines the size of point cloud disks at the most detailed level. If this value is small,...
Definition: vraysdk.hpp:3509
int previewParticles
number of preview particles (default 20000)
Definition: vraysdk.hpp:3511
std::vector< Color > voxelInfoWireColor
array of diffuse (wire) colors - 1 Color per mesh object
Definition: vraysdk.hpp:3504
std::vector< int > objectIDs
array of unique IDs for the respective meshes. This should usually match Node.objectID values.
Definition: vraysdk.hpp:3502
int previewFaces
approximate number of preview triangles (default 10000; set to 0 to disable preview)
Definition: vraysdk.hpp:3494
int mergeVoxels
merge all voxels of the same type, before subdivision
Definition: vraysdk.hpp:3499
std::vector< Bool > voxelInfoFlipNormals
array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be flipped)
Definition: vraysdk.hpp:3506
int previewHairs
number of preview hairs (default 1000)
Definition: vraysdk.hpp:3510
std::vector< Bool > voxelInfoSmoothed
array of smoothed flags (1 flag per mesh object - true if the voxel should be rendered with smoothed ...
Definition: vraysdk.hpp:3505
Bool bakeTransforms
when enabled (default), applies the input Transform(s) to the geometry data, otherwise writes the Tra...
Definition: vraysdk.hpp:3512
int elementsPerVoxel
number of triangles in each voxel
Definition: vraysdk.hpp:3493
int animOn
enables saving multiple animated frames in the proxy
Definition: vraysdk.hpp:3496
The necessary parameters for reading data in a proxy file.
Definition: vraysdk.hpp:3516
int flip_axis
0 do not rotate; 1 transform from Maya to 3dsMax coordinate system (90 deg. rotation around x axis); ...
Definition: vraysdk.hpp:3520
float particle_width_multiplier
a multiplier to the particle width data
Definition: vraysdk.hpp:3537
float smooth_angle
smooth angle in degrees
Definition: vraysdk.hpp:3525
int compute_normals
true to calculate smooth normals
Definition: vraysdk.hpp:3519
int num_preview_faces
number of faces in preview
Definition: vraysdk.hpp:3524
bool use_full_names
read the full path instead of only the name
Definition: vraysdk.hpp:3529
float hair_width_multiplier
a multiplier to the hair width data
Definition: vraysdk.hpp:3536
bool compute_bbox
true to compute the bounding box, false to read it from the file
Definition: vraysdk.hpp:3530
std::string file
file name to read
Definition: vraysdk.hpp:3517
bool subdiv_uvs
subdivide or skip mapping channels
Definition: vraysdk.hpp:3532
int subdiv_level
the subdivision level
Definition: vraysdk.hpp:3521
std::string object_path
starting object path in Alembic hierarchy
Definition: vraysdk.hpp:3518
bool use_alembic_offset
true to use Alembic animation frame offset
Definition: vraysdk.hpp:3535
float fps
frames per second for calculation of current time and frame
Definition: vraysdk.hpp:3528
bool instancing
turns on/off the instancing of Alembic duplicated objects
Definition: vraysdk.hpp:3534
bool subdiv_preserve_geom_borders
if true, the borders won't be subdivided
Definition: vraysdk.hpp:3533
int anim_type
animated proxy playback type(0 - loop; 1 - once; 2 - ping - pong; 3 - still)
Definition: vraysdk.hpp:3523
float anim_speed
animated proxy playback speed
Definition: vraysdk.hpp:3526
int subdiv_preserve_map_borders
determines the smoothing mode of the mapping channels' borders. 0-None, 1-Internal and 2-All
Definition: vraysdk.hpp:3522
bool subdiv_all_meshes
true to subdivide Alembic PolyMesh and SubD objects; false to subdivide only SubD objects
Definition: vraysdk.hpp:3531
float anim_offset
animated proxy initial frame offset
Definition: vraysdk.hpp:3527
Controls what the buffer returned by getData() contains.
Definition: vraysdk.hpp:2620
Plugin * alphaChannelPlugin
The plugin describing the alpha channel render element. Can be NULL.
Definition: vraysdk.hpp:2630
bool rgbOrder
true - RGB order, false - BGR order
Definition: vraysdk.hpp:2633
bool useDefaultAlpha
Use any existing alpha render channel.
Definition: vraysdk.hpp:2631
PixelFormat format
The desired pixel format.
Definition: vraysdk.hpp:2632
int layerIndex
For multi-layer elements only. The Cryptomatte layer index (between 0 and num_level/2)....
Definition: vraysdk.hpp:2635
ImageRegion * region
An optional image region rectange; NULL means the whole image.
Definition: vraysdk.hpp:2634
This structure is used to return information about a particular channel in the VFB.
Definition: vraysdk.hpp:2565
BinaryFormat binaryFormat
The channel binary format.
Definition: vraysdk.hpp:2567
Type type
The channel type/alias.
Definition: vraysdk.hpp:2568
const char * name
The name of the channel as it appears in the VFB.
Definition: vraysdk.hpp:2566
Definition: vraysdk.hpp:5862
int rgnLeft
Render region left.
Definition: vraysdk.hpp:5876
int rgnTop
Render region top.
Definition: vraysdk.hpp:5877
float cropRgnHeight
Crop region height.
Definition: vraysdk.hpp:5869
int bmpHeight
Output bitmap height. This is the sampling resolution, not the file resolution.
Definition: vraysdk.hpp:5865
int imgHeight
Output image height.
Definition: vraysdk.hpp:5873
float cropRgnLeft
Crop region left.
Definition: vraysdk.hpp:5866
int rgnHeight
Render region height.
Definition: vraysdk.hpp:5879
float cropRgnTop
Crop region top.
Definition: vraysdk.hpp:5867
int bmpWidth
Output bitmap width. This is the sampling resolution, not the file resolution.
Definition: vraysdk.hpp:5864
int imgWidth
Output image width.
Definition: vraysdk.hpp:5872
int rgnWidth
Render region width.
Definition: vraysdk.hpp:5878
int bitmask
Bitmask which indicates which part to be set or has been set.
Definition: vraysdk.hpp:5887
float cropRgnWidth
Crop region width.
Definition: vraysdk.hpp:5868
Combines various options required for the rendering process.
Definition: vraysdk.hpp:3682
bool showVfbButtonCopyToHostFrameBuffer
show "Duplicate to host frame buffer" button
Definition: vraysdk.hpp:3713
bool showVfbButtonIPRUpdate
show "Update IPR" button
Definition: vraysdk.hpp:3712
bool showVfbAddDenoiserREToSceneButton
show "Add Denoiser to the scene" button
Definition: vraysdk.hpp:3715
std::string vfbLanguage
[OPTIONAL] A language code string telling the VFB which builtin language to load (from VRay::Language...
Definition: vraysdk.hpp:3726
bool showVfbAddLightMixREToSceneButton
show "Add LightMix to the scene" button
Definition: vraysdk.hpp:3714
ThemeStyle vfbDrawStyle
specifies VFB drawing style
Definition: vraysdk.hpp:3693
bool useVfbLog
use built-in VFB log
Definition: vraysdk.hpp:3707
bool noRenderLicensePreCheck
if set appsdk will not check for render node license before rendering is started
Definition: vraysdk.hpp:3700
bool showVfbButtonTestResolution
show "Test Resolution" button
Definition: vraysdk.hpp:3710
bool enableVfbPlugins
Allow the VFB to load plugins.
Definition: vraysdk.hpp:3708
bool showVfbButtonIPRPause
show "Pause IPR" button
Definition: vraysdk.hpp:3711
ThemeStyle
Specifies the drawing style of the VFB widgets.
Definition: vraysdk.hpp:3685
bool hideToSceneButton
hide Light Mix To Scene button
Definition: vraysdk.hpp:3706
bool useDefaultVfbTheme
enabled by default. If set to false the parent application theme is inherited
Definition: vraysdk.hpp:3701
bool enableFrameBuffer
true to enable the frame buffer
Definition: vraysdk.hpp:3698
bool showVfbButtonDebugShading
show "IPR Debug Shading" button
Definition: vraysdk.hpp:3709
bool dockFrameBuffer
dock V-Ray Frame Buffer window
Definition: vraysdk.hpp:3705
bool allowInvalidCharactersInPluginNames
allow invalid characters in plugin names
Definition: vraysdk.hpp:3704
std::string pluginLibraryPath
[OPTIONAL] specifies additional, non-default plugin library paths to load vray_*.dll (libvray_*....
Definition: vraysdk.hpp:3724
bool showFrameBuffer
true to initially show the frame buffer
Definition: vraysdk.hpp:3699
bool previewRenderer
optimize the renderer for small preview purposes
Definition: vraysdk.hpp:3703
bool showVfbButtonInteractiveStart
show "Start IPR" button
Definition: vraysdk.hpp:3702
Definition: vraysdk.hpp:3542
std::string outputFileName
Definition: vraysdk.hpp:3545
bool compressProgressiveFiles
Set to false to disable compression. (These files can get quite large)
Definition: vraysdk.hpp:3548
int progressiveAutoSaveSeconds
Definition: vraysdk.hpp:3558
bool deleteResumableFileOnSuccess
Definition: vraysdk.hpp:3553
See encodeScannedMaterialParams() and getScannedMaterialUILicense()
Definition: vraysdk.hpp:4079
This structure contains the parameters used in the rendering of the scanned materials.
Definition: vraysdk.hpp:4094
int dome
the mapping channel
Definition: vraysdk.hpp:4140
int triplanar
Clear coat multiplier.
Definition: vraysdk.hpp:4162
float ccmul
This parameter modifies the clear coat reflection to metalic behavior, i.e., it modulates the reflect...
Definition: vraysdk.hpp:4161
float cutoff
the reflection rays count, the UI contains subdivision parameter, this must be seto to the square val...
Definition: vraysdk.hpp:4138
int noTransp
the minimal path length of a reflected ray that allows to use GI, if the path is shorter "fear" ray t...
Definition: vraysdk.hpp:4153
float sceneScale
used when the plain option is set to PL_SCRAMBLE, determines the size of the pieces that are continuo...
Definition: vraysdk.hpp:4144
Bool noCachedGI
the output color space (Not used anymore, replaced by the vray color space)
Definition: vraysdk.hpp:4159
ColorSpace
Definition: vraysdk.hpp:4115
@ CS_PP
adobe rgb
Definition: vraysdk.hpp:4118
@ CS_ADOBE
sRGB - linear
Definition: vraysdk.hpp:4117
float saturation
inverse gamma
Definition: vraysdk.hpp:4129
Transform uvtrans
general result multiplier (tint)
Definition: vraysdk.hpp:4133
int noPrimGI
edge displacement, used to prevent the flat appearance of the edges
Definition: vraysdk.hpp:4151
MapChannelsMask mapChBitmask
multiplies the transparency (only the transparency, the translucency remains!) (Not used anymore)
Definition: vraysdk.hpp:4155
float fltStrength
strength of the replace paint effect
Definition: vraysdk.hpp:4157
int disablewmap
displacement/paralax multiplier
Definition: vraysdk.hpp:4131
float sssmul
Clear coat glossiness variation, the measured value is kept in presets.scratchdens.
Definition: vraysdk.hpp:4167
Triplanar
Definition: vraysdk.hpp:4121
@ TP_RNDOFFS
Enable triplanar.
Definition: vraysdk.hpp:4123
@ TP_RNDROT
Enable random offset.
Definition: vraysdk.hpp:4124
float retrace
the primary rays are rendered without using the GI engine (better acuracity, lower speed) (Not used a...
Definition: vraysdk.hpp:4152
ColorSpace clrSpace
strength of the filter
Definition: vraysdk.hpp:4158
int twoside
uniform reflections distribution, when nonzero the importance sampling is not used
Definition: vraysdk.hpp:4149
int displace
same as two side in the standard material
Definition: vraysdk.hpp:4150
int fasttrans
Controls the triplanar mapping, combination of enum Triplanar flags.
Definition: vraysdk.hpp:4163
int nsamples
the z value of the view vector below which bump is gradualy applied
Definition: vraysdk.hpp:4137
MapChannels
Definition: vraysdk.hpp:4102
@ VRSM_FILTER
the color of the material
Definition: vraysdk.hpp:4104
@ VRSM_CCMULT
general color multiplier
Definition: vraysdk.hpp:4105
float paintStrength
bitmask for the maps used in the rendering
Definition: vraysdk.hpp:4156
MapChannelsMask
These values can be combined. Each bit enables the corresponding feature.
Definition: vraysdk.hpp:4109
float transpMul
force opaque rendering even if backside lighting is present.
Definition: vraysdk.hpp:4154
Plain
Definition: vraysdk.hpp:4095
@ PL_HMGSYM
the material is homogenous and potentially anisotropic, an averaged brdf is used instead texture,...
Definition: vraysdk.hpp:4098
@ PL_TRIPLANAR
the material is homogenous and isotropic , no uv mapping is needed
Definition: vraysdk.hpp:4099
@ PL_HMG
no plain strategy
Definition: vraysdk.hpp:4097
int mapChannel
stop of the indirect ray if the total weight is below this value
Definition: vraysdk.hpp:4139
float multdirect
prevent double lighting by direct and reflection rays (not used anymore)
Definition: vraysdk.hpp:4141
float bumpstart
bump multiplier for the inclined views
Definition: vraysdk.hpp:4136
float scrambleSize
limit for the tracing recursion
Definition: vraysdk.hpp:4143
float ccglossyvar
Clear coat glossiness, the measured value is kept in presets.specbell.
Definition: vraysdk.hpp:4166
int usemap
uv mapping transformation matrix
Definition: vraysdk.hpp:4134
float ccbump
clear coat highlights
Definition: vraysdk.hpp:4147
float bumpmul
not used
Definition: vraysdk.hpp:4135
int traceDepth
multipliers for different parts of the light (not used anymore)
Definition: vraysdk.hpp:4142
ScannedMaterialParams()
sss thickness multiplier
int cchlight
the clear coat ior, used for carpaints and other materials with thin refractive layer
Definition: vraysdk.hpp:4146
Color filter
disable use of the enlargement, directly the original small sample is used for rendering (Not used an...
Definition: vraysdk.hpp:4132
float ccmetalrefl
rendering without using the GI engine at all (but most scenes have low scanned materials in count)
Definition: vraysdk.hpp:4160
int BWforGI
Used in volumetric translucency calculation, switches between two models of calculation,...
Definition: vraysdk.hpp:4164
float ccior
the size of one scene unit in cm
Definition: vraysdk.hpp:4145
int unfRefl
used to make the clear coat not perfect
Definition: vraysdk.hpp:4148
float invgamma
this option modifies the rendering in order to improve the result for materials without large details
Definition: vraysdk.hpp:4128
float ccglossy
The material is represented as non colored for the GI rays, used to prevent the color bleeding when t...
Definition: vraysdk.hpp:4165
Definition: vraysdk.hpp:4207
float specbell
Controls how to use the smooth brdf model.
Definition: vraysdk.hpp:4228
int plain
ClearCoat index of reflection.
Definition: vraysdk.hpp:4214
float shdmul
Height multiplier for self shadowing.
Definition: vraysdk.hpp:4225
float fuzzy
Controls the pure reflective behavior for inclined angles, a feature typical for brushed metal.
Definition: vraysdk.hpp:4232
float bumpstart
Bump multiplier for the inclined views.
Definition: vraysdk.hpp:4216
float topvLs_A
Used mostly with top view fabrics, modifies the rendering of the inclined views making them blurred a...
Definition: vraysdk.hpp:4233
float bumpmul
Plain materials strategy.
Definition: vraysdk.hpp:4215
float lfsizecm
value used to control the function converting translucency to transparency
Definition: vraysdk.hpp:4241
float free7
CC specular multiplier (Not used anymore)
Definition: vraysdk.hpp:4230
float orgglvar
the clear coat glossiness the inverse angle deviation width (60 is one degree), since 20....
Definition: vraysdk.hpp:4220
float specmul
CC specular highlights, inverse bell width (60 is one degree)
Definition: vraysdk.hpp:4229
float ccmetalrefl
Multiplier of the indirect light, used to handle the fluorescent materials by putting value below 1 i...
Definition: vraysdk.hpp:4237
ScannedMaterialPreset()
The large feature map physical size.
float orggls
Clear coat noise-like bump amount (there is separate hmap bump)
Definition: vraysdk.hpp:4219
int forcebrdf
Used to render materials with sharp sparks, a procedural map with relative size this param is used to...
Definition: vraysdk.hpp:4227
float indmul
When flakes is nonzero (spark mode) this parameter specifies to not scramble the uv coordinates.
Definition: vraysdk.hpp:4236
int triplanar
The sample thickness in mm, used to introduce alpha/translucency correction of thick materials.
Definition: vraysdk.hpp:4239
int keepflakesuv
Not used anymore (set to 1)
Definition: vraysdk.hpp:4235
float topvLs_B
Used in top view materials to control the light direction correction.
Definition: vraysdk.hpp:4234
int flakes
Brightness multiplier for self shadowing.
Definition: vraysdk.hpp:4226
float depthmul
The z-value of the view vector below which bump is gradualy applied.
Definition: vraysdk.hpp:4217
float transpf
used to force triplanar mapping when certain customer has old vray (luxottica)
Definition: vraysdk.hpp:4240
SmoothModelFlags
Definition: vraysdk.hpp:4208
@ SMF_PS
when set, the BRDF is "forced"
Definition: vraysdk.hpp:4210
@ SMF_FORCE
used in forcebrdf
Definition: vraysdk.hpp:4209
float shdhmul
Clear coat effect multiplier.
Definition: vraysdk.hpp:4224
float ccbump
Displacement multiplier.
Definition: vraysdk.hpp:4218
float free4
the material thumnail relative offset - this is kind of a hack, using the place of an old obsolete pa...
Definition: vraysdk.hpp:4222
int thumbpos
the clearcoat glossiness variation (0-none 1-the shallow anglesare glossy), since 20....
Definition: vraysdk.hpp:4221
The necessary parameters for reading the data in the preset config file (.mbc)
Definition: vraysdk.hpp:9408
std::string fileName
Scatter preset config file (.mbc)
Definition: vraysdk.hpp:9409
float unitRescale
Rescale to specific callers units setup, e.g. the default Cosmos asset units are centimeters,...
Definition: vraysdk.hpp:9411
Plugin scatterPlugin
A GeomScatter plugin instance to be filled by the Scatter preset config.
Definition: vraysdk.hpp:9410
bool isYAxisUp
If true - process as if Y is up axis and otherwise default to Z.
Definition: vraysdk.hpp:9412
Definition: vraysdk.hpp:10931
Object material
Material used for the particle, can be empty/invalid if no material override present.
Definition: vraysdk.hpp:10941
Transform transform
Particle transform.
Definition: vraysdk.hpp:10938
Object node
Particle object, always valid (unless the Particle is invalid).
Definition: vraysdk.hpp:10935
Definition: vraysdk.hpp:10748
CoordinateSystem
The coordinate system in which the preview will be loaded.
Definition: vraysdk.hpp:10761
CacheType
Definition: vraysdk.hpp:10749
Definition: vraysdk.hpp:10671
Definition: vraysdk.hpp:10676
A helper struct with info regarding file exports for plugins of a specified type.
Definition: vraysdk.hpp:2717
std::string fileNameSuffix
Substring to append at the end of the common part of the filename passed to the export function.
Definition: vraysdk.hpp:2721
std::string pluginType
Allowed types: "view", "lights", "geometry", "nodes", "materials", "textures", "bitmaps",...
Definition: vraysdk.hpp:2719
Describes a sub-sequence of an animation range at regular steps (usually step=1)
Definition: vraysdk.hpp:2725
A math object used to define object position, rotation and scale in 3D space.
Definition: vraysdk.hpp:2189
void operator-=(const Transform &tm) noexcept
Subtract another tranformation from this one.
Definition: vraysdk.hpp:2239
Transform() noexcept=default
Default constructor - zero initializes all components.
Vector transformVec(const Vector &a) const noexcept
Definition: vraysdk.hpp:2246
Transform(int i) noexcept
Definition: vraysdk.hpp:2209
Vector inverseTransform(const Vector &a, const Transform &tm) noexcept
Definition: vraysdk.hpp:2322
void makeInverse(void) noexcept
Make the transformation the inverse of its current value.
Definition: vraysdk.hpp:2251
void operator*=(float x) noexcept
Multiply the transformation by a number.
Definition: vraysdk.hpp:2227
void operator+=(const Transform &tm) noexcept
Add another transformation to this one.
Definition: vraysdk.hpp:2233
void makeIdentity(void) noexcept
Make the transformation the identity transformation.
Definition: vraysdk.hpp:2221
void makeZero(void) noexcept
Make the transformation the zero transformation.
Definition: vraysdk.hpp:2215
Structure representing an enumerated item with a value and a name.
Definition: vraysdk.hpp:9838
int value
The integer value of the enum item.
Definition: vraysdk.hpp:9839
std::string name
The string name of the enum item.
Definition: vraysdk.hpp:9840
Definition: vraysdk.hpp:5913
bool skipAllSuccessorsOfCurrentPlugin
Definition: vraysdk.hpp:5926
bool overwriteExistingPlugin
Definition: vraysdk.hpp:5933
bool skipOnlyCurrentPlugin
Definition: vraysdk.hpp:5922
std::string name
Definition: vraysdk.hpp:5917
This stuct is used to describe a menu item in the VFB's custom context menu.
Definition: vraysdk.hpp:5854
int id
ID of the menu item. Should be greater than or equal to 0.
Definition: vraysdk.hpp:5855
bool enabled
False if the menu should be disabled.
Definition: vraysdk.hpp:5858
std::string text
Display text of the menu item.
Definition: vraysdk.hpp:5859
VFBMenuItemType type
Type of the menu item.
Definition: vraysdk.hpp:5856
int defaultValue
Initial value of the item. Used only when the type is "checkbox". 0 means cleared and 1 means checked...
Definition: vraysdk.hpp:5857
Describes a UI font.
Definition: vraysdk.hpp:409
StampFontFamily fontFamily
Font family.
Definition: vraysdk.hpp:411
char fontFace[100]
Name of the font face ("Arial" etc).
Definition: vraysdk.hpp:414
StampFontWeight fontWeight
Font weight.
Definition: vraysdk.hpp:413
int pointSize
Size of text, in points.
Definition: vraysdk.hpp:410
StampFontStyle fontStyle
Font style.
Definition: vraysdk.hpp:412
A struct that encapsulates the export scene options.
Definition: vraysdk.hpp:5754
bool appendFrameSuffix
valid only when currentFrameOnly=true - appends a %04d frame number to the file name
Definition: vraysdk.hpp:5763
std::string sceneBasePath
Optional absolute scene base path that can be used for resolving relative paths for the ....
Definition: vraysdk.hpp:5797
bool renderElementsSeparateFolders
controls the default value of SettingsOutput.relements_separateFolders
Definition: vraysdk.hpp:5759
bool compressed
enables zlib compression of large data arrays; requires hexArrays==true
Definition: vraysdk.hpp:5755
bool stripPaths
If enabled, the paths for bitmap textures and other external files are stripped from the file so that...
Definition: vraysdk.hpp:5764
bool hexArraysHash
data arrays hash will be computed and written for duplicate data
Definition: vraysdk.hpp:5757
bool printHeader
whether to write the comment section with version and time info
Definition: vraysdk.hpp:5760
std::vector< std::string > additionalIncludeFiles
Optional list of files to #include at the end of the main vrscene.
Definition: vraysdk.hpp:5782
bool hexTransforms
transforms will be encoded in hex (mainly useful with large instancers)
Definition: vraysdk.hpp:5758
std::vector< Plugin > pluginExportList
If this is not empty, only these plugins will be exported instead of all plugins in the scene.
Definition: vraysdk.hpp:5779
double rightInterval
Definition: vraysdk.hpp:5773
bool incremental
valid only when currentFrameOnly=true && appendFrameSuffix=false - set to true to incrementally appen...
Definition: vraysdk.hpp:5762
double leftInterval
Definition: vraysdk.hpp:5769
std::vector< SubFileInfo > subFileInfos
A list of files to split the scene into, based on plugin type. See SubFileInfo struct comments.
Definition: vraysdk.hpp:5776
bool hexArrays
data arrays will be encoded in hex
Definition: vraysdk.hpp:5756
int vrfilesComputeHashes
True if MD5 and SHA256 hashes should be computed and written in the .vrfiles file for each resolved a...
Definition: vraysdk.hpp:5799
int vrfilesExport
Enable or disable vrfiles file writing.
Definition: vraysdk.hpp:5795
std::string hostAppString
An optional string identifying the host application, version, etc.
Definition: vraysdk.hpp:5785
int vrdataSmallBufferSizeLimit
Set a limit for the min size of the buffer. If the buffer is smaller it is not written to the vrdata ...
Definition: vraysdk.hpp:5790
bool currentFrameOnly
if true only the current keyframe is exported, otherwise the whole timeline
Definition: vraysdk.hpp:5761
bool vrdataExport
Enable or disable vrdata file writing.
Definition: vraysdk.hpp:5788
int vrdataFileSizeLimitMiB
Limit the size of the vrdata file. If this limit is reached another file is started.
Definition: vraysdk.hpp:5792
Definition: vraysdk.hpp:561
static VRayImage * createFromPng(const void *buffer, size_t size)
Takes raw PNG contents including header to create a copy of the data in a new VRayImage.
VRayImage * getFitOut(int width, int height) const
static VRayImage * createFromBmp(const VRayRenderer &renderer, const void *buffer, size_t size=0)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Png * compressToPng(size_t &size, bool preserveAlpha=false) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
AColor * getPixelData()
Returns a direct pointer to the image contents for in-place modification.
Jpeg * compressToJpeg(size_t &size, int quality=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Bmp * compressToBmp(bool preserveAlpha=false, bool swapChannels=false) const
Returns a new BMP object with a copy of this image's contents. Caller has to delete it.
VRayImage * getResizedCropped(int srcX, int srcY, int srcWidth, int srcHeight, int dstWidth, int dstHeight) const
Returns a new cropped and then resized/rescaled image. Caller has to delete it.
float getGamma() const
Bmp * compressToBmp(size_t &size, bool preserveAlpha=false, bool swapChannels=false) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static VRayImage * createFromJpeg(const VRayRenderer &renderer, const void *buffer, size_t size)
This is an overloaded member function, provided for convenience. It differs from the above function o...
VRayImage * getCropped(int x, int y, int width, int height) const
Returns a new cropped image. Caller has to delete it.
VRayImage * getResized(int width, int height) const
Returns a new resized/rescaled image. Caller has to delete it.
VRayImage * getDownscaled(int width, int height) const
AColor calculateWhiteBalanceMultiplier(WhiteBalanceMode mode) const
Returns a color multiplier to pass to mulColor function.
static void loadSize(const char *fileName, int &width, int &height)
VRayImage * getDownscaledCropped(int srcX, int srcY, int srcWidth, int srcHeight, int dstWidth, int dstHeight) const
IntList_DataType
These correspond to (some of) the values of RawBitmapBuffer::pixels_type.
Definition: vraysdk.hpp:615
@ rgba_float
8-bit int BGRA
Definition: vraysdk.hpp:617
@ bgr_byte
16-bit unsigned int RGBA
Definition: vraysdk.hpp:619
@ rgba_16bit
32-bit float RGBA (sRGB or gamma won't be applied automatically)
Definition: vraysdk.hpp:618
bool setGamma(float gamma)
DrawMode
Definition: vraysdk.hpp:676
@ DRAW_MODE_BLEND_FAST
Alpha-blend using only the source image alpha but keep the original destination image alpha unchanged...
Definition: vraysdk.hpp:678
@ DRAW_MODE_COPY
Overwrite destination image pixels with the source image pixels.
Definition: vraysdk.hpp:677
VRayImage * getFitIn(int width, int height) const
const AColor * getPixelData(size_t &count) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static VRayImage * load(const std::string &fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static VRayImage * createFromBmp(const void *buffer, size_t size=0)
Takes raw BMP contents including header to create a copy of the data in a new VRayImage.
Bmp * compressToBmp(size_t &size, const VRayRenderer &renderer, bool preserveAlpha=false, bool swapChannels=false) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Jpeg * compressToJpeg(size_t &size, const VRayRenderer &renderer, int quality=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool changeGamma(float gamma)
static VRayImage * createFromJpeg(const void *buffer, size_t size)
Takes raw JPEG contents including header to create a copy of the data in a new VRayImage.
static void loadSize(const std::string &fileName, int &width, int &height)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Png * compressToPng(size_t &size, const VRayRenderer &renderer, bool preserveAlpha=false) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Png * compressToPng(bool preserveAlpha=false) const
Returns a new PNG object with a compressed copy of this image's contents. Caller has to delete it.
AColor * getPixelData(size_t &count)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Png * compressToPng(const VRayRenderer &renderer, bool preserveAlpha=false) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Bmp * compressToBmp(const VRayRenderer &renderer, bool preserveAlpha=false, bool swapChannels=false) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
float calculateDifference(const VRayImage *image) const
Jpeg * compressToJpeg(const VRayRenderer &renderer, int quality=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool draw(const VRayImage *image, int x, int y, DrawMode mode=DRAW_MODE_COPY)
VRayImage * getCutIn(int width, int height) const
const AColor * getPixelData() const
Returns a direct pointer to the image contents for reading.
static VRayImage * load(const char *fileName)
bool changeSRGB(bool apply=true)
static VRayImage * createFromPng(const VRayRenderer &renderer, const void *buffer, size_t size)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Jpeg * compressToJpeg(int quality=0) const
Returns a new JPEG object with a compressed copy of this image's contents. Caller has to delete it.
static VRayImage * createFromRawData(const void *buffer, size_t size, IntList_DataType dataType, int width, int height)
Takes raw pixel contents to create a copy of the data in a new VRayImage.
MemoryBuffer * toBitmapData(size_t &size, bool preserveAlpha=false, bool swapChannels=false, bool reverseY=false, int stride=0, int alphaValue=-1) const
The settings passed to the VRayRenderer::setVRayProfiler() interface.
Definition: vraysdk.hpp:3782
std::string outputDirectory
The directory where the profiler reports will be created. If nullptr is passed, temp directory is use...
Definition: vraysdk.hpp:3799
std::string productName
Name of the host product.
Definition: vraysdk.hpp:3801
FileType
Definition: vraysdk.hpp:3792
@ FileType_JSON
This is the raw profiler output, which is passed when an HTML file could not be generated.
Definition: vraysdk.hpp:3794
@ FileType_HTML
An html output file. Needs a valid htmlTemplatePath or valid installation of the default path.
Definition: vraysdk.hpp:3793
int maxDepth
The maximum ray bounces that will be profiled. Range [1, 8].
Definition: vraysdk.hpp:3798
Mode
Definition: vraysdk.hpp:3783
@ Simple
Do not use, this mode will be mapped to Full mode.
@ Process
Only profile the PREPARING state (e.g., plugin initialization, geometry compilation,...
@ Full
Profile the whole rendering process.
std::string htmlTemplatePath
The full path to the profiler html template. If this is left empty, the default location will be sear...
Definition: vraysdk.hpp:3800
Mode mode
Specifies the operational mode of the Profiler.
Definition: vraysdk.hpp:3797
std::string productVersion
Version of the host product.
Definition: vraysdk.hpp:3802
std::string sceneName
Name of the scene that will be profiled. Used as a suffix to the generated filename.
Definition: vraysdk.hpp:3803
Definition: vraysdk.hpp:7737
Definition: vraysdk.hpp:7747
Definition: vraysdk.hpp:7761
Definition of one changed property for LiveLink scene updates.
Definition: vraysdk.hpp:7723
Definition: vraysdk.hpp:9210
void endDurationEvent(const char *name, int threadIndex=0)
void startDurationEvent(const char *name, int threadIndex=0)
void writeAndFreeData()
Explicitly writes the profiler data, if not already written and deinitializes the profiler.
bool isManual()
Returns true if the profiler was initialized manually (through profiler.initializeManually,...
void initializeManually(const VRayProfilerSettings &settings)
General purpose vector in 3D space using float32.
Definition: vraysdk.hpp:850
float lengthSqr(const Vector &a) noexcept
Definition: vraysdk.hpp:1113
Vector & makeZero(void) noexcept
Sets the components of the vector.
Definition: vraysdk.hpp:879
float length(const Vector &a) noexcept
Definition: vraysdk.hpp:1107
Vector & set(T1 x_, T2 y_, T3 z_) noexcept
Sets the components of the vector.
Definition: vraysdk.hpp:873
Vector rotate(const Vector &v, const Vector &axis) noexcept
Definition: vraysdk.hpp:1132
float length(void) const noexcept
Returns the length of the vector.
Definition: vraysdk.hpp:948
float & operator[](const int index) noexcept
Returns the i-th component (0 for x, 1 for y, 2 for z)
Definition: vraysdk.hpp:938
Vector & operator-=(const Vector &other) noexcept
Subtracts the components of the given vector.
Definition: vraysdk.hpp:891
double mixed(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:1092
Vector mul(const Vector &a, const Vector &b) noexcept
Definition: vraysdk.hpp:1063
Vector & operator*=(int factor) noexcept
Multiplies all components by the given number.
Definition: vraysdk.hpp:897
Vector normalize(const Vector &a) noexcept
Definition: vraysdk.hpp:1101
Vector & operator/=(int divisor) noexcept
Divides all components by the given number.
Definition: vraysdk.hpp:915
void rotate(const Vector &axis) noexcept
Rotates the vector along the given axis. The length of the axis is the tangent of the angle of rotati...
Vector operator-(void) const noexcept
Reverses the sign of all components.
Definition: vraysdk.hpp:933
float lengthSqr(void) const noexcept
Returns the squared length of the vector.
Definition: vraysdk.hpp:953
Vector & operator+=(const Vector &other) noexcept
Adds the components of the given vector.
Definition: vraysdk.hpp:885
The information about a voxel.
Definition: vraysdk.hpp:2859
Color wireColor
the diffuse (wire) color of the voxel
Definition: vraysdk.hpp:2860
Bool smoothed
true, if the voxel should be rendered with smoothed normals
Definition: vraysdk.hpp:2861
Bool flipNormals
true, if the geometric normals should be flipped
Definition: vraysdk.hpp:2862
bool multipleFiles
unused
Definition: vraysdk.hpp:814
bool multiChannel
create a single multi-channel file if the file format supports it
Definition: vraysdk.hpp:822
bool velocityZeroBased
unused
Definition: vraysdk.hpp:821
bool skipRGB
do not write the RGB channel into a separate file
Definition: vraysdk.hpp:819
bool frameNumber
the current frame number will be appended to the file name(s)
Definition: vraysdk.hpp:816
bool applyColorCorrections
bake the VFB corrections to the output file
Definition: vraysdk.hpp:823
bool writeExifData
add all the available EXIF data to the written image, if the type supports it
Definition: vraysdk.hpp:824
bool noAlpha
do not write the alpha channel together with the color data
Definition: vraysdk.hpp:817
bool singleChannel
only a single channel is written to the file (the current one in vfb)
Definition: vraysdk.hpp:818
bool skipAlpha
do not write the alpha channel into a separate file
Definition: vraysdk.hpp:815
bool writeIntegerIDs
write to EXR as integer data
Definition: vraysdk.hpp:820
Definition: vraysdk.hpp:3444
static double None()
The None value (double) of the TiMe union In case used in Plugin::setValue(), the given plugin proper...
Definition: vraysdk.hpp:3463
TiMe(double time)
Constructs a TiMe object from a given time (double)
Definition: vraysdk.hpp:3453
static double Default()
Definition: vraysdk.hpp:3459
TiMe()
Default constructor.
Definition: vraysdk.hpp:3451
Definition: vraysdk.hpp:3613