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 <climits>
17#include <utility>
18#include <cstdint>
19#include <cstddef>
20#include <cstdio>
21#include <cstdlib>
22#include <cstring>
23#include <string>
24#include <sstream>
25#include <vector>
26#include <fstream>
27#include <atomic>
28
29#include "_vraysdk_utils.hpp"
30
31#define VRAY_MINIMUM2(a, b) ((a) < (b) ? (a) : (b))
32#define VRAY_MAXIMUM2(a, b) ((a) > (b) ? (a) : (b))
33#define VRAY_MAXIMUM3(a, b, c) VRAY_MAXIMUM2(VRAY_MAXIMUM2(a, b), c)
34#define VRAY_MAXIMUM4(a, b, c, d) VRAY_MAXIMUM2(VRAY_MAXIMUM3(a, b, c), d)
35
36#ifdef APPSDK_QT_NAMESPACE
37namespace APPSDK_QT_NAMESPACE {
38class QWidget;
39} // namespace APPSDK_QT_NAMESPACE
40#else
41#define APPSDK_QT_NAMESPACE
42class QWidget;
43#endif // APPSDK_QT_NAMESPACE
44
45#if defined(VRAY_ALLOW_UNSAFE_NATIVE_HANDLE) || (!defined(_WIN32) && !defined(__APPLE__))
46 typedef void* NativeWindowHandle;
47 typedef void* NativeWidgetHandle;
48#else
49 #ifdef _WIN32
50 #ifndef _WINDEF_
51 typedef struct HWND__ *HWND;
52 #endif
53 typedef HWND NativeWindowHandle;
54 typedef HWND NativeWidgetHandle;
55 #elif __APPLE__
56 #ifdef __OBJC__
57 #define VRAY_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
58 #else
59 #define VRAY_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
60 #endif
61 VRAY_FORWARD_DECLARE_OBJC_CLASS(NSWindow);
62 typedef NSWindow *NativeWindowHandle;
63 VRAY_FORWARD_DECLARE_OBJC_CLASS(NSView);
64 typedef NSView *NativeWidgetHandle;
65 #endif
66#endif
67
68namespace VRay {
69
70namespace Internal {
71 inline float linear_to_srgb(float x) {
72 if (x <= 0.0031308f) {
73 x *= 12.92f;
74 } else {
75 x = 1.055f*powf(x, 1.0f/2.4f)-0.055f;
76 }
77 return x;
78 }
79 inline float srgb_to_linear(float x) {
80 if (x < 0.04045f) {
81 x /= 12.92f;
82 } else {
83 x = powf((x+0.055f)/1.055f, 2.4f);
84 }
85 return x;
86 }
87
88 inline float interpolate(float x, float a, float b) noexcept {
89 return (b - a) * x + a;
90 }
91}
92
93#ifdef _MSC_VER
94# pragma warning(push)
95# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
96#endif // _MSC_VER
97
98#ifdef _MSC_VER
99# define VRAY_DEPRECATED(msg) __declspec(deprecated(msg))
100#else // unix
101// GCC <= 4.4 doesn't support the optional message parameter
102# if defined(__clang__) || COMPILER_VERSION >= 450
103# define VRAY_DEPRECATED(msg) __attribute__((deprecated(msg)))
104# else
105# define VRAY_DEPRECATED(msg) __attribute__((deprecated))
106# endif
107#endif // _MSC_VER
108
109#ifdef VRAY_SDK_INTEROPERABILITY
110 struct Vector;
111 struct Color;
112 namespace VUtils {
113 class Value;
114 class CharString;
115 struct TraceTransform;
116 template<class T> struct PtrArray;
117 typedef PtrArray<int> IntRefList;
118 typedef PtrArray<float> FloatRefList;
119 typedef PtrArray<Vector> VectorRefList;
120 typedef PtrArray<Color> ColorRefList;
121 typedef PtrArray<TraceTransform> TransformRefList;
122 typedef PtrArray<CharString> CharStringRefList;
123 typedef PtrArray<Value> ValueRefList;
124 }
125#endif // VRAY_SDK_INTEROPERABILITY
126
128 enum RendererState {
129 FATAL_ERROR = -1,
130 IDLE_INITIALIZED,
131 IDLE_STOPPED,
132 IDLE_ERROR,
133 IDLE_FRAME_DONE,
134 IDLE_DONE,
135 PREPARING,
136 RENDERING,
137 RENDERING_PAUSED,
138 RENDERING_AWAITING_CHANGES,
139 };
140
141 enum AddHostsResult {
142 FAILED_TO_RESOLVE = -2,
143 RENDERER_ERROR = -1,
144 FAILED_TO_CONNECT = 0,
145 SUCCESSFULLY_ADDED = 1,
146 SUCCESS_BUT_NO_WORK = 2,
147 };
148
149 enum Type {
150
151 // Plugin Property Types
152 TYPE_INT = 0,
153 TYPE_FLOAT = 1,
154 TYPE_DOUBLE = 2,
155 TYPE_BOOL = 3,
156 TYPE_VECTOR = 4,
157 TYPE_COLOR = 5,
158 TYPE_ACOLOR = 6,
159 TYPE_MATRIX = 7,
160 TYPE_TRANSFORM = 8,
161
162 TYPE_STRING = 9,
163 TYPE_PLUGIN = 10,
164 TYPE_TEXTURE = 11,
165 TYPE_LIST = 12,
166 TYPE_TEXTUREFLOAT = 13,
167 TYPE_TEXTUREINT = 14,
168 TYPE_TEXTUREVECTOR = 15,
169 TYPE_TEXTUREMATRIX = 16,
170 TYPE_TEXTURETRANSFORM = 17,
171
172 // List types
173 TYPE_GENERAL_LIST = TYPE_LIST,
174
175 // Typed Lists
176 TYPE_TYPED_LIST_BASE = 100,
177 TYPE_INT_LIST = TYPE_TYPED_LIST_BASE + TYPE_INT,
178 TYPE_FLOAT_LIST = TYPE_TYPED_LIST_BASE + TYPE_FLOAT,
179 TYPE_DOUBLE_LIST = TYPE_TYPED_LIST_BASE + TYPE_DOUBLE,
180 TYPE_BOOL_LIST = TYPE_TYPED_LIST_BASE + TYPE_BOOL,
181 TYPE_VECTOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_VECTOR,
182 TYPE_COLOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_COLOR,
183 TYPE_ACOLOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_ACOLOR,
184 TYPE_MATRIX_LIST = TYPE_TYPED_LIST_BASE + TYPE_MATRIX,
185 TYPE_TRANSFORM_LIST = TYPE_TYPED_LIST_BASE + TYPE_TRANSFORM,
186 TYPE_STRING_LIST = TYPE_TYPED_LIST_BASE + TYPE_STRING,
187 TYPE_PLUGIN_LIST = TYPE_TYPED_LIST_BASE + TYPE_PLUGIN,
188 TYPE_TEXTURE_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTURE,
189 TYPE_TEXTUREFLOAT_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREFLOAT,
190 TYPE_TEXTUREINT_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREINT,
191 TYPE_TEXTUREVECTOR_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREVECTOR,
192 TYPE_TEXTUREMATRIX_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTUREMATRIX,
193 TYPE_TEXTURETRANSFORM_LIST = TYPE_TYPED_LIST_BASE + TYPE_TEXTURETRANSFORM,
194
195 // Output (multi-texture) Property Types
196 TYPE_OUTPUTTEXTURE = 1000,
197 TYPE_OUTPUTTEXTUREFLOAT = 1001,
198 TYPE_OUTPUTTEXTUREINT = 1002,
199 TYPE_OUTPUTTEXTUREVECTOR = 1003,
200 TYPE_OUTPUTTEXTUREMATRIX = 1004,
201 TYPE_OUTPUTTEXTURETRANSFORM = 1005,
202
203 TYPE_UNSPECIFIED = 10000,
204
205 TYPE_ERROR = -1
206 };
207
209 enum MessageLevel {
210 MessageError = 0,
211 MessageWarning = 1,
212 MessageInfo = 2,
213 MessageDebug = 3
214 };
215
216 enum LicenseUserStatus : int {
217 Disabled = 0,
218 QueryFailure = 1,
219 NoActiveUser = 2,
220 ActiveUserPresent = 3,
221 };
222
224 enum ImagePassType {
225 ImagePass_Final = 0,
226 ImagePass_LightCache = 1,
227 ImagePass_IrradianceMap = 2,
228 };
229
231 enum DefaultsPreset {
232 quality_draft,
233 quality_low,
234 quality_medium,
235 quality_high,
236 quality_veryHigh,
237 };
238
240 enum VFBRenderElementType {
241 renderElementType_lightMix=0,
242 renderElementType_denoiser,
243
244 renderElementType_last
245 };
246
247 enum VFBMouseButton {
248 mouseButton_left = 1,
249 mouseButton_right = 2,
250 };
251
254 {
255 int x0, y0, x1, y1;
256
257 ImageRegion(int x = 0, int y = 0, int w = 0, int h = 0) {
258 set(x, y, w, h);
259 }
260
261 void set(int x, int y, int w, int h) {
262 x0 = x;
263 y0 = y;
264 x1 = x + w;
265 y1 = y + h;
266 }
267
268 void setX(int x) {
269 x0 = x;
270 }
271
272 void setY(int y) {
273 y0 = y;
274 }
275
276 void setWidth(int width) {
277 x1 = x0 + width;
278 }
279
280 void setHeight(int height) {
281 y1 = y0 + height;
282 }
283
284 int getX() const {
285 return x0;
286 }
287
288 int getY() const {
289 return y0;
290 }
291
292 int getWidth() const {
293 return x1 - x0;
294 }
295
296 int getHeight() const {
297 return y1 - y0;
298 }
299 };
300
301 typedef unsigned long long InstanceId; // FOR INTERNAL USE ONLY
302 typedef unsigned long long PluginTypeId; // FOR INTERNAL USE ONLY
303 constexpr InstanceId NO_ID = InstanceId(-1);
304 constexpr PluginTypeId NO_TYPE_ID = PluginTypeId(-1);
305
306 namespace Internal {
307 static_assert(sizeof(InstanceId) == 8, "InstanceId should be 8 bytes long");
308 static_assert(sizeof(PluginTypeId) == 8, "PluginTypeId should be 8 bytes long");
309
310 constexpr int INSTANCE_ID_BITS = 48;
311
312 // A helper function to combine InstanceId and PluginTypeId by truncating InstanceId to INSTANCE_ID_BITS (48) bits
313 // and combine and set typeIdIdx in the remaining higher (sizeof(InstanceId) - INSTANCE_ID_BITS) (64-48 = 16) bits.
314 inline InstanceId combineInstanceIdAndTypeIndex(InstanceId id, int typeIdIdx) {
315 return (id & ((InstanceId(1) << INSTANCE_ID_BITS) - 1)) | (InstanceId(typeIdIdx) << INSTANCE_ID_BITS);
316 }
317 }
318
319 typedef int LayerUID; // FOR INTERNAL USE ONLY
320 const LayerUID NO_LAYER_ID = -1;
321
323 namespace VFBLayerProperty {
326 enum Type {
327 IntEnum = -1,
328 Bool,
329 Int,
330 Float,
331 Color,
332 String,
345 Stream
346 };
347
348 enum Flags {
349 NoFlags = 0,
350 Internal = (1 << 0),
351 Hidden = (1 << 1),
352 EnumRadioButtons = (1 << 2),
353 EnumComboBox = (1 << 3),
354
357 Command = (1 << 4),
358
362
363 Transient = (1 << 6),
364 ReadOnly = (1 << 7),
367 NoCustomStyleTag = (1 << 10),
368 NonResettable = (1 << 11),
369 NoUndo = (1 << 12),
370 Advanced = 1 << 13,
371
372 HasPipetteTool = 1 << 14,
373
375 Const = 1 << 15,
376
380
382 Stretched = 1 << 17
383 };
384
394 };
395
400 };
401
407 };
408
415 char fontFace[100];
416 };
417
452
456
458 };
459 };
460
461 typedef unsigned char byte;
462 typedef signed char sbyte;
463 typedef int RGB32;
464 typedef int Bool;
465
466 class VRayRenderer;
467 class Value;
468 struct Color;
469 struct AColor;
470 struct Vector;
471 struct Transform;
472 class Plugin;
473
474 typedef std::vector<int> IntList;
475 typedef std::vector<float> FloatList;
476 typedef std::vector<Color> ColorList;
477 typedef std::vector<Vector> VectorList;
478 typedef std::vector<Transform> TransformList;
479 typedef std::vector<Value> ValueList;
480 typedef std::vector<std::string> StringList;
481 typedef std::vector<Plugin> PluginList;
482
485
486 public:
487 MemoryBuffer() = delete;
488 MemoryBuffer(const MemoryBuffer&) = delete;
489
490 const void* getData() const {
491 return static_cast<const void*>(this);
492 }
493 void* getData() {
494 return static_cast<void*>(this);
495 }
496 static void* operator new (size_t) = delete;
497 static void* operator new[](size_t) = delete;
498 static void operator delete[](void*) = delete;
499 static void operator delete(void* ptr);
500 };
501
503 class Png : public MemoryBuffer {};
505 class Jpeg : public MemoryBuffer {};
507 class VFBState : public MemoryBuffer {};
508
509 #pragma pack(push, 1)
510
513 unsigned short bfType;
514 unsigned bfSize;
515 unsigned bfReserved;
516 unsigned bfOffBits;
517 };
518
521 unsigned biSize;
522 int biWidth;
523 int biHeight;
524 unsigned short biPlanes;
525 unsigned short biBitCount;
526 unsigned biCompression;
527 unsigned biSizeImage;
528 int biXPelsPerMeter;
529 int biYPelsPerMeter;
530 unsigned biClrUsed;
531 unsigned biClrImportant;
532 };
533
536 void* getPixels() const {
537 return (byte*)this + bfOffBits;
538 }
539
540 unsigned getRowStride() const {
541 return (getWidth()*(biBitCount/8) + 3) & ~3;
542 }
543
544 int getWidth() const {
545 return abs(biWidth);
546 }
547
548 int getHeight() const {
549 return abs(biHeight);
550 }
551
552 int getBitsPerPixel() const {
553 return biBitCount;
554 }
555 };
556
558 class Bmp : public BmpHeader, public MemoryBuffer {};
559
560#pragma pack(pop)
561
564 struct VRayImage {
565 static VRayImage* create(int width, int height);
566 static void* operator new (size_t) = delete;
567 static void* operator new[](size_t) = delete;
568 static void operator delete[](void*) = delete;
569 static void operator delete (void *bmp);
570 VRayImage* clone() const;
571
572 int getWidth() const;
573 int getHeight() const;
574 bool getSize(int& width, int& height) const;
575
577 VRayImage* getCropped(int x, int y, int width, int height) const;
578
580 VRayImage* getResized(int width, int height) const;
581
583 VRayImage* getResizedCropped(int srcX, int srcY, int srcWidth, int srcHeight, int dstWidth, int dstHeight) const;
584
587 VRayImage* getDownscaled(int width, int height) const;
588
591 VRayImage* getDownscaledCropped(int srcX, int srcY, int srcWidth, int srcHeight, int dstWidth, int dstHeight) const;
592
595 VRayImage* getFitIn(int width, int height) const;
596
599 VRayImage* getFitOut(int width, int height) const;
600
603 VRayImage* getCutIn(int width, int height) const;
604
606 static VRayImage* createFromBmp(const void* buffer, size_t size = 0);
608 static VRayImage* createFromBmp(const VRayRenderer& renderer, const void* buffer, size_t size = 0);
609
611 static VRayImage* createFromPng(const void* buffer, size_t size);
613 static VRayImage* createFromPng(const VRayRenderer& renderer, const void* buffer, size_t size);
614
616 static VRayImage* createFromJpeg(const void* buffer, size_t size);
618 static VRayImage* createFromJpeg(const VRayRenderer& renderer, const void* buffer, size_t size);
619
622 bgra_byte = 0,
627 };
628
629 // The result of this call can be set directly to RawBitmapBuffer::pixels_type
630 IntList toIntList(IntList_DataType type) const;
631
634 static VRayImage* createFromIntList(const IntList& buffer, IntList_DataType dataType, int width, int height);
635
637 static VRayImage* createFromRawData(const void* buffer, size_t size, IntList_DataType dataType, int width, int height);
638
641 static VRayImage* load(const char* fileName);
643 static VRayImage* load(const std::string& fileName);
644
647 static void loadSize(const char* fileName, int& width, int& height);
649 static void loadSize(const std::string& fileName, int& width, int& height);
650
653 bool setGamma(float gamma);
654
657 float getGamma() const;
658
666 bool changeSRGB(bool apply = true);
667
673 bool changeGamma(float gamma);
674
675 enum WhiteBalanceMode {
676 WHITE_BALANCE_NONE,
677 WHITE_BALANCE_AVERAGE,
678 WHITE_BALANCE_WEIGHTED_AVERAGE,
679 WHITE_BALANCE_HIGHLIGHTS
680 };
681
683 AColor calculateWhiteBalanceMultiplier(WhiteBalanceMode mode) const;
684
688 float calculateDifference(const VRayImage* image) const;
689
690 enum DrawMode : int {
693 };
694
697 bool draw(const VRayImage* image, int x, int y, DrawMode mode = DRAW_MODE_COPY);
698
699 bool addColor(const Color& color);
700 bool addColor(const AColor& color);
701 bool mulColor(const AColor& color);
702 bool changeExposure(float ev);
703 bool changeContrast(float contrast);
704 bool makeNegative();
705
706 bool saveToBmp(const char* fileName, bool preserveAlpha = false, bool swapChannels = false) const;
707 bool saveToBmp(const char* fileName, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
708 bool saveToBmp(const std::string& fileName, bool preserveAlpha = false, bool swapChannels = false) const;
709 bool saveToBmp(const std::string& fileName, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
710
711 bool saveToPng(const char* fileName, bool preserveAlpha = false, int bitsPerChannel = 8) const;
712 bool saveToPng(const char* fileName, const VRayRenderer& renderer, bool preserveAlpha = false, int bitsPerChannel = 8) const;
713 bool saveToPng(const std::string& fileName, bool preserveAlpha = false, int bitsPerChannel = 8) const;
714 bool saveToPng(const std::string& fileName, const VRayRenderer& renderer, bool preserveAlpha = false, int bitsPerChannel = 8) const;
715
716 bool saveToJpeg(const char* fileName, int quality = 0) const;
717 bool saveToJpeg(const char* fileName, const VRayRenderer& renderer, int quality = 0) const;
718 bool saveToJpeg(const std::string& fileName, int quality = 0) const;
719 bool saveToJpeg(const std::string& fileName, const VRayRenderer& renderer, int quality = 0) const;
720
721 bool saveToTiff(const char* fileName, int bitsPerChannel = 16) const;
722 bool saveToTiff(const char* fileName, const VRayRenderer& renderer, int bitsPerChannel = 16) const;
723 bool saveToTiff(const std::string& fileName, int bitsPerChannel = 16) const;
724 bool saveToTiff(const std::string& fileName, const VRayRenderer& renderer, int bitsPerChannel = 16) const;
725
726 bool saveToExr(const char* fileName) const;
727 bool saveToExr(const char* fileName, const VRayRenderer& renderer) const;
728 bool saveToExr(const std::string& fileName) const;
729 bool saveToExr(const std::string& fileName, const VRayRenderer& renderer) const;
730
732 Bmp* compressToBmp(bool preserveAlpha = false, bool swapChannels = false) const;
734 Bmp* compressToBmp(size_t& size, bool preserveAlpha = false, bool swapChannels = false) const;
736 Bmp* compressToBmp(const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
738 Bmp* compressToBmp(size_t& size, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) const;
739
741 Png* compressToPng(bool preserveAlpha = false) const;
743 Png* compressToPng(size_t& size, bool preserveAlpha = false) const;
745 Png* compressToPng(const VRayRenderer& renderer, bool preserveAlpha = false) const;
747 Png* compressToPng(size_t& size, const VRayRenderer& renderer, bool preserveAlpha = false) const;
748
750 Jpeg* compressToJpeg(int quality = 0) const;
752 Jpeg* compressToJpeg(size_t& size, int quality = 0) const;
754 Jpeg* compressToJpeg(const VRayRenderer& renderer, int quality = 0) const;
756 Jpeg* compressToJpeg(size_t& size, const VRayRenderer& renderer, int quality = 0) const;
757
772 size_t& size,
773 bool preserveAlpha = false,
774 bool swapChannels = false,
775 bool reverseY = false,
776 int stride = 0,
777 int alphaValue = -1
778 ) const;
779
781 enum Flags : unsigned {
782 SWAP_CHANNELS = 1,
786 };
787
788 DrawToBitmapParams() = default;
789
790 void* dstPtr = nullptr;
791 int dstWidth = 0;
792 int dstHeight = 0;
793 int x = INT_MIN;
794 int y = INT_MIN;
795 int dstStride = 0;
796 unsigned flags = 0;
797 int alphaValue = -1;
798 unsigned fillerBytes = 0;
800 DrawMode mode = DRAW_MODE_COPY; // A blending mode (e.g. DRAW_MODE_BLEND_FAST) will alpha-blend the source image with the destination pixels.
801 };
802
806 size_t drawToBitmap(const DrawToBitmapParams& params) const;
807
811 AColor* getPixelData(size_t& count);
813 const AColor* getPixelData() const;
815 const AColor* getPixelData(size_t& count) const;
816
817 private:
818 VRayImage() = delete;
819 VRayImage(const VRayImage&) = delete;
820 VRayImage& operator=(const VRayImage &image) = delete;
821 };
822
825 VRayImage* img;
826 LocalVRayImage(const LocalVRayImage& image) = delete;
827 LocalVRayImage& operator=(const LocalVRayImage& image) = delete;
828
829 public:
830 LocalVRayImage(LocalVRayImage&& image) noexcept : img(image.img) {
831 image.img = nullptr;
832 }
833
834 LocalVRayImage& operator=(LocalVRayImage&& image) noexcept {
835 std::swap(img, image.img);
836 return *this;
837 }
838
840 delete img;
841 }
842
843 LocalVRayImage(VRayImage* img) noexcept : img(img) {}
844
845 operator VRayImage* () {
846 return img;
847 }
848
849 operator const VRayImage* () const noexcept {
850 return img;
851 }
852
853 VRayImage* operator->() noexcept {
854 return img;
855 }
856
857 const VRayImage* operator->() const noexcept {
858 return img;
859 }
860
861 VRayImage& operator*() {
862 return *img;
863 }
864
865 const VRayImage& operator*() const {
866 return *img;
867 }
868
869 LocalVRayImage& operator=(VRayImage* image) {
870 delete img;
871 img = image;
872 return *this;
873 }
874 };
875
879 int asInt;
880
881 struct {
882 bool multipleFiles : 1;
883 bool skipAlpha : 1;
884 bool frameNumber : 1;
885 bool noAlpha : 1;
886 bool singleChannel : 1;
887 bool skipRGB : 1;
890 bool multiChannel : 1;
892 bool writeExifData : 1;
893 };
894
895 ImageWriterFlags() : asInt() {}
896 } flags;
897
898 enum CompressionType {
899 DEFAULT,
900 NO_COMPRESSION,
901 RUN_LENGTH,
902 ZIP_SCANLINE,
903 ZIP_BLOCK,
904 PIZ,
905 PXR24,
906 B44,
907 B44A,
908 DWAA,
909 DWAB
911
913
915 };
916
918 struct Vector {
919 union {
920 struct { float x, y, z; };
921 float f[3];
922 };
923
924 Vector(const Vector&) noexcept = default;
925 Vector(Vector&&) noexcept = default;
926 Vector& operator=(const Vector&) noexcept = default;
927 Vector& operator=(Vector&&) noexcept = default;
928
929 Vector() noexcept : x(), y(), z() {}
930
931 template <typename T1, typename T2, typename T3>
932 Vector(T1 x, T2 y, T3 z) noexcept : x(float(x)), y(float(y)), z(float(z)) {}
933
934 template <typename T>
935 explicit Vector(T value) noexcept : x(float(value)), y(float(value)), z(float(value)) {}
936
937 std::string toString() const;
938
940 template <typename T1, typename T2, typename T3>
941 Vector& set(T1 x_, T2 y_, T3 z_) noexcept {
942 x = float(x_), y = float(y_), z = float(z_);
943 return *this;
944 }
945
947 Vector& makeZero(void) noexcept {
948 z = y = x = 0;
949 return *this;
950 }
951
953 Vector& makeNormalized(void) noexcept {
954 float len1=1.0f/length();
955 x*=len1;
956 y*=len1;
957 z*=len1;
958
959 return *this;
960 }
961
963 bool makeNormalized0(void) {
964 float len = length();
965 float maxf = fmaxf(fmaxf(fabsf(x), fabsf(y)), fabsf(z));
966 if (maxf < 1e18f*len) {
967 float len1=1.0f/len;
968 x*=len1;
969 y*=len1;
970 z*=len1;
971 return true;
972 }
973 return false;
974 }
975
977 Vector& operator +=(const Vector &other) noexcept {
978 x += other.x, y += other.y, z += other.z;
979 return *this;
980 }
981
983 Vector& operator -=(const Vector &other) noexcept {
984 x -= other.x, y -= other.y, z -= other.z;
985 return *this;
986 }
987
989 Vector& operator *=(int factor) noexcept {
990 x *= float(factor), y *= float(factor), z *= float(factor);
991 return *this;
992 }
993
995 Vector& operator *=(float factor) noexcept {
996 x *= factor, y *= factor, z *= factor;
997 return *this;
998 }
999
1001 Vector& operator *=(double factor) noexcept {
1002 x *= float(factor), y *= float(factor), z*=float(factor);
1003 return *this;
1004 }
1005
1007 Vector& operator /=(int divisor) noexcept {
1008 x/=float(divisor); y/=float(divisor); z/=float(divisor);
1009 return *this;
1010 }
1011
1013 Vector& operator /=(float divisor) noexcept {
1014 x/=divisor; y/=divisor; z/=divisor;
1015 return *this;
1016 }
1017
1019 Vector& operator /=(double divisor) noexcept {
1020 x/=float(divisor); y/=float(divisor); z/=float(divisor);
1021 return *this;
1022 }
1023
1025 Vector operator -(void) const noexcept {
1026 return Vector(-x, -y, -z);
1027 }
1028
1030 float& operator [](const int index) noexcept {
1031 return f[index];
1032 }
1033
1035 const float& operator [](const int index) const noexcept {
1036 return f[index];
1037 }
1038
1040 float length(void) const noexcept {
1041 return sqrtf(x*x + y*y + z*z);
1042 }
1043
1045 float lengthSqr(void) const noexcept {
1046 return x*x + y*y + z*z;
1047 }
1048
1050 void rotate(const Vector &axis) noexcept;
1051 };
1052
1055 inline Vector operator *(const Vector &a, int factor) noexcept {
1056 Vector res(a);
1057 res *= factor;
1058 return res;
1059 }
1060
1063 inline Vector operator *(const Vector &a, float factor) noexcept {
1064 Vector res(a);
1065 res *= factor;
1066 return res;
1067 }
1068
1071 inline Vector operator *(const Vector &a, double factor) noexcept {
1072 Vector res(a);
1073 res *= factor;
1074 return res;
1075 }
1076
1079 inline Vector operator *(int factor, const Vector &a) {
1080 Vector res(a);
1081 res *= factor;
1082 return res;
1083 }
1084
1087 inline Vector operator *(float factor, const Vector &a) noexcept {
1088 Vector res(a);
1089 res *= factor;
1090 return res;
1091 }
1092
1095 inline Vector operator *(double factor, const Vector &a) noexcept {
1096 Vector res(a);
1097 res *= factor;
1098 return res;
1099 }
1100
1103 inline Vector operator /(const Vector &a, int factor) noexcept {
1104 Vector res(a);
1105 res /= factor;
1106 return res;
1107 }
1108
1111 inline Vector operator /(const Vector &a, float factor) noexcept {
1112 Vector res(a);
1113 res /= factor;
1114 return res;
1115 }
1116
1119 inline Vector operator /(const Vector &a, double factor) noexcept {
1120 Vector res(a);
1121 res /= factor;
1122 return res;
1123 }
1124
1127 inline double operator *(const Vector &a, const Vector &b) noexcept {
1128 return double(a.x)*double(b.x) + double(a.y)*double(b.y) + double(a.z)*double(b.z);
1129 }
1130
1133 inline Vector operator +(const Vector &a, const Vector &b) noexcept {
1134 Vector res(a);
1135 res += b;
1136 return res;
1137 }
1138
1141 inline Vector operator -(const Vector &a, const Vector &b) noexcept {
1142 Vector res(a);
1143 res -= b;
1144 return res;
1145 }
1146
1149 inline Vector operator /(const Vector &a, const Vector &b) noexcept {
1150 return Vector(a.x/b.x, a.y/b.y, a.z/b.z);
1151 }
1152
1155 inline Vector mul(const Vector &a, const Vector &b) noexcept {
1156 return Vector(a.x*b.x, a.y*b.y, a.z*b.z);
1157 }
1158
1161 inline bool operator !=(const Vector &a, const Vector &b) noexcept {
1162 return a.x != b.x || a.y != b.y || a.z != b.z;
1163 }
1164
1168 inline bool operator ==(const Vector &a, const Vector &b) noexcept {
1169 return a.x == b.x && a.y == b.y && a.z == b.z;
1170 }
1171
1174 inline Vector operator ^(const Vector &a, const Vector &b) noexcept {
1175 return Vector(
1176 double(a.y)*double(b.z) - double(b.y)*double(a.z),
1177 double(a.z)*double(b.x) - double(b.z)*double(a.x),
1178 double(a.x)*double(b.y) - double(b.x)*double(a.y)
1179 );
1180 }
1181
1184 inline double mixed(const Vector &a, const Vector &b, const Vector &c) noexcept {
1185 return
1186 (double(a.y)*double(b.z) - double(b.y)*double(a.z))*double(c.x)+
1187 (double(a.z)*double(b.x) - double(b.z)*double(a.x))*double(c.y)+
1188 (double(a.x)*double(b.y) - double(b.x)*double(a.y))*double(c.z);
1189 }
1190
1193 inline Vector normalize(const Vector &a) noexcept {
1194 return a/a.length();
1195 }
1196
1199 inline float length(const Vector &a) noexcept {
1200 return a.length();
1201 }
1202
1205 inline float lengthSqr(const Vector &a) noexcept {
1206 return a.lengthSqr();
1207 }
1208
1211 inline void Vector::rotate(const Vector &axis) noexcept {
1212 float oldLen = length();
1213
1214 Vector d = axis ^ (*this);
1215 d += (*this);
1216
1217 float newLen = d.length();
1218 if (newLen > 1e-6f)
1219 (*this) = d*oldLen/newLen;
1220 }
1221
1224 inline Vector rotate(const Vector &v, const Vector &axis) noexcept {
1225 Vector r(v);
1226 r.rotate(axis);
1227 return r;
1228 }
1229
1230 inline std::ostream& operator <<(std::ostream& stream, const Vector& vector) {
1231 stream << "Vector(" << vector.x << ", " << vector.y << ", " << vector.z << ")";
1232 return stream;
1233 }
1234
1235 inline std::string Vector::toString() const {
1236 std::ostringstream stream;
1237 stream << *this;
1238 return stream.str();
1239 }
1240
1241 struct Matrix;
1243 struct Color {
1244 union {
1245 struct { float r, g, b; };
1246 float rgb[3];
1247 };
1248
1249 Color(const Color&) noexcept = default;
1250 Color(Color&&) noexcept = default;
1251 Color& operator=(const Color&) noexcept = default;
1252 Color& operator=(Color&&) noexcept = default;
1253
1254 Color() noexcept : r(), g(), b() {}
1255
1256 template <typename T1, typename T2, typename T3>
1257 Color(T1 r, T2 g, T3 b) noexcept : r(float(r)), g(float(g)), b(float(b)) {}
1258
1259 template <typename T>
1260 explicit Color(const T& value) noexcept : r(float(value)), g(float(value)), b(float(value)) {}
1261
1264 CIE, sRGB, ACEScg
1265 };
1266
1268 static Color fromTemperature(float temperature, RGBColorSpace colorSpace = sRGB);
1269
1271 float getClosestTemperature(RGBColorSpace colorSpace = sRGB) const;
1272
1274 float getClosestTemperatureAndColor(Color& closestColor, RGBColorSpace colorSpace = sRGB) const;
1275
1281 static Matrix getRGBtoRGBmatrix(RGBColorSpace srcColorSpace, RGBColorSpace dstColorSpace);
1282
1284 float getIntensity() const noexcept {
1285 return (r + g + b) * (1.0f / 3.0f);
1286 }
1287
1289 float getLuminance() const noexcept {
1290 const float RED_LUMINANCE_COMPONENT = 0.3f;
1291 const float GREEN_LUMINANCE_COMPONENT = 0.59f;
1292 const float BLUE_LUMINANCE_COMPONENT = 0.11f;
1293 return RED_LUMINANCE_COMPONENT * r + GREEN_LUMINANCE_COMPONENT * g + BLUE_LUMINANCE_COMPONENT * b;
1294 }
1295
1297 float getLengthSquared() const noexcept {
1298 return r * r + g * g + b * b;
1299 }
1300
1302 float getLength() const noexcept {
1303 return sqrtf(r * r + g * g + b * b);
1304 }
1305
1307 float getPower() const {
1308 return r + g + b;
1309 }
1310
1313 void setSaturation(float k) noexcept {
1314 if (k == 1.0f) return;
1315 float grey = (r + g + b) / 3.0f;
1316 r = Internal::interpolate(k, grey, r);
1317 g = Internal::interpolate(k, grey, g);
1318 b = Internal::interpolate(k, grey, b);
1319 }
1320
1324 void setContrast(float k, float middle = 0.5f) noexcept {
1325 if (k == 1.0f) return;
1326 r = (r - middle) * k + middle;
1327 g = (g - middle) * k + middle;
1328 b = (b - middle) * k + middle;
1329 }
1330
1332 Color getWhiteComplement() const noexcept {
1333 return Color(std::fmaxf(0.0f, 1.0f - r), std::fmaxf(0.0f, 1.0f - g), std::fmaxf(0.0f, 1.0f - b));
1334 }
1335
1338 void makeWhiteComplement() noexcept {
1339 r = std::fmaxf(0.0f, 1.0f - r);
1340 g = std::fmaxf(0.0f, 1.0f - g);
1341 b = std::fmaxf(0.0f, 1.0f - b);
1342 }
1343
1344 std::string toString() const;
1345
1348 void operator +=(const Color &c) noexcept {
1349 r += c.r;
1350 g += c.g;
1351 b += c.b;
1352 }
1353
1356 void operator -=(const Color &c) noexcept {
1357 r -= c.r;
1358 g -= c.g;
1359 b -= c.b;
1360 }
1361
1364 void operator *=(const Color &c) noexcept {
1365 r *= c.r;
1366 g *= c.g;
1367 b *= c.b;
1368 }
1369
1372 void operator *=(int factor) noexcept {
1373 float f = static_cast<float>(factor);
1374 r *= f;
1375 g *= f;
1376 b *= f;
1377 }
1378
1381 void operator *=(float factor) noexcept {
1382 r *= factor;
1383 g *= factor;
1384 b *= factor;
1385 }
1386
1389 void operator *=(double factor) noexcept {
1390 float f = static_cast<float>(factor);
1391 r *= f;
1392 g *= f;
1393 b *= f;
1394 }
1395
1398 void operator /=(const Color &c) noexcept {
1399 r /= c.r;
1400 g /= c.g;
1401 b /= c.b;
1402 }
1403
1406 void operator /=(int factor) noexcept {
1407 float f = static_cast<float>(factor);
1408 r /= f;
1409 g /= f;
1410 b /= f;
1411 }
1412
1415 void operator /=(float factor) noexcept {
1416 r /= factor;
1417 g /= factor;
1418 b /= factor;
1419 }
1420
1423 void operator /=(double factor) noexcept {
1424 float f = static_cast<float>(factor);
1425 r /= f;
1426 g /= f;
1427 b /= f;
1428 }
1429
1431 float maxComponentValue() const noexcept {
1432 const float rg = r > g ? r : g;
1433 return rg > b ? rg : b;
1434 }
1435
1438 Color color2 = Color(r, g, b);
1439 color2.r = Internal::srgb_to_linear(color2.r);
1440 color2.g = Internal::srgb_to_linear(color2.g);
1441 color2.b = Internal::srgb_to_linear(color2.b);
1442 return color2;
1443 }
1444
1447 Color color2 = Color(r, g, b);
1448 color2.r = Internal::linear_to_srgb(color2.r);
1449 color2.g = Internal::linear_to_srgb(color2.g);
1450 color2.b = Internal::linear_to_srgb(color2.b);
1451 return color2;
1452 }
1453
1454 };
1455
1456 std::ostream& operator <<(std::ostream& stream, const Color& color);
1457
1459 inline Color operator +(const Color& a, const Color& b) noexcept {
1460 return Color(
1461 a.r + b.r,
1462 a.g + b.g,
1463 a.b + b.b
1464 );
1465 }
1466
1468 inline Color operator -(const Color& a, const Color& b) noexcept {
1469 return Color(
1470 a.r - b.r,
1471 a.g - b.g,
1472 a.b - b.b
1473 );
1474 }
1475
1477 inline Color operator *(const Color& a, const Color& b) noexcept {
1478 return Color(
1479 a.r * b.r,
1480 a.g * b.g,
1481 a.b * b.b
1482 );
1483 }
1484
1488 inline Color operator *(const Color& a, int factor) noexcept {
1489 float f = static_cast<float>(factor);
1490 return Color(a.r * f, a.g * f, a.b * f);
1491 }
1492
1496 inline Color operator *(const Color& a, float factor) noexcept {
1497 return Color(a.r * factor, a.g * factor, a.b * factor);
1498 }
1499
1503 inline Color operator *(const Color& a, double factor) noexcept {
1504 float f = static_cast<float>(factor);
1505 return Color(a.r * f, a.g * f, a.b * f);
1506 }
1507
1511 inline Color operator *(int factor, const Color& a) noexcept {
1512 return a * float(factor);
1513 }
1514
1518 inline Color operator *(float factor, const Color& a) noexcept {
1519 return a * factor;
1520 }
1521
1525 inline Color operator *(double factor, const Color& a) noexcept {
1526 return a * float(factor);
1527 }
1528
1530 inline Color operator /(const Color& a, const Color& b) noexcept {
1531 return Color(a.r / b.r, a.g / b.g, a.b / b.b);
1532 }
1533
1537 inline Color operator /(const Color& a, int factor) noexcept {
1538 float f = static_cast<float>(factor);
1539 return Color(a.r / f, a.g / f, a.b / f);
1540 }
1541
1545 inline Color operator /(const Color& a, float factor) noexcept {
1546 return Color(a.r / factor, a.g / factor, a.b / factor);
1547 }
1548
1552 inline Color operator /(const Color& a, double factor) noexcept {
1553 float f = static_cast<float>(factor);
1554 return Color(a.r / f, a.g / f, a.b / f);
1555 }
1556
1559 inline bool operator !=(const Color& a, const Color& b) noexcept {
1560 return a.r != b.r || a.g != b.g || a.b != b.b;
1561 }
1562
1566 inline bool operator ==(const Color& a, const Color& b) noexcept {
1567 return a.r == b.r && a.g == b.g && a.b == b.b;
1568 }
1569
1571 struct AColor {
1572 Color color;
1573 float alpha;
1574
1575 AColor(const AColor&) noexcept = default;
1576 AColor(AColor&&) noexcept = default;
1577 AColor& operator=(const AColor&) noexcept = default;
1578 AColor& operator=(AColor&&) noexcept = default;
1579
1580 AColor() noexcept : color(), alpha() {}
1581
1582 template <typename T>
1583 AColor(Color c, T a) noexcept : color(c), alpha(float(a)) {}
1584
1585 template <typename T1, typename T2, typename T3>
1586 AColor(T1 r, T2 g, T3 b) noexcept : color(r, g, b), alpha(1.0f) {}
1587
1588 template <typename T1, typename T2, typename T3, typename T4>
1589 AColor(T1 r, T2 g, T3 b, T4 a) noexcept : color(r, g, b), alpha(float(a)) {}
1590
1591 template <typename T>
1592 explicit AColor(const T& value) noexcept : color(value), alpha(1) {}
1593
1594 std::string toString() const ;
1595
1598 void operator +=(const AColor& c) noexcept {
1599 color += c.color;
1600 alpha += c.alpha;
1601 }
1602
1605 void operator -=(const AColor& c) noexcept {
1606 color -= c.color;
1607 alpha -= c.alpha;
1608 }
1609
1612 void operator *=(const AColor& c) noexcept {
1613 color *= c.color;
1614 alpha *= c.alpha;
1615 }
1616
1619 void operator *=(int factor) noexcept {
1620 color *= float(factor);
1621 alpha *= float(factor);
1622 }
1623
1626 void operator *=(float factor) noexcept {
1627 color *= factor;
1628 alpha *= factor;
1629 }
1630
1633 void operator *=(double factor) noexcept {
1634 color *= float(factor);
1635 alpha *= float(factor);
1636 }
1637
1640 void operator /=(const AColor& c) noexcept {
1641 color /= c.color;
1642 alpha /= c.alpha;
1643 }
1644
1647 void operator /=(int factor) noexcept {
1648 color /= float(factor);
1649 alpha /= float(factor);
1650 }
1651
1654 void operator /=(float factor) noexcept {
1655 color /= factor;
1656 alpha /= factor;
1657 }
1658
1661 void operator /=(double factor) noexcept {
1662 color /= float(factor);
1663 alpha /= float(factor);
1664 }
1665
1667 float getLength() const noexcept {
1668 return sqrtf(color.getLengthSquared() + alpha * alpha);
1669 }
1670
1672 float getLengthSquared() const noexcept {
1673 return color.getLengthSquared() + alpha * alpha;
1674 }
1675
1677 AColor getWhiteComplement() const noexcept {
1678 return AColor(color.getWhiteComplement(), std::fmaxf(0.0f, 1.0f - alpha));
1679 }
1680
1683 void makeWhiteComplement() noexcept {
1684 color.makeWhiteComplement();
1685 alpha = std::fmaxf(0.0f, 1.0f - alpha);
1686 }
1687
1689 float maxComponentValue() const noexcept {
1690 return color.maxComponentValue();
1691 }
1692
1694 AColor fromSRGB() const noexcept {
1695 return AColor(
1696 Internal::srgb_to_linear(color.r),
1697 Internal::srgb_to_linear(color.g),
1698 Internal::srgb_to_linear(color.b),
1699 alpha
1700 );
1701 }
1702
1704 AColor toSRGB() const noexcept {
1705 return AColor(
1706 Internal::linear_to_srgb(color.r),
1707 Internal::linear_to_srgb(color.g),
1708 Internal::linear_to_srgb(color.b),
1709 alpha
1710 );
1711 }
1712
1713 };
1714
1715 inline std::ostream& operator <<(std::ostream& stream, const AColor& acolor) {
1716 stream << "AColor(" << acolor.color.r << ", " << acolor.color.g << ", " << acolor.color.b << ", " << acolor.alpha << ")";
1717 return stream;
1718 }
1719
1720 inline std::string AColor::toString() const {
1721 std::ostringstream stream;
1722 stream << *this;
1723 return stream.str();
1724 }
1725
1727 inline AColor operator +(const AColor& a, const AColor& b) noexcept {
1728 return AColor(
1729 a.color + b.color,
1730 a.alpha + b.alpha
1731 );
1732 }
1733
1735 inline AColor operator -(const AColor& a, const AColor& b) noexcept {
1736 return AColor(
1737 a.color - b.color,
1738 a.alpha - b.alpha
1739 );
1740 }
1741
1743 inline AColor operator *(const AColor& a, const AColor& b) noexcept {
1744 return AColor(
1745 a.color * b.color,
1746 a.alpha * b.alpha
1747 );
1748 }
1749
1753 inline AColor operator *(const AColor& a, int factor) noexcept {
1754 return AColor(
1755 a.color * float(factor),
1756 a.alpha * float(factor)
1757 );
1758 }
1759
1763 inline AColor operator *(const AColor& a, float factor) noexcept {
1764 return AColor(
1765 a.color * factor,
1766 a.alpha * factor
1767 );
1768 }
1769
1773 inline AColor operator *(const AColor& a, double factor) noexcept {
1774 return AColor(
1775 a.color * float(factor),
1776 a.alpha * float(factor)
1777 );
1778 }
1779
1783 inline AColor operator *(int factor, const AColor& a) noexcept {
1784 return a * float(factor);
1785 }
1786
1790 inline AColor operator *(float factor, const AColor& a) noexcept {
1791 return a * factor;
1792 }
1793
1797 inline AColor operator *(double factor, const AColor& a) noexcept {
1798 return a * float(factor);
1799 }
1800
1802 inline AColor operator /(const AColor& a, const AColor& b) noexcept {
1803 return AColor(
1804 a.color / b.color,
1805 a.alpha / b.alpha
1806 );
1807 }
1808
1812 inline AColor operator /(const AColor& a, int factor) noexcept {
1813 return AColor(
1814 a.color / float(factor),
1815 a.alpha / float(factor)
1816 );
1817 }
1818
1822 inline AColor operator /(const AColor& a, float factor) noexcept {
1823 return AColor(
1824 a.color / factor,
1825 a.alpha / factor
1826 );
1827 }
1828
1832 inline AColor operator /(const AColor& a, double factor) noexcept {
1833 return AColor(
1834 a.color / float(factor),
1835 a.alpha / float(factor)
1836 );
1837 }
1838
1841 inline bool operator !=(const AColor& a, const AColor& b) noexcept {
1842 return a.color != b.color || a.alpha != b.alpha;
1843 }
1844
1848 inline bool operator ==(const AColor& a, const AColor& b) noexcept {
1849 return a.color == b.color && a.alpha == b.alpha;
1850 }
1851
1853 struct Matrix {
1854 Vector v0, v1, v2;
1855
1856 std::string toString() const;
1857
1859 Vector& operator [](const int index) noexcept {
1860 return (&v0)[index];
1861 }
1862
1864 const Vector& operator [](const int index) const noexcept {
1865 return (&v0)[index];
1866 }
1867
1869 Matrix() noexcept = default;
1870
1871 Matrix(const Matrix&) noexcept = default;
1872 Matrix(Matrix&&) noexcept = default;
1873 Matrix& operator=(const Matrix&) noexcept = default;
1874 Matrix& operator=(Matrix&&) noexcept = default;
1875
1877 explicit Matrix(float value) noexcept : v0(value, 0, 0), v1(0 ,value, 0), v2(0, 0, value) {}
1878
1880 explicit Matrix(Vector diagonal) noexcept : v0(diagonal.x, 0, 0), v1(0, diagonal.y, 0), v2(0, 0, diagonal.z) {}
1881
1886 Matrix(const Vector &a, const Vector &b, const Vector &c) noexcept : v0(a), v1(b), v2(c) {}
1887
1890 //Matrix(const Matrix& other) noexcept : v0(other.v0), v1(other.v1), v2(other.v2) {}
1891
1896 void set(const Vector &a, const Vector &b, const Vector &c) noexcept {
1897 v0 = a, v1 = b, v2 = c;
1898 }
1899
1901 void set(float value) noexcept {
1902 v0.set(value, 0, 0);
1903 v1.set(0, value, 0);
1904 v2.set(0, 0, value);
1905 }
1906
1909 void set(const Matrix& other) noexcept {
1910 v0 = other.v0;
1911 v1 = other.v1;
1912 v2 = other.v2;
1913 }
1914
1918 void setCol(const int i, const Vector &a) noexcept {
1919 (*this)[i] = a;
1920 }
1921
1925 void setRow(const int i, const Vector &a) noexcept {
1926 (*this)[0][i] = a.x, (*this)[1][i] = a.y, (*this)[2][i]=a.z;
1927 }
1928
1930 void makeZero(void) noexcept {
1931 v0.makeZero();
1932 v1.makeZero();
1933 v2.makeZero();
1934 }
1935
1937 void makeIdentity(void) noexcept {
1938 v0.set(1.0f, 0.0f, 0.0f);
1939 v1.set(0.0f, 1.0f, 0.0f);
1940 v2.set(0.0f, 0.0f, 1.0f);
1941 }
1942
1945 void makeDiagonal(const Vector &a) noexcept {
1946 v0.set(a.x, 0.0f, 0.0f);
1947 v1.set(0.0f, a.y, 0.0f);
1948 v2.set(0.0f, 0.0f, a.z);
1949 }
1950
1951 void makeOuterProduct(const Vector &a, const Vector &b) noexcept {
1952 v0 = a.x*b;
1953 v1 = a.y*b;
1954 v2 = a.z*b;
1955 }
1956
1958 void makeTranspose(void) noexcept {
1959 float t;
1960 t = v0[1], v0[1] = v1[0], v1[0] = t;
1961 t = v0[2], v0[2] = v2[0], v2[0] = t;
1962 t = v1[2], v1[2] = v2[1], v2[1] = t;
1963 }
1964
1968 bool makeInverse(void) noexcept {
1969 Matrix r;
1970 double d = mixed(v0, v1, v2);
1971 bool ret = true;
1972 if (d) {
1973 r.setRow(0, (v1^v2)/d);
1974 r.setRow(1, (v2^v0)/d);
1975 r.setRow(2, (v0^v1)/d);
1976 } else {
1977 r.makeZero();
1978 ret = false;
1979 }
1980 *this = r;
1981 return ret;
1982 }
1983
1984 void addDiagonal(const Vector &a) noexcept {
1985 v0[0] += a[0];
1986 v1[1] += a[1];
1987 v2[2] += a[2];
1988 }
1989
1990 void addTranspose(const Matrix &b) noexcept {
1991 v0[0] += b.v0[0];
1992 v0[1] += b.v1[0];
1993 v0[2] += b.v2[0];
1994
1995 v1[0] += b.v0[1];
1996 v1[1] += b.v1[1];
1997 v1[2] += b.v2[1];
1998
1999 v2[0] += b.v0[2];
2000 v2[1] += b.v1[2];
2001 v2[2] += b.v2[2];
2002 }
2003
2005 void operator *=(float x) noexcept {
2006 v0 *= x, v1 *= x, v2 *= x;
2007 }
2008
2010 void operator /=(float x) noexcept {
2011 v0 /= x, v1 /= x, v2 /= x;
2012 }
2013
2016 void operator +=(const Matrix &m) noexcept {
2017 v0 += m.v0;
2018 v1 += m.v1;
2019 v2 += m.v2;
2020 }
2021
2024 void operator -=(const Matrix &m) noexcept {
2025 v0-=m.v0;
2026 v1-=m.v1;
2027 v2-=m.v2;
2028 }
2029
2031 void rotate(const Vector &axis) noexcept {
2032 v0.rotate(axis);
2033 v1.rotate(axis);
2034 v2.rotate(axis);
2035 }
2036
2037 void makeOrthogonal(void) noexcept {
2038 Matrix t;
2039 t.v0 = normalize(v0);
2040 t.v1 = normalize(v2 ^ v0);
2041 t.v2 = t.v0 ^ t.v1;
2042 v0 = length(v0) * t.v0;
2043 v1 = length(v1) * t.v1;
2044 v2 = length(v2) * t.v2;
2045 }
2046
2047 void makeOrthonormal(void) noexcept {
2048 v0 = normalize(v0);
2049 v1 = normalize(v2 ^ v0);
2050 v2 = normalize(v0 ^ v1);
2051 }
2052 };
2053
2056 inline Matrix inverse(const Matrix &m) noexcept {
2057 Matrix r;
2058 double d = m.v0*(m.v1^m.v2);
2059 r.setRow(0, (m.v1^m.v2)/d);
2060 r.setRow(1, (m.v2^m.v0)/d);
2061 r.setRow(2, (m.v0^m.v1)/d);
2062 return r;
2063 }
2064
2067 inline Vector operator *(const Vector &a, const Matrix &m) noexcept {
2068 return Vector(a*m.v0, a*m.v1, a*m.v2);
2069 }
2070
2073 inline Vector operator *(const Matrix &m, const Vector &a) noexcept {
2074 return a.x*m.v0 + a.y*m.v1 + a.z*m.v2;
2075 }
2076
2079 inline Matrix operator ^(const Matrix &m, const Vector &a) noexcept {
2080 return Matrix(m.v0^a, m.v1^a, m.v2^a);
2081 }
2082
2085 inline Matrix operator ^(const Vector &a, const Matrix &m) noexcept {
2086 return Matrix(a^m.v0, a^m.v1, a^m.v2);
2087 }
2088
2091 inline Matrix operator *(const Matrix &m, float x) noexcept {
2092 return Matrix(m.v0*x, m.v1*x, m.v2*x);
2093 }
2094
2097 inline Matrix operator *(float x, const Matrix &m) noexcept {
2098 return Matrix(x*m.v0, x*m.v1, x*m.v2);
2099 }
2100
2103 inline Matrix operator /(const Matrix &m, float x) noexcept {
2104 return Matrix(m.v0/x, m.v1/x, m.v2/x);
2105 }
2106
2109 inline float operator /(float x, const Matrix &m) noexcept {
2110 return x / float(m.v0*(m.v1^m.v2));
2111 }
2112
2115 inline Matrix operator +(const Matrix &a, const Matrix &b) noexcept {
2116 return Matrix(a.v0 + b.v0, a.v1 + b.v1, a.v2 + b.v2);
2117 }
2118
2121 inline Matrix operator -(const Matrix &a, const Matrix &b) noexcept {
2122 return Matrix(a.v0 - b.v0, a.v1 - b.v1, a.v2 - b.v2);
2123 }
2124
2127 inline Matrix operator *(const Matrix &a, const Matrix &b) noexcept {
2128 Matrix r(
2129 Vector(
2130 a.v0[0]*b.v0[0]+a.v1[0]*b.v0[1]+a.v2[0]*b.v0[2],
2131 a.v0[1]*b.v0[0]+a.v1[1]*b.v0[1]+a.v2[1]*b.v0[2],
2132 a.v0[2]*b.v0[0]+a.v1[2]*b.v0[1]+a.v2[2]*b.v0[2]),
2133 Vector(
2134 a.v0[0]*b.v1[0]+a.v1[0]*b.v1[1]+a.v2[0]*b.v1[2],
2135 a.v0[1]*b.v1[0]+a.v1[1]*b.v1[1]+a.v2[1]*b.v1[2],
2136 a.v0[2]*b.v1[0]+a.v1[2]*b.v1[1]+a.v2[2]*b.v1[2]),
2137 Vector(
2138 a.v0[0]*b.v2[0]+a.v1[0]*b.v2[1]+a.v2[0]*b.v2[2],
2139 a.v0[1]*b.v2[0]+a.v1[1]*b.v2[1]+a.v2[1]*b.v2[2],
2140 a.v0[2]*b.v2[0]+a.v1[2]*b.v2[1]+a.v2[2]*b.v2[2])
2141 );
2142 return r;
2143 }
2144
2147 inline bool operator !=(const Matrix &a, const Matrix &b) noexcept {
2148 return a.v0 != b.v0 || a.v1 != b.v1 || a.v2 != b.v2;
2149 }
2150
2154 inline bool operator ==(const Matrix &a, const Matrix &b) noexcept {
2155 return a.v0 == b.v0 && a.v1 == b.v1 && a.v2 == b.v2;
2156 }
2157
2160 inline Matrix operator -(const Matrix &a) noexcept {
2161 return Matrix(-a.v0, -a.v1, -a.v2);
2162 }
2163
2164 inline Matrix outerProductMatrix(const Vector &a, const Vector &b) noexcept {
2165 return Matrix(a.x*b, a.y*b, a.z*b);
2166 }
2167
2169 inline Matrix transpose(const Matrix &m) noexcept {
2170 return Matrix(
2171 Vector(m.v0[0], m.v1[0], m.v2[0]),
2172 Vector(m.v0[1], m.v1[1], m.v2[1]),
2173 Vector(m.v0[2], m.v1[2], m.v2[2]));
2174 }
2175
2178 inline Matrix rotate(const Matrix &m, const Vector &axis) noexcept {
2179 return Matrix(rotate(m.v0, axis), rotate(m.v1, axis), rotate(m.v2, axis));
2180 }
2181
2184 inline Matrix normalize(const Matrix &m) noexcept {
2185 Vector v0 = normalize(m.v0);
2186 Vector v1 = normalize(m.v2^m.v0);
2187 return Matrix(v0, v1, v0^v1);
2188 }
2189
2192 inline Matrix noScale(const Matrix &m) noexcept {
2193 return Matrix(normalize(m.v0), normalize(m.v1), normalize(m.v2));
2194 }
2195
2198 inline Vector scale(const Matrix &m) noexcept {
2199 return Vector(m[0].length(), m[1].length(), m[2].length());
2200 }
2201
2204 inline Vector rotationAngles(const Matrix& m) noexcept {
2205 const Matrix mns = noScale(m);
2206
2207 /*the 3x3 matrix, starting from identity and given random rotational angles, x,y and z looks like this:
2208 | cy*cz -cy*sz sy |
2209 | sx*sy*cz + cx*cz -sx*sy*sz + cx*cz -sx*cy |
2210 | -cx*sy*cz + sx*sz cx*sy*sz + sx*cz cx*cy |
2211
2212 where the alignment are in V-Ray terms. The Euler angles, with a bit of simplification:
2213 x = atan(-(-sx*cy)/cx*cy) = atan(-a21/a22)
2214 y = asin(sy) = asin(a20)
2215 z = atan(-(-cy*sz)/cy*cz) = atan(-a10/a00)
2216 */
2217
2218 //atan2 will only raise an error if both arguments are 0, which should never happen
2219 //equivalent to a scale of zero
2220 return Vector(
2221 atan2(-mns[2][1], mns[2][2]),
2222 asin(mns[2][0]),
2223 atan2(-mns[1][0], mns[0][0])
2224 );
2225 }
2226
2230 inline Matrix makeRotationMatrixX(float xrot) noexcept {
2231 const float s = sinf(xrot);
2232 const float c = cosf(xrot);
2233 return Matrix(Vector(1.0f, 0.0f, 0.0f), Vector(0, c, s), Vector(0, -s, c));
2234 }
2235
2239 inline Matrix makeRotationMatrixY(float yrot) noexcept {
2240 const float s = sinf(yrot);
2241 const float c = cosf(yrot);
2242 return Matrix(Vector(c, 0, -s), Vector(0.0f, 1.0f, 0.0f), Vector(s, 0, c));
2243 }
2244
2248 inline Matrix makeRotationMatrixZ(float zrot) noexcept {
2249 const float s = sinf(zrot);
2250 const float c = cosf(zrot);
2251 return Matrix(Vector(c, s, 0), Vector(-s, c, 0), Vector(0.0f, 0.0f, 1.0f));
2252 }
2253
2255 inline Matrix normalTransformMatrix(const Matrix &m) noexcept {
2256 return Matrix(m[1]^m[2], m[2]^m[0], m[0]^m[1]);
2257 }
2258
2260 inline Matrix normalTransformMatrixX(const Matrix &m, bool &DlessThanZero ) noexcept {
2261 if((m[0]^m[1])*m[2] < 0){
2262 DlessThanZero = true;
2263 return Matrix(m[2]^m[1], m[0]^m[2], m[1]^m[0]);
2264 }
2265 DlessThanZero = false;
2266 return Matrix(m[1]^m[2], m[2]^m[0], m[0]^m[1]);
2267 }
2268
2272 inline Matrix makeMatrixFromRowMajor(const Vector &a, const Vector &b, const Vector &c) noexcept{
2273 return Matrix(
2274 {a.x, b.x, c.x},
2275 {a.y, b.y, c.y},
2276 {a.z, b.z, c.z}
2277 );
2278 }
2279
2289 inline void simpleDecompose(const Matrix &m, Vector &rotation, Vector &scale, Vector &shear) noexcept {
2290 Matrix rot(m);
2291 // get scaleX and normalize first column
2292 scale[0] = rot.v0.length();
2293 rot.v0.makeNormalized();
2294
2295 shear[0] = (float)(rot.v0 * rot.v1);
2296 if (fabsf(shear[0]) < 1e-6f) shear[0] = 0.0f;
2297 // orthogonalize second column
2298 rot.v1 = rot.v1 - shear[0] * rot.v0;
2299
2300 scale[1] = rot.v1.length();
2301 rot.v1.makeNormalized();
2302
2303 // orthogonalize third column
2304 shear[1] = (float)(rot.v0 * rot.v2);
2305 if (fabsf(shear[1]) < 1e-6f) shear[1] = 0.0f;
2306 rot.v2 = rot.v2 - shear[1] * rot.v0;
2307 shear[2] = (float)(rot.v1 * rot.v2);
2308 if (fabsf(shear[2]) < 1e-6f) shear[2] = 0.0f;
2309 rot.v2 = rot.v2 - shear[2] * rot.v1;
2310
2311 scale[2] = rot.v2.length();
2312 rot.v2.makeNormalized();
2313
2314 shear[0] /= scale[1];
2315 shear[1] /= scale[2];
2316 shear[2] /= scale[2];
2317
2318 // rot should now be an orthonormal matrix
2319
2320 // check for reflection
2321 if (mixed(rot.v1, rot.v2, rot.v0) < 0.0f) {
2322 for (int i = 0; i < 3; i++) {
2323 scale[i] = -scale[i];
2324 rot[i] = -rot[i];
2325 }
2326 }
2327
2328 rotation[1] = asinf(-rot.v0.f[2]);
2329 const float cosBeta = cosf(rotation[1]);
2330 if (fabsf(cosBeta) > 1e-6) {
2331 rotation[0] = atan2f(rot.v1.f[2], rot.v2.f[2]);
2332 rotation[2] = atan2f(rot.v0.f[1], rot.v0.f[0]);
2333 }
2334 else {
2335 rotation[0] = atan2f(rot.v1.f[0], rot.v1.f[1]);
2336 rotation[2] = 0;
2337 }
2338
2339 for (int i = 0; i < 3; ++i) {
2340 if (fabsf(rotation[i]) < 1e-6f) rotation[i] = 0.0f;
2341 if (fabsf(fabsf(scale[i]) - 1.0f) < 1e-6f) scale[i] = (scale[i]<0.0f) ? -1.0f : (scale[i]>0.0f) ? 1.0f : 0.0f;
2342 }
2343 }
2344
2345
2346 inline Matrix simpleCompose(const Vector &rotation, const Vector &scale, const Vector &shear) noexcept {
2347 Matrix result = makeRotationMatrixZ(rotation.z) * makeRotationMatrixY(rotation.y) * makeRotationMatrixX(rotation.x) *
2348 Matrix({1.0f, 0.0f, 0.0f},{shear.x,1.0f,0.0f},{shear.y,shear.z,1.0f}) *
2349 Matrix({scale.x,.0f,.0f},{.0f,scale.y,.0f},{.0f,.0f,scale.z});
2350
2351 return result;
2352 }
2353
2361 inline bool computeQRFactorization(const Matrix &m, Matrix &q, Matrix &r) {
2362 // compute the matrix q using Gram-Schmidt orthogonalization (subtract projections)
2363 q = m;
2364 if (!q[0].makeNormalized0()) return false;
2365
2366 float proj10 = (float)(m[1] * q[0]);
2367 q[1] -= proj10 * q[0];
2368 if (!q[1].makeNormalized0()) return false;
2369
2370 float proj20= (float)(m[2] * q[0]);
2371 float proj21= (float)(m[2] * q[1]);
2372 q[2] -= proj20 * q[0];
2373 q[2] -= proj21 * q[1];
2374 if (!q[2].makeNormalized0()) return false;
2375
2376 // compute the matrix r
2377 r.makeZero();
2378 // compute the scales
2379 for (int i=0; i<3; i++)
2380 r[i][i]= (float)(m[i] * q[i]);
2381
2382 // set the shears
2383 r[1][0] = proj10;
2384 r[2][0] = proj20;
2385 r[2][1] = proj21;
2386
2387 // Since det(q) always inherits the sign of det(m), if det(m)<0, then
2388 // we pass the negative sign of det(q) to det(r). In this way we make sure that always det(q)=1.
2389 if (mixed(m[0], m[1], m[2])<0.0f) {
2390 // Note that the changes below do not change the product q*r.
2391 // Negate the last column of q, to flip the sign of its determinant.
2392 q[2] = -q[2];
2393
2394 // Negate the last row of r, to flip the sign of its determinant. Note that only the last element is nonzero.
2395 r[2][2] = -r[2][2];
2396 }
2397
2398 return true;
2399 }
2400
2407 inline bool computeCholeskyDecomposition(const Matrix &m, Matrix& l) {
2408 l = m;
2409 float accum;
2410 for (int i=0; i<3; i++) {
2411 for (int j=i; j<3; j++) {
2412 accum = l[j][i];
2413 for (int k=i-1; k>=0; k--) {
2414 accum -= l[k][i] * l[k][j];
2415 }
2416 if (i==j) {
2417 if (accum>0.0f) l[i][i]=sqrtf(accum);
2418 else return false;
2419 }
2420 else {
2421 l[i][j] = accum/l[i][i];
2422 }
2423 }
2424 }
2425
2426 //convert to lower-triangular
2427 l[1][0] = 0.0f;
2428 l[2][0] = 0.0f;
2429 l[2][1] = 0.0f;
2430 return true;
2431 }
2432
2433
2434 inline std::ostream& operator <<(std::ostream& stream, const Matrix& matrix) {
2435 stream << "Matrix(" << matrix.v0 << ", " << matrix.v1 << ", " << matrix.v2 << ")";
2436 return stream;
2437 }
2438
2439 inline std::string Matrix::toString() const {
2440 std::ostringstream stream;
2441 stream << *this;
2442 return stream.str();
2443 }
2444
2446 struct Transform {
2447 Matrix matrix;
2448 Vector offset;
2449
2451 Transform() noexcept = default;
2452
2453 Transform(const Transform&) noexcept = default;
2454 Transform(Transform&&) noexcept = default;
2455 Transform& operator=(const Transform&) noexcept = default;
2456 Transform& operator=(Transform&&) noexcept = default;
2457
2461 Transform(const Matrix& matrix, const Vector& offset) noexcept : matrix(matrix), offset(offset) {}
2462
2466 Transform(int i) noexcept {
2467 if (i == 1) makeIdentity();
2468 if (i == 0) makeZero();
2469 }
2470
2472 void makeZero(void) noexcept {
2473 matrix.makeZero();
2474 offset.makeZero();
2475 }
2476
2478 void makeIdentity(void) noexcept {
2479 matrix.makeIdentity();
2480 offset.makeZero();
2481 }
2482
2484 void operator *=(float x) noexcept {
2485 matrix *= x;
2486 offset *= x;
2487 }
2488
2490 void operator +=(const Transform &tm) noexcept {
2491 matrix += tm.matrix;
2492 offset += tm.offset;
2493 }
2494
2496 void operator -=(const Transform &tm) noexcept {
2497 matrix -= tm.matrix;
2498 offset -= tm.offset;
2499 }
2500
2503 Vector transformVec(const Vector &a) const noexcept {
2504 return matrix * a;
2505 }
2506
2508 void makeInverse(void) noexcept {
2509 matrix.makeInverse();
2510 offset = -matrix * offset;
2511 }
2512
2513
2515 void rotate(const Vector& axis) noexcept {
2516 matrix.rotate(axis);
2517 }
2518
2520 void translate(const Vector& offsetParameter) noexcept {
2521 offset += offsetParameter;
2522 }
2523
2525 void scale(const Vector& scale) noexcept{
2526 matrix.v0=mul(scale, matrix.v0);
2527 matrix.v1=mul(scale, matrix.v1);
2528 matrix.v2=mul(scale, matrix.v2);
2529 }
2530
2531 std::string toString() const;
2532 };
2533
2536 inline bool operator !=(const Transform &a, const Transform &b) noexcept {
2537 return a.matrix != b.matrix || a.offset != b.offset;
2538 }
2539
2543 inline bool operator ==(const Transform &a, const Transform &b) noexcept {
2544 return a.matrix == b.matrix && a.offset == b.offset;
2545 }
2546
2549 inline Transform operator -(const Transform &tm) noexcept {
2550 return Transform(-tm.matrix, -tm.offset);
2551 }
2552
2555 inline Transform operator *(const Transform &tm, float x) noexcept {
2556 return Transform(tm.matrix * x, tm.offset * x);
2557 }
2558
2561 inline Transform operator *(float x, const Transform &tm) noexcept {
2562 return Transform(x * tm.matrix, x * tm.offset);
2563 }
2564
2567 inline Transform operator /(const Transform &tm, float x) noexcept {
2568 return Transform(tm.matrix / x, tm.offset / x);
2569 }
2570
2573 inline Transform operator +(const Transform &a, const Transform &b) noexcept {
2574 return Transform(a.matrix + b.matrix, a.offset + b.offset);
2575 }
2576
2579 inline Transform operator -(const Transform &a, const Transform &b) noexcept {
2580 return Transform(a.matrix - b.matrix, a.offset - b.offset);
2581 }
2582
2585 inline Transform operator *(const Transform &a, const Transform &b) noexcept {
2586 return Transform(a.matrix * b.matrix, a.matrix * b.offset + a.offset);
2587 }
2588
2591 inline Vector operator *(const Transform &tm, const Vector &a) noexcept {
2592 return tm.matrix * a + tm.offset;
2593 }
2594
2597 inline Vector inverseTransform(const Vector &a, const Transform &tm) noexcept {
2598 return (a - tm.offset) * tm.matrix;
2599 }
2600
2601 inline std::ostream& operator <<(std::ostream& stream, const Transform& transform) {
2602 stream << "Transform(" << transform.matrix << ", " << transform.offset << ")";
2603 return stream;
2604 }
2605
2606 inline std::string Transform::toString() const {
2607 std::ostringstream stream;
2608 stream << *this;
2609 return stream.str();
2610 }
2611
2614 std::vector<Transform> transforms;
2615 std::vector<int> keyFrames;
2616
2617 AnimatedTransform() noexcept = default;
2618 AnimatedTransform(const AnimatedTransform&) = default;
2619 AnimatedTransform(AnimatedTransform&&) noexcept = default;
2620 AnimatedTransform& operator=(const AnimatedTransform&) = default;
2621 AnimatedTransform& operator=(AnimatedTransform&&) noexcept = default;
2622
2623 AnimatedTransform(const std::vector<Transform>& transforms, const std::vector<int>& keyFrames) noexcept
2625 AnimatedTransform(std::vector<Transform>&& transforms, std::vector<int>&& keyFrames) noexcept
2626 : transforms(std::move(transforms)), keyFrames(std::move(keyFrames)) {}
2627 };
2628
2629 typedef int RGB32;
2630
2631 struct RendererOptions;
2632 class PluginMeta;
2633 class PropertyMeta;
2634 class PropertyRuntimeMeta;
2635 class UIGuides;
2636 struct Box;
2637 struct RenderSizeParams;
2638
2639 namespace Internal {
2640 const float DEFAULT_FPS = 24.0f;
2641 const float DEFAULT_POINT_SIZE = 2.2f;
2642 const long long READ_DATA_STRUCT_VERSION = 5; // added numFrames / hasVelocityChannel / hairVelocities / particleVelocities
2643 const long long READ_PARAMS_STRUCT_VERSION = 2; // updated struct layout
2644 const long long CREATE_PARAMS_STRUCT_VERSION = 7; // added bakeTransforms
2645 const long long GEOM_MESH_DATA_STRUCT_VERSION = 2; // added hair / particles
2646 const long long ENABLE_DRCLIENT_PARAMS_STRUCT_VERSION = 0; // initial version
2647 const long long LIVE_LINK_CLIENT_PARAMS_STRUCT_VERSION = 0; // initial version
2648 const long long SCATTER_READ_PARAMS_STRUCT_VERSION = 0; // initial version
2649 class VRayRendererNative;
2650 class BinaryValueParser;
2651 class BinaryValueBuilder;
2652 struct MeshFileDataParser;
2653 }
2654
2661
2663 : doColorCorrect(false)
2664 , stripAlpha(false)
2665 , flipImage(false)
2666 {}
2667 };
2668
2671 friend class RenderElements;
2672
2673 public:
2675 enum Type {
2676 NONE = -1,
2677 AUTO = 0,
2678
2692
2698
2701
2704
2708
2711
2714
2717
2719
2721
2723
2725
2729
2732
2735
2741
2744
2749
2752
2755
2768
2770
2771 USER=1000,
2772
2773 COVERAGE = USER + 5001,
2775 MULTIMATTE = USER + 5004,
2778 EXTRA_TEX = USER + 5007,
2781 COAT = USER + 5010,
2782 SHEEN = USER + 5011,
2783 AMBIENT_OCCLUSION = USER + 5012,
2784 };
2785
2794 };
2795
2798 PF_DEFAULT = -1,
2804
2809
2814 };
2815
2819
2822
2827
2832
2835
2839
2841 struct Info {
2842 const char *name;
2845 };
2846
2847 private:
2848 const VRayRenderer* renderer;
2849 InstanceId pluginID;
2850 std::string name;
2851 Type type;
2852 BinaryFormat binaryFormat;
2853 PixelFormat defaultPixelFormat;
2854
2855 RenderElement(const VRayRenderer* renderer, Type type, const Plugin &plugin);
2856 static PixelFormat binaryFormatToPixelFormat(BinaryFormat binFormat);
2857
2858 size_t getData_internal(
2859 int layer,
2860 InstanceId alphaPluginID,
2861 void** data,
2862 PixelFormat format = PF_DEFAULT,
2864 bool rgbOrder = false,
2865 const ImageRegion* rgn = nullptr
2866 ) const;
2867
2868 public:
2870 RenderElement() : renderer(nullptr), pluginID(NO_ID), type(NONE), binaryFormat(BF_FLOAT), defaultPixelFormat(PF_DEFAULT) {}
2871
2874
2876 std::string getName() const {
2877 return name;
2878 }
2879
2881 Type getType() const {
2882 return type;
2883 }
2884
2887 return binaryFormat;
2888 }
2889
2892 return defaultPixelFormat;
2893 }
2894
2898 : alphaChannelPlugin(nullptr)
2899 , useDefaultAlpha(false)
2900 , format(PF_DEFAULT)
2901 , rgbOrder(false)
2902 , region(nullptr)
2903 , layerIndex(0)
2904 {}
2905
2912 bool flipImage = false; //<! Flip image top-bottom.
2913 DataIntent intent = DI_INTENT_DISPLAY;
2914 };
2915
2921 size_t getData(void** data, const GetDataOptions &options) const;
2922
2928 size_t getDataIntoBuffer(const GetDataOptions &options, void* data) const;
2929
2931 static void releaseData(void* data);
2932
2938 VRayImage* getImage(const ImageRegion* rgn = nullptr, int layerIndex = 0) const;
2939
2945 VRayImage* getImage(const GetImageOptions &options, int layerIndex = 0) const;
2946
2948 std::string getMetadata() const;
2949
2954 operator bool () const {
2955 return pluginID != NO_ID;
2956 }
2957 };
2958
2961 friend class VRayRenderer;
2962
2963 VRayRenderer& renderer;
2964
2965 RenderElements(VRayRenderer& renderer);
2966 RenderElements& operator=(const RenderElements&);
2967
2968 public:
2973 RenderElement add(RenderElement::Type type, const char* displayName = nullptr, const char* instanceName = nullptr);
2974
2978
2985 size_t get(const std::string &name, const RenderElement::GetDataOptions &options, void* buf) const;
2986
2989 std::vector<RenderElement> getAll(RenderElement::Type type) const;
2990 };
2991
2995 std::string pluginType;
2997 std::string fileNameSuffix;
2998 };
2999
3002 int start, end, step;
3003 };
3004
3007 long long deviceHandle;
3008 long long platform;
3009
3010 std::string name;
3011
3013 struct {
3017 };
3018
3020 enum Type {
3022 deviceType_CPU = (1 << 1),
3023 deviceType_GPU = (1 << 2),
3024 deviceType_ACCEL = (1 << 3),
3025 };
3026
3035
3037 int busId;
3041
3043
3045 };
3046
3050 std::vector<ComputeDeviceInfo> getComputeDevicesMetal();
3051
3055 std::vector<ComputeDeviceInfo> getComputeDevicesMetalRT();
3056
3060 std::vector<ComputeDeviceInfo> getComputeDevicesOptix();
3061
3068 std::vector<ComputeDeviceInfo> getComputeDevicesCUDA();
3069
3073 std::vector<ComputeDeviceInfo> getComputeDevicesDenoiser();
3074
3078 bool setComputeDevicesMetal(const std::vector<int>& indices);
3079
3083 bool setComputeDevicesMetalRT(const std::vector<int>& indices);
3084
3088 bool setComputeDevicesOptix(const std::vector<int>& indices);
3089
3093 bool setComputeDevicesCUDA(const std::vector<int>& indices);
3094
3098 bool setComputeDevicesDenoiser(const std::vector<int>& indices);
3099
3103 bool setComputeDevicesEnvironmentVariable();
3104
3108 unsigned elapsedTicks;
3112 float currentProgress;
3113
3115 std::string name;
3117 float freeMem;
3118 float totalMem;
3119 };
3120
3121 std::vector<ComputeDeviceStatistics> computeDevices;
3122
3124 const char* name;
3125 unsigned long long usage;
3126 };
3127
3128 std::vector<ComputeDeviceMemoryType> computeDevicesMemUsage;
3129 };
3130
3131 typedef std::vector<int> IntList;
3132 typedef std::vector<float> FloatList;
3133 typedef std::vector<Color> ColorList;
3134 typedef std::vector<Vector> VectorList;
3135 typedef std::vector<Value> ValueList;
3136 typedef std::vector<std::string> StringList;
3137
3139 struct ObjectInfo {
3140 std::string name;
3141 int id;
3143 int vEnd;
3144 };
3145
3147 struct VoxelInfo {
3151 };
3152
3154 struct Box {
3157
3160 void expand(const Vector& point) {
3161 pmin = Vector(
3162 VRAY_MINIMUM2(pmin.x, point.x),
3163 VRAY_MINIMUM2(pmin.y, point.y),
3164 VRAY_MINIMUM2(pmin.z, point.z)
3165 );
3166 pmax = Vector(
3167 VRAY_MAXIMUM2(pmax.x, point.x),
3168 VRAY_MAXIMUM2(pmax.y, point.y),
3169 VRAY_MAXIMUM2(pmax.z, point.z)
3170 );
3171 }
3172
3175 void expand(const Box& box) {
3176 pmin = Vector(
3177 VRAY_MINIMUM2(pmin.x, box.pmin.x),
3178 VRAY_MINIMUM2(pmin.y, box.pmin.y),
3179 VRAY_MINIMUM2(pmin.z, box.pmin.z)
3180 );
3181 pmax = Vector(
3182 VRAY_MAXIMUM2(pmax.x, box.pmax.x),
3183 VRAY_MAXIMUM2(pmax.y, box.pmax.y),
3184 VRAY_MAXIMUM2(pmax.z, box.pmax.z)
3185 );
3186 }
3187
3188 std::string toString() const;
3189 };
3190
3191 inline std::ostream& operator <<(std::ostream& stream, const Box& box) {
3192 stream << "Box(min: " << box.pmin << ", max: " << box.pmax << ")";
3193 return stream;
3194 }
3195
3196 inline std::string Box::toString() const {
3197 std::ostringstream stream;
3198 stream << *this;
3199 return stream.str();
3200 }
3201
3206 friend class GeomUtils;
3207 public:
3209 GaussianReadData(GaussianReadData&& rhs) noexcept;
3210 GaussianReadData& operator=(GaussianReadData&& rhs) noexcept;
3212
3215
3217 Vector getPosition(unsigned index) const;
3218
3220 Color getAverageColor(unsigned index) const;
3221
3223 const Box& getPreviewBoundingBox() const { return previewBBox; }
3224
3225 private:
3226 GaussianReadData(const GaussianReadData&) = delete;
3227 GaussianReadData& operator=(const GaussianReadData&) = delete;
3228
3230 void* handle;
3232 Box previewBBox;
3233 };
3234
3239 public:
3240 enum ReadFlags {
3241 MESH_VERTICES = (1 << 4),
3242 MESH_NORMALS = (1 << 5),
3243 MESH_MTLIDS = (1 << 6),
3244 MESH_VELOCITIES = (1 << 7),
3245 MESH_UVS = (1 << 8),
3246 MESH_SHADERS = (1 << 9),
3247 MESH_OBJECTINFOS = (1 << 10),
3248 MESH_HAIROBJECTINFOS = (1 << 11),
3249 MESH_PARTICLEOBJECTINFOS = (1 << 12),
3250 MESH_HAIRGEOMETRY = (1 << 13),
3251 MESH_PARTICLESGEOMETRY = (1 << 14),
3252 MESH_GEOMETRYMESHESBBOXES = (1 << 15),
3253 MESH_HAIROBJECTBBOXES = (1 << 16),
3254 MESH_PARTICLEOBJECTBBOXES = (1 << 17),
3255 MESH_ALL = MESH_VERTICES | MESH_NORMALS | MESH_VELOCITIES | MESH_MTLIDS | MESH_UVS | MESH_SHADERS |
3256 MESH_OBJECTINFOS | MESH_HAIROBJECTINFOS | MESH_PARTICLEOBJECTINFOS | MESH_HAIRGEOMETRY | MESH_PARTICLESGEOMETRY |
3257 MESH_GEOMETRYMESHESBBOXES | MESH_HAIROBJECTBBOXES | MESH_PARTICLEOBJECTBBOXES,
3258 };
3259
3261 ProxyReadData(int flags=MESH_ALL);
3262
3264 void setFlags(int flags) { d.flags = flags; }
3265
3267 const std::vector<Vector> &getVertices() const { return vertices; }
3268
3270 const std::vector<int> &getVertexIndices() const { return indices; }
3271
3273 const std::vector<Vector> &getNormals() const { return normals; }
3274
3276 const std::vector<int> &getNormalIndices() const { return normalIndices; }
3277
3279 const std::vector<int> &getMaterialIDs() const { return materialIDs; }
3280
3282 const std::vector<int> &getEdgeVisibility() const { return edgeVisibility; }
3283
3285 const std::vector<Vector> &getVelocities() const { return velocities; }
3286
3288 int getUVSetsCount() const;
3289
3291 std::vector<int> getUVOriginalIndices() const;
3292
3294 std::string getUVSetName(int setIndex) const;
3295
3297 size_t getUVValuesCount(int setIndex) const;
3298
3300 size_t getUVValueIndicesCount(int setIndex) const;
3301
3303 const Vector * getUVValues(int setIndex) const;
3304
3306 const int * getUVValueIndices(int setIndex) const;
3307
3309 int getShadersCount() const;
3310
3312 std::string getShaderName(int shaderIndex) const;
3313
3315 int getShaderID(int shaderIndex) const;
3316
3319
3321 ObjectInfo getMeshObjectInfo(int meshIndex) const;
3322
3325
3327 ObjectInfo getHairObjectInfo(int meshIndex) const;
3328
3331
3333 ObjectInfo getParticleObjectInfo(int meshIndex) const;
3334
3336 VoxelInfo getMeshVoxelInfo(int meshIndex) const;
3337
3339 VoxelInfo getHairVoxelInfo(int meshIndex) const;
3340
3342 VoxelInfo getParticleVoxelInfo(int meshIndex) const;
3343
3345 const std::vector<Vector> &getHairVertices() const { return hairVertices; }
3346
3348 const std::vector<int> &getHairVerticesPerStrand() const { return hairVerticesPerStrand; }
3349
3351 const std::vector<float> &getHairWidths() const { return hairWidths; }
3352
3354 const std::vector<Vector> &getParticleVertices() const { return particleVertices; }
3355
3357 const std::vector<float> &getParticleWidths() const { return particleWidths; }
3358
3361
3364
3366 int getNumFrames() const;
3367
3370
3372 std::vector<Vector> getVoxelVertices(int voxelIndex) const;
3373
3375 std::vector<int> getVoxelVertexIndices(int voxelIndex) const;
3376
3378 const std::vector<int> &getVoxelVerticesStartIndices() const { return voxelVerticesStartIndices; }
3379
3381 const std::vector<int> &getVoxelVertexIndicesStartIndices() const { return voxelVertexIndicesStartIndices; }
3382
3384 std::vector<Vector> getVoxelNormals(int voxelIndex) const;
3385
3387 std::vector<int> getVoxelNormalIndices(int voxelIndex) const;
3388
3390 const std::vector<int> &getVoxelNormalsStartIndices() const { return voxelNormalsStartIndices; }
3391
3393 const std::vector<int> &getVoxelNormalIndicesStartIndices() const { return voxelNormalIndicesStartIndices; }
3394
3396 std::vector<int> getVoxelMaterialIDs(int voxelIndex) const;
3397
3399 const std::vector<int> &getVoxelMaterialIDsStartIndices() const { return voxelMaterialIDsStartIndices; }
3400
3402 std::vector<int> getVoxelEdgeVisibility(int voxelIndex) const;
3403
3405 std::vector<Vector> getVoxelVelocities(int voxelIndex) const;
3406
3408 const std::vector<int> &getVoxelVelocitiesStartIndices() const { return voxelVelocitiesStartIndices; }
3409
3411 std::vector<Vector> getVoxelUVValues(int voxelIndex, int setIndex) const;
3412
3414 std::vector<int> getVoxelUVValueIndices(int voxelIndex, int setIndex) const;
3415
3417 const std::vector<int> &getVoxelUVValuesStartIndices() const { return voxelUVValuesStartIndices; }
3418
3420 const std::vector<int> &getVoxelUVValueIndicesStartIndices() const { return voxelUVValueIndicesStartIndices; }
3421
3423 const std::vector<Vector> &getUVValues() const { return uvValues; }
3424
3426 const std::vector<int> &getUVValueIndices() const { return uvValueIndices; }
3427
3430
3433
3435 const std::vector<int> &getHairVerticesStartIndices() const { return hairVerticesStartIndices; }
3436
3438 const std::vector<int> &getHairVerticesPerStrandStartIndices() const { return hairVerticesPerStrandStartIndices; }
3439
3441 const std::vector<int> &getHairWidthsStartIndices() const { return hairWidthsStartIndices; }
3442
3444 const std::vector<int> &getHairVelocitiesStartIndices() const { return hairVelocitiesStartIndices; }
3445
3447 const std::vector<int> &getParticleVerticesStartIndices() const { return particleVerticesStartIndices; }
3448
3450 const std::vector<int> &getParticleWidthsStartIndices() const { return particleWidthsStartIndices; }
3451
3453 const std::vector<int> &getParticleVelocitiesStartIndices() const { return particleVelocitiesStartIndices; }
3454
3456 std::vector<Vector> getHairVoxelVertices(int hairVoxelIndex) const;
3457
3459 std::vector<int> getHairVoxelVerticesPerStrand(int hairVoxelIndex) const;
3460
3462 std::vector<float> getHairVoxelWidths(int hairVoxelIndex) const;
3463
3465 std::vector<Vector> getHairVoxelVelocities(int hairVoxelIndex) const;
3466
3468 std::vector<Vector> getParticleVoxelVertices(int particleVoxelIndex) const;
3469
3471 std::vector<float> getParticleVoxelWidths(int particleVoxelIndex) const;
3472
3474 std::vector<Vector> getParticleVoxelVelocities(int particleVoxelIndex) const;
3475
3480 std::vector<int> getArrayOfLengths(const int* startIndices, int elementsCount, int objectCount) const;
3481
3487 std::vector<int> getArrayOfLengths(const int* startIndices, int elementsCount, int objectCount, int uvSetsCount) const;
3488
3494 int getLengthFromStartIndex(int objectIndex, const int* startIndices, int elementsCount, int objectCount) const;
3495
3503 int getLengthFromStartIndex(int objectIndex, int setIndex, const int* startIndices, int elementsCount, int objectCount, int uvSetsCount) const;
3504
3506 const std::vector<Box> &getGeometryVoxelsBBoxes() const { return geometryVoxelsBBoxes; }
3507
3509 const std::vector<Box> &getHairVoxelsBBoxes() const { return hairVoxelsBBoxes; }
3510
3512 const std::vector<Box> &getParticleVoxelsBBoxes() const { return particleVoxelsBBoxes; }
3513
3515 Box getGeometryVoxelBBox(int voxelIndex) const;
3516
3518 Box getHairVoxelBBox(int hairVoxelIndex) const;
3519
3521 Box getParticleVoxelBBox(int particleVoxelIndex) const;
3522
3524 const std::vector<Color> &getVoxelInfoWireColor() const { return voxelInfoWireColor; }
3525
3527 const std::vector<Bool> &getVoxelInfoSmoothed() const { return voxelInfoSmoothed; }
3528
3530 const std::vector<Bool> &getVoxelInfoFlipNormals() const { return voxelInfoFlipNormals; }
3531
3534
3535 private:
3536 friend class VRayRenderer;
3537 friend class Proxy;
3538 void allocateArrays();
3539 std::vector<Vector> getArrayElement (int objectIndex, const int* startIndices, const VectorList& list, int elementsCount, size_t objectCount) const;
3540 std::vector<int> getArrayElement (int objectIndex, const int* startIndices, const int* primaryStartIndices, const IntList& list, int elementsCount, size_t objectCount) const;
3541 std::vector<int> getArrayElement (int objectIndex, const int* startIndices, const IntList& list, int elementsCount, size_t objectCount) const;
3542 std::vector<float> getArrayElement (int objectIndex, const int* startIndices, const FloatList& list, int elementsCount, size_t objectCount) const;
3543 std::vector<Vector> getArrayElement (int objectIndex, int setIndex, const int* startIndices, const VectorList& list, int elementsCount, size_t objectCount, size_t uvSetsCount) const;
3544 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;
3545
3546 struct Internal {
3547 long long version;
3548 union {
3549 long long int flags;
3550 struct {
3551 bool maxToMayaTM : 1;
3552 bool mayaToMaxTM : 1;
3553 bool reserved_bit2 : 1;
3554 bool reserved_bit3 : 1;
3555 bool use_vertices : 1;
3556 bool use_normals : 1;
3557 bool use_mtlIDs : 1;
3558 bool use_velocities : 1;
3559 bool use_UVs : 1;
3560 bool use_shaders : 1;
3561 bool use_objectInfos : 1;
3562 bool use_hairObjectInfos : 1;
3563 bool use_particleObjectInfos : 1;
3564 bool use_hair : 1;
3565 bool use_particles : 1;
3566 bool use_geometryVoxelsBBoxes : 1;
3567 bool use_hairVoxelsBBoxes : 1;
3568 bool use_particleVoxelsBBoxes : 1;
3569 };
3570 };
3571
3572 float* vertices;
3573 size_t vertices_count;
3574 int* indices;
3575 size_t indices_count;
3576 float* normals;
3577 size_t normals_count;
3578 int* normalIndices;
3579 size_t normalIndices_count;
3580 int* materialIDs;
3581 size_t materialIDs_count;
3582 float* velocities;
3583 size_t velocities_count;
3584
3585 char* uvSetNames;
3586 float* uvValues;
3587 int* uvValueIndices;
3588 size_t uvSets_count;
3589 size_t uvSetNames_length;
3590 int uvSetIndices[100];
3591 size_t uvValues_counts[100];
3592 size_t uvValueIndices_counts[100];
3593
3594 char* shaderNames;
3595 int* shaderIds;
3596 size_t shaders_count;
3597 size_t shaderNames_length;
3598
3599 char* objectInfoNames;
3600 int* objectInfoIds;
3601 int* objectInfoVBegins;
3602 int* objectInfoVEnds;
3603 size_t objectInfos_count;
3604 size_t objectInfoNames_length;
3605
3606 char* hairObjectInfoNames;
3607 int* hairObjectInfoIds;
3608 int* hairObjectInfoVBegins;
3609 int* hairObjectInfoVEnds;
3610 size_t hairObjectInfos_count;
3611 size_t hairObjectInfoNames_length;
3612
3613 char* particleObjectInfoNames;
3614 int* particleObjectInfoIds;
3615 int* particleObjectInfoVBegins;
3616 int* particleObjectInfoVEnds;
3617 size_t particleObjectInfos_count;
3618 size_t particleObjectInfoNames_length;
3619
3620 float* hairVertices;
3621 size_t hairVertices_count;
3622 int* hairVerticesPerStrand;
3623 size_t hairVerticesPerStrand_count;
3624 float* particleVertices;
3625 size_t particlesVertices_count;
3626
3627 int* voxelVerticesStartIndices;
3628 int* voxelVertexIndicesStartIndices;
3629 int* voxelNormalsStartIndices;
3630 int* voxelNormalIndicesStartIndices;
3631 int* voxelMaterialIDsStartIndices;
3632 int* voxelVelocitiesStartIndices;
3633 int* voxelUVValuesStartIndices;
3634 int* voxelUVValueIndicesStartIndices;
3635
3636 float* geometryVoxelsBBoxes;
3637 float* hairVoxelsBBoxes;
3638 float* particleVoxelsBBoxes;
3639
3640 int* hairVerticesStartIndices;
3641 int* hairVerticesPerStrandStartIndices;
3642 int* particleVerticesStartIndices;
3643
3644 size_t geometryVoxels_count;
3645 size_t hairVoxels_count;
3646 size_t particleVoxels_count;
3647
3648 size_t totalUVvalues;
3649 size_t totalUVindices;
3650
3651 int* edgeVisibility;
3652
3653 Color* voxelInfoWireColor;
3654 int* voxelInfoSmoothed;
3655 int* voxelInfoFlipNormals;
3656 size_t voxelInfoObjects_count;
3657
3658 float* hairWidths;
3659 size_t hairWidths_count;
3660 int* hairWidthsStartIndices;
3661 float* particleWidths;
3662 size_t particleWidths_count;
3663 int* particleWidthsStartIndices;
3664
3665 int numFrames;
3666 Bool hasVelocityChannel;
3667
3668 float* hairVelocities;
3669 size_t hairVelocities_count;
3670 int* hairVelocitiesStartIndices;
3671 float* particleVelocities;
3672 size_t particleVelocities_count;
3673 int* particleVelocitiesStartIndices;
3674 } d;
3675
3676 std::vector<Vector> vertices;
3677 std::vector<int> indices;
3678 std::vector<Vector> normals;
3679 std::vector<int> normalIndices;
3680 std::vector<int> materialIDs;
3681 std::vector<Vector> velocities;
3682 std::vector<char> uvSetNames;
3683 std::vector<Vector> uvValues;
3684 std::vector<int> uvValueIndices;
3685 std::vector<char> shaderNames;
3686 std::vector<int> shaderIds;
3687 std::vector<char> objectInfoNames;
3688 std::vector<int> objectInfoIds;
3689 std::vector<int> objectInfoVBegins;
3690 std::vector<int> objectInfoVEnds;
3691 std::vector<char> hairObjectInfoNames;
3692 std::vector<int> hairObjectInfoIds;
3693 std::vector<int> hairObjectInfoVBegins;
3694 std::vector<int> hairObjectInfoVEnds;
3695 std::vector<char> particleObjectInfoNames;
3696 std::vector<int> particleObjectInfoIds;
3697 std::vector<int> particleObjectInfoVBegins;
3698 std::vector<int> particleObjectInfoVEnds;
3699 std::vector<Vector> hairVertices;
3700 std::vector<int> hairVerticesPerStrand;
3701 std::vector<Vector> particleVertices;
3702 std::vector<int> voxelVerticesStartIndices;
3703 std::vector<int> voxelVertexIndicesStartIndices;
3704 std::vector<int> voxelNormalsStartIndices;
3705 std::vector<int> voxelNormalIndicesStartIndices;
3706 std::vector<int> voxelMaterialIDsStartIndices;
3707 std::vector<int> voxelVelocitiesStartIndices;
3708 std::vector<int> voxelUVValuesStartIndices;
3709 std::vector<int> voxelUVValueIndicesStartIndices;
3710 std::vector<Box> geometryVoxelsBBoxes;
3711 std::vector<Box> hairVoxelsBBoxes;
3712 std::vector<Box> particleVoxelsBBoxes;
3713 std::vector<int> hairVerticesStartIndices;
3714 std::vector<int> hairVerticesPerStrandStartIndices;
3715 std::vector<int> particleVerticesStartIndices;
3716 std::vector<int> edgeVisibility;
3717 std::vector<Color> voxelInfoWireColor;
3718 std::vector<Bool> voxelInfoSmoothed;
3719 std::vector<Bool> voxelInfoFlipNormals;
3720 std::vector<float> hairWidths;
3721 std::vector<int> hairWidthsStartIndices;
3722 std::vector<float> particleWidths;
3723 std::vector<int> particleWidthsStartIndices;
3724 std::vector<Vector> hairVelocities;
3725 std::vector<int> hairVelocitiesStartIndices;
3726 std::vector<Vector> particleVelocities;
3727 std::vector<int> particleVelocitiesStartIndices;
3728 };
3729
3732 union TiMe {
3733 private:
3734 int64_t asInt;
3735 double asDouble;
3736 explicit TiMe(int64_t time) : asInt(time) {}
3737 public:
3739 TiMe() : asInt(-1) {}
3741 explicit TiMe(double time) : asDouble(time) {}
3743 operator double() { return asDouble; }
3747 static double Default() { return TiMe(int64_t(-1)).asDouble; }
3751 static double None() { return TiMe(int64_t(-2)).asDouble; }
3752 };
3753
3777
3779
3780 std::string destination;
3788
3789 std::vector<std::string> objectNames;
3790 std::vector<int> objectIDs;
3791 std::string customPreviewFile;
3792 std::vector<Color> voxelInfoWireColor;
3793 std::vector<Bool> voxelInfoSmoothed;
3794 std::vector<Bool> voxelInfoFlipNormals;
3795
3801 };
3802
3805 std::string file;
3806 std::string object_path;
3816 float fps;
3826
3828 };
3829
3833 std::string outputFileName;
3834
3837
3842
3847
3850 {}
3851 };
3852
3854 enum FlagVal : byte {
3855 Disabled = 0,
3857 Default = 0xFF
3859
3866
3869
3870 DenoiserOptions(const DenoiserOptions& options) = default;
3871 DenoiserOptions& operator=(const DenoiserOptions& options) = default;
3872 };
3873
3874 class LightUtils;
3875
3879 friend LightUtils;
3880 public:
3881 LuminaireFieldReadPreviewData() : luminaireFieldHandle(nullptr) {}
3883
3885 bool isValid() const;
3888 bool useConvexHull() const;
3892 float getScale() const;
3894 std::vector<Vector> getConvexHullVertices() const;
3896 std::vector<int> getConvexHullTriangles() const;
3897 private:
3898 void* luminaireFieldHandle;
3899 };
3900
3902 struct {
3903 unsigned char revision;
3904 unsigned char minor;
3905 unsigned short major;
3906 };
3907 unsigned allFields;
3908
3909 #ifdef _MSC_VER
3910 #pragma warning(disable : 4996)
3911 #endif
3912 std::string toString() const {
3913 std::string str;
3914 str.resize(15);
3915 int n = std::snprintf(&str[0], str.size() - 1, "%u.%02u.%02u", major, minor, revision);
3916 str.resize(n);
3917 return str;
3918 }
3919 #ifdef _MSC_VER
3920 #pragma warning(default : 4996)
3921 #endif
3922 };
3923 typedef VersionUnion VRayVersion;
3924 typedef VersionUnion APIVersion;
3925
3926 inline std::ostream& operator <<(std::ostream& stream, const VRayVersion& version) {
3927 stream << version.toString();
3928 return stream;
3929 }
3930
3933 static const int useParentTimes = (1 << 0);
3934 static const int useObjectID = (1 << 1);
3935 static const int usePrimaryVisibility = (1 << 2);
3936 static const int useUserAttributes = (1 << 3);
3937 static const int useParentTimesAtleastForGeometry = (1 << 4);
3939 static const int useMaterial = (1 << 5);
3940 static const int useGeometry = (1 << 6);
3941 static const int useMapChannels = (1 << 7);
3942 static const int useSkipCryptomatte = (1 << 8);
3943 static const int useRenderIDOverride = (1 << 9);
3944 static const int useUserAttributesBin = (1 << 10);
3945 static const int useObjectProperties = (1<<11);
3946 };
3947
3948 struct ScannedMaterialParams;
3949 struct ScannedMaterialPreset;
3950
3955 float ISO;
3957 };
3958} // namespace VRay
3959
3960// internal function declarations
3961#include "_vraysdk_import.hpp"
3962
3963namespace VRay {
3964 namespace Language {
3965 constexpr const char* EN_US = "en-US";
3966 constexpr const char* ZH_CN = "zh-CN";
3967 }
3968
3971
3974 ThemeStyleAuto = 0,
3975 ThemeStyleStandalone,
3976 ThemeStyle3dsMax,
3977 ThemeStyle3dsMaxQt,
3978 ThemeStyleMaya,
3979 };
3980
3982
3983 union {
3984 int flags;
3985 struct {
3995 bool useVfbLog : 1;
4004 bool forwardProgressToVfbProgressBar : 1; // true to forward progress messages to VFB progress bar
4005 };
4006 };
4007
4010 void* parentWindowHandle;
4011
4012 std::string pluginLibraryPath;
4013
4014 std::string vfbLanguage;
4015
4017 : vfbDrawStyle(ThemeStyleAuto)
4018 , flags(0)
4019 , parentWindowHandle()
4020 {
4021 enableFrameBuffer = true;
4022 showFrameBuffer = true;
4023 useDefaultVfbTheme = true;
4024 useVfbLog = true;
4025 }
4026
4027 RendererOptions(const RendererOptions& options) = default;
4028 RendererOptions(RendererOptions&& options) = default;
4029
4030 RendererOptions& operator=(const RendererOptions& options) = default;
4031 RendererOptions& operator=(RendererOptions&& options) = default;
4032
4033 void swap(RendererOptions& options) noexcept;
4034 };
4035
4038 std::string dispatcher;
4039 std::string httpProxy;
4040 union {
4041 int flags;
4042 struct {
4047 bool immediatelyForwardReadySplitBucketSubunits : 1;
4048 };
4049 };
4053
4055 : flags(0)
4056 , connectTimeout(10)
4057 , upstreamChannels(3)
4058 , verboseLevel(3) {
4059 pipelinedUpstream = true;
4061 }
4062 };
4063
4065 std::string hosts; // can either be an empty string or host[:port]
4066 std::string vantageFile; // absolute path to .vantage file
4067 };
4068
4071 enum class Mode {
4072 Off = 0,
4073 Simple,
4074 Full,
4075 Process,
4076 };
4077
4080 enum FileType : int {
4083 };
4084
4087 std::string outputDirectory;
4088 std::string htmlTemplatePath;
4089 std::string productName;
4090 std::string productVersion;
4091 std::string sceneName;
4092
4094 mode = Mode::Off;
4095 maxDepth = 1;
4096 }
4097 };
4098
4099
4100#if !defined(VRAY_RUNTIME_LOAD_PRIMARY) && !defined(VRAY_RUNTIME_LOAD_SECONDARY)
4103 class VRayInit {
4104 VRayInit(VRayInit&); // copy construction disabled
4105
4106 public:
4107 enum Flags : unsigned {
4110 };
4111
4112 VRayInit() {
4113 Internal::VRay_incrementModuleReferenceCounter();
4114 }
4115
4117 explicit VRayInit(unsigned enableFlags) {
4118 Internal::VRay_incrementModuleReferenceCounter();
4119 Internal::VRay_enableFrameBuffer((enableFlags & EnableFrameBuffer)!=0);
4120 Internal::VRay_LicenseManager_enableChaosCloudLicensing((enableFlags & EnableChaosCloudLicensing)!=0);
4121 }
4122
4123#ifdef _WIN32
4126 void setUseParentEventLoop() {
4127 Internal::VRay_blendFrameBuffer();
4128 }
4129#endif // _WIN32
4130
4134 void setGUIMessageProcessing(bool enableMessageProcessing) {
4135 Internal::VRay_GUIMessageProcessing(enableMessageProcessing);
4136 }
4137
4142 void setOSMessageDispatching(bool enableMessageDispatching) {
4143 Internal::VRay_OSMessageDispatching(enableMessageDispatching);
4144 }
4145
4146 ~VRayInit() {
4147 Internal::VRay_LicenseManager_releaseLicense();
4148 }
4149 };
4150
4151#elif defined(VRAY_RUNTIME_LOAD_PRIMARY)
4154 class VRayInit {
4155 VRayInit(VRayInit&); // copy construction disabled
4156
4157 public:
4158 enum Flags : unsigned {
4159 EnableFrameBuffer=(1u<<0),
4161 };
4165 explicit VRayInit(const char* const libraryFileName) {
4166 initialize(libraryFileName);
4167 if (Internal::VRay_incrementModuleReferenceCounter) Internal::VRay_incrementModuleReferenceCounter();
4168 }
4169
4174 VRayInit(const char* const libraryFileName, unsigned enableFlags) {
4175 initialize(libraryFileName);
4176 if (Internal::VRay_incrementModuleReferenceCounter) Internal::VRay_incrementModuleReferenceCounter();
4177 if (Internal::VRay_enableFrameBuffer) Internal::VRay_enableFrameBuffer((enableFlags & EnableFrameBuffer)!=0);
4178 if (Internal::VRay_LicenseManager_enableChaosCloudLicensing) Internal::VRay_LicenseManager_enableChaosCloudLicensing((enableFlags & EnableChaosCloudLicensing)!=0);
4179 }
4180
4181#ifdef _WIN32
4184 void setUseParentEventLoop() {
4185 Internal::VRay_blendFrameBuffer();
4186 }
4187#endif // _WIN32
4188
4192 void setGUIMessageProcessing(bool enableMessageProcessing) {
4193 Internal::VRay_GUIMessageProcessing(enableMessageProcessing);
4194 }
4195
4200 void setOSMessageDispatching(bool enableMessageDispatching) {
4201 Internal::VRay_OSMessageDispatching(enableMessageDispatching);
4202 }
4203
4204 ~VRayInit() {
4205 if (Internal::VRay_LicenseManager_releaseLicense)
4206 Internal::VRay_LicenseManager_releaseLicense();
4207 release();
4208 }
4209
4210 operator bool () const {
4211 return !!hLib;
4212 }
4213
4215 std::string getSDKLibraryErrorString() const {
4216 return errString;
4217 }
4218
4219 protected:
4220 VRayInit() {}
4221
4222 Internal::HModule hLib;
4223 std::string errString;
4224
4225#ifdef VRAY_NOTHROW
4226 void makeError(const std::string &errMsg) {
4227 errString = errMsg;
4228 hLib = nullptr;
4229 }
4230#endif // VRAY_NOTHROW
4231
4232 void initialize(const char* libraryFileName);
4233 void importFunctions();
4234
4235 void release() {
4236 if (hLib)
4237#ifdef _WIN32
4238 Internal::FreeLibrary(hLib);
4239#else
4240 Internal::dlclose(hLib);
4241#endif // _WIN32
4242 }
4243 };
4244#endif // #if !defined(VRAY_RUNTIME_LOAD_PRIMARY) && !defined(VRAY_RUNTIME_LOAD_SECONDARY)
4245
4248 inline bool isDR2() {
4249 return !!Internal::VRay_isDR2();
4250 }
4251
4253 inline APIVersion getAPIVersion() {
4254 APIVersion ver;
4255 ver.allFields = Internal::VRay_getSDKVersion();
4256 return ver;
4257 }
4258
4260 inline VRayVersion getVRayVersion() {
4261 VRayVersion ver;
4262 ver.allFields = Internal::VRay_getVRayVersion();
4263 return ver;
4264 }
4265
4267 inline const char* getVRayVersionDetails() {
4268 return Internal::VRay_getVRayVersionDetails();
4269 }
4270
4273 inline const char* getMaterialLibraryPath() {
4274 return Internal::VRay_getMaterialLibraryPath();
4275 }
4276
4279 std::string serverName;
4281 std::string proxyName;
4282 int proxyPort;
4283 std::string username;
4284 std::string password;
4285
4286 std::string serverName1;
4287 int serverPort1;
4288
4289 std::string serverName2;
4290 int serverPort2;
4291
4292 std::string proxyUserName;
4293 std::string proxyPassword;
4294
4296 std::string secureServer;
4297
4299
4301 std::string certificateFilePath;
4302
4303 LicenseServerSettings(void) {
4304 serverPort = 0;
4305 proxyPort = 0;
4306 serverPort1 = 0;
4307 serverPort2 = 0;
4308 useSecureConnection=false;
4309 safeModeFlags=0;
4311 }
4312 };
4313
4319 inline int setLicenseServers(const LicenseServerSettings& settings);
4320
4324 inline void setUSDProvider(const char* usdProvider);
4325
4326 class Error {
4327
4328 protected:
4329 ErrorCode errorCode;
4330
4331 public:
4332 Error(int errorCode = SUCCESS) : errorCode(static_cast<ErrorCode>(errorCode)) {
4333 }
4334
4335 Error(ErrorCode errorCode) : errorCode(errorCode) {
4336 }
4337
4338 bool error() const {
4339 return errorCode != SUCCESS;
4340 }
4341
4342 ErrorCode getCode() const {
4343 return errorCode;
4344 }
4345
4346 const char* toString() const {
4347 return Internal::VRay_getErrorTextStringFromErrorCode(errorCode);
4348 }
4349
4350 friend inline bool operator==(const Error& err0, const Error& err1) {
4351 return err0.errorCode == err1.errorCode;
4352 }
4353
4354 friend inline bool operator!=(const Error& err0, const Error& err1) {
4355 return err0.errorCode != err1.errorCode;
4356 }
4357
4358 friend inline bool operator==(const Error& err, ErrorCode errCode) {
4359 return err.errorCode == errCode;
4360 }
4361
4362 friend inline bool operator==(ErrorCode errCode, const Error& err) {
4363 return errCode == err.errorCode;
4364 }
4365
4366 friend inline bool operator!=(const Error& err, ErrorCode errCode) {
4367 return err.errorCode != errCode;
4368 }
4369
4370 friend inline bool operator!=(ErrorCode errCode, const Error& err) {
4371 return errCode != err.errorCode;
4372 }
4373
4374 };
4375
4376 inline std::ostream& operator <<(std::ostream& stream, const Error& err) {
4377 stream << err.toString();
4378 return stream;
4379 }
4380
4383 std::string fileName;
4384 std::string errorText;
4385 int fileLine;
4386 };
4387
4390 LicenseError::VRLAuthError errorCode;
4391
4392 ScannedMaterialLicenseError(LicenseError::VRLAuthError errorCode = LicenseError::vrlauth_noError)
4393 : errorCode(errorCode) {}
4394
4395 bool error() const {
4396 return errorCode != LicenseError::vrlauth_noError;
4397 }
4398
4399 const char* toString() const;
4400 };
4401
4402
4405 enum Plain {
4406 PL_NONE = 0,
4409 PL_TRIPLANAR = 3
4411
4413 VRSM_PAINT = 0,
4415 VRSM_CCMULT = 2
4417
4420 CH_PAINT_MASK = 1 << VRSM_PAINT,
4421 CH_FILTER_MASK = 1 << VRSM_FILTER,
4422 CH_CCMULT_MASK = 1 << VRSM_CCMULT
4423 };
4424
4426 CS_SRGB = 0,
4428 CS_PP = 2
4430
4432 TP_ENABLED = 1,
4435 };
4436
4437 Plain plain;
4438 float invgamma;
4440 float depthMul;
4445 float bumpmul;
4448 float cutoff;
4450 int dome;
4451 float multdirect, multrefl, multgi;
4455 float ccior;
4457 float ccbump;
4462 float retrace;
4471 float ccmul;
4475 float ccglossy;
4477 float sssmul;
4478
4480 };
4481
4486 bool encodeScannedMaterialParams(const ScannedMaterialParams& mtlParams, IntList& paramBlock);
4487
4493 bool encodeScannedMaterialParams(const ScannedMaterialParams& mtlParams, IntList& paramBlock, ScannedMaterialLicenseError& licError);
4494
4498 unsigned getScannedMaterialUILicense();
4499
4504 unsigned getScannedMaterialUILicense(ScannedMaterialLicenseError& licError);
4505
4509 unsigned releaseScannedMaterialUILicense();
4510
4520 SMF_PS = 4
4522
4523 float ccior;
4524 int plain;
4525 float bumpmul;
4527 float depthmul;
4528 float ccbump;
4529 float orggls;
4532 float free4, free5, free6;
4533 float ccmul;
4534 float shdhmul;
4535 float shdmul;
4538 float specbell;
4539 float specmul;
4540 float free7;
4541 float scratchdens;
4542 float fuzzy;
4543 float topvLs_A;
4544 float topvLs_B;
4546 float indmul;
4548 float thickness;
4550 float transpf;
4551 float lfsizecm;
4552
4554 };
4555
4557 union {
4558 void* handle;
4559 int err;
4560 } u;
4561
4562 void createThis(const char* pluginLibPath);
4563
4564 public:
4565 enum Error {
4566 NO_ERR = 0,
4567 BAD_LIBRARY_FILE = 1,
4568 SDK_BROKEN = 3
4569 };
4570
4571 explicit ScannedMaterialInfo(const char* pluginLibPath = nullptr);
4572 explicit ScannedMaterialInfo(const std::string& pluginLibPath);
4574
4578 Error getError() const;
4579
4583 operator bool() const;
4584
4587 bool operator!() const;
4588
4593 bool getInfo(const char* filename, std::string& info) const;
4594
4596 bool getInfo(const std::string& filename, std::string& info) const;
4597
4598
4603 bool getPreset(const char* filename, ScannedMaterialPreset& result) const;
4604
4606 bool getPreset(const std::string& filename, ScannedMaterialPreset& result) const;
4607 };
4608
4609 namespace VUtils {
4610 class Value;
4611 }
4612 namespace Internal {
4613 class Access;
4614 class BinaryValueParser;
4615 }
4616
4617 enum PluginCategory {
4618 category_bitmap = 0,
4619 category_bsdf,
4620 category_geometric_object,
4621 category_geometry_source,
4622 category_light,
4623 category_material,
4624 category_render_channel,
4625 category_render_view,
4626 category_settings,
4627 category_texture,
4628 category_texture_float,
4629 category_texture_int,
4630 category_texture_matrix,
4631 category_texture_transform,
4632 category_texture_vector,
4633 category_uvwgen,
4634 category_volumetric,
4635 category_camera,
4636 category_hair,
4637 category_instancer,
4638
4639 category_last // Used for enumerating all possible plugin categories
4640 };
4641
4644 unsigned long long pluginCategoryField;
4645
4646 bool operator==(const PluginCategories& categories) const noexcept {
4647 return pluginCategoryField == categories.pluginCategoryField;
4648 }
4649
4650 bool operator!=(const PluginCategories& categories) const noexcept {
4651 return pluginCategoryField != categories.pluginCategoryField;
4652 }
4653
4655 bool hasBitmapCategory() const noexcept { return (pluginCategoryField & (1ull << category_bitmap)) != 0; }
4656 void setBitmapCategory() noexcept { pluginCategoryField |= 1ull << category_bitmap; }
4657 void resetBitmapCategory() noexcept { pluginCategoryField &= ~(1ull << category_bitmap); }
4658
4660 bool hasBsdfCategory() const noexcept { return (pluginCategoryField & (1ull << category_bsdf)) != 0; }
4661 void setBsdfCategory() noexcept { pluginCategoryField |= 1ull << category_bsdf; }
4662 void resetBsdfCategory() noexcept { pluginCategoryField &= ~(1ull << category_bsdf); }
4663
4665 bool hasGeometricObjectCategory() const noexcept { return (pluginCategoryField & (1ull << category_geometric_object)) != 0; }
4666 void setGeometricObjectCategory() noexcept { pluginCategoryField |= 1ull << category_geometric_object; }
4667 void resetGeometricObjectCategory() noexcept { pluginCategoryField &= ~(1ull << category_geometric_object); }
4668
4670 bool hasGeometrySourceCategory() const noexcept { return (pluginCategoryField & (1ull << category_geometry_source)) != 0; }
4671 void setGeometrySourceCategory() noexcept { pluginCategoryField |= 1ull << category_geometry_source; }
4672 void resetGeometrySourceCategory() noexcept { pluginCategoryField &= ~(1ull << category_geometry_source); }
4673
4675 bool hasLightCategory() const noexcept { return (pluginCategoryField & (1ull << category_light)) != 0; }
4676 void setLightCategory() noexcept { pluginCategoryField |= 1ull << category_light; }
4677 void resetLightCategory() noexcept { pluginCategoryField &= ~(1ull << category_light); }
4678
4680 bool hasMaterialCategory() const noexcept { return (pluginCategoryField & (1ull << category_material)) != 0; }
4681 void setMaterialCategory() noexcept { pluginCategoryField |= 1ull << category_material; }
4682 void resetMaterialCategory() noexcept { pluginCategoryField &= ~(1ull << category_material); }
4683
4685 bool hasRenderChannelCategory() const noexcept { return (pluginCategoryField & (1ull << category_render_channel)) != 0; }
4686 void setRenderChannelCategory() noexcept { pluginCategoryField |= 1ull << category_render_channel; }
4687 void resetRenderChannelCategory() noexcept { pluginCategoryField &= ~(1ull << category_render_channel); }
4688
4690 bool hasRenderViewCategory() const noexcept { return (pluginCategoryField & (1ull << category_render_view)) != 0; }
4691 void setRenderViewCategory() noexcept { pluginCategoryField |= 1ull << category_render_view; }
4692 void resetRenderViewCategory() noexcept { pluginCategoryField &= ~(1ull << category_render_view); }
4693
4695 bool hasSettingsCategory() const noexcept { return (pluginCategoryField & (1ull << category_settings)) != 0; }
4696 void setSettingsCategory() noexcept { pluginCategoryField |= 1ull << category_settings; }
4697 void resetSettingsCategory() noexcept { pluginCategoryField &= ~(1ull << category_settings); }
4698
4700 bool hasTextureCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture)) != 0; }
4701 void setTextureCategory() noexcept { pluginCategoryField |= 1ull << category_texture; }
4702 void resetTextureCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture); }
4703
4705 bool hasTextureFloatCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_float)) != 0; }
4706 void setTextureFloatCategory() noexcept { pluginCategoryField |= 1ull << category_texture_float; }
4707 void resetTextureFloatCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_float); }
4708
4710 bool hasTextureIntCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_int)) != 0; }
4711 void setTextureIntCategory() noexcept { pluginCategoryField |= 1ull << category_texture_int; }
4712 void resetTextureIntCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_int); }
4713
4715 bool hasTextureMatrixCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_matrix)) != 0; }
4716 void setTextureMatrixCategory() noexcept { pluginCategoryField |= 1ull << category_texture_matrix; }
4717 void resetTextureMatrixCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_matrix); }
4718
4720 bool hasTextureTransformCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_transform)) != 0; }
4721 void setTextureTransformCategory() noexcept { pluginCategoryField |= 1ull << category_texture_transform; }
4722 void resetTextureTransformCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_transform); }
4723
4725 bool hasTextureVectorCategory() const noexcept { return (pluginCategoryField & (1ull << category_texture_vector)) != 0; }
4726 void setTextureVectorCategory() noexcept { pluginCategoryField |= 1ull << category_texture_vector; }
4727 void resetTextureVectorCategory() noexcept { pluginCategoryField &= ~(1ull << category_texture_vector); }
4728
4730 bool hasUvwgenCategory() const noexcept { return (pluginCategoryField & (1ull << category_uvwgen)) != 0; }
4731 void setUvwgenCategory() noexcept { pluginCategoryField |= 1ull << category_uvwgen; }
4732 void resetUvwgenCategory() noexcept { pluginCategoryField &= ~(1ull << category_uvwgen); }
4733
4735 bool hasVolumetricCategory() const noexcept { return (pluginCategoryField & (1ull << category_volumetric)) != 0; }
4736 void setVolumetricCategory() noexcept { pluginCategoryField |= 1ull << category_volumetric; }
4737 void resetVolumetricCategory() noexcept { pluginCategoryField &= ~(1ull << category_volumetric); }
4738
4740 bool hasCameraCategory() const noexcept { return (pluginCategoryField & (1ull << category_camera)) != 0; }
4741 void setCameraCategory() noexcept { pluginCategoryField |= 1ull << category_camera; }
4742 void resetCameraCategory() noexcept { pluginCategoryField &= ~(1ull << category_camera); }
4743
4745 bool hasHairCategory() const noexcept { return (pluginCategoryField & (1ull << category_hair)) != 0; }
4746 void setHairCategory() noexcept { pluginCategoryField |= 1ull << category_hair; }
4747 void resetHairCategory() noexcept { pluginCategoryField &= ~(1ull << category_hair); }
4748
4750 bool hasInstancerCategory() const noexcept { return (pluginCategoryField & (1ull << category_instancer)) != 0; }
4751 void setInstancerCategory() noexcept { pluginCategoryField |= 1ull << category_instancer; }
4752 void resetInstancerCategory() noexcept { pluginCategoryField &= ~(1ull << category_instancer); }
4753
4754 PluginCategories() noexcept : pluginCategoryField() {}
4755
4756 explicit PluginCategories(PluginCategory category) noexcept
4757 : pluginCategoryField(1ull << category) {}
4758
4759 PluginCategories(PluginCategory category0, PluginCategory category1) noexcept
4760 : pluginCategoryField((1ull << category0) || (1ull << category1)) {}
4761
4762 PluginCategories(PluginCategory category0, PluginCategory category1, PluginCategory category2) noexcept
4763 : pluginCategoryField((1ull << category0) || (1ull << category1) || (1ull << category2)) {}
4764
4765 PluginCategories(PluginCategory category0, PluginCategory category1, PluginCategory category2, PluginCategory category3) noexcept
4766 : pluginCategoryField((1ull << category0) || (1ull << category1) || (1ull << category2) || (1ull << category3)) {}
4767
4768 void clear() noexcept { pluginCategoryField = 0; }
4769
4770 bool hasCategory(PluginCategory category) const noexcept {
4771 return (pluginCategoryField & (1ull << category)) != 0;
4772 }
4773
4774 void setCategory(PluginCategory category, bool value) noexcept {
4775 const long long msk = 1ll << category;
4776 const long long val = -static_cast<long long>(value);
4777 pluginCategoryField = (pluginCategoryField | (msk & val)) & (~msk | val);
4778 }
4779
4781 std::vector<PluginCategory> getAll() const;
4782 };
4783
4785 const char* getPluginCategoryName(PluginCategory category);
4786
4787 template<class T>
4788 class PluginRefT;
4789
4793 class Plugin {
4794 friend class VRayRenderer;
4795 friend class PropertyRuntimeMeta;
4796 friend class VUtils::Value;
4797 friend class Internal::Access;
4798 friend class Internal::BinaryValueParser;
4799 friend class Internal::BinaryValueBuilder;
4800
4801 protected:
4802 const VRayRenderer* pRenderer;
4803 InstanceId internalId;
4804 InstanceId id() const {
4805 constexpr int shift = sizeof(InstanceId) * 8 - Internal::INSTANCE_ID_BITS;
4806 return static_cast<signed long long>(internalId << shift) >> shift;
4807 }
4808
4809 Plugin(VRayRenderer& renderer, const char* name);
4810 Plugin(VRayRenderer& renderer, InstanceId id) noexcept;
4811 Plugin(VRayRenderer& renderer, InstanceId id, PluginTypeId typeId) noexcept;
4812 Plugin(VRayRenderer& renderer, InstanceId id, int typeIdIdx) noexcept;
4813
4814 template<typename T, int TYPE>
4815 bool setValueAtTimeTemplate(const char* propertyName, const T& value, double time);
4816
4817 template<typename T, int TYPE>
4818 bool setArrayAtTimeTemplate(const char* propertyName, size_t count, const T& value, double time);
4819
4820 template<typename LengthFn, typename PointerFn>
4821 bool setStringArrayTemplate(const char *propertyName, size_t count, LengthFn lengthAt, PointerFn pointerAt, double time);
4822
4823 public:
4824 enum class PropertyState : int {
4825 Invalid = 0,
4826 Default = 1,
4827 NotAnimated = 2,
4828 Animated = 3
4829 };
4830
4832 Plugin() noexcept : pRenderer(), internalId(NO_ID) {}
4833
4835 Plugin(const Plugin &plugin) noexcept;
4836
4838 Plugin& operator=(const Plugin &plugin) noexcept;
4839
4841 bool operator==(const Plugin &plugin) const noexcept;
4842
4844 bool operator!=(const Plugin &plugin) const noexcept;
4845
4846 bool operator<(const Plugin& plugin) const noexcept;
4847 bool operator<=(const Plugin& plugin) const noexcept;
4848 bool operator>(const Plugin& plugin) const noexcept;
4849 bool operator>=(const Plugin& plugin) const noexcept;
4850
4852 void swap(Plugin &plugin) noexcept;
4853
4856 bool isEmpty() const noexcept;
4857
4860 bool isNotEmpty() const noexcept;
4861
4866 bool isValid() const;
4867
4869 VRayRenderer* getRenderer() const noexcept;
4870
4872 unsigned long long getIntegerID() const noexcept;
4873
4877 const char* getName() const;
4878
4882 bool setName(const char* newName);
4883
4885 bool setName(const std::string& newName);
4886
4888 const char* getType() const;
4889
4891 PluginTypeId getTypeId() const noexcept;
4892
4894 std::string toString() const;
4895
4899
4903
4906 PropertyRuntimeMeta getPropertyRuntimeMeta(const char* propertyName) const;
4908 PropertyRuntimeMeta getPropertyRuntimeMeta(const std::string& propertyName) const;
4909
4912 std::string getValueAsString(const char* propertyName, double time = TiMe::Default()) const;
4914 std::string getValueAsString(const std::string& propertyName, double time = TiMe::Default()) const;
4915
4919 std::string getValueAsString(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4921 std::string getValueAsString(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4922
4927 bool setValueAsString(const char* propertyName, const char* value);
4929 bool setValueAsString(const char* propertyName, const std::string& value);
4930
4932 bool setValueAsString(const std::string& propertyName, const char* value);
4934 bool setValueAsString(const std::string& propertyName, const std::string& value);
4935
4937 bool getBool(const char* propertyName, double time = TiMe::Default()) const;
4939 bool getBool(const std::string& propertyName, double time = TiMe::Default()) const;
4940
4944 bool getBool(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4946 bool getBool(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4947
4950 int getInt(const char* propertyName, double time = TiMe::Default()) const;
4952 int getInt(const std::string& propertyName, double time = TiMe::Default()) const;
4953
4957 int getInt(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4959 int getInt(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4960
4962 float getFloat(const char* propertyName, double time = TiMe::Default()) const;
4964 float getFloat(const std::string& propertyName, double time = TiMe::Default()) const;
4965
4969 float getFloat(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4971 float getFloat(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4972
4974 double getDouble(const char* propertyName, double time = TiMe::Default()) const;
4976 double getDouble(const std::string& propertyName, double time = TiMe::Default()) const;
4977
4981 double getDouble(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4983 double getDouble(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4984
4986 Color getColor(const char* propertyName, double time = TiMe::Default()) const;
4988 Color getColor(const std::string& propertyName, double time = TiMe::Default()) const;
4989
4993 Color getColor(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
4995 Color getColor(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
4996
4998 AColor getAColor(const char* propertyName, double time = TiMe::Default()) const;
5000 AColor getAColor(const std::string& propertyName, double time = TiMe::Default()) const;
5001
5005 AColor getAColor(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5007 AColor getAColor(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5008
5010 Vector getVector(const char* propertyName, double time = TiMe::Default()) const;
5012 Vector getVector(const std::string& propertyName, double time = TiMe::Default()) const;
5013
5017 Vector getVector(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5019 Vector getVector(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5020
5022 Matrix getMatrix(const char* propertyName, double time = TiMe::Default()) const;
5024 Matrix getMatrix(const std::string& propertyName, double time = TiMe::Default()) const;
5025
5029 Matrix getMatrix(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5031 Matrix getMatrix(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5032
5034 Transform getTransform(const char* propertyName, double time = TiMe::Default()) const;
5036 Transform getTransform(const std::string& propertyName, double time = TiMe::Default()) const;
5037
5041 Transform getTransform(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5043 Transform getTransform(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5044
5046 PluginRefT<Plugin> getPlugin(const char* propertyName, double time = TiMe::Default()) const;
5048 PluginRefT<Plugin> getPlugin(const std::string& propertyName, double time = TiMe::Default()) const;
5049
5053 PluginRefT<Plugin> getPlugin(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5055 PluginRefT<Plugin> getPlugin(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5056
5058 std::string getString(const char* propertyName, double time = TiMe::Default()) const;
5060 std::string getString(const std::string& propertyName, double time = TiMe::Default()) const;
5061
5065 std::string getString(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5067 std::string getString(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5068
5070 IntList getIntList(const char* propertyName, double time = TiMe::Default()) const;
5072 IntList getIntList(const std::string& propertyName, double time = TiMe::Default()) const;
5073
5077 IntList getIntList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5079 IntList getIntList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5080
5082 FloatList getFloatList(const char* propertyName, double time = TiMe::Default()) const;
5084 FloatList getFloatList(const std::string& propertyName, double time = TiMe::Default()) const;
5085
5089 FloatList getFloatList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5091 FloatList getFloatList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5092
5094 ColorList getColorList(const char* propertyName, double time = TiMe::Default()) const;
5096 ColorList getColorList(const std::string& propertyName, double time = TiMe::Default()) const;
5097
5101 ColorList getColorList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5103 ColorList getColorList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5104
5106 VectorList getVectorList(const char* propertyName, double time = TiMe::Default()) const;
5108 VectorList getVectorList(const std::string& propertyName, double time = TiMe::Default()) const;
5109
5113 VectorList getVectorList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5115 VectorList getVectorList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5116
5118 TransformList getTransformList(const char* propertyName, double time = TiMe::Default()) const;
5120 TransformList getTransformList(const std::string& propertyName, double time = TiMe::Default()) const;
5121
5125 TransformList getTransformList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5127 TransformList getTransformList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5128
5130 ValueList getValueList(const char* propertyName, double time = TiMe::Default()) const;
5132 ValueList getValueList(const std::string& propertyName, double time = TiMe::Default()) const;
5133
5137 ValueList getValueList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5139 ValueList getValueList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5140
5142 StringList getStringList(const char* propertyName, double time = TiMe::Default()) const;
5144 StringList getStringList(const std::string& propertyName, double time = TiMe::Default()) const;
5145
5149 StringList getStringList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5151 StringList getStringList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5152
5154 PluginList getPluginList(const char* propertyName, double time = TiMe::Default()) const;
5156 PluginList getPluginList(const std::string& propertyName, double time = TiMe::Default()) const;
5157
5161 PluginList getPluginList(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5163 PluginList getPluginList(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5164
5167 Value getValue(const char* propertyName, double time = TiMe::Default()) const;
5169 Value getValue(const std::string& propertyName, double time = TiMe::Default()) const;
5170
5175 Value getValue(const char* propertyName, bool& ok, double time = TiMe::Default()) const;
5177 Value getValue(const std::string& propertyName, bool& ok, double time = TiMe::Default()) const;
5178
5181 bool isPropertyAnimated(const char* propertyName) const;
5183 bool isPropertyAnimated(const std::string& propertyName) const;
5184
5188 PropertyState getPropertyState(const char* propertyName) const;
5190 PropertyState getPropertyState(const std::string& propertyName) const;
5191
5194 std::vector<double> getKeyframeTimes(const char* propertyName) const;
5196 std::vector<double> getKeyframeTimes(const std::string& propertyName) const;
5197
5201 std::vector<double> getKeyframeTimes(const char* propertyName, bool& ok) const;
5203 std::vector<double> getKeyframeTimes(const std::string& propertyName, bool& ok) const;
5204
5207 bool setValue(const char* propertyName, const bool value, double time = TiMe::Default());
5209 bool setValue(const std::string& propertyName, const bool value, double time = TiMe::Default());
5210
5213 bool setValue(const char* propertyName, const int value, double time = TiMe::Default());
5215 bool setValue(const std::string& propertyName, const int value, double time = TiMe::Default());
5216
5219 bool setValue(const char* propertyName, const float value, double time = TiMe::Default());
5221 bool setValue(const std::string& propertyName, const float value, double time = TiMe::Default());
5222
5225 bool setValue(const char* propertyName, const double value, double time = TiMe::Default());
5227 bool setValue(const std::string& propertyName, const double value, double time = TiMe::Default());
5228
5231 bool setValue(const char* propertyName, const Color& value, double time = TiMe::Default());
5233 bool setValue(const std::string& propertyName, const Color& value, double time = TiMe::Default());
5234
5237 bool setValue(const char* propertyName, const AColor& value, double time = TiMe::Default());
5239 bool setValue(const std::string& propertyName, const AColor& value, double time = TiMe::Default());
5240
5243 bool setValue(const char* propertyName, const Vector& value, double time = TiMe::Default());
5245 bool setValue(const std::string& propertyName, const Vector& value, double time = TiMe::Default());
5246
5249 bool setValue(const char* propertyName, const Matrix& value, double time = TiMe::Default());
5251 bool setValue(const std::string& propertyName, const Matrix& value, double time = TiMe::Default());
5252
5255 bool setValue(const char* propertyName, const Transform& transform, double time = TiMe::Default());
5257 bool setValue(const std::string& propertyName, const Transform& transform, double time = TiMe::Default());
5258
5261 bool setValue(const char* propertyName, const PluginRefT<Plugin>& pluginRef, double time = TiMe::Default());
5263 bool setValue(const std::string& propertyName, const PluginRefT<Plugin>& pluginRef, double time = TiMe::Default());
5264
5267 bool setValue(const char* propertyName, const char* str, double time = TiMe::Default());
5269 bool setValue(const std::string& propertyName, const char* str, double time = TiMe::Default());
5270
5273 bool setValue(const char* propertyName, const std::string& str, double time = TiMe::Default());
5275 bool setValue(const std::string& propertyName, const std::string& str, double time = TiMe::Default());
5276
5279 bool setValue(const char* propertyName, const Value& value, double time = TiMe::Default());
5281 bool setValue(const std::string& propertyName, const Value& value, double time = TiMe::Default());
5283 bool setValue(const char* propertyName, Value&& value, double time = TiMe::Default());
5285 bool setValue(const std::string& propertyName, Value&& value, double time = TiMe::Default());
5286
5289 bool setValue(const char* propertyName, const ValueList& value, double time = TiMe::Default());
5291 bool setValue(const std::string& propertyName, const ValueList& value, double time = TiMe::Default());
5293 bool setValue(const char* propertyName, ValueList&& value, double time = TiMe::Default());
5295 bool setValue(const std::string& propertyName, ValueList&& value, double time = TiMe::Default());
5297 template<size_t count> bool setValue(const char* propertyName, const Value(&arr)[count], double time = TiMe::Default());
5299 template<size_t count> bool setValue(const std::string& propertyName, const Value(&arr)[count], double time = TiMe::Default());
5301 template<size_t count> bool setValue(const char* propertyName, Value(&&arr)[count], double time = TiMe::Default());
5303 template<size_t count> bool setValue(const std::string& propertyName, Value(&&arr)[count], double time = TiMe::Default());
5304
5307 bool setValue(const char* propertyName, const IntList& value, double time = TiMe::Default());
5309 bool setValue(const std::string& propertyName, const IntList& value, double time = TiMe::Default());
5311 bool setValue(const char* propertyName, IntList&& value, double time = TiMe::Default());
5313 bool setValue(const std::string& propertyName, IntList&& value, double time = TiMe::Default());
5314
5317 bool setValue(const char* propertyName, const FloatList& value, double time = TiMe::Default());
5319 bool setValue(const std::string& propertyName, const FloatList& value, double time = TiMe::Default());
5321 bool setValue(const char* propertyName, FloatList&& value, double time = TiMe::Default());
5323 bool setValue(const std::string& propertyName, FloatList&& value, double time = TiMe::Default());
5324
5327 bool setValue(const char* propertyName, const VectorList& value, double time = TiMe::Default());
5329 bool setValue(const std::string& propertyName, const VectorList& value, double time = TiMe::Default());
5331 bool setValue(const char* propertyName, VectorList&& value, double time = TiMe::Default());
5333 bool setValue(const std::string& propertyName, VectorList&& value, double time = TiMe::Default());
5334
5337 bool setValue(const char* propertyName, const ColorList& value, double time = TiMe::Default());
5339 bool setValue(const std::string& propertyName, const ColorList& value, double time = TiMe::Default());
5341 bool setValue(const char* propertyName, ColorList&& value, double time = TiMe::Default());
5343 bool setValue(const std::string& propertyName, ColorList&& value, double time = TiMe::Default());
5344
5347 bool setValue(const char* propertyName, const TransformList& value, double time = TiMe::Default());
5349 bool setValue(const std::string& propertyName, const TransformList& value, double time = TiMe::Default());
5350
5353 bool setValue(const char* propertyName, const StringList& value, double time = TiMe::Default());
5355 bool setValue(const std::string& propertyName, const StringList& value, double time = TiMe::Default());
5356
5359 bool setValue(const char* propertyName, const PluginList& value, double time = TiMe::Default());
5361 bool setValue(const std::string& propertyName, const PluginList& value, double time = TiMe::Default());
5362
5365 bool setArray(const char* propertyName, const int data[], size_t count, double time = TiMe::Default());
5367 bool setArray(const std::string& propertyName, const int data[], size_t count, double time = TiMe::Default());
5368
5372 bool setArray(const char* propertyName, const float data[], size_t count, double time = TiMe::Default());
5374 bool setArray(const std::string& propertyName, const float data[], size_t count, double time = TiMe::Default());
5375
5380 bool setArray(const char* propertyName, const double data[], size_t count, double time = TiMe::Default());
5382 bool setArray(const std::string& propertyName, const double data[], size_t count, double time = TiMe::Default());
5383
5386 bool setArray(const char* propertyName, const Vector data[], size_t count, double time = TiMe::Default());
5388 bool setArray(const std::string& propertyName, const Vector data[], size_t count, double time = TiMe::Default());
5389
5392 bool setArray(const char* propertyName, const Color data[], size_t count, double time = TiMe::Default());
5394 bool setArray(const std::string& propertyName, const Color data[], size_t count, double time = TiMe::Default());
5395
5398 bool setArray(const char* propertyName, const Transform data[], size_t count, double time = TiMe::Default());
5400 bool setArray(const std::string& propertyName, const Transform data[], size_t count, double time = TiMe::Default());
5401
5404 bool setArray(const char* propertyName, const std::string data[], size_t count, double time = TiMe::Default());
5406 bool setArray(const std::string& propertyName, const std::string data[], size_t count, double time = TiMe::Default());
5408 bool setArray(const char* propertyName, const char* const data[], size_t count, double time = TiMe::Default());
5410 bool setArray(const std::string& propertyName, const char* const data[], size_t count, double time = TiMe::Default());
5411
5414 bool setArray(const char* propertyName, const Plugin plugins[], size_t count, double time = TiMe::Default());
5416 bool setArray(const std::string& propertyName, const Plugin plugins[], size_t count, double time = TiMe::Default());
5417
5420 bool setArray(const char* propertyName, const Value values[], size_t count, double time = TiMe::Default());
5422 bool setArray(const std::string& propertyName, const Value values[], size_t count, double time = TiMe::Default());
5423
5427 bool setArray(const char* propertyName, Value valuesToMove[], size_t count, double time = TiMe::Default());
5429 bool setArray(const std::string& propertyName, Value valuesToMove[], size_t count, double time = TiMe::Default());
5430
5434 bool setValue(const char* propertyName, const void* data, size_t size, double time = TiMe::Default());
5436 bool setValue(const std::string& propertyName, const void* data, size_t size, double time = TiMe::Default());
5437
5441
5442 friend std::ostream& operator <<(std::ostream& stream, const Plugin& plugin);
5443
5444#ifdef VRAY_SDK_INTEROPERABILITY
5445 bool setValueAsStringAtTime(const char* propertyName, const char* value, double time);
5446 bool setValueAsStringAtTime(const char* propertyName, const std::string& value, double time);
5447 bool setValueAsStringAtTime(const std::string& propertyName, const char* value, double time);
5448 bool setValueAsStringAtTime(const std::string& propertyName, const std::string& value, double time);
5449 bool setValueAtTime(const char* propertyName, const bool value, double time);
5450 bool setValueAtTime(const std::string& propertyName, const bool value, double time);
5451 bool setValueAtTime(const char* propertyName, const int value, double time);
5452 bool setValueAtTime(const std::string& propertyName, const int value, double time);
5453 bool setValueAtTime(const char* propertyName, const float value, double time);
5454 bool setValueAtTime(const std::string& propertyName, const float value, double time);
5455 bool setValueAtTime(const char* propertyName, const double value, double time);
5456 bool setValueAtTime(const std::string& propertyName, const double value, double time);
5457 bool setValueAtTime(const char* propertyName, const Color& value, double time);
5458 bool setValueAtTime(const std::string& propertyName, const Color& value, double time);
5459 bool setValueAtTime(const char* propertyName, const AColor& value, double time);
5460 bool setValueAtTime(const std::string& propertyName, const AColor& value, double time);
5461 bool setValueAtTime(const char* propertyName, const Vector& value, double time);
5462 bool setValueAtTime(const std::string& propertyName, const Vector& value, double time);
5463 bool setValueAtTime(const char* propertyName, const Matrix& value, double time);
5464 bool setValueAtTime(const std::string& propertyName, const Matrix& value, double time);
5465 bool setValueAtTime(const char* propertyName, const Transform& transform, double time);
5466 bool setValueAtTime(const std::string& propertyName, const Transform& transform, double time);
5467 bool setValueAtTime(const char* propertyName, const PluginRefT<Plugin>& pluginRef, double time);
5468 bool setValueAtTime(const std::string& propertyName, const PluginRefT<Plugin>& pluginRef, double time);
5469 bool setValueAtTime(const char* propertyName, const char* str, double time);
5470 bool setValueAtTime(const std::string& propertyName, const char* str, double time);
5471 bool setValueAtTime(const char* propertyName, const std::string& str, double time);
5472 bool setValueAtTime(const std::string& propertyName, const std::string& str, double time);
5473 bool setValueAtTime(const char* propertyName, const Value& value, double time);
5474 bool setValueAtTime(const std::string& propertyName, const Value& value, double time);
5475 bool setValueAtTime(const char* propertyName, const ValueList& value, double time);
5476 bool setValueAtTime(const std::string& propertyName, const ValueList& value, double time);
5477 bool setValueAtTime(const char* propertyName, const IntList& value, double time);
5478 bool setValueAtTime(const std::string& propertyName, const IntList& value, double time);
5479 bool setValueAtTime(const char* propertyName, const FloatList& value, double time);
5480 bool setValueAtTime(const std::string& propertyName, const FloatList& value, double time);
5481 bool setValueAtTime(const char* propertyName, const VectorList& value, double time);
5482 bool setValueAtTime(const std::string& propertyName, const VectorList& value, double time);
5483 bool setValueAtTime(const char* propertyName, const ColorList& value, double time);
5484 bool setValueAtTime(const std::string& propertyName, const ColorList& value, double time);
5485 bool setValueAtTime(const char* propertyName, const PluginList& value, double time);
5486 bool setValueAtTime(const std::string& propertyName, const PluginList& value, double time);
5487 bool setValueAtTime(const char* propertyName, const StringList& value, double time);
5488 bool setValueAtTime(const std::string& propertyName, const StringList& value, double time);
5489 bool setArrayAtTime(const char* propertyName, const int data[], size_t count, double time);
5490 bool setArrayAtTime(const std::string& propertyName, const int data[], size_t count, double time);
5491 bool setArrayAtTime(const char* propertyName, const float data[], size_t count, double time);
5492 bool setArrayAtTime(const std::string& propertyName, const float data[], size_t count, double time);
5493 bool setArrayAtTime(const char* propertyName, const double data[], size_t count, double time);
5494 bool setArrayAtTime(const std::string& propertyName, const double data[], size_t count, double time);
5495 bool setArrayAtTime(const char* propertyName, const Vector data[], size_t count, double time);
5496 bool setArrayAtTime(const std::string& propertyName, const Vector data[], size_t count, double time);
5497 bool setArrayAtTime(const char* propertyName, const Color data[], size_t count, double time);
5498 bool setArrayAtTime(const std::string& propertyName, const Color data[], size_t count, double time);
5499 bool setArrayAtTime(const char* propertyName, const Plugin data[], size_t count, double time);
5500 bool setArrayAtTime(const std::string& propertyName, const Plugin data[], size_t count, double time);
5501 bool setArrayAtTime(const char* propertyName, const std::string data[], size_t count, double time);
5502 bool setArrayAtTime(const std::string& propertyName, const std::string data[], size_t count, double time);
5503 bool setValueAtTime(const char* propertyName, const void* data, size_t size, double time);
5504 bool setValueAtTime(const std::string& propertyName, const void* data, size_t size, double time);
5505
5506
5507 VUtils::IntRefList getIntRefList(const char* propertyName);
5508 VUtils::IntRefList getIntRefList(const char* propertyName, bool& ok);
5509 VUtils::IntRefList getIntRefListAtTime(const char* propertyName, double time);
5510 VUtils::IntRefList getIntRefListAtTime(const char* propertyName, double time, bool& ok);
5511 VUtils::IntRefList getIntRefList(const std::string& propertyName);
5512 VUtils::IntRefList getIntRefList(const std::string& propertyName, bool& ok);
5513 VUtils::IntRefList getIntRefListAtTime(const std::string& propertyName, double time);
5514 VUtils::IntRefList getIntRefListAtTime(const std::string& propertyName, double time, bool& ok);
5515
5516 VUtils::FloatRefList getFloatRefList(const char* propertyName);
5517 VUtils::FloatRefList getFloatRefList(const char* propertyName, bool& ok);
5518 VUtils::FloatRefList getFloatRefListAtTime(const char* propertyName, double time);
5519 VUtils::FloatRefList getFloatRefListAtTime(const char* propertyName, double time, bool& ok);
5520 VUtils::FloatRefList getFloatRefList(const std::string& propertyName);
5521 VUtils::FloatRefList getFloatRefList(const std::string& propertyName, bool& ok);
5522 VUtils::FloatRefList getFloatRefListAtTime(const std::string& propertyName, double time);
5523 VUtils::FloatRefList getFloatRefListAtTime(const std::string& propertyName, double time, bool& ok);
5524
5525 VUtils::VectorRefList getVectorRefList(const char* propertyName);
5526 VUtils::VectorRefList getVectorRefList(const char* propertyName, bool& ok);
5527 VUtils::VectorRefList getVectorRefListAtTime(const char* propertyName, double time);
5528 VUtils::VectorRefList getVectorRefListAtTime(const char* propertyName, double time, bool& ok);
5529 VUtils::VectorRefList getVectorRefList(const std::string& propertyName);
5530 VUtils::VectorRefList getVectorRefList(const std::string& propertyName, bool& ok);
5531 VUtils::VectorRefList getVectorRefListAtTime(const std::string& propertyName, double time);
5532 VUtils::VectorRefList getVectorRefListAtTime(const std::string& propertyName, double time, bool& ok);
5533
5534 VUtils::ColorRefList getColorRefList(const char* propertyName);
5535 VUtils::ColorRefList getColorRefList(const char* propertyName, bool& ok);
5536 VUtils::ColorRefList getColorRefListAtTime(const char* propertyName, double time);
5537 VUtils::ColorRefList getColorRefListAtTime(const char* propertyName, double time, bool& ok);
5538 VUtils::ColorRefList getColorRefList(const std::string& propertyName);
5539 VUtils::ColorRefList getColorRefList(const std::string& propertyName, bool& ok);
5540 VUtils::ColorRefList getColorRefListAtTime(const std::string& propertyName, double time);
5541 VUtils::ColorRefList getColorRefListAtTime(const std::string& propertyName, double time, bool& ok);
5542
5543 VUtils::ValueRefList getValueRefList(const char* propertyName);
5544 VUtils::ValueRefList getValueRefList(const char* propertyName, bool& ok);
5545 VUtils::ValueRefList getValueRefListAtTime(const char* propertyName, double time);
5546 VUtils::ValueRefList getValueRefListAtTime(const char* propertyName, double time, bool& ok);
5547 VUtils::ValueRefList getValueRefList(const std::string& propertyName);
5548 VUtils::ValueRefList getValueRefList(const std::string& propertyName, bool& ok);
5549 VUtils::ValueRefList getValueRefListAtTime(const std::string& propertyName, double time);
5550 VUtils::ValueRefList getValueRefListAtTime(const std::string& propertyName, double time, bool& ok);
5551
5552 VUtils::CharStringRefList getStringRefList(const char* propertyName);
5553 VUtils::CharStringRefList getStringRefList(const char* propertyName, bool& ok);
5554 VUtils::CharStringRefList getStringRefListAtTime(const char* propertyName, double time);
5555 VUtils::CharStringRefList getStringRefListAtTime(const char* propertyName, double time, bool& ok);
5556 VUtils::CharStringRefList getStringRefList(const std::string& propertyName);
5557 VUtils::CharStringRefList getStringRefList(const std::string& propertyName, bool& ok);
5558 VUtils::CharStringRefList getStringRefListAtTime(const std::string& propertyName, double time);
5559 VUtils::CharStringRefList getStringRefListAtTime(const std::string& propertyName, double time, bool& ok);
5560
5561 VUtils::CharString getCharString(const char* propertyName);
5562 VUtils::CharString getCharString(const char* propertyName, bool& ok);
5563 VUtils::CharString getCharStringAtTime(const char* propertyName, double time);
5564 VUtils::CharString getCharStringAtTime(const char* propertyName, double time, bool& ok);
5565 VUtils::CharString getCharString(const std::string& propertyName);
5566 VUtils::CharString getCharString(const std::string& propertyName, bool& ok);
5567 VUtils::CharString getCharStringAtTime(const std::string& propertyName, double time);
5568 VUtils::CharString getCharStringAtTime(const std::string& propertyName, double time, bool& ok);
5569
5570 bool setValue(const char* propertyName, const VUtils::IntRefList& intList);
5571 bool setValueAtTime(const char* propertyName, const VUtils::IntRefList& intList, double time);
5572 bool setValue(const std::string& propertyName, const VUtils::IntRefList& intList);
5573 bool setValueAtTime(const std::string& propertyName, const VUtils::IntRefList& intList, double time);
5574
5575 bool setValue(const char* propertyName, const VUtils::FloatRefList& floatList);
5576 bool setValueAtTime(const char* propertyName, const VUtils::FloatRefList& floatList, double time);
5577 bool setValue(const std::string& propertyName, const VUtils::FloatRefList& floatList);
5578 bool setValueAtTime(const std::string& propertyName, const VUtils::FloatRefList& floatList, double time);
5579
5580 bool setValue(const char* propertyName, const VUtils::VectorRefList& vectorList);
5581 bool setValueAtTime(const char* propertyName, const VUtils::VectorRefList& vectorList, double time);
5582 bool setValue(const std::string& propertyName, const VUtils::VectorRefList& vectorList);
5583 bool setValueAtTime(const std::string& propertyName, const VUtils::VectorRefList& vectorList, double time);
5584
5585 bool setValue(const char* propertyName, const VUtils::ColorRefList& colorList);
5586 bool setValueAtTime(const char* propertyName, const VUtils::ColorRefList& colorList, double time);
5587 bool setValue(const std::string& propertyName, const VUtils::ColorRefList& colorList);
5588 bool setValueAtTime(const std::string& propertyName, const VUtils::ColorRefList& colorList, double time);
5589
5590 bool setValue(const char* propertyName, const VUtils::TransformRefList& transformList);
5591 bool setValueAtTime(const char* propertyName, const VUtils::TransformRefList& transformList, double time);
5592 bool setValue(const std::string& propertyName, const VUtils::TransformRefList& transformList);
5593 bool setValueAtTime(const std::string& propertyName, const VUtils::TransformRefList& transformList, double time);
5594
5595 bool setValue(const char* propertyName, const VUtils::CharStringRefList& stringList);
5596 bool setValueAtTime(const char* propertyName, const VUtils::CharStringRefList& stringList, double time);
5597 bool setValue(const std::string& propertyName, const VUtils::CharStringRefList& stringList);
5598 bool setValueAtTime(const std::string& propertyName, const VUtils::CharStringRefList& stringList, double time);
5599
5600 bool setValue(const char* propertyName, const VUtils::ValueRefList& valueList);
5601 bool setValueAtTime(const char* propertyName, const VUtils::ValueRefList& valueList, double time);
5602 bool setValue(const std::string& propertyName, const VUtils::ValueRefList& valueList);
5603 bool setValueAtTime(const std::string& propertyName, const VUtils::ValueRefList& valueList, double time);
5604
5605 bool setValue(const char* propertyName, const VUtils::CharString& str);
5606 bool setValueAtTime(const char* propertyName, const VUtils::CharString& str, double time);
5607 bool setValue(const std::string& propertyName, const VUtils::CharString& str);
5608 bool setValueAtTime(const std::string& propertyName, const VUtils::CharString& str, double time);
5609#endif // VRAY_SDK_INTEROPERABILITY
5610 };
5611
5614 template<>
5615 class PluginRefT<Plugin> : public Plugin {
5616 friend class VRayRenderer;
5617 template<class T> friend class PluginRefT;
5618 friend class Value;
5619 friend class Internal::BinaryValueBuilder;
5620 friend class UVTextureSampler;
5621
5622 int outPropIdx;
5623
5624 protected:
5625 PluginRefT(VRayRenderer& renderer, InstanceId id, const char* outPropertyName);
5626 PluginRefT(VRayRenderer& renderer, InstanceId id, int outPropertyIndex) noexcept;
5627
5628 int getOutputIndex() const noexcept { return outPropIdx; }
5629
5630 public:
5632 PluginRefT() noexcept : outPropIdx(0) {}
5633
5635 PluginRefT(const Plugin &plugin) noexcept : Plugin(plugin), outPropIdx(0) {}
5636
5638 PluginRefT(const PluginRefT &plugin) noexcept : Plugin(plugin), outPropIdx(plugin.outPropIdx) {}
5639
5641 template<class T>
5642 PluginRefT(const PluginRefT<T> &plugin) noexcept : Plugin(plugin), outPropIdx(plugin.outPropIdx) {}
5643
5645 PluginRefT(const Plugin &plugin, const char* outPropertyName);
5646
5648 template<class T>
5649 PluginRefT& operator=(const PluginRefT<T> &plugin) noexcept;
5650
5652 template<class T>
5653 bool operator==(const PluginRefT<T> &plugin) const noexcept;
5654
5656 bool operator==(const Plugin &plugin) const noexcept;
5657
5658 template<class T> bool operator<(const PluginRefT<T>& plugin) const noexcept;
5659 template<class T> bool operator<=(const PluginRefT<T>& plugin) const noexcept;
5660 template<class T> bool operator>(const PluginRefT<T>& plugin) const noexcept;
5661 template<class T> bool operator>=(const PluginRefT<T>& plugin) const noexcept;
5662
5664 void swap(PluginRefT &plugin) noexcept;
5665
5667 bool isOutputValid() const noexcept {
5668 return outPropIdx >= 0;
5669 }
5670
5673 const char* getOutputName() const;
5674
5676 std::string toString() const;
5677
5678 friend std::ostream& operator <<(std::ostream& stream, const PluginRefT& pluginRef);
5679 };
5680
5682
5692 template<class T>
5693 class PluginRefT : public T {
5694 friend class VRayRenderer;
5695 friend class PluginRefT<Plugin>;
5696
5697 int outPropIdx;
5698
5699 PluginRefT(VRayRenderer& renderer, InstanceId id, const char* outPropertyName);
5700
5701 public:
5703 PluginRefT() noexcept : outPropIdx(0) {}
5704
5706 PluginRefT(const T &plugin) noexcept : T(plugin), outPropIdx(0) {}
5707
5709 PluginRefT(const PluginRefT &plugin) noexcept : T(plugin), outPropIdx(plugin.outPropIdx) {}
5710
5712 PluginRefT(const T &plugin, const char* outPropertyName);
5713
5714 template<class X>
5715 PluginRefT(const PluginRefT<X> &plugin) noexcept : T(static_cast<X>(plugin)), outPropIdx(static_cast<PluginRef>(plugin).outPropIdx) {}
5716
5717 template<class X>
5718 PluginRefT(const X &plugin) noexcept : T(static_cast<X>(plugin)), outPropIdx(0) {}
5719
5721 PluginRefT& operator=(const PluginRefT &plugin) noexcept;
5722
5724 bool operator==(const PluginRefT &plugin) const noexcept;
5725
5727 bool operator==(const PluginRefT<Plugin> &plugin) const noexcept;
5728
5730 bool operator==(const Plugin &plugin) const noexcept;
5731
5732 bool operator<(const PluginRefT& plugin) const noexcept;
5733 bool operator<(const PluginRefT<Plugin>& plugin) const noexcept;
5734 bool operator<=(const PluginRefT& plugin) const noexcept;
5735 bool operator<=(const PluginRefT<Plugin>& plugin) const noexcept;
5736 bool operator>(const PluginRefT& plugin) const noexcept;
5737 bool operator>(const PluginRefT<Plugin>& plugin) const noexcept;
5738 bool operator>=(const PluginRefT& plugin) const noexcept;
5739 bool operator>=(const PluginRefT<Plugin>& plugin) const noexcept;
5740
5742 void swap(PluginRefT &plugin) noexcept;
5743
5745 bool isOutputValid() const noexcept {
5746 return outPropIdx >= 0;
5747 }
5748
5751 const char* getOutputName() const;
5752
5754 std::string toString() const;
5755
5756 template<class U>
5757 friend std::ostream& operator <<(std::ostream& stream, const PluginRefT<U>& pluginRef);
5758 };
5759
5761 class Value {
5762 friend class Internal::BinaryValueParser;
5763 friend class Internal::BinaryValueBuilder;
5764 friend struct Internal::MeshFileDataParser;
5765 friend std::ostream& operator<<(std::ostream& stream, const Value& value);
5766
5767 protected:
5768 union {
5769 char val[VRAY_MAXIMUM4(sizeof(Transform), sizeof(std::string), sizeof(ValueList), sizeof(PluginRef))];
5770 void* alignment;
5771 };
5772 Type type;
5773
5774 explicit Value(Type type) noexcept;
5775
5776 void copyValue(const Value& value);
5777 void moveValue(Value&& value) noexcept;
5778 void swapValue(Value& value) noexcept;
5779 void destroyValue() noexcept;
5780 template<typename T, Type TYPE> void constructOnly_() noexcept;
5781 template<typename T, Type TYPE> void constructListWithIterators_(const T* first, const T* last);
5782 template<typename T, Type TYPE, bool noExcept> void constructWithValue_(T&& value) noexcept(noExcept);
5783 template<typename T, Type TYPE> void setToValue_(T&& value);
5784 template<typename T> T& interpretAs_();
5785 template<typename T> const T& interpretAs_() const;
5786 template<typename T, Type TYPE> T& viewAs_();
5787 template<typename T, Type TYPE> const T& viewAs_() const;
5788 template<typename T, Type TYPE> T getValue_() const;
5789 Value(VRayRenderer* renderer, InstanceId id, int outIdx) noexcept;
5790
5791 public:
5793 Value() noexcept;
5794
5795 Value(const Value& value);
5796 Value(Value&& value) noexcept;
5797
5798 explicit Value(int value) noexcept;
5799 explicit Value(float value) noexcept;
5800 explicit Value(double value) noexcept;
5801 explicit Value(bool value) noexcept;
5802 explicit Value(const Color& value) noexcept;
5803 explicit Value(const AColor& value) noexcept;
5804 explicit Value(const Vector& value) noexcept;
5805 explicit Value(const Matrix& value) noexcept;
5806 explicit Value(const Transform& value) noexcept;
5807 explicit Value(const IntList& value);
5808 explicit Value(IntList&& value) noexcept;
5809 explicit Value(const FloatList& value);
5810 explicit Value(FloatList&& value) noexcept;
5811 explicit Value(const VectorList& value);
5812 explicit Value(VectorList&& value) noexcept;
5813 explicit Value(const ColorList& value);
5814 explicit Value(ColorList&& value) noexcept;
5815 explicit Value(TransformList&& value) noexcept;
5816 explicit Value(const TransformList& value);
5817 explicit Value(const ValueList& value);
5818 explicit Value(ValueList&& value) noexcept;
5819 explicit Value(const StringList& value);
5820 explicit Value(StringList&& value) noexcept;
5821 explicit Value(const PluginList& value);
5822 explicit Value(PluginList&& value) noexcept;
5823 explicit Value(const char* value);
5824 explicit Value(const std::string& value);
5825 explicit Value(std::string&& value) noexcept;
5826 explicit Value(const PluginRef& value) noexcept;
5827 Value(const int* values, size_t count);
5828 Value(const float* values, size_t count);
5829 Value(const Vector* values, size_t count);
5830 Value(const Color* values, size_t count);
5831 Value(const Transform* values, size_t count);
5832 Value(const Plugin* values, size_t count);
5833 Value(const Value* values, size_t count);
5834 template<size_t count> explicit Value(const int(&arr)[count]);
5835 template<size_t count> explicit Value(const float(&arr)[count]);
5836 template<size_t count> explicit Value(const Vector(&arr)[count]);
5837 template<size_t count> explicit Value(const Color(&arr)[count]);
5838 template<size_t count> explicit Value(const Transform(&arr)[count]);
5839 template<size_t count> explicit Value(const Plugin(&arr)[count]);
5840 template<size_t count> explicit Value(const Value(&arr)[count]);
5841 template<size_t count> explicit Value(Value(&&arr)[count]);
5842
5844 static Value Unspecified() noexcept;
5845
5846 ~Value() noexcept;
5847
5848 void swap(Value& value) noexcept;
5849
5850 Value& operator=(const Value& value);
5851 Value& operator=(Value&& value) noexcept;
5852 bool operator==(const Value& value) const noexcept;
5853 bool operator!=(const Value& value) const noexcept;
5854
5856 Type getType() const noexcept;
5857
5859 size_t getCount() const;
5860
5862 bool isList() const;
5863
5865 void set(int value);
5866
5868 void set(float value);
5869
5871 void set(double value);
5872
5874 void set(bool value);
5875
5877 void set(const Color& value);
5878
5880 void set(const AColor& value);
5881
5883 void set(const Vector& value);
5884
5886 void set(const Matrix& value);
5887
5889 void set(const Transform& value);
5890
5892 void set(const Plugin& value);
5893
5895 void set(const PluginRef& value);
5896
5898 void set(const char* value);
5899
5901 void set(const std::string& value);
5902
5904 void set(std::string&& value);
5905
5907 void set(const IntList& value);
5908
5910 void set(IntList&& value);
5911
5913 void set(const FloatList& value);
5914
5916 void set(FloatList&& value);
5917
5919 void set(const ColorList& value);
5920
5922 void set(ColorList&& value);
5923
5925 void set(const VectorList& value);
5926
5928 void set(VectorList&& value);
5929
5931 void set(const TransformList& value);
5932
5934 void set(TransformList&& value);
5935
5937 void set(const ValueList& value);
5938
5940 void set(ValueList&& value);
5941
5943 void set(const StringList& value);
5944
5946 void set(StringList&& value);
5947
5949 void set(const PluginList& value);
5950
5952 void set(PluginList&& value);
5953
5955 void set(const int* values, size_t count);
5956
5958 void set(const float* values, size_t count);
5959
5961 void set(const Vector* values, size_t count);
5962
5964 void set(const Color* values, size_t count);
5965
5967 void set(const Transform* values, size_t count);
5968
5970 void set(const std::string* values, size_t count);
5971
5974 template<typename T> T& as();
5975
5978 template<typename T> const T& as() const;
5979
5983 template<typename T> T get() const;
5984
5986 int getInt() const;
5987
5989 float getFloat() const;
5990
5992 double getDouble() const;
5993
5995 bool getBool() const;
5996
5999
6002
6005
6008
6011
6014 IntList getIntList() const;
6015
6018 FloatList getFloatList() const;
6019
6022 ColorList getColorList() const;
6023
6026 VectorList getVectorList() const;
6027
6030 TransformList getTransformList() const;
6031
6034 ValueList getValueList() const;
6035
6038 StringList getStringList() const;
6039
6042 PluginList getPluginList() const;
6043
6045 std::string getString() const;
6046
6049
6052
6055 Value& operator[](int i);
6056
6059 const Value operator[](int i) const;
6060
6062 bool isOK() const;
6063
6065 bool isBad() const;
6066
6068 const char* getStringType() const;
6069
6071 std::string toString() const;
6072
6073 private:
6075 std::ostream& toString(std::ostream& stream) const;
6076 };
6077
6078 std::ostream& operator <<(std::ostream& stream, const IntList& list);
6079 std::ostream& operator <<(std::ostream& stream, const FloatList& list);
6080 std::ostream& operator <<(std::ostream& stream, const VectorList& list);
6081 std::ostream& operator <<(std::ostream& stream, const ColorList& list);
6082 std::ostream& operator <<(std::ostream& stream, const TransformList& list);
6083 std::ostream& operator <<(std::ostream& stream, const ValueList& list);
6084 std::ostream& operator <<(std::ostream& stream, const StringList& list);
6085 std::ostream& operator <<(std::ostream& stream, const PluginList& list);
6086 std::ostream& operator <<(std::ostream& stream, const Value& value);
6087
6100
6109
6111 std::vector<SubFileInfo> subFileInfos;
6112
6114 std::vector<Plugin> pluginExportList;
6115
6117 std::vector<std::string> additionalIncludeFiles;
6118
6120 std::string hostAppString;
6121
6128
6132 std::string sceneBasePath;
6135
6137 : compressed(true)
6138 , hexArrays(true)
6139 , hexArraysHash(false)
6140 , hexTransforms(false)
6141 , renderElementsSeparateFolders(false)
6142 , printHeader(true)
6143 , currentFrameOnly(false)
6144 , incremental(false)
6145 , appendFrameSuffix(false)
6146 , stripPaths(false)
6147 , leftInterval(0.0)
6148 , rightInterval(0.0)
6149 , vrdataExport(false)
6150 , vrdataSmallBufferSizeLimit(2048)
6151 , vrdataFileSizeLimitMiB(0)
6152 , vrfilesExport(false)
6153 , vrfilesComputeHashes(false)
6154 {}
6155 };
6156
6159 ValueList vertices;
6160 ValueList faces;
6161 ValueList normals;
6162 ValueList faceNormals;
6163 ValueList velocities;
6164 ValueList faceMtlIDs;
6165 ValueList mapChannels;
6166 ValueList mapChNames;
6167 ValueList shaderNames;
6168 ValueList edgeVisibility;
6169 ValueList hairVertices;
6171 ValueList hairWidths;
6173 ValueList particleWidths;
6174 };
6175
6178 Plugin plugin;
6179 double distance;
6180 int mtlID;
6181 };
6182
6183 enum VFBMenuItemType {
6184 normal,
6185 checkbox
6186 };
6187
6190 int id;
6191 VFBMenuItemType type;
6193 bool enabled;
6194 std::string text;
6195 };
6196
6198 // Crop region
6205
6206 // Image size
6209
6210 // Render region
6215
6216 enum RenderSizesBitmask {
6217 RS_NONE = 0,
6218 RS_IMG_SIZE = 1 << 0,
6219 RS_RENDER_RGN = 1 << 1,
6220 RS_CROP_RGN = 1 << 2
6221 };
6223 };
6224
6226 Plugin plugin;
6229 bool enabled;
6230 mutable bool isApplied;
6231 };
6232
6233 namespace Util {
6234 enum ReasonsForAutoRename {
6236 NO_AUTO_RENAME = 0,
6239 NO_OVERWRITE_NO_EXISTING_PLUGIN_BUT_INVALID_PLUGIN_NAME,
6242 NO_OVERWRITE_BUT_EXISTING_PLUGIN_WITH_NAME,
6245 OVERWRITE_EXISTING_PLUGIN_WITH_NAME_BUT_DIFFERENT_TYPE
6246 };
6247
6252 std::string name;
6253
6258
6262
6269
6271 this->skipOnlyCurrentPlugin = false;
6272 this->skipAllSuccessorsOfCurrentPlugin = false;
6273 this->overwriteExistingPlugin = false;
6274 }
6275
6276 PreCreateCallbackOptions(const char* name, const bool skipOnlyCurrentPlugin = false, const bool skipAllSuccessorsOfCurrentPlugin = false, const bool overwriteExistingPlugin = false) {
6277 if (name) {
6278 this->name = name;
6279 }
6280 this->skipOnlyCurrentPlugin = skipOnlyCurrentPlugin;
6281 this->skipAllSuccessorsOfCurrentPlugin = skipAllSuccessorsOfCurrentPlugin;
6282 this->overwriteExistingPlugin = overwriteExistingPlugin;
6283 }
6284
6285 PreCreateCallbackOptions(const std::string& name, const bool skipOnlyCurrentPlugin = false, const bool skipAllSuccessorsOfCurrentPlugin = false, const bool overwriteExistingPlugin = false) {
6286 if (!name.empty()) {
6287 this->name = name;
6288 }
6289 this->skipOnlyCurrentPlugin = skipOnlyCurrentPlugin;
6290 this->skipAllSuccessorsOfCurrentPlugin = skipAllSuccessorsOfCurrentPlugin;
6291 this->overwriteExistingPlugin = overwriteExistingPlugin;
6292 }
6293 };
6294
6327 int copyPlugins(
6328 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6329 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6330 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6331 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6332 const void* userData = nullptr);
6333
6365 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6366 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6367 int copyPlugins(
6368 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6369 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6370 T& obj,
6371 const void* userData = nullptr);
6372
6398 int copyPlugins(
6399 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6400 const char* pluginType,
6401 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6402 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6403 const void* userData = nullptr);
6404
6406 int copyPlugins(
6407 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6408 const std::string& pluginType,
6409 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6410 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6411 const void* userData = nullptr);
6412
6414 int copyPlugins(
6415 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6416 const PluginTypeId& pluginTypeId,
6417 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6418 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6419 const void* userData = nullptr);
6420
6422 template<class PluginType>
6423 int copyPlugins(
6424 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6425 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6426 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6427 const void* userData = nullptr);
6428
6452 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6453 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6454 int copyPlugins(
6455 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6456 const char* pluginType,
6457 T& obj,
6458 const void* userData = nullptr);
6459
6461 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6462 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6463 int copyPlugins(
6464 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6465 const std::string& pluginType,
6466 T& obj,
6467 const void* userData = nullptr);
6468
6470 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6471 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6472 int copyPlugins(
6473 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6474 const PluginTypeId& pluginTypeId,
6475 T& obj,
6476 const void* userData = nullptr);
6477
6479 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6480 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6481 class PluginType>
6482 int copyPlugins(
6483 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6484 T& obj,
6485 const void* userData = nullptr);
6486 }
6487
6499 friend class Plugin;
6500 template<class P> friend class PluginRefT;
6501 friend class PluginMeta;
6502 friend class PropertyMeta;
6503 friend class PropertyRuntimeMeta;
6504 friend class UIGuides;
6505 friend class RenderElement;
6506 friend class RenderElements;
6507 friend class LocalPng;
6508 friend class LocalJpeg;
6509 friend class LocalBmp;
6510 friend class Internal::Access;
6511
6512 friend int Util::copyPlugins(
6513 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6514 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6515 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6516 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6517 const void* userData);
6518
6519 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6520 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6521 friend int Util::copyPlugins(
6522 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6523 const std::vector<Plugin>& includeListOfPlugins, const std::vector<Plugin>& excludeListOfPlugins,
6524 T& obj,
6525 const void* userData);
6526
6527 friend int Util::copyPlugins(
6528 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6529 const char* pluginType,
6530 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6531 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6532 const void* userData);
6533
6534 friend int Util::copyPlugins(
6535 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6536 const std::string& pluginType,
6537 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6538 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6539 const void* userData);
6540
6541 friend int Util::copyPlugins(
6542 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6543 const PluginTypeId& pluginTypeId,
6544 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6545 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6546 const void* userData);
6547
6548 template<class PluginType>
6549 friend int Util::copyPlugins(
6550 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6551 Util::PreCreateCallbackOptions(*preCreateCallback)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6552 void(*postCreateCallback)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6553 const void* userData);
6554
6555 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6556 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6557 friend int Util::copyPlugins(
6558 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6559 const char* pluginType,
6560 T& obj,
6561 const void* userData);
6562
6563 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6564 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6565 friend int Util::copyPlugins(
6566 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6567 const std::string& pluginType,
6568 T& obj,
6569 const void* userData);
6570
6571 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6572 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6573 friend int Util::copyPlugins(
6574 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6575 const PluginTypeId& pluginTypeId,
6576 T& obj,
6577 const void* userData);
6578
6579 template<class T, Util::PreCreateCallbackOptions(T::* TMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6580 void(T::* TMethod1)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*),
6581 class PluginType>
6582 friend int Util::copyPlugins(
6583 VRayRenderer& srcRenderer, VRayRenderer& dstRenderer,
6584 T& obj,
6585 const void* userData);
6586
6587 // We need to keep these methods private and they need also access to protected renderer methods
6588 static void pluginCopyParamsPreCreateCallback(const InstanceId srcPluginID, Internal::PreCreateCallbackOptions* opts, void* info);
6589 static void pluginCopyParamsPostCreateCallback(
6590 const InstanceId dstPluginID, const char* srcPluginName,
6591 Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName,
6592 void* info);
6593
6594 class PluginCopyParamsCreateDelegate {
6595 typedef Util::PreCreateCallbackOptions(*tstubPre)(void* pobject, VRayRenderer& dstRenderer, Plugin& srcPlugin, void* userObj);
6596 typedef Util::PreCreateCallbackOptions(*tfuncPre)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void* userObj);
6597
6598 typedef void (*tstubPost)(void* pobject, Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* userObj);
6599 typedef void (*tfuncPost)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* userObj);
6600
6601 void* pobject;
6602 union tmethodPre {
6603 tstubPre pstubPre;
6604 tfuncPre pfuncPre;
6605 tmethodPre() : pstubPre() {}
6606 tmethodPre(tstubPre pstubPre) : pstubPre(pstubPre) {}
6607 tmethodPre(tfuncPre pfuncPre) : pfuncPre(pfuncPre) {}
6608 } pmethodPre;
6609
6610 union tmethodPost {
6611 tstubPost pstubPost;
6612 tfuncPost pfuncPost;
6613 tmethodPost() : pstubPost() {}
6614 tmethodPost(tstubPost pstubPost) : pstubPost(pstubPost) {}
6615 tmethodPost(tfuncPost pfuncPost) : pfuncPost(pfuncPost) {}
6616 } pmethodPost;
6617
6618 void* puserObj;
6619 VRayRenderer* srcRenderer;
6620 VRayRenderer* dstRenderer;
6621
6622 template <class T, Util::PreCreateCallbackOptions(T::* PreCreateTMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void* puserObj)>
6623 static Util::PreCreateCallbackOptions method_stubPre(void* pobject, VRayRenderer& dstRenderer, Plugin& srcPlugin, void* puserObj) {
6624 T* p = static_cast<T*>(pobject);
6625 return (p->*PreCreateTMethod)(dstRenderer, srcPlugin, puserObj);
6626 }
6627
6628 template <class T, void(T::* PostCreateTMethod)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* puserObj)>
6629 static void method_stubPost(void* pobject, Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void* puserObj) {
6630 T* p = static_cast<T*>(pobject);
6631 (p->*PostCreateTMethod)(dstPlugin, srcPluginName, autoRenamedResult, preCreateCallbackReturnedName, puserObj);
6632 }
6633
6634 PluginCopyParamsCreateDelegate(tfuncPre pfuncPre, tfuncPost pfuncPost, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) :
6635 pobject(), pmethodPre(pfuncPre), pmethodPost(pfuncPost), puserObj(puserObj), srcRenderer(srcRenderer), dstRenderer(dstRenderer) {}
6636 PluginCopyParamsCreateDelegate(void* pobject, tstubPre pstubPre, tstubPost pstubPost, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) :
6637 pobject(pobject), pmethodPre(pstubPre), pmethodPost(pstubPost), puserObj(puserObj), srcRenderer(srcRenderer), dstRenderer(dstRenderer) {}
6638
6639 public:
6640 template <class T, Util::PreCreateCallbackOptions(T::* PreCreateTMethod)(VRayRenderer& dstRenderer, Plugin& srcPlugin, void*),
6641 void(T::* PostCreateTMethod)(Plugin& dstPlugin, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName, void*)>
6642 static PluginCopyParamsCreateDelegate from_method(T* pobject, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) {
6643 return PluginCopyParamsCreateDelegate(pobject, &method_stubPre<T, PreCreateTMethod>, &method_stubPost<T, PostCreateTMethod>, puserObj, srcRenderer, dstRenderer);
6644 }
6645
6646 static PluginCopyParamsCreateDelegate from_function(tfuncPre pfuncPre, tfuncPost pfuncPost, void* puserObj, VRayRenderer* srcRenderer, VRayRenderer* dstRenderer) {
6647 return PluginCopyParamsCreateDelegate(pfuncPre, pfuncPost, puserObj, srcRenderer, dstRenderer);
6648 }
6649
6650 Util::PreCreateCallbackOptions operator()(const InstanceId& srcPluginID) const {
6651 Plugin srcPlugin = srcRenderer->getPlugin_internal(srcPluginID);
6652 return pobject ? (*pmethodPre.pstubPre)(pobject, *dstRenderer, srcPlugin, puserObj) : (*pmethodPre.pfuncPre)(*dstRenderer, srcPlugin, puserObj);
6653 }
6654
6655 void operator()(const InstanceId& dstPluginID, const char* srcPluginName, Util::ReasonsForAutoRename autoRenamedResult, const char* preCreateCallbackReturnedName) const {
6656 Plugin dstPlugin = dstRenderer->getPlugin_internal(dstPluginID);
6657 pobject ? (*pmethodPost.pstubPost)(pobject, dstPlugin, srcPluginName, autoRenamedResult, preCreateCallbackReturnedName, puserObj) :
6658 (*pmethodPost.pfuncPost)(dstPlugin, srcPluginName, autoRenamedResult, preCreateCallbackReturnedName, puserObj);
6659 }
6660 };
6661
6665 VRayRenderer(const VRayRenderer&);
6666 VRayRenderer& operator=(const VRayRenderer&);
6667
6668 class PluginFilterDelegate {
6669 typedef bool (*tstub)(void* pobject, VRayRenderer& renderer, const char* type, std::string& name, void* userObj);
6670 typedef bool (*tfunc)(VRayRenderer& renderer, const char* type, std::string& name, void* userObj);
6671
6672 void *pobject;
6673 union tmethod {
6674 tstub pstub;
6675 tfunc pfunc;
6676 tmethod() : pstub() {}
6677 tmethod(tstub pstub) : pstub(pstub) {}
6678 tmethod(tfunc pfunc) : pfunc(pfunc) {}
6679 } pmethod;
6680 void *puserObj;
6681 VRayRenderer &renderer;
6682
6683 template <class T, bool (T::*TMethod)(VRayRenderer&, const char* type, std::string& name, void* puserObj)>
6684 static bool method_stub(void* pobject, VRayRenderer& renderer, const char* type, std::string& name, void *puserObj) {
6685 T* p = static_cast<T*>(pobject);
6686 return (p->*TMethod)(renderer, type, name, puserObj);
6687 }
6688
6689 PluginFilterDelegate(tfunc pfunc, void *puserObj, VRayRenderer& renderer) : pobject(), pmethod(pfunc), puserObj(puserObj), renderer(renderer) {}
6690 PluginFilterDelegate(void *pobject, tstub pstub, void *puserObj, VRayRenderer& renderer) : pobject(pobject), pmethod(pstub), puserObj(puserObj), renderer(renderer) {}
6691
6692 public:
6693 template <class T, bool (T::*TMethod)(VRayRenderer&, const char*, std::string&, void*)>
6694 static PluginFilterDelegate from_method(T* pobject, void *puserObj, VRayRenderer& renderer) {
6695 return PluginFilterDelegate(pobject, &method_stub<T, TMethod>, puserObj, renderer);
6696 }
6697
6698 static PluginFilterDelegate from_function(tfunc pfunc, void *puserObj, VRayRenderer& renderer) {
6699 return PluginFilterDelegate(pfunc, puserObj, renderer);
6700 }
6701
6702 bool operator()(const char* type, std::string& name) const {
6703 return pobject ? (*pmethod.pstub)(pobject, renderer, type, name, puserObj) : (*pmethod.pfunc)(renderer, type, name, puserObj);
6704 }
6705 };
6706
6707 template<class T, void (T::*TMethod)(VRayRenderer&, RendererState oldState, RendererState newState, double instant, void* userData)>
6708 static void stateChangedCallbackT(const Internal::StateChangedParams* params);
6709 static void stateChangedCallback(const Internal::StateChangedParams* params);
6710
6711 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
6712 static void rendererCloseCallbackT(const Internal::CallbackParamsBase* params);
6713 static void rendererCloseCallback(const Internal::CallbackParamsBase* params);
6714
6715 template<class T, void (T::*TMethod)(VRayRenderer&, VRayImage* img, unsigned long long changeIndex, ImagePassType pass, double instant, void* userData)>
6716 static void progressiveImageUpdatedCallbackT(const Internal::ImageUpdatedParams* params);
6717 static void progressiveImageUpdatedCallback(const Internal::ImageUpdatedParams* params);
6718
6719 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, MessageLevel level, double instant, void* userData)>
6720 static void logMessageCallbackT(const Internal::LogMessageParams* params);
6721 static void logMessageCallback(const Internal::LogMessageParams* params);
6722
6723 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, int errorCode, LicenseUserStatus userStatus, double instant, void* userData)>
6724 static void licenseErrorCallbackT(const Internal::LicenseErrorParams* params);
6725 static void licenseErrorCallback(const Internal::LicenseErrorParams* params);
6726
6727 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)>
6728 static void bucketInitCallbackT(const Internal::BucketInitParams* params);
6729 static void bucketInitCallback(const Internal::BucketInitParams* params);
6730
6731 template<class T, void (T::*TMethod)(VRayRenderer& renderer, int x, int y, const char* host, VRayImage* image, ImagePassType pass, double instant, void* userData)>
6732 static void bucketReadyCallbackT(const Internal::BucketReadyParams* params);
6733 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)>
6734 static void bucketReadyCallback1T(const Internal::BucketReadyParams* params);
6735 static void bucketReadyCallback(const Internal::BucketReadyParams* params);
6736 static void bucketReadyCallback1(const Internal::BucketReadyParams* params);
6737
6738 template<class T, void (T::*TMethod)(VRayRenderer&, const char* msg, int elementNumber, int elementsCount, double instant, void* userData)>
6739 static void progressCallbackT(const Internal::ProgressParams* params);
6740 static void progressCallback(const Internal::ProgressParams* params);
6741
6742 template<class T, void (T::*TMethod)(VRayRenderer&, const char* propName, double instant, void* userData)>
6743 static void renderViewChangedCallbackT(const Internal::RenderViewChangedParams* params);
6744 static void renderViewChangedCallback(const Internal::RenderViewChangedParams* params);
6745
6746 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
6747 static void vfbRenderLastCallbackT(const Internal::RenderLastParams* params);
6748 static void vfbRenderLastCallback(const Internal::RenderLastParams* params);
6749
6750 template<class T, void (T::*TMethod)(VRayRenderer&, const char* hostName, double instant, void* userData)>
6751 static void drHostConnectedCallbackT(const Internal::ConnectParams* params);
6752 static void drHostConnectedCallback(const Internal::ConnectParams* params);
6753
6754 template<class T, void(T::*TMethod)(VRayRenderer&, int commandId, int x, int y, void* userData)>
6755 static void vfbContextMenuSelectedCallbackT(const Internal::VFBContextMenuSelectedParams* params);
6756 static void vfbContextMenuSelectedCallback(const Internal::VFBContextMenuSelectedParams* params);
6757
6758 public:
6759 enum class VFBSourceButton : int {
6760 Default = 0, // The default Render button
6761 InteractiveRendering = 1, // The "Start interactive rendering" button, only shown when RendererOptions::showVfbButtonInteractiveStart is set
6762 Maximum, // The number of VFBSourceButton values
6763 };
6764
6765 private:
6766 static void vfbCameraSelectionCallback(const Internal::VFBRenderCameraSelectedParams* params);
6767 template<class T, void(T::*TMethod)(VRayRenderer&, int itemId, VFBSourceButton sourceButton, void* userData)>
6768 static void vfbCameraSelectionCallbackT(const Internal::VFBRenderCameraSelectedParams* params);
6769
6770 static char* pluginFilterCallback(const char* pluginType, const char* pluginName, void* userObject);
6771 static void deleteTempStringCallback(char*, size_t, std::string* str);
6772
6773
6774 template<class T, void(T::*TMethod)(VRayRenderer&, VRayImage* img, void* userData)>
6775 static void manualDenoiseCallbackT(VRayImage* img, void* info);
6776 static void manualDenoiseCallback(VRayImage* img, void* info);
6777
6778 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<LightMixChange>& lightMixChanges, double instant, void* userData)>
6779 static int lightMixTransferToSceneCallbackT(Internal::LightMixCallbackParams* params);
6780 static int lightMixTransferToSceneCallback(Internal::LightMixCallbackParams* params);
6781 void transferToScenePreCallback(std::vector<LightMixChange>& changes, const Internal::LightMixCallbackParams* params);
6782 void transferToScenePostCallback(const std::vector<LightMixChange>& changes, Internal::LightMixCallbackParams* params);
6783
6784 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
6785 static int uploadToCollaborationCallbackT(Internal::UploadToCollaborationParams* params);
6786 static int uploadToCollaborationCallback(Internal::UploadToCollaborationParams* params);
6787 void uploadToCollaborationPreCallback(std::vector<std::string>& fileList, const Internal::UploadToCollaborationParams* params);
6788
6789 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
6790 static int enhanceOnCollaborationCallbackT(Internal::UploadToCollaborationParams* params);
6791 static int enhanceOnCollaborationCallback(Internal::UploadToCollaborationParams* params);
6792 void enhanceOnCollaborationPreCallback(std::vector<std::string>& fileList, const Internal::UploadToCollaborationParams* params);
6793
6794 template<class T, void(T::*TMethod)(VRayRenderer&, int imageLoaded, int enhanceSupported, double instant, void* userData)>
6795 static void collaborationImageChangeCallbackT(const Internal::VFBCollaborationImageParams* params);
6796 static void collaborationImageChangeCallback(const Internal::VFBCollaborationImageParams* params);
6797
6798 template<class T, void (T::* TMethod)(VRayRenderer&, int enabled, int mode, int selectionLocked, double instant, void* userData)>
6799 static void debugShadingCallbackT(const Internal::DebugShadingCallbackParams* params);
6800 static void debugShadingCallback(const Internal::DebugShadingCallbackParams* params);
6801
6802 template<class T, void(T::*TMethod)(VRayRenderer&, const std::string &outputFile, int fileType, double instant, void* userData)>
6803 static void vrayProfilerWriteCallbackT(const Internal::VRayProfilerWriteParams* params);
6804 static void vrayProfilerWriteCallback(const Internal::VRayProfilerWriteParams* params);
6805
6806 template<class T, bool (T::*TMethod)(VRayRenderer&, VFBRenderElementType type, double instant, void* userData)>
6807 static int vfbAddRenderElementToSceneT(const Internal::AddRenderElementToSceneParams* params);
6808 static int vfbAddRenderElementToScene(const Internal::AddRenderElementToSceneParams* params);
6809
6810 template<class T, void (T::*TMethod)(VRayRenderer&, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void* userData)>
6811 static void vfbClickT(const Internal::VFBClickParams* params);
6812 static void vfbClick(const Internal::VFBClickParams* params);
6813
6814 public:
6815 typedef void* InstanceHandleType;
6816
6818 class VFB {
6819 friend class UVTextureSampler;
6820
6821 Internal::VRayRendererNative *rendererNative;
6822 bool autoCommit;
6823 friend class VRayRenderer;
6824 friend class LayerManager;
6825 friend class HistoryManager;
6826 friend class ToolbarManager;
6827 VFB() : autoCommit(true),
6828 layerManager(*this),
6829 historyManager(*this),
6830 toolbarManager(*this) {}
6831 VFB(const VFB&);
6832 VFB& operator=(const VFB&);
6833 public:
6837 void show(bool show, bool setFocus = true);
6838
6840 bool isShown() const;
6841
6844
6846 void enableInteractivity(bool enable = true);
6847
6850
6852 void enableConfirmation(bool enable = true);
6853
6856
6858 void setPosition(int x, int y);
6859
6861 void setPositionAndSize(int x, int y, int w, int h);
6862
6864 bool getPositionAndSize(int& x, int& y, int& w, int& h) const;
6865
6873 VFBState* getState(size_t& dataSize, bool includeMain = true, bool includeHistory = true) const;
6874
6882 void setState(const void* vfbStateData, size_t dataSize, bool setMain = true, bool setHistory = true);
6883
6886 std::string getSettings() const;
6887
6891 int setSettings(const char *json);
6892
6895 std::string getLayers() const;
6896
6900 int setLayers(const char *json);
6901
6902 // Forward declaration.
6903 class LayerManager;
6904
6906 class Layer {
6907 friend class LayerManager;
6908 public:
6909
6913 int getIntegerID() const;
6914
6917
6920 bool isValid() const;
6921
6926 int getUniqueTreePathID(std::string& treePathUID) const;
6927
6931 int getClass(std::string& layerClass) const;
6932
6936 int getEnabled(bool& isEnabled) const;
6940 int setEnabled(const bool enabled);
6941
6945 int canDelete(bool& isDeletable) const;
6946
6950
6954 int getUserName(std::string& layerName) const;
6955
6959 int setUserName(const char* layerName);
6961 int setUserName(const std::string& layerName);
6962
6966 int getChildrenCount(int& childrenCount) const;
6969 std::vector<Layer> getChildren() const;
6973 Layer getChild(const int childIndex) const;
6974
6978 int getOpacity(float& opacity) const;
6982 int setOpacity(const float opacity) const;
6983
6987 int canBlend(bool& isBlendable) const;
6995 int setBlendMode(const VFBLayerProperty::BlendMode blendMode) const;
6996
7000 int getLayerPropertiesCount(int& propsCount) const;
7004 int getLayerPropertyNames(std::vector<std::string>& propNames) const;
7005
7010 int getLayerPropertyDisplayName(const char* propName, std::string& displayName) const;
7012 int getLayerPropertyDisplayName(const std::string& propName, std::string& displayName) const;
7013
7017 int resetLayerPropertyToDefault(const char* propName);
7019 int resetLayerPropertyToDefault(const std::string& propName);
7020
7024 int getLayerPropertiesReadOnly(std::vector<std::string>& values) const;
7025
7030 int isLayerPropertyReadOnly(const char* propName, bool& isReadOnly) const;
7032 int isLayerPropertyReadOnly(const std::string& propName, bool& isReadOnly) const;
7033
7038 int getLayerPropertiesOfType(const VFBLayerProperty::Type type, std::vector<std::string>& values) const;
7039
7044 int getLayerPropertyType(const char* propName, VFBLayerProperty::Type& type) const;
7046 int getLayerPropertyType(const std::string& propName, VFBLayerProperty::Type& type) const;
7047
7049
7054 int getLayerPropertyFlags(const char* propName, int& flags) const;
7056 int getLayerPropertyFlags(const std::string& propName, int& flags) const;
7057
7059
7064 int getLayerPropertyBoolValue(const char* propName, bool& value) const;
7066 int getLayerPropertyBoolValue(const std::string& propName, bool& value) const;
7067
7072 int setLayerPropertyBoolValue(const char* propName, const bool value);
7074 int setLayerPropertyBoolValue(const std::string& propName, const bool value);
7075
7080 int getLayerPropertyIntValue(const char* propName, int& value) const;
7082 int getLayerPropertyIntValue(const std::string& propName, int& value) const;
7083
7088 int setLayerPropertyIntValue(const char* propName, const int value);
7090 int setLayerPropertyIntValue(const std::string& propName, const int value);
7091
7093
7097 int getLayerEnumProperties(std::vector<std::string>& values) const;
7098
7103 int getLayerPropertyIntEnumValues(const char* propName, std::vector<std::string>& values) const;
7105 int getLayerPropertyIntEnumValues(const std::string& propName, std::vector<std::string>& values) const;
7106
7111 int getLayerPropertyIntEnumLabel(const char* propName, std::string& valueLabel) const;
7113 int getLayerPropertyIntEnumLabel(const std::string& propName, std::string& valueLabel) const;
7114
7119 int setLayerPropertyIntByEnumLabel(const char* propName, const char* label);
7121 int setLayerPropertyIntByEnumLabel(const char* propName, const std::string& label);
7123 int setLayerPropertyIntByEnumLabel(const std::string& propName, const char* label);
7125 int setLayerPropertyIntByEnumLabel(const std::string& propName, const std::string& label);
7126
7131 int getLayerPropertyIntEnumIndex(const char* propName, int& enumIndex) const;
7133 int getLayerPropertyIntEnumIndex(const std::string& propName, int& enumIndex) const;
7134
7139 int setLayerPropertyIntByEnumIndex(const char* propName, const int enumIndex);
7141 int setLayerPropertyIntByEnumIndex(const std::string& propName, const int enumIndex);
7142
7144
7149 int getLayerPropertyFloatValue(const char* propName, float& value) const;
7151 int getLayerPropertyFloatValue(const std::string& propName, float& value) const;
7152
7157 int setLayerPropertyFloatValue(const char* propName, const float value);
7159 int setLayerPropertyFloatValue(const std::string& propName, const float value);
7160
7165 int getLayerPropertyStringValue(const char* propName, std::string& value) const;
7167 int getLayerPropertyStringValue(const std::string& propName, std::string& value) const;
7168
7173 int setLayerPropertyStringValue(const char* propName, const char* value);
7175 int setLayerPropertyStringValue(const std::string& propName, const char* value);
7176
7181 int getLayerPropertyColorValue(const char* propName, Color& value) const;
7183 int getLayerPropertyColorValue(const std::string& propName, Color& value) const;
7184
7189 int setLayerPropertyColorValue(const char* propName, const Color& value);
7191 int setLayerPropertyColorValue(const std::string& propName, const Color& value);
7192
7197 int getLayerPropertyStampRawStringValue(const char* propName, std::string& value) const;
7199 int getLayerPropertyStampRawStringValue(const std::string& propName, std::string& value) const;
7200
7205 int setLayerPropertyStampRawStringValue(const char* propName, const char* value);
7207 int setLayerPropertyStampRawStringValue(const char* propName, const std::string& value);
7209 int setLayerPropertyStampRawStringValue(const std::string& propName, const char* value);
7211 int setLayerPropertyStampRawStringValue(const std::string& propName, const std::string& value);
7212
7219 int getLayerPropertyStampFontDescValue(const std::string& propName, VFBLayerProperty::StampFontDesc& value) const;
7220
7227 int setLayerPropertyStampFontDescValue(const std::string& propName, const VFBLayerProperty::StampFontDesc& value);
7228
7229 Layer() = delete;
7230
7231 Layer& operator=(const Layer& rhs) {
7232 if (this != &rhs) {
7233 if (&myLayerManager == &rhs.myLayerManager) {
7234 layerUID = rhs.layerUID;
7235 }
7236 }
7237 return *this;
7238 }
7239
7240 bool operator==(const Layer& rhs) const {
7241 return layerUID == rhs.layerUID && &myLayerManager == &rhs.myLayerManager;
7242 }
7243 protected:
7244 Layer(const int& layerUID, const LayerManager& layerManager) :
7245 layerUID(layerUID), myLayerManager(layerManager){
7246 };
7247
7248 void invalidateLayer() const {
7249 layerUID = NO_LAYER_ID;
7250 }
7251 private:
7252 const LayerManager& myLayerManager;
7253 mutable LayerUID layerUID;
7254 };
7255
7271 friend class Layer;
7272 friend class VFB;
7273 public:
7275
7277 VFB& getVFB() const;
7278
7283 void reset();
7284
7287 int getLayersCount() const;
7288
7291 std::vector<Layer> getAllLayersAsLayerObjects() const;
7292
7295 std::vector<std::string> getCreatableLayerClasses() const;
7296
7302 int loadAllLayers(const char* filename);
7304 int loadAllLayers(const std::string& filename);
7305
7309 int saveAllLayers(const char* filename) const;
7311 int saveAllLayers(const std::string& filename) const;
7312
7316 int bakeLayersToLUT(const char* filename) const;
7318 int bakeLayersToLUT(const std::string& filename) const;
7319
7322 std::string getAllLayers() const;
7323
7329 int setAllLayers(const char* json);
7331 int setAllLayers(const std::string& json);
7332
7358 Layer createLayer(const char* layerClass, const Layer& parent);
7360 Layer createLayer(const std::string& layerClass, const Layer& parent);
7361
7367 int deleteLayer(Layer& layer);
7368
7370
7395
7397
7401 std::vector<Layer> findAllLayersWithLayerClass(const char* layerClass) const;
7403 std::vector<Layer> findAllLayersWithLayerClass(const std::string& layerClass) const;
7404
7408 std::vector<Layer> findAllLayersWithUserName(const char* userName) const;
7410 std::vector<Layer> findAllLayersWithUserName(const std::string& userName) const;
7411
7414 std::vector<Layer> getAllEnabledLayers() const;
7415
7418 std::vector<Layer> getAllBlendableLayers() const;
7419
7421
7425
7430
7434
7435 LayerManager() = delete;
7436
7437 LayerManager(const LayerManager& rhs) = delete;
7438
7439 LayerManager& operator=(const LayerManager& rhs) = delete;
7440
7441 ~LayerManager() {
7442 void* original = errMsgHandle.exchange(nullptr);
7443 if (original) {
7444 Internal::releaseCharString(&original);
7445 }
7446 }
7447
7449 std::string getLastError() const {
7450 void* original = (void*)errMsgHandle;
7451 return Internal::getCharStringContent(&original);
7452 }
7453 protected:
7454 LayerManager(VRayRenderer::VFB& vfb) : myVfb(vfb), errMsgHandle(nullptr) {}
7455
7456 Internal::VRayRendererNative* getNativeRenderer() const {
7457 return myVfb.rendererNative;
7458 }
7459
7460#ifndef VRAY_NOTHROW
7461 void handleError(void*& errorMsgHandlePtr, const bool throwException = true) const {
7462 const char* errstr = nullptr;
7463 if (throwException) {
7464 errstr = Internal::getCharStringContent(&errorMsgHandlePtr);
7465 }
7466 void* oldErr = errMsgHandle.exchange(errorMsgHandlePtr);
7467 Internal::releaseCharString(&oldErr);
7468 if (throwException) {
7469 throw VFBLayerErr(errstr);
7470 }
7471 }
7472#else
7473 void handleError(void*& errorMsgHandlePtr, const bool throwException = false) const {
7474 void* oldErr = errMsgHandle.exchange(errorMsgHandlePtr);
7475 Internal::releaseCharString(&oldErr);
7476 }
7477#endif
7478
7479 void getLayerListAndReleaseIDs(std::vector<Layer>& layers, LayerUID*& layerIDs, const int len) const {
7480 layers.reserve(len);
7481 for (int i = 0; i < len; i++) {
7482 layers.push_back(Layer(layerIDs[i], *this));
7483 }
7484 Internal::C_memory_free(layerIDs);
7485 }
7486
7487 static void getStringListAndReleaseCharStars(std::vector<std::string>& words, char*& cStyleWords, const int len) {
7488 words.reserve(len);
7489 const char* curr = cStyleWords;
7490 for (int i = 0; i < len; i++) {
7491 words.emplace_back(curr);
7492 curr += words[i].size() + 1;
7493 }
7494 Internal::C_memory_free(cStyleWords);
7495 }
7496
7497 Layer getCommonLayer(int (*layerLoader)(Internal::VRayRendererNative* renderer, LayerUID* layerID, void** errorMsgHandlePtr)) const {
7498 LayerUID layerID = NO_LAYER_ID;
7499 void* errorMsgHandlePtr = nullptr;
7500 int err = layerLoader(myVfb.rendererNative, &layerID, &errorMsgHandlePtr);
7501 if (err != 0) {
7502 handleError(errorMsgHandlePtr);
7503 return Layer(NO_LAYER_ID, *this);
7504 }
7505 return Layer(layerID, *this);
7506 }
7507
7508 private:
7509 const VRayRenderer::VFB& myVfb;
7510 mutable std::atomic<void*> errMsgHandle;
7511 } layerManager;
7512
7515 friend class VFB;
7516 public:
7519 bool getWindowStatus() const;
7520
7523 void setWindowStatus(const bool status);
7524
7527 bool getPanelStatus() const;
7528
7531 void setPanelStatus(const bool status);
7532
7535 int getMaximumSize() const;
7536
7539 void setMaximumSize(const int maxSize);
7540
7543 std::string getTemporaryPath() const;
7544
7547 void setTemporaryPath(const char* path);
7549 void setTemporaryPath(const std::string& path);
7550
7551 HistoryManager() = delete;
7552
7553 HistoryManager(const HistoryManager& rhs) = delete;
7554
7555 HistoryManager& operator=(const HistoryManager& rhs) = delete;
7556 protected:
7557 HistoryManager(VRayRenderer::VFB& vfb) : myVfb(vfb) {}
7558
7559 Internal::VRayRendererNative* getNativeRenderer() const {
7560 return myVfb.rendererNative;
7561 }
7562 private:
7563 const VRayRenderer::VFB& myVfb;
7564 } historyManager;
7565
7568 friend class VFB;
7569 public:
7572 red = 1,
7573 green,
7574 blue,
7575 alpha,
7576 monochrome
7577 };
7578
7582 resolution_10p = 0,
7583 resolution_25p,
7584 resolution_50p,
7585 resolution_75p,
7586 resolution_100p,
7587 resolution_110p,
7588 resolution_125p,
7589 resolution_150p
7590 };
7591
7595 bool getChannelButtonStatus(const ChannelButton whichChannel) const;
7596
7600 void setChannelButtonStatus(const ChannelButton whichChannel, const bool status);
7601
7605
7608 void setTestResolutionButtonStatus(const bool status);
7609
7613
7616 void setTestResolution(const Resolution resolution);
7617
7623
7628 void setTrackMouseButtonStatus(const bool status);
7629
7635 void getBucketLockPoint(int& left, int& top) const;
7636
7642 void setBucketLockPoint(const int left, const int top);
7643
7656
7668 void setBucketLockButtonStatus(const bool status);
7669
7673 StringList getChannelNames() const;
7674
7683
7690 void setCurrentChannel(const int channelIdx);
7691
7695
7698 void setRenderRegionButtonStatus(const bool status);
7699
7700 ToolbarManager() = delete;
7701
7702 ToolbarManager(const ToolbarManager& rhs) = delete;
7703
7704 ToolbarManager& operator=(const ToolbarManager& rhs) = delete;
7705 protected:
7706 ToolbarManager(VRayRenderer::VFB& vfb) : myVfb(vfb) {}
7707
7708 Internal::VRayRendererNative* getNativeRenderer() const {
7709 return myVfb.rendererNative;
7710 }
7711 private:
7712 const VRayRenderer::VFB& myVfb;
7713 } toolbarManager;
7714
7718
7724 VFBState* getPersistentState(size_t& dataSize) const;
7725
7730 void setPersistentState(const void* vfbPersistentStateData, size_t dataSize);
7731
7737 VRAY_DEPRECATED("getWindowHandle in unsafe and deprecated - use getNativeHandle or getQWidget instead")
7738 void* getWindowHandle() const;
7739
7745 NativeWidgetHandle getNativeHandle() const;
7746
7748 APPSDK_QT_NAMESPACE::QWidget* getQWidget() const;
7749
7754 VRAY_DEPRECATED("setParentWindow in unsafe and deprecated - use setNativeParentWindow or setQWidgetParent instead")
7755 void setParentWindow(void* hWnd);
7756
7762 void setNativeParentWindow(NativeWindowHandle handle);
7763
7766 void setQWidgetParent(APPSDK_QT_NAMESPACE::QWidget* parentWidget);
7767
7772 bool getMinimumSize(int& w, int& h) const;
7773
7777 bool loadColorCorrectionsPreset(const char* filename);
7778
7780 bool loadColorCorrectionsPreset(const std::string& filename);
7781
7785 bool saveColorCorrectionsPreset(const char* filename) const;
7786
7788 bool saveColorCorrectionsPreset(const std::string& filename) const;
7789
7793 bool setTitlePrefix(const char* prefix);
7794
7796 bool setTitlePrefix(const std::string& prefix);
7797
7801 bool setProjectPath(const char *projectPath);
7802
7804 bool setProjectPath(const std::string& projectPath);
7805
7808 void enableProgressBar(bool enable = true);
7809
7813 void setProgressText(const char* text);
7814
7816 void setProgressText(const std::string& text);
7817
7821 void setProgressValue(float value = -1.0f);
7822
7827 void setProgressTextAndValue(const char* text, float value);
7828
7830 void setProgressTextAndValue(const std::string& text, float value);
7831
7836 bool fillSettingsVFB(const char* instanceName = nullptr);
7837
7839 bool fillSettingsVFB(const std::string& instanceName);
7840
7844 bool applySettingsVFB();
7845
7849 bool loadImage(const char* filename);
7850
7852 bool loadImage(const std::string& filename);
7853
7856 bool saveImage(const char* fileName) const;
7857
7859 bool saveImage(const std::string& fileName) const;
7860
7864 bool saveImage(const char* fileName, const ImageWriterOptions& options) const;
7865
7867 bool saveImage(const std::string& fileName, const ImageWriterOptions& options) const;
7868
7870 void clearImage();
7871
7874 void setUpdateAvailable(bool available);
7875
7879 void logMessage(MessageLevel level, const char* message);
7880
7882 void logMessage(MessageLevel level, const std::string& message);
7883
7889 void appendAdditionalStyleSheet(const char *styleSheet);
7890
7891 } vfb;
7892
7893 enum RenderMode {
7894 RENDER_MODE_PRODUCTION = -1,
7895 RENDER_MODE_INTERACTIVE = 0,
7896 RENDER_MODE_INTERACTIVE_CUDA = 4,
7897 RENDER_MODE_INTERACTIVE_OPTIX = 7,
7898 RENDER_MODE_INTERACTIVE_METAL = 8,
7899 RENDER_MODE_INTERACTIVE_METALRT = 9,
7900 RENDER_MODE_PRODUCTION_CUDA = 104,
7901 RENDER_MODE_PRODUCTION_OPTIX = 107,
7902 RENDER_MODE_PRODUCTION_METAL = 108,
7903 RENDER_MODE_PRODUCTION_METALRT = 109,
7904 };
7905
7907 static bool isInactiveState(RendererState value) { return value <= IDLE_DONE; }
7908
7910 static bool isActiveState(RendererState value) { return !isInactiveState(value); }
7911
7915 return Internal::VRay_VRayRenderer_halfResolutionMode
7916 (getNativeRenderer());
7917 }
7918 private:
7919 LicenseError licErr;
7920 PluginTypeId* pluginTypeIds; // PluginTypeId LUT allocated in the VRayRenderer constructor, freed in the VRayRenderer destructor
7921 int pluginTypeIdsCount; // Number of plugin classes and the size of the pluginTypeIds LUT
7922
7923 void createInstance(const Internal::RendererOptions_internal* options);
7924 int findPluginIdIndex(PluginTypeId typeId) const;
7925
7926 public:
7930
7933 VRayRenderer(const RendererOptions &rendererOptions);
7934
7939 explicit VRayRenderer(InstanceHandleType handle);
7940
7943
7947 InstanceHandleType getInstanceHandle() const;
7948
7951 operator bool() const;
7952
7955 bool operator!() const;
7956
7959
7962
7964 LicenseError getLicenseError() const;
7965
7968
7972 bool setRenderMode(RenderMode mode);
7973
7975 RenderMode getRenderMode() const;
7976
7979
7985 int setBitmapCache(bool onOff);
7986
7990 bool setInteractiveSampleLevel(int samplesPerPixel);
7991
7995 bool setInteractiveNoiseThreshold(float threshold);
7996
8000 bool setInteractiveTimeout(int timeoutMsec);
8001
8005 void setKeepInteractiveRunning(bool keepRunning);
8006
8009
8017
8020
8028 bool setDREnabled(bool drEnabled, bool enableBroadcastListener = true);
8029
8032 bool getDREnabled() const;
8033
8035 int getNumThreads() const;
8036
8041 bool setNumThreads(int numThreads);
8042
8047 bool enableDRClient(const EnableDRClientParams& enableParams);
8048
8053
8056 bool isDRClientEnabled() const;
8057
8063
8066 UPType_int = 0,
8067 UPType_bool = 1,
8068 UPType_double = 2,
8069 UPType_float = 3,
8070 UPType_string = 4,
8071 UPType_vector = 5,
8072 UPType_color = 6
8073 };
8074
8077 const char* propName;
8078 UserPropertyType type;
8079 union {
8080 int vint;
8081 bool vbool;
8082 double vdouble;
8083 float vfloat;
8084 const char* vstring;
8085 float vvector[3];
8086 };
8087 };
8088
8089 // Information passed with userCameraChanged
8091 // Name of the VRay plugin whose property was changed. Can be nullptr if
8092 // the property changed comes from a Vantage default and is not associated
8093 // with an existing scene plugin, e.g. a scene without a physical camera plugin
8094 const char* camName;
8095 // Information about the actual parameter that was changed and its new value
8096 const UserPropertyChanged* prop;
8097 };
8098
8099 // Information passed with userLightChanged
8101 // Name of the VRay plugin whose property was changed. Can be nullptr if
8102 // the property changed comes from a Vantage default and is not associated
8103 // with an existing scene plugin
8104 const char* lightName;
8105 // Information about the actual parameter that was changed and its new value
8106 const UserPropertyChanged* prop;
8107 };
8108
8109 enum UserSceneManipType { USMType_Transform_Set = 0, USMType_Show = 1, USMType_Hide = 2 };
8110
8111 enum UserSceneNodeObjectType { USNOType_Node = 0, USNOType_Camera = 1, USNOType_Light = 2 };
8112
8113 // Information passed with userNodeChanged
8115 // Name of the VRay plugin whose property is changed with this operation.
8116 // This can be one of the light plugins, the render view, one of the camera
8117 // plugins, or a geometry node
8118 const char* objName;
8119 // Type of manipulation that occurred
8120 UserSceneManipType umt;
8121 // The general kind of object passed with objName
8122 UserSceneNodeObjectType objType;
8123 // If the type of manipulation is transform, the matrix and vector that describe
8124 // the transformation (i.e. the 'transform' plugin parameter). This should be
8125 // regarded as an offset to the current position/rotation and is in Vantage
8126 // world coordinates
8127 Transform moveTm;
8128 };
8129
8136 void setUserCameraChangedCB(void(*cb) (const UserCameraChanged* info, void* userData), void* userData);
8137
8144 void setUserLightChangedCB(void(*cb) (const UserLightChanged* info, void* userData), void* userData);
8145
8153 void setUserNodeChangedCB(void(*cb) (const UserNodeChanged* info, void* userData), void* userData);
8154
8157 bool getInProcess() const;
8158
8164 bool setInProcess(bool inProcess);
8165
8171 bool setImprovedDefaultSettings(DefaultsPreset preset=quality_medium);
8172
8176
8179 int getCurrentFrame() const;
8180
8185 bool setCurrentFrame(int frame);
8186
8189 double getCurrentTime() const;
8190
8193 bool setCurrentTime(double time);
8194
8197
8199 bool clearPropertyValuesUpToTime(double time, PluginCategories categories);
8200
8203 void useAnimatedValues(bool on);
8204
8207
8210
8212 Box getBoundingBox(bool& ok) const;
8213
8216 bool setCamera(const Plugin& plugin);
8217
8220
8222 void setCameraName(const char* name);
8223
8225 const char* getCameraName() const;
8226
8229
8232 bool pause() const;
8233
8236 bool resume() const;
8237
8239 bool getImageSize(int& width, int& height) const;
8240
8243 bool setImageSize(int width, int height, bool resetCropRegion = true, bool resetRenderRegion = true);
8244
8247 bool getRenderRegion(int& rgnLeft, int& rgnTop, int& rgnWidth, int& rgnHeight) const;
8248
8254 bool setRenderRegion(int rgnLeft, int rgnTop, int rgnWidth, int rgnHeight);
8255
8257 bool getCropRegion(int& srcWidth, int& srcHeight, float& rgnLeft, float& rgnTop, float& rgnWidth, float& rgnHeight) const;
8258
8264 bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop);
8265
8271 bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop, float rgnWidth, float rgnHeight);
8272
8276 bool setRenderSizes(const RenderSizeParams& sizes, bool regionButtonState);
8277
8281 bool getRenderSizes(RenderSizeParams& sizes, bool& regionButtonState) const;
8282
8287 int load(const char* fileName);
8288
8290 int load(const std::string& fileName);
8291
8296 int loadAsText(const char* text);
8297
8299 int loadAsText(const std::string& text);
8300
8302 int loadAsText(std::string&& text);
8303
8312 template<typename T = void>
8313 int loadAsText(const char* text, size_t length, void(*freeFn)(char* text, size_t size, T* holderObject) = nullptr, T* holderObject = nullptr);
8314
8319 int append(const char* fileName, bool drSendNameOnly = false);
8320
8322 int append(const std::string& fileName, bool drSendNameOnly = false);
8323
8329 int append(const std::vector<const char*> &fileNames);
8330
8332 int append(const std::vector<std::string> &fileNames);
8333
8336 int appendAsText(const char* text);
8337
8339 int appendAsText(const std::string& text);
8340
8342 int appendAsText(std::string&& text);
8343
8349 int appendAsText(const std::vector<const char*> &sceneTexts);
8350
8352 int appendAsText(const std::vector<std::string> &sceneTexts);
8353
8362 template<typename T = void>
8363 int appendAsText(const char* text, size_t length, void(*freeFn)(char* text, size_t size, T* holderObject) = nullptr, T* holderObject = nullptr);
8364
8374 int loadFiltered(const char* fileName, bool (*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8375
8377 int loadFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8378
8390 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8391 int loadFiltered(const char* fileName, T& obj, const void* userData = nullptr);
8392
8394 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8395 int loadFiltered(const std::string& fileName, T& obj, const void* userData = nullptr);
8396
8406 int appendFiltered(const char* fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8407
8409 int appendFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8410
8422 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8423 int appendFiltered(const char* fileName, T& obj, const void* userData = nullptr);
8424
8426 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8427 int appendFiltered(const std::string& fileName, T& obj, const void* userData = nullptr);
8428
8441 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8442 int appendFiltered(const std::vector<const char*> &fileNames, T& obj, const void* userData = nullptr);
8443
8445 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8446 int appendFiltered(const std::vector<std::string> &fileNames, T& obj, const void* userData = nullptr);
8447
8458 int appendFiltered(const std::vector<const char*> &fileNames, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8459
8461 int appendFiltered(const std::vector<std::string> &fileNames, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8462
8463
8466 int loadAsTextFiltered(const char* fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8467
8469 int loadAsTextFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8470
8473 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8474 int loadAsTextFiltered(const char* fileName, T& obj, const void* userData = nullptr);
8475
8477 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8478 int loadAsTextFiltered(const std::string& fileName, T& obj, const void* userData = nullptr);
8479
8482 int appendAsTextFiltered(const char* fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8483
8485 int appendAsTextFiltered(const std::string& fileName, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8486
8489 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8490 int appendAsTextFiltered(const char* fileName, T& obj, const void* userData = nullptr);
8491
8493 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8494 int appendAsTextFiltered(const std::string& fileName, T& obj, const void* userData = nullptr);
8495
8508 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8509 int appendAsTextFiltered(const std::vector<const char*> &sceneTexts, T& obj, const void* userData = nullptr);
8510
8512 template<class T, bool (T::*TMethod)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*)>
8513 int appendAsTextFiltered(const std::vector<std::string> &sceneTexts, T& obj, const void* userData = nullptr);
8514
8525 int appendAsTextFiltered(const std::vector<const char*> &sceneTexts, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8526
8528 int appendAsTextFiltered(const std::vector<std::string> &sceneTexts, bool(*callback)(VRayRenderer&, const char* pluginType, std::string& pluginName, void*), const void* userData = nullptr);
8529
8532 void start() const;
8533
8536 int startSync() const;
8537
8539 void renderSequence() const;
8540
8544 void renderSequence(SubSequenceDesc descriptions[], size_t count) const;
8545
8547 void continueSequence() const;
8548
8550 void abort() const;
8551
8553 void stop() const;
8554
8560 int exportScene(const char* filePath) const;
8561
8563 int exportScene(const std::string& filePath) const;
8564
8571 int exportScene(const char* filePath, const VRayExportSettings& settings) const;
8572
8574 int exportScene(const std::string& filePath, const VRayExportSettings& settings) const;
8575
8579 std::string exportSceneToBuffer() const;
8580
8585 std::string exportSceneToBuffer(const VRayExportSettings& settings) const;
8586
8592 void bucketRenderNearest(int x, int y) const;
8593
8597 AddHostsResult addHosts(const char* hosts) const;
8598
8600 AddHostsResult addHosts(const std::string& hosts) const;
8601
8605 int removeHosts(const char* hosts) const;
8606
8608 int removeHosts(const std::string& hosts) const;
8609
8613 int resetHosts(const char* hosts = nullptr) const;
8614
8616 int resetHosts(const std::string& hosts) const;
8617
8620 std::string getAllHosts() const;
8621
8624 std::string getActiveHosts() const;
8625
8628 std::string getInactiveHosts() const;
8629
8632 unsigned long long commit(bool force = false);
8633
8636 unsigned long long getChangeIndex() const;
8637
8643
8647
8655
8660
8665 VRayImage* getImage(const GetImageOptions &options) const;
8666
8672 size_t getImageIntoBuffer(const GetImageOptions &options, void *buf) const;
8673
8678 RendererState getState() const;
8679
8683 bool isRenderEnded() const;
8684
8687 bool isAborted() const;
8688
8691 bool isFrameSkipped() const;
8692
8695 bool isSequenceEnded() const;
8696
8698 enum class WaitTime : int {
8701 AwaitingOrIdle = -1,
8702
8705 Idle = -2
8706 };
8707
8713 bool waitForRenderEnd(const WaitTime time = WaitTime::AwaitingOrIdle) const;
8714
8719 bool waitForRenderEnd(const int timeout) const;
8720
8724
8728 bool waitForSequenceEnd(const int timeout) const;
8729
8732 bool waitForVFBClosed() const;
8733
8737 bool waitForVFBClosed(const int timeout) const;
8738
8740 std::vector<Plugin> getPlugins() const;
8741
8745 template <class T, class RetT = T> std::vector<RetT> getPlugins() const;
8746
8748 std::vector<Plugin> getPlugins(const char* pluginClassName) const;
8749
8751 std::vector<Plugin> getPlugins(const std::string& pluginClassName) const;
8752
8754 std::vector<Plugin> getPluginsOfCategory(PluginCategory category) const;
8755
8757 std::vector<Plugin> getPluginsOfCategories(const PluginCategories& categories) const;
8758
8761 std::vector<Plugin> getPluginsOfCategories(const std::vector<PluginCategories>& categories) const;
8762
8764 std::vector<std::string> getAllPluginTypes() const;
8765
8769 std::vector<std::string> getPluginTypesOfCategory(PluginCategory category) const;
8770
8774 std::vector<std::string> getPluginTypesOfCategories(PluginCategories categories) const;
8775
8780 std::vector<std::string> getPluginTypesOfCategories(const std::vector<PluginCategories>& categories) const;
8781
8786 Plugin getInstanceOf(const char* pluginType) const;
8787
8792 Plugin getInstanceOf(PluginTypeId pluginTypeId) const;
8793
8795 Plugin getInstanceOf(const std::string& pluginType) const;
8796
8798 template<class T> T getInstanceOf() const;
8799
8806 Plugin getInstanceOrCreate(const char* pluginType);
8807
8814 Plugin getInstanceOrCreate(PluginTypeId pluginTypeId);
8815
8817 Plugin getInstanceOrCreate(const std::string& pluginType);
8818
8820 template<class T> T getInstanceOrCreate();
8821
8829 Plugin getInstanceOrCreate(const char* pluginName, const char* pluginType);
8830
8832 Plugin getInstanceOrCreate(const std::string& pluginName, const char* pluginType);
8833
8835 Plugin getInstanceOrCreate(const char* pluginName, const std::string& pluginType);
8836
8838 Plugin getInstanceOrCreate(const std::string& pluginName, const std::string& pluginType);
8839
8841 Plugin getInstanceOrCreate(const char* pluginName, PluginTypeId pluginTypeId);
8842
8844 Plugin getInstanceOrCreate(const std::string& pluginName, PluginTypeId pluginTypeId);
8845
8847 template<class T> T getInstanceOrCreate(const char* pluginName);
8848
8850 template<class T> T getInstanceOrCreate(const std::string& pluginName);
8851
8853 double getCurrentEventTime() const;
8854
8861 void setOnStateChanged(void(*callback)(VRayRenderer&, RendererState oldState, RendererState newState, double instant, void*), const void* userData = nullptr);
8863 template<class T, void (T::*TMethod)(VRayRenderer&, RendererState oldState, RendererState newState, double instant, void* userData)>
8864 void setOnStateChanged(T& object, const void* userData = nullptr);
8865
8870 void setOnRendererClose(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
8872 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
8873 void setOnRendererClose(T& object, const void* userData = nullptr);
8874
8882 void setOnProgressiveImageUpdated(void(*callback)(VRayRenderer&, VRayImage* img, unsigned long long changeIndex, ImagePassType pass, double instant, void* userData), const void* userData = nullptr);
8884 template<class T, void (T::*TMethod)(VRayRenderer&, VRayImage* img, unsigned long long changeIndex, ImagePassType pass, double instant, void* userData)>
8885 void setOnProgressiveImageUpdated(T& object, const void* userData = nullptr);
8886
8893 void setOnLogMessage(void(*callback)(VRayRenderer&, const char* msg, MessageLevel level, double instant, void* userData), MessageLevel minLevel=MessageInfo, const void* userData = nullptr);
8895 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, MessageLevel level, double instant, void* userData)>
8896 void setOnLogMessage(T& object, MessageLevel minLevel = MessageInfo, const void* userData = nullptr);
8897
8905 void setOnLicenseError(void(*callback)(VRayRenderer&, const char* msg, int errorCode, LicenseUserStatus userStatus, double instant, void* userData), const void* userData = nullptr);
8907 template<class T, void (T::*TMethod)(VRayRenderer& renderer, const char* msg, int errorCode, LicenseUserStatus userStatus, double instant, void* userData)>
8908 void setOnLicenseError(T& object, const void* userData = nullptr);
8909
8920 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 = nullptr);
8922 template<class T, void (T::*TMethod)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
8923 void setOnBucketInit(T& object, const void* userData = nullptr);
8924
8934 void setOnBucketReady(void(&callback)(VRayRenderer&, int x, int y, const char* host, VRayImage* img, ImagePassType pass, double instant, void* userData), const void* userData = nullptr);
8936 template<class T, void (T::*TMethod)(VRayRenderer&, int x, int y, const char* host, VRayImage* img, ImagePassType pass, double instant, void* userData)>
8937 void setOnBucketReady(T& object, const void* userData = nullptr);
8938
8949 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 = nullptr);
8951 template<class T, void (T::* TMethod)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
8952 void setOnBucketReady(T& object, const void* userData = nullptr);
8954 void setOnBucketReady(std::nullptr_t null);
8955
8966 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 = nullptr);
8968 template<class T, void (T::*TMethod)(VRayRenderer&, int x, int y, int width, int height, const char* host, ImagePassType pass, double instant, void* userData)>
8969 void setOnBucketFailed(T& object, const void* userData = nullptr);
8970
8979 void setOnProgress(void(*callback)(VRayRenderer&, const char* msg, int elementNumber, int elementsCount, double instant, void* userData), const void* userData = nullptr);
8981 template<class T, void (T::*TMethod)(VRayRenderer&, const char* msg, int elementNumber, int elementsCount, double instant, void* userData)>
8982 void setOnProgress(T& object, const void* userData = nullptr);
8983
8989 void setOnRenderViewChanged(void(*callback)(VRayRenderer&, const char* propName, double instant, void* userData), const void* userData = nullptr);
8991 template<class T, void (T::*TMethod)(VRayRenderer&, const char* propName, double instant, void* userData)>
8992 void setOnRenderViewChanged(T& object, const void* userData = nullptr);
8993
8999 void setOnVFBRenderLast(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = nullptr);
9001 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double, void* userData)>
9002 void setOnVFBRenderLast(T& object, const void* userData = nullptr);
9003
9009 void setOnVFBInteractiveStart(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = nullptr);
9011 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
9012 void setOnVFBInteractiveStart(T& object, const void* userData = nullptr);
9013
9018 void setOnVFBClosed(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9020 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9021 void setOnVFBClosed(T& object, const void* userData = nullptr);
9022
9027 void setOnPostEffectsUpdated(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9029 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9030 void setOnPostEffectsUpdated(T& object, const void* userData = nullptr);
9031
9037 void setOnVFBLayersChanged(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9039 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9040 void setOnVFBLayersChanged(T& object, const void* userData = nullptr);
9041
9046 void setOnVFBShowMessagesWindow(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9048 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9049 void setOnVFBShowMessagesWindow(T& object, const void* userData = nullptr);
9050
9056 void setOnHostConnected(void(*callback)(VRayRenderer&, const char* hostName, double instant, void* userData), const void* userData = nullptr);
9058 template<class T, void (T::*TMethod)(VRayRenderer&, const char* hostName, double instant, void* userData)>
9059 void setOnHostConnected(T& object, const void* userData = nullptr);
9060
9066 void setOnHostDisconnected(void(*callback)(VRayRenderer&, const char* hostName, double instant, void* userData), const void* userData = nullptr);
9068 template<class T, void (T::*TMethod)(VRayRenderer&, const char* hostName, double instant, void* userData)>
9069 void setOnHostDisconnected(T& object, const void* userData = nullptr);
9070
9075 void setOnVFBOpenUpdateNotify(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9077 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9078 void setOnVFBOpenUpdateNotify(T& object, const void* userData = nullptr);
9079
9083 void setOnVFBSaveSettingsNotify(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9085 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9086 void setOnVFBSaveSettingsNotify(T& object, const void* userData = nullptr);
9087
9088
9090 enum class DebugShadingMode : int {
9091 isolateSelect,
9092 globalLighting,
9093 globalAO,
9094 globalWireframe,
9095 globalNormal,
9096 globalUV,
9097 globalBarycentric,
9098 };
9099
9106 void setOnVFBDebugShadingNotify(void(*callback)(VRayRenderer&, int enabled, DebugShadingMode mode, int selectionLocked, double instant, void* userData), const void* userData = nullptr);
9108 template<class T, void (T::*TMethod)(VRayRenderer&, int enabled, int mode, int selectionLocked, double instant, void* userData)>
9109 void setOnVFBDebugShadingNotify(T& object, const void* userData = nullptr);
9110
9117 void setVFBContextMenuSelectedCallback(void(*callback)(VRayRenderer&, int commandId, int x, int y, void* userData), const void* userData = nullptr);
9119 template<class T, void(T::*TMethod)(VRayRenderer&, int commandId, int x, int y, void* userData)>
9120 void setVFBContextMenuSelectedCallback(T& object, const void* userData = nullptr);
9121
9125 void setOnVFBCopyToHostFrameBufferNotify(void(*callback)(VRayRenderer&, double instant, void* userData), const void* userData = nullptr);
9127 template<class T, void (T::*TMethod)(VRayRenderer&, double instant, void* userData)>
9128 void setOnVFBCopyToHostFrameBufferNotify(T& object, const void* userData = nullptr);
9129
9136 void setOnLightMixTransferToScene(int(*callback)(VRayRenderer&, const std::vector<LightMixChange>& changes, double instant, void*), const void* userData = nullptr);
9138 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<LightMixChange>& lightMixChanges, double instant, void* userData)>
9139 void setOnLightMixTransferToScene(T& object, const void* userData = nullptr);
9140
9147 void setOnUploadToCollaboration(int(*callback)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void*), const void* userData = nullptr);
9149 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
9150 void setOnUploadToCollaboration(T& object, const void* userData = nullptr);
9151
9158 void setOnEnhanceOnCollaboration(int(*callback)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void*), const void* userData = nullptr);
9160 template<class T, int(T::*TMethod)(VRayRenderer&, const std::vector<std::string>& fileList, double instant, void* userData)>
9161 void setOnEnhanceOnCollaboration(T& object, const void* userData = nullptr);
9162
9169 void setOnCollaborationImageChange(void(*callback)(VRayRenderer&, int imageLoaded, int enhanceSupported, double instant, void* userData), const void* userData = nullptr);
9171 template<class T, void (T::*TMethod)(VRayRenderer&, int imageLoaded, int enhanceSupported, double instant, void* userData)>
9172 void setOnCollaborationImageChange(T& object, const void* userData = nullptr);
9173
9180 void setOnVFBPauseIPR(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = nullptr);
9182 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
9183 void setOnVFBPauseIPR(T& object, const void* userData = nullptr);
9184
9191 void setOnVFBUpdateIPR(void(*callback)(VRayRenderer&, bool isRendering, double instant, void* userData), const void* userData = nullptr);
9193 template<class T, void (T::*TMethod)(VRayRenderer&, bool isRendering, double instant, void* userData)>
9194 void setOnVFBUpdateIPR(T& object, const void* userData = nullptr);
9195
9203 void setOnVFBAddRenderElementToScene(bool(*callback)(VRayRenderer&, VFBRenderElementType type, double instant, void* userData), const void* userData = nullptr);
9205 template<class T, bool (T::*TMethod)(VRayRenderer&, VFBRenderElementType type, double instant, void* userData)>
9206 void setOnVFBAddRenderElementToScene(T& object, const void* userData = nullptr);
9207
9216 void setOnVFBClick(void(*callback)(VRayRenderer&, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void* userData), const void* userData = nullptr);
9218 template<class T, void (T::* TMethod)(VRayRenderer&, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void* userData)>
9219 void setOnVFBClick(T& object, const void* userData = nullptr);
9220
9221
9223 void setVFBContextMenuItems(const std::vector<VFBContextMenuItem> &items);
9224
9229 bool getVFBContextMenuItemValue(int commandId, int& value) const;
9230
9235 bool setVFBContextMenuItemValue(int commandId, int value);
9236
9239 void setVFBCameraSelectionItems(const std::vector<const char*>& items);
9240 void setVFBCameraSelectionItems(const std::vector<std::string>& items);
9241
9247 void setOnVFBCameraSelection(void(*callback)(VRayRenderer& renderer, int itemId, VFBSourceButton sourceButton, void* userData), const void* userData = nullptr);
9249 template<class T, void(T::*TMethod)(VRayRenderer&, int itemId, VFBSourceButton sourceButton, void* userData)>
9250 void setOnVFBCameraSelection(T& object, const void* userData = nullptr);
9251
9256
9260 unsigned long setProgressiveImageUpdateTimeout(unsigned long timeout);
9261
9264
9267
9269 void setBucketReadyHasBuffer(bool hasBuffer);
9270
9273
9276
9279
9280 VRAY_DEPRECATED("Use setProgressiveImageUpdatedHasBuffer instead")
9281 void setProgresiveImageUpdatedHasBuffer(bool hasBuffer) {
9282 setProgressiveImageUpdatedHasBuffer(hasBuffer);
9283 }
9284
9285 VRAY_DEPRECATED("Use getProgressiveImageUpdatedHasBuffer instead")
9286 bool getProgresiveImageUpdatedHasBuffer() const {
9287 return getProgressiveImageUpdatedHasBuffer();
9288 }
9289
9305 bool hasAlpha = true,
9306 bool flipImage = false
9307 );
9308
9310 void setVisualDebuggerEnabled(bool enable);
9311
9314
9317 Plugin getPlugin(const char *pluginName) const;
9318
9320 Plugin getPlugin(const std::string &pluginName) const;
9321
9323 template<class T> T getPlugin(const char *pluginName) const;
9324
9326 template<class T> T getPlugin(const std::string &pluginName) const;
9327
9329 PluginMeta getPluginMeta(const char *pluginClassName) const;
9330
9332 PluginMeta getPluginMeta(const std::string& pluginClassName) const;
9333
9335 PluginMeta getPluginMeta(const PluginTypeId pluginTypeId) const;
9336
9341 Plugin newPlugin(const char* pluginName, const char* pluginType);
9342
9344 Plugin newPlugin(const char* pluginName, PluginTypeId pluginTypeId);
9345
9347 Plugin newPlugin(const std::string& pluginName, const std::string& pluginType);
9348
9350 Plugin newPlugin(const char* pluginName, const std::string& pluginType);
9351
9353 Plugin newPlugin(const std::string& pluginName, const char* pluginType);
9354
9356 template<class T> T newPlugin(const char* pluginName);
9357
9359 template<class T> T newPlugin(const std::string& pluginName);
9360
9362 template<class T> T newPlugin();
9363
9367 Plugin newPlugin(const char* pluginType);
9368
9370 Plugin newPlugin(const std::string &pluginType);
9371
9373 Plugin newPlugin(PluginTypeId pluginTypeId);
9374
9384 Plugin getOrCreatePlugin(const char* pluginName, const char* pluginType);
9385
9387 Plugin getOrCreatePlugin(const std::string& pluginName, const char* pluginType);
9388
9390 Plugin getOrCreatePlugin(const char* pluginName, const std::string& pluginType);
9391
9393 Plugin getOrCreatePlugin(const std::string& pluginName, const std::string& pluginType);
9394
9396 Plugin getOrCreatePlugin(const char* pluginName, PluginTypeId pluginTypeId);
9397
9399 Plugin getOrCreatePlugin(const std::string& pluginName, PluginTypeId pluginTypeId);
9400
9402 template<class T> T getOrCreatePlugin(const char* pluginName);
9403
9405 template<class T> T getOrCreatePlugin(const std::string& pluginName);
9406
9410 Plugin pickPlugin(int x, int y) const;
9411
9416 Plugin pickPlugin(int x, int y, int timeout) const;
9417
9423 std::vector<PickedPluginInfo> pickPlugins(double x, double y, int maxcount = 0, int timeout = -1) const;
9424
9427 bool deletePlugin(const Plugin& plugin);
9428
9431 bool deletePlugin(const std::string& pluginName);
9432
9435 bool deletePlugin(const char* pluginName);
9436
9440 bool deletePlugins(const char* names[], size_t namesCount);
9441
9445 bool deletePlugins(const std::vector<std::string> &names);
9446
9450 bool deletePlugins(const std::vector<VRay::Plugin> &plugins);
9451
9460 bool replacePlugin(const Plugin& oldPlugin, const Plugin& newPlugin);
9461
9468 bool optimizeMaterialGraph(const Plugin& topPlugin);
9469
9471 bool getAutoCommit() const;
9472
9475 void setAutoCommit(bool autoCommit);
9476
9479
9481 size_t getIrradianceMapSize() const;
9484 bool saveIrradianceMapFile(const std::string &fileName);
9486 bool saveIrradianceMapFile(const char* fileName);
9487
9489 size_t getLightCacheSize() const;
9492 bool saveLightCacheFile(const std::string &fileName);
9494 bool saveLightCacheFile(const char* fileName);
9495
9497 size_t getPhotonMapSize() const;
9500 bool savePhotonMapFile(const std::string &fileName);
9502 bool savePhotonMapFile(const char* fileName);
9503
9505 size_t getCausticsSize() const;
9508 bool saveCausticsFile(const std::string &fileName);
9510 bool saveCausticsFile(const char* fileName);
9511
9515 std::vector<ComputeDeviceInfo> getComputeDevicesMetal() const;
9516
9520 std::vector<ComputeDeviceInfo> getComputeDevicesMetalRT() const;
9521
9525 std::vector<ComputeDeviceInfo> getComputeDevicesOptix() const;
9526
9533 std::vector<ComputeDeviceInfo> getComputeDevicesCUDA() const;
9534
9538 std::vector<ComputeDeviceInfo> getComputeDevicesDenoiser() const;
9539
9543 std::vector<ComputeDeviceInfo> getComputeDevicesCurrentEngine() const;
9544
9548 bool setComputeDevicesMetal(const std::vector<int> &indices);
9549
9553 bool setComputeDevicesMetalRT(const std::vector<int> &indices);
9554
9558 bool setComputeDevicesOptix(const std::vector<int> &indices);
9559
9563 bool setComputeDevicesCUDA(const std::vector<int> &indices);
9564
9568 bool setComputeDevicesDenoiser(const std::vector<int> &indices);
9569
9574
9578 bool setComputeDevicesCurrentEngine(const std::vector<int> &indices);
9579
9584 bool setResumableRendering(bool enable, const ResumableRenderingOptions* options);
9585
9588 void setDenoiserOptions(const DenoiserOptions& denoiserOptions);
9589
9599 bool denoiseNow(void(*userCb)(VRayRenderer&, VRayImage*, void*) = 0, bool shouldPassImage = true, const void* userData = nullptr);
9600
9602 template<class T, void (T::*TMethod)(VRayRenderer&, VRayImage*, void*)>
9603 bool denoiseNow(T& object, bool shouldPassImage = true, const void* userData = nullptr);
9604
9613
9621
9625 void setIncludePaths(const char* includePaths, bool overwrite = true);
9626
9628 void setIncludePaths(const std::string &includePaths, bool overwrite = true);
9629
9632
9635 float getIESPrescribedIntensity(const char* iesLightFileName) const;
9636
9638 float getIESPrescribedIntensity(const std::string &iesLightFileName) const;
9639
9645
9647 bool isManual();
9648
9651
9657 void startDurationEvent(const char* name, int threadIndex = 0);
9658
9664 void endDurationEvent(const char* name, int threadIndex = 0);
9665
9666 private:
9667 VRayProfiler(VRayRenderer& renderer) : owner(renderer) {}
9668 VRayRenderer& owner;
9669 friend class VRayRenderer;
9670 } profiler{ *this };
9671
9678
9685 bool addVRayProfilerMetadata(const char* category, const char* key, const char* value);
9686
9688 bool addVRayProfilerMetadata(const std::string& category, const std::string& key, const std::string& value);
9689
9692 void setUserSceneName(const char* sceneName);
9693
9695 void setUserSceneName(const std::string& sceneName);
9696
9699 std::string getUserSceneName();
9700
9707 void setOnVRayProfilerWrite(void(*callback)(VRayRenderer&, const std::string& outputFile, int fileType, double instant, void*), const void* userData = nullptr);
9709 template<class T, void(T::*TMethod)(VRayRenderer&, const std::string &outputFile, int fileType, double instant, void* userData)>
9710 void setOnVRayProfilerWrite(T& object, const void* userData = nullptr);
9711
9714 void setDebugShadingSelection(const std::vector<Plugin>& selection);
9715
9716 protected:
9717 Internal::VRayRendererNative* getNativeRenderer() const;
9718 static VRayRenderer* getVRayRenderer(void* rendererNative);
9719
9720 InstanceId getPluginId_internal(const char* pluginName, PluginTypeId& outTypeId) const;
9721 PluginTypeId getPluginTypeId_internal(const char* pluginType) const;
9722 PluginTypeId getPluginTypeId_internal(InstanceId pluginID) const;
9723 const char* getPluginTypeString(PluginTypeId pluginTypeId) const;
9724 Plugin getPlugin_internal(InstanceId pluginID) const;
9725 template<class T> T getPlugin_internal(InstanceId pluginID) const;
9726 const char* getPluginName_internal(InstanceId pluginID) const;
9727 bool pluginExists_internal(InstanceId pluginID) const;
9728
9729 int getPropertyIndexFromName(InstanceId pluginID, const char* propertyName) const;
9730 const char* getPropertyNameFromIndex(InstanceId pluginID, int idx) const;
9731 template<class T> static std::vector<T> getPluginsOfType(VRayRenderer& renderer, const char* pluginType);
9732 template<class T> static std::vector<T> getPluginsOfTypeId(VRayRenderer& renderer, PluginTypeId typeId);
9733 static std::vector<std::string> getStringVector(void *pvector);
9734 static std::vector<const char*> getCharPtrVector(const std::vector<std::string> &strVector);
9735 std::vector<std::string> getPluginPropertyNames(const char* pluginClassName) const; // Returns the names of all properties of a plugin.
9736 const char* getPluginType(const char* name) const;
9737 const char* getPluginType(InstanceId pluginID) const;
9738 bool setPluginName(InstanceId pluginID, const char* name) const;
9739 Type getPluginPropertyRuntimeType(const char* pluginName, const char* propertyName) const;
9740 Type getPluginPropertyRuntimeType(InstanceId pluginID, const char* propertyName) const;
9741 int getPluginPropertyElementsCount(InstanceId pluginID, const char* propertyName) const;
9742 const void* getPluginPropertyDefinition(const char* pluginName, const char* propertyName) const;
9743 const void* getPluginPropertyDefinition(InstanceId pluginID, const char* propertyName) const;
9744 const void* getPluginPropertyDefinitionFromClass(const char* pluginClassName, const char* propertyName) const;
9745 std::string getPluginPropertyValueAsString(const char* pluginName, const char* propertyName, double time) const;
9746 std::string getPluginPropertyValueAsString(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9747 bool setPluginPropertyValueAsString(InstanceId pluginID, const char* propertyName, const char* value) const;
9748 bool setPluginPropertyValueAsStringAtTime(InstanceId pluginID, const char* propertyName, const char* value, double time) const;
9749 bool getPluginPropertyBool(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9750 bool getPluginPropertyBool(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9751 int getPluginPropertyInt(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9752 int getPluginPropertyInt(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9753 float getPluginPropertyFloat(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9754 float getPluginPropertyFloat(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9755 double getPluginPropertyDouble(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9756 Color getPluginPropertyColor(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9757 Color getPluginPropertyColor(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9758 AColor getPluginPropertyAColor(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9759 AColor getPluginPropertyAColor(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9760 Vector getPluginPropertyVector(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9761 Vector getPluginPropertyVector(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9762 Matrix getPluginPropertyMatrix(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9763 Matrix getPluginPropertyMatrix(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9764 Transform getPluginPropertyTransform(const char* pluginName, const char* propertyName, bool& ok, double time) const;
9765 Transform getPluginPropertyTransform(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9766 PluginRef getPluginPropertyPluginRef(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9767 Value getPluginPropertyValue(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9768 template<typename T> T getPluginPropertyTyped(InstanceId pluginID, const char* propertyName, bool& ok, double time) const;
9769 int getPropertyState(InstanceId pluginID, const char* propertyName) const;
9770 int getKeyframeTimes(InstanceId pluginID, const char* propertyName, double* &times) const;
9771 bool setPluginPropertyValueAtTime(InstanceId pluginID, const char* propertyName, const void *pval, double time) const;
9772 bool setPluginPropertyValueRawAtTime(InstanceId pluginID, const char* propertyName, const void *pval, size_t count, double time) const;
9773 bool setPluginUpdatedDefaultProperties(InstanceId pluginID) const;
9774
9775#ifdef VRAY_SDK_INTEROPERABILITY
9776 bool getPluginPropertyValueSDKInterop(InstanceId pluginID, const char* propertyName, void *pval, int type) const;
9777 bool getPluginPropertyValueAtTimeSDKInterop(InstanceId pluginID, const char* propertyName, void *pval, int type, double time) const;
9778 bool setPluginPropertyValueSDKInterop(InstanceId pluginID, const char* propertyName, const void* pval, int type) const;
9779 bool setPluginPropertyValueAtTimeSDKInterop(InstanceId pluginID, const char* propertyName, const void* pval, int type, double time) const;
9780#endif // VRAY_SDK_INTEROPERABILITY
9781
9782 Plugin newRenderElementPlugin(int type, const char *instanceName, const char *displayName);
9783 Plugin getRenderElementPlugin(int type) const;
9784 std::vector<Plugin> getRenderElementPluginsList(int type) const;
9785 bool getRenderElementInfo(InstanceId pluginID, int type, RenderElement::Info& chInfo) const;
9786 size_t getRenderElementData(
9787 InstanceId pluginID,
9788 InstanceId alphaPluginID,
9789 int type,
9790 int layer,
9792 int intent,
9793 bool rgbOrder,
9794 const ImageRegion* rgn,
9795 void** buf
9796 ) const;
9797 size_t getRenderElementDataIntoBuffer(
9798 InstanceId pluginID,
9799 InstanceId alphaPluginID,
9800 int type,
9801 int layer,
9803 int intent,
9804 bool rgbOrder,
9805 const ImageRegion* rgn,
9806 bool flipImage,
9807 void *buf
9808 ) const;
9809 VRayImage* getRenderElementAsImage(InstanceId pluginID, int type, int layer, const GetImageOptions &options, const bool isDoColorCorrectionsUSerSet = false) const;
9810 std::string getRenderElementMetadata(InstanceId pluginID, int type) const;
9811 };
9812
9816 public:
9817 ProfilerDurationScope(VRayRenderer& renderer, std::string eventName, int threadIndex = 0) :
9818 renderer(renderer),
9819 eventName(eventName),
9820 threadIndex(threadIndex) {
9821 if (renderer.profiler.isManual()) {
9822 renderer.profiler.startDurationEvent(eventName.c_str(), threadIndex);
9823 }
9824 }
9825
9827 if (renderer.profiler.isManual()) {
9828 renderer.profiler.endDurationEvent(eventName.c_str(), threadIndex);
9829 }
9830
9831 }
9832 private:
9833 VRayRenderer& renderer;
9834 std::string eventName;
9835 int threadIndex;
9836 };
9837
9840 std::string fileName;
9844
9846 };
9847
9850 private:
9851 template<class T, Plugin(T::* TMethod)(VRayRenderer&, const char* assetId, Vector importPosition, void* userData)>
9852 static InstanceId importScatterPresetCallbackT(const char* assetId, Vector* importPosition, void* info);
9853 static InstanceId importScatterPresetCallback(const char* assetId, Vector* importPosition, void* info);
9854
9855 public:
9860 static bool readScatterData(const Plugin& scatterPlugin, std::vector<Transform>& transforms, IntList& topo);
9861
9865 static bool readGaussianData(const Plugin& gaussianPlugin, GaussianReadData& readData);
9866
9870 static bool readGaussianData(const std::string& fileName, GaussianReadData& readData);
9871
9880 static bool readScatterPreset(const ScatterReadParams& params, Plugin(*callback)(VRayRenderer&, const char* assetId, Vector importPosition, void* userData) = 0, const void* userData = nullptr);
9882 template<class T, Plugin(T::* TMethod)(VRayRenderer&, const char* assetId, Vector importPosition, void* userData)>
9883 static bool readScatterPreset(const ScatterReadParams& params, T& object, const void* userData = nullptr);
9884
9891 static bool readGeomHairData(const Plugin& nodePlugin, VectorList& vertices, IntList& lengths, int countHint = 0);
9892 };
9893
9896 public:
9900 static bool readLuminaireFieldPreviewData(const Plugin& luminairePlugin, LuminaireFieldReadPreviewData& readData);
9901
9905 static bool readLuminaireFieldPreviewData(const std::string& fileName, LuminaireFieldReadPreviewData& readData);
9906
9911 static bool readIESPreviewData(const Plugin& lightPlugin, VectorList& vertices, IntList& indices);
9912
9917 static bool readIESPreviewData(const std::string& fileName, VectorList& vertices, IntList& indices);
9918 };
9919
9922
9924 class Proxy {
9925 public:
9931 static bool readPreviewGeometry(const Plugin &proxyPlugin, VectorList &vertices, IntList &indices, int countHint = 0);
9932
9938 static bool readPreviewHair(const Plugin &proxyPlugin, VectorList &vertices, IntList &lengths, int countHint = 0);
9939
9944 static bool readPreviewParticles(const Plugin &proxyPlugin, VectorList &positions, int countHint = 0);
9945
9949 static bool readPreviewData(const Plugin &proxyPlugin, ProxyReadData &readData);
9950
9954 static bool readFullData(const Plugin &proxyPlugin, ProxyReadData &readData);
9955
9963 static bool createMeshFile(const Plugin &geomMeshPlugin, const Transform *transform, const ProxyCreateParams &params);
9964
9972 static bool createMeshFile(const Plugin &geomMeshPlugin, const AnimatedTransform &animTransform, const ProxyCreateParams &params);
9973
9981 static bool createCombinedMeshFile(const std::vector<Plugin> &geomMeshPlugins, const std::vector<Transform> *transforms, const ProxyCreateParams &params);
9982
9990 static bool createCombinedMeshFile(const std::vector<Plugin> &geomMeshPlugins, const std::vector<AnimatedTransform> &animTransforms, const ProxyCreateParams &params);
9991
9997 static bool readPreviewGeometry(const ProxyReadParams &params, VectorList &vertices, IntList &indices, int countHint = 0);
9998
10004 static bool readPreviewHair(const ProxyReadParams &params, VectorList &vertices, IntList &lengths, int countHint = 0);
10005
10010 static bool readPreviewParticles(const ProxyReadParams &params, VectorList &positions, int countHint = 0);
10011
10015 static bool readPreviewData(const ProxyReadParams &params, ProxyReadData &readData);
10016
10020 static bool readFullData(const ProxyReadParams &params, ProxyReadData &readData);
10021
10026 static bool createMeshFile(const MeshFileData &data, const Transform *transform, const ProxyCreateParams &params);
10027
10032 static bool createMeshFile(const MeshFileData &data, const AnimatedTransform &animTransform, const ProxyCreateParams &params);
10033
10038 static bool createCombinedMeshFile(const std::vector<MeshFileData> &data, const std::vector<Transform> *transforms, const ProxyCreateParams &params);
10039
10044 static bool createCombinedMeshFile(const std::vector<MeshFileData> &data, const std::vector<AnimatedTransform> &animTransforms, const ProxyCreateParams &params);
10045 };
10046
10048 enum GPUParamSupport {
10049 GPUParamSupport_Full,
10050 GPUParamSupport_Partial,
10051 GPUParamSupport_None,
10052 GPUParamSupport_Unknown,
10053 };
10054
10055 inline std::ostream& operator <<(std::ostream& stream, const GPUParamSupport val) {
10056 switch (val) {
10057 case GPUParamSupport_Full:
10058 stream << "Full";
10059 break;
10060 case GPUParamSupport_Partial:
10061 stream << "Partial";
10062 break;
10063 case GPUParamSupport_None:
10064 stream << "None";
10065 break;
10066 default:
10067 stream << "Unknown";
10068 }
10069 return stream;
10070 }
10071
10072 class UIGuides {
10073 friend class PropertyMeta;
10074
10075 private:
10076 const void* pParamDef;
10077
10078 protected:
10079 UIGuides(const void* pParamDef) : pParamDef(pParamDef) {}
10080
10081 const void* getParamDef() const {
10082 return pParamDef;
10083 }
10084
10085 public:
10163 MaxGuides
10165
10168 Unknown,
10182 LocalSubdivs
10184
10188 DefaultUnits,
10189 Radians,
10190 Degrees,
10191 Millimeters,
10192 Centimeters,
10193 Meters
10194 };
10195
10202 Load,
10203 Save,
10204 LoadAndSave
10205 };
10206
10209 None = 0,
10211 ObjectSet = 1,
10215 TextureSlot = 2,
10217 LightSet = 4,
10219 PartOf3dsMaxTriple = 8,
10221 BitSet = 16,
10225 Boolean = 32
10227
10233 Basic = 0,
10234 DefaultTier = 1,
10235 Advanced = 2
10236 };
10237
10238 UIGuides(const UIGuides& uiGuides) : pParamDef(uiGuides.pParamDef) {}
10239
10240 UIGuides& operator=(const UIGuides& uiGuides) {
10241 pParamDef = uiGuides.pParamDef;
10242 return *this;
10243 }
10244
10247 bool isEnum() const;
10248
10252 bool hasType(const GuideType type) const;
10253
10257 float getFloat(const GuideType type) const;
10258
10262 std::vector<float> getFloats(const GuideType type) const;
10263
10266 std::string getDisplayName() const;
10267
10269 struct EnumItem {
10270 int value;
10271 std::string name;
10272 };
10273
10276 std::vector<EnumItem> getEnumStrings() const;
10277
10281
10285
10288 std::vector<std::string> getFileAssetExts() const;
10289
10292 std::vector<std::string> getFileAssetNames() const;
10293
10297
10301 bool hasAttribute(const AttributesType attributeType) const;
10302
10305 std::vector<std::string> getStringEnumStrings() const;
10306
10309 bool isStringEnum() const;
10310
10313 std::string getRolloutName() const;
10314
10317 std::string getTabName() const;
10318
10321 bool hasOverriddenBy() const;
10322
10325 std::string getValueOfOverriddenBy() const;
10326
10330
10333 bool hasOverride() const;
10334
10338
10342 std::string getValueOfOverride(const int index) const;
10343
10347
10350 std::vector<std::string> getEnableDepends() const;
10351
10354 GPUParamSupport getGPUSupportStatus() const;
10355
10359
10362 std::vector<std::string> getHideDepends() const;
10363 };
10364
10365 class RuntimeUIGuides : public UIGuides {
10366 friend class PropertyRuntimeMeta;
10367 private:
10368 const Internal::VRayRendererNative* renderer;
10369 InstanceId id;
10370 protected:
10371 RuntimeUIGuides(const void* pParamDef, const Internal::VRayRendererNative* renderer, InstanceId id) :
10372 UIGuides(pParamDef), renderer(renderer), id(id) {}
10373
10374 public:
10377 bool isEnabled() const;
10378
10381 bool isHidden() const;
10382 };
10383
10386 friend class PluginMeta;
10387
10388 protected:
10389 const void* pParamDef;
10390 GPUParamSupport gpuSupport;
10391
10392 PropertyMeta(const VRayRenderer *pRenderer, const char* pluginClassName, const char* propertyName)
10393 {
10394 pParamDef = pRenderer->getPluginPropertyDefinitionFromClass(pluginClassName, propertyName);
10395 gpuSupport = (GPUParamSupport)Internal::VRay_PluginUtils_getPropertyGpuSupport(pRenderer->getNativeRenderer(), pluginClassName, pParamDef);
10396 }
10397
10398 public:
10399 PropertyMeta(const PropertyMeta &propertyMeta)
10400 : pParamDef(propertyMeta.pParamDef), gpuSupport(propertyMeta.gpuSupport) {}
10401
10402 PropertyMeta& operator=(const PropertyMeta &propertyMeta) {
10403 pParamDef = propertyMeta.pParamDef;
10404 gpuSupport = propertyMeta.gpuSupport;
10405 return *this;
10406 }
10407
10408 void swap(PropertyMeta &propertyMeta) noexcept {
10409 std::swap(pParamDef, propertyMeta.pParamDef);
10410 std::swap(gpuSupport, propertyMeta.gpuSupport);
10411 }
10412
10414 operator bool () const {
10415 return !!pParamDef;
10416 }
10417
10419 int getElementsCount() const {
10420 return Internal::VRay_PluginUtils_getPropertyElementsCount(pParamDef);
10421 }
10422
10424 const char* getName() const {
10425 return Internal::VRay_PluginUtils_getPropertyName(pParamDef);
10426 }
10427
10429 StringList getAliases() const;
10430
10433 Type getType() const {
10434 return Internal::VRay_PluginUtils_getPropertyType(pParamDef);
10435 }
10436
10438 Type getElementType() const {
10439 return Internal::VRay_PluginUtils_getPropertyElementType(pParamDef);
10440 }
10441
10446
10448 std::string getDescription() const {
10449 const char* const description = Internal::VRay_PluginUtils_getPropertyDescription(pParamDef);
10450 return description ? description : "";
10451 }
10452
10454 const char* getDeprecation() const {
10455 return Internal::VRay_PluginUtils_getPropertyDeprecation(pParamDef);
10456 }
10457
10460 std::string getUIGuides() const {
10461 const char* const uiGuides = Internal::VRay_PluginUtils_getPropertyUIGuides(pParamDef);
10462 return uiGuides ? uiGuides : "";
10463 }
10464
10467 return UIGuides(pParamDef);
10468 }
10469
10470 static const char* typeToString(const Type type);
10471
10472 const char* getTypeAsString() const {
10473 return typeToString(getType());
10474 }
10475
10477 GPUParamSupport getGPUSupport() const {
10478 return gpuSupport;
10479 }
10480 };
10481
10484 friend class Plugin;
10485
10486 const VRayRenderer* renderer;
10487 InstanceId id;
10488
10489 protected:
10490 PropertyRuntimeMeta(const Plugin& plugin, const char* propertyName)
10491 : PropertyMeta(plugin.pRenderer, plugin.getType(), propertyName), renderer(plugin.pRenderer), id(plugin.id()) {
10492 }
10493
10494 public:
10495 PropertyRuntimeMeta(const PropertyRuntimeMeta& propertyRuntimeMeta)
10496 : PropertyMeta(propertyRuntimeMeta), renderer(propertyRuntimeMeta.renderer), id(propertyRuntimeMeta.id) {
10497 }
10498
10499 PropertyRuntimeMeta& operator=(const PropertyRuntimeMeta &propertyRuntimeMeta) {
10500 PropertyMeta::operator=(propertyRuntimeMeta);
10501 renderer = propertyRuntimeMeta.renderer;
10502 id = propertyRuntimeMeta.id;
10503 return *this;
10504 }
10505
10508 return renderer->getPluginPropertyElementsCount(id, getName());
10509 }
10510
10512 Type getRuntimeType() const {
10513 return renderer->getPluginPropertyRuntimeType(id, getName());
10514 }
10515
10516 const char* getRuntimeTypeAsString() const {
10517 return typeToString(getRuntimeType());
10518 }
10519
10520 void swap(PropertyRuntimeMeta &propertyRuntimeMeta) noexcept {
10521 PropertyMeta::swap(propertyRuntimeMeta);
10522 std::swap(renderer, propertyRuntimeMeta.renderer);
10523 std::swap(id, id);
10524 }
10525
10528 return RuntimeUIGuides(pParamDef, renderer->getNativeRenderer(), id);
10529 }
10530 };
10531
10533 enum GPUPluginSupport {
10534 GPUPluginSupport_Full,
10535 GPUPluginSupport_Partial,
10536 GPUPluginSupport_Bake,
10537 GPUPluginSupport_None,
10538 GPUPluginSupport_Unknown,
10539 };
10540
10541 inline std::ostream& operator <<(std::ostream& stream, const GPUPluginSupport val) {
10542 switch (val) {
10543 case GPUPluginSupport_Full:
10544 stream << "Full";
10545 break;
10546 case GPUPluginSupport_Partial:
10547 stream << "Partial";
10548 break;
10549 case GPUPluginSupport_Bake:
10550 stream << "Bake";
10551 break;
10552 case GPUPluginSupport_None:
10553 stream << "None";
10554 break;
10555 default:
10556 stream << "Unknown";
10557 }
10558 return stream;
10559 }
10560
10563 friend class VRayRenderer;
10564 friend class Plugin;
10565
10566 PluginTypeId typeId;
10567 const char* type;
10568 const VRayRenderer* pRenderer;
10569
10570 protected:
10571 PluginMeta(const Plugin& plugin)
10572 : typeId(plugin.getTypeId())
10573 , type(plugin.getType())
10574 , pRenderer(plugin.getRenderer())
10575 { }
10576
10577 PluginMeta(const VRayRenderer* renderer, const char* typeStr) {
10578 typeId = renderer->getPluginTypeId_internal(typeStr);
10579 type = renderer->getPluginTypeString(typeId);
10580 pRenderer = renderer;
10581 }
10582
10583 PluginMeta(const VRayRenderer* renderer, PluginTypeId pluginTypeId) {
10584 typeId = pluginTypeId;
10585 type = renderer->getPluginTypeString(pluginTypeId);
10586 pRenderer = renderer;
10587 }
10588
10589 public:
10590 PluginMeta(const PluginMeta& pluginMeta) = default;
10591 PluginMeta& operator=(const PluginMeta& pluginMeta) = default;
10592
10593 bool operator==(const PluginMeta& pluginMeta) const {
10594 return typeId == pluginMeta.typeId && pRenderer == pluginMeta.pRenderer;
10595 }
10596
10597 void swap(PluginMeta& pluginMeta) noexcept {
10598 std::swap(typeId, pluginMeta.typeId);
10599 std::swap(type, pluginMeta.type);
10600 std::swap(pRenderer, pluginMeta.pRenderer);
10601 }
10602
10604 bool isValid() const {
10605 return !!type;
10606 }
10607
10609 const char* getType() const {
10610 return type;
10611 }
10612
10614 PluginTypeId getTypeId() const {
10615 return typeId;
10616 }
10617
10619 std::vector<std::string> getPropertyNames() const {
10620 return pRenderer->getPluginPropertyNames(type);
10621 }
10622
10624 std::string getDescription() const;
10625
10627 const char* getDeprecation() const;
10628
10630 PropertyMeta getPropertyMeta(const char* propertyName) const {
10631 return PropertyMeta(pRenderer, type, propertyName);
10632 }
10633
10635 PropertyMeta getPropertyMeta(const std::string &propertyName) const {
10636 return PropertyMeta(pRenderer, type, propertyName.c_str());
10637 }
10638
10643 bool checkPluginUIGuides(std::string& errMsg) const;
10644
10646 GPUPluginSupport getGPUSupport() const;
10647
10650 };
10651
10652 class CompressImage;
10653
10654 namespace Internal {
10656 friend class VRay::CompressImage;
10657
10658 std::ofstream ofs;
10659
10660 FileSaveWriteHelper(const char* fileName) : ofs(fileName, std::ofstream::binary) {}
10661
10663 ofs.close();
10664 }
10665 };
10666 }
10667
10670 CompressImage(const CompressImage& ci) = delete;
10671 CompressImage& operator=(const CompressImage& ci) = delete;
10672
10673 protected:
10674 void* bufAddr;
10675 size_t bufSize;
10676
10677 CompressImage() : bufAddr(), bufSize() {}
10678
10679 CompressImage(CompressImage&& ci) noexcept : bufAddr(ci.bufAddr), bufSize(ci.bufSize) {
10680 ci.bufAddr = nullptr;
10681 ci.bufSize = 0;
10682 }
10683
10684 public:
10685 void swap(CompressImage& ci) noexcept;
10686
10687 operator size_t () const noexcept {
10688 return bufSize;
10689 }
10690
10692 void* getBuf() const noexcept {
10693 return bufAddr;
10694 }
10695
10697 size_t getLen() const noexcept {
10698 return bufSize;
10699 }
10700
10702 bool saveToFile(const char* fileName) const;
10703
10705 bool saveToFile(const std::string &fileName) const {
10706 return saveToFile(fileName.c_str());
10707 }
10708
10709 ~CompressImage() {
10710 if (bufSize)
10711 Internal::C_memory_free(bufAddr);
10712 }
10713 };
10714
10716 class LocalJpeg : public CompressImage {
10717
10718 public:
10722 LocalJpeg(const VRayImage* img, int quality = 0) {
10723 bufSize = Internal::VRayImage_compressToJpeg(img, quality, &bufAddr, nullptr);
10724 }
10725
10727 LocalJpeg(const VRayImage* img, const VRayRenderer& renderer, int quality = 0) {
10728 bufSize = Internal::VRayImage_compressToJpeg(img, quality, &bufAddr, renderer.getNativeRenderer());
10729 }
10730
10731 LocalJpeg(LocalJpeg&& other) noexcept : CompressImage(std::move(other)) {}
10732 };
10733
10734 class LocalPng : public CompressImage {
10735
10736 public:
10740 LocalPng(const VRayImage* img, bool preserveAlpha = false) {
10741 bufSize = Internal::VRayImage_compressToPng(img, preserveAlpha, &bufAddr, nullptr);
10742 }
10743
10745 LocalPng(const VRayImage* img, const VRayRenderer& renderer, bool preserveAlpha = false) {
10746 bufSize = Internal::VRayImage_compressToPng(img, preserveAlpha, &bufAddr, renderer.getNativeRenderer());
10747 }
10748
10749 LocalPng(LocalPng&& other) noexcept : CompressImage(std::move(other)) {}
10750 };
10751
10752 class LocalBmp : public CompressImage {
10753
10754 public:
10759 LocalBmp(const VRayImage* img, bool preserveAlpha = false, bool swapChannels = false) {
10760 bufSize = Internal::VRayImage_convertToBmp(img, preserveAlpha, &bufAddr, nullptr, swapChannels ? 1 : 0);
10761 }
10762
10764 LocalBmp(const VRayImage* img, const VRayRenderer& renderer, bool preserveAlpha = false, bool swapChannels = false) {
10765 bufSize = Internal::VRayImage_convertToBmp(img, preserveAlpha, &bufAddr, renderer.getNativeRenderer(), swapChannels ? 1 : 0);
10766 }
10767
10768 LocalBmp(LocalBmp&& other) noexcept : CompressImage(std::move(other)) {}
10769 };
10770
10772 template<class T>
10773 T plugin_cast(Plugin plugin) {
10774 return *static_cast<T*>(&plugin);
10775 }
10776
10778 template<class T>
10779 PluginRefT<T> plugin_cast(PluginRef pluginRef) {
10780 // won't compile if T doesn't inherit from Plugin
10781 return *static_cast<PluginRefT<T>*>(static_cast<T*>(static_cast<Plugin*>(&pluginRef)));
10782 }
10783
10786 template<class T>
10787 T plugin_checked_cast(Plugin plugin) {
10788 return plugin_cast<T>(plugin.getTypeId() != T::getTypeId() ? Plugin() : plugin);
10789 }
10790
10793 template<class T>
10794 PluginRefT<T> plugin_checked_cast(PluginRef pluginRef) {
10795 return plugin_cast<T>(pluginRef.getTypeId() != T::getTypeId() ? PluginRef() : pluginRef);
10796 }
10797
10798 namespace Internal {
10799 template<typename PluginType>
10800 inline bool _isPluginOfTypes(PluginTypeId typeId) {
10801 return typeId == PluginType::getTypeId();
10802 }
10803
10804 template<typename PluginType0, typename PluginType1, typename... RemainingTypes>
10805 inline bool _isPluginOfTypes(PluginTypeId typeId) {
10806 return typeId == PluginType0::getTypeId() || _isPluginOfTypes<PluginType1, RemainingTypes...>(typeId);
10807 }
10808 }
10809
10815 template<typename PluginType>
10816 inline bool isPluginOfType(const Plugin& plugin) {
10817 return plugin.getTypeId() == PluginType::getTypeId();
10818 }
10819
10825 template<typename PluginType, typename... Types>
10826 inline bool isPluginOfTypes(const Plugin& plugin) {
10827 return Internal::_isPluginOfTypes<PluginType, Types...>(plugin.getTypeId());
10828 }
10829
10835 inline bool isPluginOfType(const Plugin& plugin, const char* type) {
10836 return plugin.isNotEmpty() && strcmp(plugin.getType(), type) == 0;
10837 }
10838
10846 template <size_t N>
10847 inline bool isPluginOfTypes(const Plugin& plugin, const char* const (&types)[N]) {
10848 if (plugin.isNotEmpty()) {
10849 const char* type = plugin.getType();
10850 for (size_t i = 0; i < N; ++i) {
10851 if (strcmp(type, types[i]) == 0)
10852 return true;
10853 }
10854 }
10855 return false;
10856 }
10857
10865 template <size_t N>
10866 inline bool isPluginOfTypes(const Plugin& plugin, const PluginTypeId (&types)[N]) {
10867 PluginTypeId typeId = plugin.getTypeId();
10868 for (size_t i = 0; i < N; ++i) {
10869 if (typeId == types[i])
10870 return true;
10871 }
10872 return false;
10873 }
10874
10875 namespace OCIO {
10877 enum SourceMode : int {
10879 Automatic = 0,
10881 Environment,
10883 File,
10885 Internal,
10886 };
10887
10891 std::vector<std::string> colorSpaces;
10893 std::vector<std::string> colorSpaceFamilies;
10895 std::vector<std::string> roles;
10897 std::vector<std::string> roleColorSpaces;
10899 std::vector<std::string> looks;
10901 std::vector<std::string> devices;
10903 std::vector<std::string> viewTransforms;
10906
10911 OCIOConfigurationData(const char* fileName = nullptr, SourceMode vraySourceType = SourceMode::Automatic)
10912 : errorCode(OCIOResult::Result_OK) {
10913
10914 Internal::OCIOData internalOCIOData;
10915 errorCode = (OCIOResult)Internal::VRay_OCIO_initData(&internalOCIOData, fileName, (int)vraySourceType);
10916 if (errorCode != OCIOResult::Result_OK) {
10917 const char* ending = internalOCIOData.status ? internalOCIOData.status : "<unknown>";
10918 errorString = std::string("Failed initializing OCIO configuration: ") + ending;
10919 Internal::VRay_OCIO_freeData(&internalOCIOData);
10920#ifndef VRAY_NOTHROW
10921 throw VRayException(errorString);
10922#endif
10923 return;
10924 }
10925
10926 familySeparator = char(internalOCIOData.familySeparator);
10927
10928 convertRawData(colorSpaces, internalOCIOData.colorSpaces, internalOCIOData.colorSpacesCount);
10929 if (internalOCIOData.colorSpaceFamilies) {
10930 convertRawData(colorSpaceFamilies, internalOCIOData.colorSpaceFamilies, internalOCIOData.colorSpacesCount);
10931 }
10932 convertRawData(roles, internalOCIOData.roles, internalOCIOData.rolesCount);
10933 convertRawData(roleColorSpaces, internalOCIOData.roleColorSpaces, internalOCIOData.rolesCount);
10934
10935 convertRawData(looks, internalOCIOData.looks, internalOCIOData.looksCount);
10936 convertRawData(devices, internalOCIOData.devices, internalOCIOData.devicesCount);
10937 convertRawData(viewTransforms, internalOCIOData.viewTransforms, internalOCIOData.viewTransformsCount);
10938
10939 Internal::VRay_OCIO_freeData(&internalOCIOData);
10940 }
10941
10943 std::string getErrorString() const {
10944 return errorString;
10945 }
10946
10947 private:
10949 enum OCIOResult : int {
10950 Result_OK = 0,
10951 Result_FileNotFound,
10952 Result_OCIOException,
10953 Result_EmptyConfiguration,
10954 Result_InternalException = -1
10955 } errorCode;
10956
10958 std::string errorString;
10959
10960 void convertRawData(std::vector<std::string>& output, char const* const* input, const int inputCount) {
10961 output.clear();
10962 output.reserve(inputCount);
10963 for (int i = 0; i < inputCount; ++i) {
10964 output.emplace_back(input[i]);
10965 }
10966 }
10967 };
10968 }
10969
10974 bool setEnvVar(const char* name, const char* value);
10975
10979 const char* getEnvVar(const char* name);
10980
10981 enum OSLParameterType {
10982 OSL_TYPE_UNSUPPORTED,
10983 OSL_TYPE_INT,
10984 OSL_TYPE_BOOL,
10985 OSL_TYPE_FLOAT,
10986 OSL_TYPE_STRING,
10987 OSL_TYPE_TEXTURE,
10988 OSL_TYPE_COLOR,
10989 OSL_TYPE_VECTOR,
10990 OSL_TYPE_OUTPUT_CLOSURE,
10991 OSL_TYPE_OUTPUT_COLOR,
10992 OSL_TYPE_OUTPUT_FLOAT,
10993 OSL_TYPE_MENU
10994 };
10995
10997 std::string name;
10998 OSLParameterType type;
11000 };
11001
11003 std::vector<std::string> outputColorParams;
11004 std::vector<std::string> outputFloatParams;
11005 std::vector<std::string> outputClosureParams;
11006 std::vector<OSLInputParameter> inputParams;
11007 };
11008
11012 Error getOSLParameters(const char* fileName, OSLParameters& params);
11013
11015 Error getOSLParameters(const std::string& fileName, OSLParameters& params);
11016
11017 enum OSLSourceType {
11018 OSL_SOURCE_TYPE_OSL = 1,
11019 OSL_SOURCE_TYPE_OSO = 2,
11020 };
11021
11022 enum OSLSourceEncoding {
11023 OSL_SOURCE_ENC_TXT,
11024 OSL_SOURCE_ENC_BASE64,
11025 };
11026
11032 Error getOSLParameters(const char* src, OSLSourceType type, OSLSourceEncoding encoding, OSLParameters& params);
11033
11035 Error getOSLParameters(const std::string& src, OSLSourceType type, OSLSourceEncoding encoding, OSLParameters& params);
11036
11038 void* vrsceneDesc;
11039 void createThis(const char* filename, const void* settings);
11040 ScenePreview(const ScenePreview&);
11041
11042 public:
11043 struct Settings;
11044 class Object;
11045 struct Particle;
11046
11047 enum ObjectType {
11048 ObjectTypeAll = 0,
11049 ObjectTypeNode,
11050 ObjectTypeNodeParticle,
11051 ObjectTypeLight,
11052 ObjectTypeInstancer,
11053 ObjectTypeVolume,
11054 ObjectTypeVRayScene,
11055 ObjectTypeMaterial,
11056 ObjectTypeDecal,
11057 ObjectTypeClipper,
11058 };
11059
11060 enum DataType {
11061 DataTypeAll = -1,
11062 DataTypeNoData = 0,
11063 DataTypeMesh = (1 << 0),
11064 DataTypeHair = (1 << 1),
11065 DataTypeParticles = (1 << 2),
11066 DataTypeVolume = (1 << 3),
11067 DataTypeInfinitePlane = (1 << 4),
11068 DataTypeInstancer2 = (1 << 5),
11069 DataTypeVRayProxy = (1 << 6),
11070 DataTypeRayserverInstancer = (1 << 7),
11071 DataTypeStaticMesh = (1 << 8),
11072 DataTypePerfectSphere = (1 << 9),
11073 DataTypeGeomInstancer = (1 << 10),
11074
11075 DataTypeHasInstances = DataTypeInstancer2 | DataTypeRayserverInstancer | DataTypeGeomInstancer,
11076
11077 ObjectDataTypeAll = DataTypeAll,
11078 ObjectDataTypeNoData = DataTypeNoData,
11079 ObjectDataTypeMesh = DataTypeMesh,
11080 ObjectDataTypeHair = DataTypeHair,
11081 ObjectDataTypeParticles = DataTypeParticles,
11082 ObjectDataTypeVolume = DataTypeVolume,
11083 ObjectDataTypeInfinitePlane = DataTypeInfinitePlane,
11084 ObjectDataTypeInstancer2 = DataTypeInstancer2,
11085 ObjectDataTypeVRayProxy = DataTypeVRayProxy,
11086 ObjectDataTypeRayserverInstancer = DataTypeRayserverInstancer,
11087 ObjectDataTypeStaticMesh = DataTypeStaticMesh,
11088 ObjectDataTypePerfectSphere = DataTypePerfectSphere,
11089 ObjectDataTypeGeomInstancer = DataTypeGeomInstancer,
11090
11091 ObjectDataTypeHasInstances = DataTypeHasInstances,
11092 };
11093
11094 enum LightType {
11095 LightTypeUnsupported = 0,
11096 LightTypeOmni,
11097 LightTypeRectangle,
11098 LightTypeSphere,
11099 LightTypeDirect,
11100 LightTypeSpot,
11101 LightTypeSun,
11102 LightTypeIES,
11103 LightTypeDome,
11104 LightTypeMesh,
11105 };
11106
11107 enum UpAxis {
11108 UpAxisUnknown = -1,
11109 UpAxisZ = 0,
11110 UpAxisY,
11111 };
11112
11113 struct Sizes2D {
11114 float width;
11115 float length;
11116 };
11117
11118 struct Sizes3D {
11119 float width;
11120 float height;
11121 float length;
11122 };
11123
11127 explicit ScenePreview(const char* filename);
11128
11133 ScenePreview(const char* filename, const Settings& settings);
11134
11135 ~ScenePreview();
11136
11143 std::vector<Object> getObjects(ObjectType objectType = ObjectTypeAll, DataType dataType = DataTypeAll) const;
11144
11148 Object getObject(const char* name) const;
11149
11152 operator bool() const {
11153 return !!vrsceneDesc;
11154 }
11155
11158 bool operator!() const {
11159 return !vrsceneDesc;
11160 }
11161
11163 UpAxis getUpAxis() const;
11164
11166 float getMetersScale() const;
11167
11169 float getPhotometricScale() const;
11170
11172 float getSecondsScale() const;
11173
11175 float getFramesScale() const;
11176
11178 int getFrameStart() const;
11179
11181 int getFrameEnd() const;
11182
11184 int getFPS() const;
11185
11187 size_t getTotalFaces() const;
11188 };
11189
11194 CacheTypeSingle=0,
11196 CacheTypeNone=1,
11199 CacheTypeRam=2
11201
11205 CoordinateSystemRightHanded=0,
11207 CoordinateSystemLeftHanded=1
11209
11210 Settings() :
11211 usePreview(true),
11212 previewFacesCount(100000),
11213 minPreviewFaces(64),
11214 maxPreviewFaces(10000),
11215 cacheType(CacheType::CacheTypeSingle),
11216 coordinateSystem(CoordinateSystem::CoordinateSystemRightHanded) {
11217 }
11218
11219 Bool usePreview;
11220 int previewFacesCount;
11221 int minPreviewFaces;
11222 int maxPreviewFaces;
11223 CacheType cacheType;
11224 CoordinateSystem coordinateSystem;
11225 };
11226
11228 friend class ScenePreview;
11229
11230 void* objectBase;
11231
11232 static void addDataTypeStringHelperPrivate(std::string& currentString, DataType types, DataType dataType, const char* typeString);
11233
11234 explicit Object(void* objectBase) : objectBase(objectBase) {}
11235 Object(void* vrsceneDesc, const char* name);
11236
11237 public:
11238 Object() : objectBase() {}
11239
11242 const char* getName() const;
11243
11246 bool isValid() const {
11247 return !!objectBase;
11248 }
11249
11252 ObjectType getType() const;
11253
11256 const char* getTypeAsString() const;
11257
11261 Transform getTransform(double time = 0) const;
11262
11266 bool getVisibility(double time = 0) const;
11267
11270 const char* getNodeDataName() const;
11271
11274 DataType getDataType() const;
11275
11278 std::string getDataTypeAsString() const;
11279
11285
11290
11291#ifndef VRAY_SDK_INTEROPERABILITY
11295 VectorList getMeshVertices(double time = 0);
11296
11300 IntList getMeshFaces(double time = 0);
11301
11306 VectorList getHairVertices(double time = 0);
11307
11312 IntList getHairNumVertices(double time = 0);
11313
11319 int getMeshVerticesFast(const Vector* &vertices, double time = 0);
11320
11326 int getMeshFacesFast(const int* &faces, double time = 0);
11327
11334 int getHairVerticesFast(const Vector* &vertices, double time = 0);
11335
11342 int getHairNumVerticesFast(const int* &lengths, double time = 0);
11343#else
11347 VUtils::VectorRefList getMeshVertices(double time = 0);
11348
11352 VUtils::IntRefList getMeshFaces(double time = 0);
11353
11358 VUtils::VectorRefList getHairVertices(double time = 0);
11359
11364 VUtils::IntRefList getHairNumVertices(double time = 0);
11365#endif
11366
11367 std::vector<Particle> getInstancerParticles(double time = 0);
11368
11369 Sizes3D getDecalSize(double time = 0);
11370 Sizes2D getClipperSize(double time = 0);
11371 };
11372
11374 friend class Object;
11375
11378
11381
11384
11385 int particleId;
11386
11387 bool isValid() const {
11388 return node.isValid();
11389 }
11390
11391 //char* getUserAttributes() const;
11392 //~Particle();
11393 //private:
11394 //void* userAttributes;
11395 };
11396
11401 void *internalTextureSampler;
11402
11403 public:
11405 UVTextureSampler(const UVTextureSampler &r) = delete;
11406 UVTextureSampler& operator=(const UVTextureSampler &rhs) = delete;
11407 UVTextureSampler(UVTextureSampler &&r) noexcept;
11408 UVTextureSampler& operator=(UVTextureSampler &&rhs) noexcept;
11410
11411 public:
11419
11426
11435 bool sample(const PluginRef &pluginRef, float u, float v, AColor &result);
11436
11438 bool sample(const PluginRef &pluginRef, float u, float v, float &result);
11439
11441 bool sample(const PluginRef &pluginRef, float u, float v, int &result);
11442
11453 VRayImage* sampleArea(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height);
11454
11466 FloatList sampleAreaFloat(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height);
11467
11470 IntList sampleAreaInt(const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height);
11471
11475 void abort();
11476
11477 private:
11479 template<typename ListType, typename SampleFunction>
11480 static std::vector<ListType> sampleAreaAsListResult(int width, int height, SampleFunction &&sampleArea);
11481 };
11482
11483 namespace Util {
11484
11486 struct PluginLink {
11488 std::string fromProperty;
11490
11491 bool operator==(const PluginLink& other) const noexcept {
11492 return fromPlugin == other.fromPlugin && fromProperty == other.fromProperty && toPlugin == other.toPlugin;
11493 }
11494
11495 bool operator!=(const PluginLink& other) const noexcept {
11496 return fromPlugin != other.fromPlugin || fromProperty != other.fromProperty || toPlugin != other.toPlugin;
11497 }
11498
11499 bool operator<(const PluginLink& other) const noexcept {
11500 if (fromPlugin != other.fromPlugin)
11501 return fromPlugin < other.fromPlugin;
11502 if (fromProperty != other.fromProperty)
11503 return fromProperty < other.fromProperty;
11504 return toPlugin < other.toPlugin;
11505 }
11506
11507 bool operator<=(const PluginLink& other) const noexcept {
11508 if (fromPlugin < other.fromPlugin) return true;
11509 if (fromPlugin > other.fromPlugin) return false;
11510 if (fromProperty < other.fromProperty) return true;
11511 if (fromProperty > other.fromProperty) return false;
11512 return toPlugin < other.toPlugin;
11513 }
11514 };
11515
11521 std::vector<PluginLink> getChildPlugins(Plugin root, bool recursive);
11522
11526 std::vector<PluginLink> getParentPlugins(Plugin child, bool recursive = false);
11527
11530 float getIESPrescribedIntensity(const char* iesLightFileName);
11531
11533 float getIESPrescribedIntensity(const std::string& iesLightFileName);
11534 }
11535
11537 enum Status {
11539 ErrorMemory = -4,
11540
11542 ErrorResolve = -3,
11543
11545 ErrorConnect = -2,
11546
11548 ErrorTimeout = -1,
11549
11551 ServerReady = 0,
11552
11554 ServerUnknown = 1,
11555
11557 ServerError = 2,
11558
11560 ServerBusy = 3
11561 } status;
11562
11565
11568
11570 std::string hostResolved;
11571
11573 std::string hostConnectedTo; // valid only if ServerBusy
11574
11576 std::string revisionTime;
11577 };
11578
11582 CheckDRHostResult checkDRHost(const char* host);
11583
11585 CheckDRHostResult checkDRHost(const std::string& host);
11586
11589
11590 BinUserAttributesWriter() : index() {}
11591
11602 binUserAttributeType_int = 0,
11603 binUserAttributeType_float,
11604 binUserAttributeType_vector,
11605 binUserAttributeType_acolor,
11606 binUserAttributeType_string,
11607 binUserAttributeType_last,
11608 };
11609
11613 binUserAttributeFlag_small = 1 << 3,
11614
11616 binUserAttributeFlag_smallY = 1 << 2,
11617
11619 binUserAttributeFlag_smallZ = 1 << 1,
11620
11622 binUserAttributeFlag_smallA = 1 << 0,
11623 };
11624
11628 template<size_t count>
11629 void add(const char(&name)[count], int value) {
11630 add(name, count - 1, value);
11631 }
11632
11636 template<size_t count>
11637 void add(const char(&name)[count], float value) {
11638 add(name, count - 1, value);
11639 }
11640
11644 template<size_t count>
11645 void add(const char(&name)[count], const Vector& value) {
11646 add(name, count - 1, value);
11647 }
11648
11652 template<size_t count>
11653 void add(const char(&name)[count], const AColor& value) {
11654 add(name, count - 1, value);
11655 }
11656
11661 template<size_t nameLen>
11662 void add(const char(&name)[nameLen], const char* value, size_t valueLen) {
11663 add(name, nameLen - 1, value, valueLen);
11664 }
11665
11669 template<size_t nameLen, size_t valueLen>
11670 void add(const char(&name)[nameLen], const char(&value)[valueLen]) {
11671 add(name, nameLen - 1, value, valueLen - 1);
11672 }
11673
11677 template<size_t nameLen>
11678 void add(const char(&name)[nameLen], const std::string& value) {
11679 add(name, nameLen - 1, value.c_str(), value.length());
11680 }
11681
11685 void add(const std::string& name, int value) {
11686 add(name.c_str(), name.length(), value);
11687 }
11688
11692 void add(const std::string& name, float value) {
11693 add(name.c_str(), name.length(), value);
11694 }
11695
11699 void add(const std::string& name, const Vector& value) {
11700 add(name.c_str(), name.length(), value);
11701 }
11702
11706 void add(const std::string& name, const AColor& value) {
11707 add(name.c_str(), name.length(), value);
11708 }
11709
11714 void add(const std::string& name, const char* value, size_t valueLen) {
11715 add(name.c_str(), name.length(), value, valueLen);
11716 }
11717
11721 template<size_t valueLen>
11722 void add(const std::string& name, const char(&value)[valueLen]) {
11723 add(name.c_str(), name.length(), value, valueLen - 1);
11724 }
11725
11729 void add(const std::string& name, const std::string& value) {
11730 add(name.c_str(), name.length(), value.c_str(), value.length());
11731 }
11732
11737 void add(const char* name, size_t nameLen, int value) {
11738 appendString(name, nameLen);
11739
11740 if (value >= -128 && value <= 127) {
11741 const byte attrType = binUserAttributeType_int | (binUserAttributeFlag_small << 4);
11742 resize(2);
11743 write(attrType);
11744 write(sbyte(value));
11745 } else {
11746 resize(1 + sizeof(int));
11747 write(binUserAttributeType_int);
11748 write(value);
11749 }
11750 }
11751
11756 void add(const char* name, size_t nameLen, float value) {
11757 appendString(name, nameLen);
11758
11759 byte attrType = binUserAttributeType_float;
11760 byte writeSize = 1;
11761
11762 const SmallFloat smallValue(value, attrType, binUserAttributeFlag_small, writeSize);
11763 resize(writeSize);
11764 write(attrType);
11765 smallValue.write(*this);
11766 }
11767
11772 void add(const char* name, size_t nameLen, const Vector& value) {
11773 appendString(name, nameLen);
11774
11775 byte attrType = binUserAttributeType_vector;
11776 byte writeSize = sizeof(byte);
11777
11778 const SmallFloat smallX(value.x, attrType, binUserAttributeFlag_small, writeSize);
11779 const SmallFloat smallY(value.y, attrType, binUserAttributeFlag_smallY, writeSize);
11780 const SmallFloat smallZ(value.z, attrType, binUserAttributeFlag_smallZ, writeSize);
11781
11782 resize(writeSize);
11783 write(attrType);
11784
11785 smallX.write(*this);
11786 smallY.write(*this);
11787 smallZ.write(*this);
11788 }
11789
11794 void add(const char* name, size_t nameLen, const AColor& value) {
11795 appendString(name, nameLen);
11796
11797 byte attrType = binUserAttributeType_acolor;
11798 byte writeSize = sizeof(byte);
11799
11800 const SmallFloat smallR(value.color.r, attrType, binUserAttributeFlag_small, writeSize);
11801 const SmallFloat smallG(value.color.g, attrType, binUserAttributeFlag_smallY, writeSize);
11802 const SmallFloat smallB(value.color.b, attrType, binUserAttributeFlag_smallZ, writeSize);
11803 const SmallFloat smallA(value.alpha, attrType, binUserAttributeFlag_smallA, writeSize);
11804
11805 resize(writeSize);
11806
11807 write(attrType);
11808
11809 smallR.write(*this);
11810 smallG.write(*this);
11811 smallB.write(*this);
11812 smallA.write(*this);
11813 }
11814
11820 void add(const char* name, size_t nameLen, const char* value, size_t valueLen) {
11821 appendString(name, nameLen);
11822
11823 resize(1);
11824 write(binUserAttributeType_string);
11825
11826 appendString(value, valueLen);
11827 }
11828
11831 void close() {
11832 resize(1);
11833 write('\0');
11834 }
11835
11837 size_t getNumBytes() const {
11838 return index;
11839 }
11840
11842 bool hasData() const {
11843 // Close will write one termination char '\0'.
11844 // Having only name also doesn't make sense.
11845 return index > 2;
11846 }
11847
11850 IntList toIntList() {
11851 resize(1);
11852 write('\0'); // finalize attributes
11853
11854 index = 0;
11855 IntList temp;
11856 temp.swap(data);
11857 return temp;
11858 }
11859
11862 std::string toString() const {
11863 const byte* bytes = reinterpret_cast<const byte*>(data.data());
11864 size_t count = getNumBytes();
11865 std::string chars(count * 3 + 2, '\0');
11866
11867 for (size_t i = 0; i < count; ++i) {
11868 byte b = bytes[i];
11869 chars[3 * i + 0] = getHexChar(b >> 4);
11870 chars[3 * i + 1] = getHexChar(b & 0xf);
11871 chars[3 * i + 2] = ' ';
11872 };
11873 chars[3 * count + 0] = '0';
11874 chars[3 * count + 1] = '0';
11875
11876 return chars;
11877 }
11878
11879 private:
11880 // If float value could be represented as an int (values like 0.0, 1.0, 42.0)
11881 // and fits in int8 [SCHAR_MIN, SCHAR_MAX] it'll be written as a single byte
11882 // setting one of BinUserAttributeTypeFlags "small" flags.
11883 struct SmallFloat {
11884 SmallFloat(float value, byte& attrType, byte smallFlag, byte& writeSize)
11885 : value(value)
11886 , smallFloat(0)
11887 , isSmall(false)
11888 {
11889 const float roundValue = roundf(value);
11890 const bool almostInt = std::abs(value - roundValue) < 1e-6f;
11891 isSmall = almostInt && roundValue >= -128 && roundValue <= 127;
11892 if (!isSmall) {
11893 writeSize += sizeof(float);
11894 }
11895 else {
11896 smallFloat = sbyte(roundValue);
11897 attrType |= (smallFlag << 4);
11898 writeSize += sizeof(sbyte);
11899 }
11900 }
11901
11902 // Get original float value.
11903 float getFloat() const { return value; }
11904
11905 // Get value that fits in int8.
11906 sbyte getSmallFloat() const { return smallFloat; }
11907
11908 // Check if value could be stored as int8.
11909 bool getIsSmall() const { return isSmall; }
11910
11911 // Write value to buffer.
11912 void write(BinUserAttributesWriter& buf) const {
11913 if (isSmall)
11914 buf.write(smallFloat);
11915 else
11916 buf.write(value);
11917 }
11918
11919 private:
11920 const float value;
11921 sbyte smallFloat;
11922 bool isSmall;
11923 };
11924
11925 inline static char getHexChar(byte b) {
11926 return b < 10 ? b + '0' : b - 10 + 'A';
11927 }
11928
11929 // Append string bytes along with null-terminator.
11930 // @param name String value.
11931 // @param nameLen String value length (without null-terminator).
11932 void appendString(const char* name, size_t nameLen) {
11933 // We'll write name along with '\0' terminator.
11934 resize(nameLen + 1);
11935 std::memcpy(ptr(), name, nameLen);
11936 index += nameLen;
11937 *(ptr()) = 0;
11938 ++index;
11939 }
11940
11941 // Resize container, write bytes_count bytes, increment index.
11942 void append(const void* bytes, size_t bytes_count) {
11943 resize(bytes_count);
11944 std::memcpy(ptr(), bytes, bytes_count);
11945 index += bytes_count;
11946 }
11947
11948 // Resize container, write data, increment index.
11949 template<typename T>
11950 void append(const T& value) {
11951 resize(sizeof(T));
11952 write(value);
11953 }
11954
11955 // Write data, increment index. Container must have been resized beforehand.
11956 template<typename T>
11957 void write(const T& value) {
11958 std::memcpy(ptr(), &value, sizeof(value));
11959 index += sizeof(T);
11960 }
11961
11962 // Resize serialization buffer to fit extra bytes.
11963 // @param bytesToAdd Bytes count to accomodate.
11964 void resize(size_t bytesToAdd) {
11965 size_t newSize = index + bytesToAdd;
11966 if (newSize > data.size() * sizeof(int)) {
11967 data.resize((newSize + sizeof(int) - 1) / sizeof(int));
11968 }
11969 }
11970
11971 // Return the current data byte pointer.
11972 byte* ptr() {
11973 return reinterpret_cast<byte*>(data.data()) + index;
11974 }
11975
11976 // Serialization storage.
11977 std::vector<int> data;
11978
11979 // Byte index inside data, size in bytes.
11980 size_t index;
11981 };
11982
11983 inline std::ostream& operator <<(std::ostream& stream, const BinUserAttributesWriter& writer) {
11984 stream << writer.toString();
11985 return stream;
11986 }
11987} // namespace VRay
11988
11989#ifdef VRAY_SDK_INTEROPERABILITY
11990#include "vrayinterop.hpp"
11991#endif
11992
11993#include "_vraysdk_implementation.hpp"
11994
11995#ifdef _MSC_VER
11996# pragma warning(pop) // 4201
11997#endif // _MSC_VER
11998
11999#endif // _VRAY_SDK_HPP_
The raw memory contents of a BMP image.
Definition: vraysdk.hpp:558
Base class for LocalJpeg, LocalPng, LocalBmp. Can't be instantiated.
Definition: vraysdk.hpp:10669
bool saveToFile(const char *fileName) const
Write the data to disk.
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:10705
size_t getLen() const noexcept
Returns size of image data in bytes.
Definition: vraysdk.hpp:10697
void * getBuf() const noexcept
Returns a pointer to the image data.
Definition: vraysdk.hpp:10692
Definition: vraysdk.hpp:4326
Definition: vraysdk.hpp:3205
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:3223
A group of utility methods related to variuos geometry source plugins.
Definition: vraysdk.hpp:9849
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:10655
The raw memory contents of a JPEG image.
Definition: vraysdk.hpp:505
A group of utility methods related to variuos light source plugins.
Definition: vraysdk.hpp:9895
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:10752
LocalBmp(const VRayImage *img, bool preserveAlpha=false, bool swapChannels=false)
Definition: vraysdk.hpp:10759
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:10764
A wrapper around JPEG data in memory. It's meant to be stack allocated to free the data when done.
Definition: vraysdk.hpp:10716
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:10727
LocalJpeg(const VRayImage *img, int quality=0)
Definition: vraysdk.hpp:10722
Definition: vraysdk.hpp:10734
LocalPng(const VRayImage *img, bool preserveAlpha=false)
Definition: vraysdk.hpp:10740
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:10745
A variation of VRayImage to be created on the stack so that the image gets auto-deleted.
Definition: vraysdk.hpp:824
Definition: vraysdk.hpp:3878
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:484
Definition: vraysdk.hpp:4793
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.
bool setUpdatedDefaultProperties()
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:4824
@ 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:4832
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:10562
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:10604
PluginTypeId getTypeId() const
Returns the type id of the plugin.
Definition: vraysdk.hpp:10614
PropertyMeta getPropertyMeta(const char *propertyName) const
Returns an object used to obtain meta information about a plugin property.
Definition: vraysdk.hpp:10630
std::vector< std::string > getPropertyNames() const
Returns the names of all properties.
Definition: vraysdk.hpp:10619
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:10609
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:10635
const char * getDeprecation() const
Returns a deprecation string for this render plugin type. May be nullptr!
Definition: vraysdk.hpp:5615
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:5642
PluginRefT(const PluginRefT &plugin) noexcept
Copy construct from another PluginRef.
Definition: vraysdk.hpp:5638
PluginRefT() noexcept
Default construct an invalid PluginRef - not referencing a V-Ray scene object.
Definition: vraysdk.hpp:5632
bool isOutputValid() const noexcept
Returns true if this PluginRef references a valid Plugin output (including the default one).
Definition: vraysdk.hpp:5667
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:5635
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:5693
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:5745
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:5706
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:5703
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:5709
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:503
Definition: vraysdk.hpp:9815
Static meta information about a plugin property.
Definition: vraysdk.hpp:10385
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:10438
Type getType() const
Definition: vraysdk.hpp:10433
std::string getDescription() const
Returns a short description of this property. May be empty.
Definition: vraysdk.hpp:10448
GPUParamSupport getGPUSupport() const
Returns to what extent the property is supported by V-Ray GPU.
Definition: vraysdk.hpp:10477
std::string getUIGuides() const
Definition: vraysdk.hpp:10460
const char * getName() const
Returns the primary name of this property.
Definition: vraysdk.hpp:10424
int getElementsCount() const
Returns the number of elements for the property if it is a list and -1 otherwise.
Definition: vraysdk.hpp:10419
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:10454
UIGuides getUIGuidesObject() const
Returns an object used to obtain meta information about a plugin property uiGuides.
Definition: vraysdk.hpp:10466
Value getDefaultValue() const
Extends PropertyMeta with type information only available at runtime for a specific property instance...
Definition: vraysdk.hpp:10483
RuntimeUIGuides getRuntimeUIGuidesObject() const
Returns an object used to obtain meta and dynamic information about a plugin property uiGuides.
Definition: vraysdk.hpp:10527
Type getRuntimeType() const
Get the current type of the property value. This can differ from the result of getType().
Definition: vraysdk.hpp:10512
int getRuntimeElementsCount() const
Return the current number of elements in a list property.
Definition: vraysdk.hpp:10507
A group of methods for reading data and creating V-Ray geometry proxies.
Definition: vraysdk.hpp:9924
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:3238
const std::vector< int > & getMaterialIDs() const
Get material IDs for each consecutive triangle in the full mesh.
Definition: vraysdk.hpp:3279
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:3447
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:3420
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:3512
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:3506
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:3378
const std::vector< Vector > & getUVValues() const
Get the full array of UVW 3-tuples.
Definition: vraysdk.hpp:3423
const std::vector< float > & getHairWidths() const
Get the full array of the hair geometry widths.
Definition: vraysdk.hpp:3351
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:3530
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:3509
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:3348
const std::vector< Vector > & getNormals() const
Get full mesh normal vectors array.
Definition: vraysdk.hpp:3273
const std::vector< Color > & getVoxelInfoWireColor() const
Get an array of diffuse (wire) colors - 1 Color per mesh object.
Definition: vraysdk.hpp:3524
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:3444
const std::vector< Vector > & getVelocities() const
Get velocity vectors for each vertex in the vertex array.
Definition: vraysdk.hpp:3285
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:3417
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:3450
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:3435
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:3381
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:3276
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:3438
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:3390
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:3426
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:3357
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:3527
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:3453
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:3393
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:3441
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:3354
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:3408
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:3270
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:3264
const std::vector< Vector > & getVertices() const
Get full mesh vertex positions array.
Definition: vraysdk.hpp:3267
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:3399
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:3282
const std::vector< Vector > & getHairVertices() const
Get the full array of the hair geometry vertices.
Definition: vraysdk.hpp:3345
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:2670
PixelFormat
This describes the desired data format for getData().
Definition: vraysdk.hpp:2797
@ PF_RGBA_BIT16
4x2 bytes RGBA.
Definition: vraysdk.hpp:2811
@ PF_BW_BIT8
1-byte greyscale/integer.
Definition: vraysdk.hpp:2799
@ PF_RGBA_FLOAT
4x4 bytes float RGBA.
Definition: vraysdk.hpp:2813
@ PF_RGB_FLOAT
3x4 bytes float RGB.
Definition: vraysdk.hpp:2808
@ PF_BW_BIT16
2-byte greyscale/integer.
Definition: vraysdk.hpp:2800
@ PF_RGBA_HALF
4x2 bytes half-float RGBA.
Definition: vraysdk.hpp:2812
@ PF_RGB_BIT16
3x2 bytes RGB.
Definition: vraysdk.hpp:2806
@ PF_BW_BIT32
4-byte greyscale/integer.
Definition: vraysdk.hpp:2801
@ PF_BW_FLOAT
4-byte float greyscale.
Definition: vraysdk.hpp:2803
@ PF_RGB_BIT8
3x1 bytes RGB.
Definition: vraysdk.hpp:2805
@ PF_RGBA_BIT8
4x1 bytes RGBA.
Definition: vraysdk.hpp:2810
@ PF_RGB_HALF
3x2 bytes half-float RGB.
Definition: vraysdk.hpp:2807
@ PF_BW_HALF
2-byte half-float greyscale.
Definition: vraysdk.hpp:2802
Plugin getPlugin() const
Get the plugin instance in the scene that enables this render element. Might be invalid for special c...
RenderElement()
Default construct an invalid object.
Definition: vraysdk.hpp:2870
size_t getDataIntoBuffer(const GetDataOptions &options, void *data) const
VRayImage * getImage(const ImageRegion *rgn=nullptr, int layerIndex=0) const
DataIntent
Definition: vraysdk.hpp:2816
@ DI_INTENT_FILE
The data will be saved in a file, so we don't want color corrections applied.
Definition: vraysdk.hpp:2821
@ DI_INTENT_VIEWPORT_IPR
Image will be displayed in viewport, color corrections should be applied with the exception of sRGB a...
Definition: vraysdk.hpp:2837
@ DI_INTENT_FILE_SRGB
Same as IntentFile, but with forced sRGB/Gamma correction.
Definition: vraysdk.hpp:2834
@ DI_INTENT_DISPLAY
The data will be shown on a display, so we want color corrections to be applied.
Definition: vraysdk.hpp:2818
@ DI_INTENT_FILE_NO_COLOR_CORRECTIONS
Definition: vraysdk.hpp:2831
@ DI_INTENT_RAW
Definition: vraysdk.hpp:2826
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:2787
@ BF_FLOAT
A single float number (e.g. z-depth).
Definition: vraysdk.hpp:2788
@ BF_3FLOAT_SIGNED
3 signed float numbers (e.g. surface normals).
Definition: vraysdk.hpp:2792
@ BF_4FLOAT
4 float numbers (e.g. RGBA color).
Definition: vraysdk.hpp:2793
@ BF_3FLOAT
3 float numbers (e.g. RGB color).
Definition: vraysdk.hpp:2789
@ BF_2FLOAT
2 signed float numbers (e.g. uv coordinates or pixel screen velocity).
Definition: vraysdk.hpp:2790
@ BF_INT
A single integer number (e.g. render ID, material ID etc).
Definition: vraysdk.hpp:2791
PixelFormat getDefaultPixelFormat() const
Get the default format used by the getData method for this render element.
Definition: vraysdk.hpp:2891
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:2876
BinaryFormat getBinaryFormat() const
Get the binary format of pixels in this render element.
Definition: vraysdk.hpp:2886
Type
The render channal types/aliases are used to identify some common channels.
Definition: vraysdk.hpp:2675
@ REFLECT_ALPHA
Used by matte materials to store the alpha of the reflections.
Definition: vraysdk.hpp:2731
@ VRMTL_SHEEN_GLOSSINESS
VRayMtl sheen glossiness parameter.
Definition: vraysdk.hpp:2759
@ REALCOLOR
Real color VFB channel.
Definition: vraysdk.hpp:2705
@ COLOR
RGB VFB channel. This is always created by V-Ray and there can't be multiple instances....
Definition: vraysdk.hpp:2710
@ CRYPTOMATTE
Used for Cryptomatte render channel output.
Definition: vraysdk.hpp:2746
@ NODEID
Node ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2696
@ RAW_COAT_REFLECTION
Raw coat indirect reflection VFB channel.
Definition: vraysdk.hpp:2763
@ REFLECT
Reflection VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2681
@ VRMTL_COAT_COLOR
VRayMtl coat highlight color (coat filter uninfluenced by Fresnel weight, reflection and refraction c...
Definition: vraysdk.hpp:2762
@ EXTRA_TEX_FLOAT
A single texture override is applied to the whole scene (e.g. Dirt)
Definition: vraysdk.hpp:2780
@ LAST
not a type, just a delimiter
Definition: vraysdk.hpp:2769
@ RENDERTIME
Per-pixel render time.
Definition: vraysdk.hpp:2745
@ DRBUCKET
A channel that keeps track of which DR server rendered a particular bucket (it is a Color buffer that...
Definition: vraysdk.hpp:2724
@ NOISE_LEVEL
The noise level as estimated by the Adaptive and Progressive image samplers. Used for denoising purpo...
Definition: vraysdk.hpp:2736
@ RAW_REFLECTION
Raw reflection VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2700
@ BACKGROUND
Background VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2707
@ VRMTL_REFRACTGLOSS
A VRayMtl reflection glossiness VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2728
@ ZDEPTH
Z-Depth VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2697
@ SHEEN_FILTER
Sheen filter VFB channel.
Definition: vraysdk.hpp:2758
@ COAT_FILTER
Coat filter VFB channel.
Definition: vraysdk.hpp:2764
@ TOON
Toon effect channel.
Definition: vraysdk.hpp:2743
@ MTLRENDERID
Mtl render ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2734
@ DENOISED
A denoised version of the image. Adding this render element enables denoising.
Definition: vraysdk.hpp:2738
@ MATERIAL_SELECT
Material select.
Definition: vraysdk.hpp:2774
@ REFRACTION_FILTER
Refraction filter VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2702
@ COAT_REFL_ALPHA
Used by matte materials to store the alpha of the coat reflections.
Definition: vraysdk.hpp:2761
@ NONE
Unspecified channel.
Definition: vraysdk.hpp:2676
@ NORMALS
Normals VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2706
@ LIGHT_SELECT
Link this in the channels parameters of your lights.
Definition: vraysdk.hpp:2748
@ SAMPLERATE
The sample rate for the image samplers.
Definition: vraysdk.hpp:2720
@ SHEEN_REFLECTION
Sheen indirect reflection VFB channel.
Definition: vraysdk.hpp:2766
@ RAWGI
Raw GI VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2689
@ AUTO
Not an actual channel, used by e.g. setProgressiveImageUpdatedDataType()
Definition: vraysdk.hpp:2677
@ COAT_REFLECTION
Raw coat indirect reflection VFB channel.
Definition: vraysdk.hpp:2767
@ COVERAGE
Pixel coverage.
Definition: vraysdk.hpp:2773
@ RAW_REFRACTION
Raw refraction VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2703
@ OBJECT_SELECT
Selects by object/material ID.
Definition: vraysdk.hpp:2777
@ LIGHTING_ANALYSIS
The lighting analysis overlay.
Definition: vraysdk.hpp:2747
@ BUMPNORMALS
The normals modified with bump map. This channel must be generated by shaders.
Definition: vraysdk.hpp:2718
@ LIGHT_MIX
Channel for Interactive Light Mix.
Definition: vraysdk.hpp:2751
@ MULTIMATTE_ID
RGB matte using material IDs.
Definition: vraysdk.hpp:2776
@ SHADEMAP_EXPORT
A channel that keeps the fragment coordinates in camera space.
Definition: vraysdk.hpp:2730
@ VRMTL_METALNESS
VRayMtl metalness parameter.
Definition: vraysdk.hpp:2750
@ SHADOW
Shadow VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2684
@ REFLECTION_FILTER
Reflection filter VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2699
@ SPECULAR
Specular VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2685
@ MATTESHADOW
Matte shadow channel where full shadows are white and areas not in shadow are black; essentially this...
Definition: vraysdk.hpp:2713
@ ALPHA
Alpha VFB channel. This is always created by V-Ray and there can't be multiple instances....
Definition: vraysdk.hpp:2709
@ EXTRA_TEX_INT
A single texture override is applied to the whole scene (e.g. Dirt)
Definition: vraysdk.hpp:2779
@ CAUSTICS
Caustics VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2688
@ SHEEN_REFL_ALPHA
Used by matte materials to store the alpha of the sheen reflections.
Definition: vraysdk.hpp:2760
@ VRMTL_REFLECTHIGLOSS
A VRayMtl reflection hilight glossiness VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2727
@ GI
GI VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2687
@ RAWTOTALLIGHT
The raw total diffuse lighting (direct+indirect) falling on a surface. This channel is generated by V...
Definition: vraysdk.hpp:2716
@ VRMTL_REFLECTGLOSS
A VRayMtl reflection glossiness VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2726
@ VELOCITY
Velocity VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2693
@ WORLD_POSITION
The position in world space. Used for denoising purposes.
Definition: vraysdk.hpp:2737
@ RENDERID
Render ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2694
@ TOON_LIGHTING
Direct toon diffuse lighting.
Definition: vraysdk.hpp:2753
@ EXTRA_TEX
A single texture override is applied to the whole scene (e.g. Dirt)
Definition: vraysdk.hpp:2778
@ USER
User defined channel indices start from here.
Definition: vraysdk.hpp:2771
@ TOTALLIGHT
The total diffuse lighting (direct+indirect) falling on a surface. This channel is generated by V-Ray...
Definition: vraysdk.hpp:2715
@ MTLID
Mtl ID VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2695
@ TOON_SPECULAR
Direct toon specular lighting.
Definition: vraysdk.hpp:2754
@ DIFFUSE
Diffuse filter VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2680
@ WIRECOLOR
Wire color channel where each object appears with a solid color. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2712
@ VRMTL_COAT_GLOSSINESS
VRayMtl coat glossiness parameter.
Definition: vraysdk.hpp:2765
@ RAW_SHEEN_REFLECTION
Raw sheen indirect reflection VFB channel.
Definition: vraysdk.hpp:2757
@ SELFILLUM
Self-illumination VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2683
@ DEFOCUS_AMOUNT
Pixel blur, combination of DOF and moblur. Used for denoising purposes.
Definition: vraysdk.hpp:2740
@ MULTIMATTE
RGB matte for up to 3 objects.
Definition: vraysdk.hpp:2775
@ VRMTL_SHEEN_COLOR
VRayMtl sheen color parameter (sheen filter uninfluenced by Fresnel weight, reflection and refraction...
Definition: vraysdk.hpp:2756
@ LIGHTING
Lighting VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2686
@ RAWLIGHT
Raw light VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2690
@ EFFECTS_RESULT
Channel for all post effects.
Definition: vraysdk.hpp:2742
@ REFRACT
Refraction VFB channel. This channel must be generated by shaders.
Definition: vraysdk.hpp:2682
@ RAWSHADOW
Raw shadow VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2691
@ ATMOSPHERE
Atmospheric effects channel.
Definition: vraysdk.hpp:2679
@ VRMTL_REFLECTIOR
A VRayMtl reflection IOR VFB channel. This channel is generated by V-Ray.
Definition: vraysdk.hpp:2733
@ SSS
A channel used for VRayFastSSS2 material sub-surface portion.
Definition: vraysdk.hpp:2722
@ WORLD_BUMPNORMAL
Normal with bump mapping in world space.
Definition: vraysdk.hpp:2739
Type getType() const
Get the type of the render element.
Definition: vraysdk.hpp:2881
This class groups methods related to management of render elements in the scene.
Definition: vraysdk.hpp:2960
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:10365
bool isEnabled() const
bool isHidden() const
Definition: vraysdk.hpp:4556
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:11227
DataType getDataType() const
bool isValid() const
Definition: vraysdk.hpp:11246
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:11037
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:11158
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:10072
bool hasOverriddenBy() const
bool hasOverride() const
bool hasAttribute(const AttributesType attributeType) const
UnitsType
Definition: vraysdk.hpp:10187
QuantityTypeEnum
Defines the quantity type that the parameter represents.
Definition: vraysdk.hpp:10167
@ Angle
Definition: vraysdk.hpp:10179
@ Distance
Definition: vraysdk.hpp:10174
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:10087
@ StartRollout
Definition: vraysdk.hpp:10123
@ Tier
Definition: vraysdk.hpp:10152
@ Hide
Indicates when the control should be hidden (not shown at all), depending on other plugin parameter v...
Definition: vraysdk.hpp:10154
@ GPUSupport
To what extent the property is supported by V-Ray GPU.
Definition: vraysdk.hpp:10149
@ QuantityType
Definition: vraysdk.hpp:10133
@ Enum
Definition: vraysdk.hpp:10090
@ Overrides
Definition: vraysdk.hpp:10147
@ MinValue
Limits the min value of the control.
Definition: vraysdk.hpp:10097
@ StringEnum
Definition: vraysdk.hpp:10113
@ SoftMinValue
Limits the max value of the control initially (the user can override it).
Definition: vraysdk.hpp:10128
@ StartTab
Definition: vraysdk.hpp:10126
@ Enable
Indicates when the control should be active (not grayed out), depending on other plugin parameter val...
Definition: vraysdk.hpp:10092
@ FileAssetNames
Definition: vraysdk.hpp:10116
@ SoftMaxValue
Limits the min value of the control initially (the user can override it).
Definition: vraysdk.hpp:10130
@ 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:10118
@ Attributes
Definition: vraysdk.hpp:10110
@ Units
Definition: vraysdk.hpp:10104
@ FileAsset
Definition: vraysdk.hpp:10107
@ OverridenBy
Definition: vraysdk.hpp:10140
@ DisplayName
Definition: vraysdk.hpp:10095
@ SpinStep
Add a step hint to a slider.
Definition: vraysdk.hpp:10101
@ MaxValue
Limits the max value of the control.
Definition: vraysdk.hpp:10099
@ DefaultValue
Definition: vraysdk.hpp:10161
FileAssetOpType
Definition: vraysdk.hpp:10201
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:10208
TierType
Definition: vraysdk.hpp:10232
bool isEnum() const
Definition: vraysdk.hpp:11400
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:507
Definition: vraythrow.hpp:9
Definition: vraysdk.hpp:4103
void setOSMessageDispatching(bool enableMessageDispatching)
Definition: vraysdk.hpp:4142
VRayInit(unsigned enableFlags)
Definition: vraysdk.hpp:4117
void setGUIMessageProcessing(bool enableMessageProcessing)
Definition: vraysdk.hpp:4134
Flags
Definition: vraysdk.hpp:4107
@ EnableChaosCloudLicensing
Add to enable the Chaos Cloud licensing when using V-Ray. Note that the licensing also requires a val...
Definition: vraysdk.hpp:4109
@ EnableFrameBuffer
Add to enable the usage of the V-Ray Frame Buffer. Note that this flag is needed to use the V-Ray Fra...
Definition: vraysdk.hpp:4108
This class groups all VFB history related methods.
Definition: vraysdk.hpp:7514
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:6906
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:7270
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:7449
Layer createLayer(const char *layerClass, const Layer &parent)
This class groups all VFB toolbar related methods.
Definition: vraysdk.hpp:7567
void setTestResolutionButtonStatus(const bool status)
void setBucketLockPoint(const int left, const int top)
ChannelButton
The UI visible channel buttons.
Definition: vraysdk.hpp:7571
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:7581
void setTrackMouseButtonStatus(const bool status)
This class groups all VFB related methods.
Definition: vraysdk.hpp:6818
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:6498
static bool isActiveState(RendererState value)
Convenience function for checking if a state value is in the rendering subset (including preparing).
Definition: vraysdk.hpp:7910
bool isRenderEnded() const
void start() const
Box getBoundingBox(bool &ok) const
Returns the current bounding box of the scene.
InstanceHandleType getInstanceHandle() const
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...
void setOnEnhanceOnCollaboration(int(*callback)(VRayRenderer &, const std::vector< std::string > &fileList, double instant, void *), const void *userData=nullptr)
void setOnPostEffectsUpdated(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
int resetHosts(const std::string &hosts) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 setBucketReadyHasBuffer(bool hasBuffer)
Sets if an image passed in the BucketReady event parameters is needed. If not, no unnecessary copies ...
bool setInteractiveNoiseThreshold(float threshold)
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.
int getNumThreads() const
Return the number of threads that will be used for rendering. 0 means all CPU logical threads.
bool setCurrentTime(double time)
void setOnHostDisconnected(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBPauseIPR(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnProgressiveImageUpdated(T &object, const void *userData=nullptr)
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...
std::string getAllHosts() const
bool denoiseNow(T &object, bool shouldPassImage=true, const void *userData=nullptr)
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 setOnBucketInit(void(*callback)(VRayRenderer &, int x, int y, int width, int height, const char *host, ImagePassType pass, double instant, void *userData), const void *userData=nullptr)
bool getDREnabled() const
void setVFBContextMenuSelectedCallback(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string getActiveHosts() const
int appendFiltered(const std::vector< std::string > &fileNames, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 setOnBucketInit(T &object, const void *userData=nullptr)
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 std::vector< std::string > &fileNames, T &obj, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool clearAllPropertyValuesUpToTime(double time)
Removes all keyframe values at times less than 'time'.
std::vector< ComputeDeviceInfo > getComputeDevicesMetalRT() const
bool deletePlugin(const Plugin &plugin)
bool resume() const
void setOnLightMixTransferToScene(int(*callback)(VRayRenderer &, const std::vector< LightMixChange > &changes, double instant, void *), const void *userData=nullptr)
RenderElements getRenderElements()
Returns an object that groups render element management methods.
bool updateLightingAnalysis(VRay::Plugin plugin)
void setOnVFBUpdateIPR(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=nullptr)
bool deletePlugin(const char *pluginName)
void setProgressiveImageUpdatedHasBuffer(bool hasBuffer)
Sets if an image passed in the ProgressiveImageUpdated event parameters is needed....
bool getInProcess() const
Plugin pickPlugin(int x, int y, int timeout) const
void setOnRendererClose(T &object, const void *userData=nullptr)
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:8698
bool enableDRClient(const EnableDRClientParams &enableParams)
int appendAsTextFiltered(const std::vector< std::string > &sceneTexts, T &obj, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBClosed(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
void setOnBucketReady(void(&callback)(VRayRenderer &, int x, int y, const char *host, VRayImage *img, ImagePassType pass, double instant, void *userData), const void *userData=nullptr)
int loadFiltered(const std::string &fileName, T &obj, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnLightMixTransferToScene(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
AddHostsResult addHosts(const char *hosts) const
Plugin newPlugin(const char *pluginType)
void setOnRenderViewChanged(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setProgressiveImageUpdatedDataType(RenderElement::Type renderChannel=RenderElement::AUTO, RenderElement::DataIntent intent=RenderElement::DI_INTENT_VIEWPORT_IPR, bool hasAlpha=true, bool flipImage=false)
bool setRenderSizes(const RenderSizeParams &sizes, bool regionButtonState)
bool waitForSequenceEnd() const
std::vector< Plugin > getPlugins() const
Returns all plugin instances in the current scene.
void setOnBucketFailed(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Plugin newPlugin(const char *pluginName, const char *pluginType)
bool setComputeDevicesMetalRT(const std::vector< int > &indices)
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...
void setOnVFBDebugShadingNotify(void(*callback)(VRayRenderer &, int enabled, DebugShadingMode mode, int selectionLocked, double instant, void *userData), const void *userData=nullptr)
bool waitForVFBClosed(const int timeout) const
void setOnVFBRenderLast(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=nullptr)
T getInstanceOrCreate(const char *pluginName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int setBitmapCache(bool onOff)
void setOnProgress(void(*callback)(VRayRenderer &, const char *msg, int elementNumber, int elementsCount, double instant, void *userData), const void *userData=nullptr)
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.
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=nullptr)
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...
int loadFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
void setUserSceneName(const std::string &sceneName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBInteractiveStart(T &object, const void *userData=nullptr)
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...
unsigned long long commit(bool force=false)
void setOnLogMessage(void(*callback)(VRayRenderer &, const char *msg, MessageLevel level, double instant, void *userData), MessageLevel minLevel=MessageInfo, const void *userData=nullptr)
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)
bool getProgressiveImageUpdatedHasBuffer() const
Gets if an image will be passed in the ProgressiveImageUpdated callback parameters.
const RendererOptions getOptions() const
Return the options used to construct this renderer.
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)
void setOnRenderViewChanged(void(*callback)(VRayRenderer &, const char *propName, double instant, void *userData), const void *userData=nullptr)
int appendAsText(const std::string &text)
This is an overloaded member function, provided for convenience. It differs from the above function o...
size_t getIrradianceMapSize() const
VRayRenderer(InstanceHandleType handle)
void setVFBContextMenuSelectedCallback(void(*callback)(VRayRenderer &, int commandId, int x, int y, void *userData), const void *userData=nullptr)
bool getImageSize(int &width, int &height) const
Returns the frame buffer width and height.
bool updateLightingAnalysis()
void setOnVFBCopyToHostFrameBufferNotify(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool saveLightCacheFile(const std::string &fileName)
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=nullptr)
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:7907
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...
void setDebugShadingSelection(const std::vector< Plugin > &selection)
~VRayRenderer()
Destructor.
Plugin getPlugin(const char *pluginName) const
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 isRenderingInHalfResolution() const
Definition: vraysdk.hpp:7914
int appendAsText(const char *text, size_t length, void(*freeFn)(char *text, size_t size, T *holderObject)=nullptr, T *holderObject=nullptr)
int loadFiltered(const char *fileName, T &obj, const void *userData=nullptr)
int appendFiltered(const std::vector< const char * > &fileNames, T &obj, const void *userData=nullptr)
void renderSequence() const
Begins rendering an animation sequence in a separate thread. A non-blocking call.
int loadAsText(const char *text)
std::vector< Plugin > getPluginsOfCategories(const std::vector< PluginCategories > &categories) const
Plugin getCamera() const
Gets the current camera plugin. Don't use this unless you need to use setCamera() - see the comments ...
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.
void setDenoiserOptions(const DenoiserOptions &denoiserOptions)
void setVFBContextMenuItems(const std::vector< VFBContextMenuItem > &items)
Set menu items for the VFB's context menu.
int appendAsTextFiltered(const std::vector< const char * > &sceneTexts, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
int loadFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool waitForSequenceEnd(const int timeout) const
int appendFiltered(const std::string &fileName, T &obj, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int loadAsTextFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
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)
void setOnStateChanged(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBShowMessagesWindow(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
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...
std::vector< ComputeDeviceInfo > getComputeDevicesCurrentEngine() const
void setOnHostDisconnected(void(*callback)(VRayRenderer &, const char *hostName, double instant, void *userData), const void *userData=nullptr)
void bucketRenderNearest(int x, int y) const
void clearLastError()
Clears the last error code.
size_t getLightCacheSize() const
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...
void setOnLogMessage(T &object, MessageLevel minLevel=MessageInfo, const void *userData=nullptr)
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 denoiseNow(void(*userCb)(VRayRenderer &, VRayImage *, void *)=0, bool shouldPassImage=true, const void *userData=nullptr)
bool enableLiveLinkClient(const LiveLinkClientParameters &params)
int appendFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
size_t getCausticsSize() const
void setOnEnhanceOnCollaboration(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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)
int resetHosts(const char *hosts=nullptr) const
void setUserLightChangedCB(void(*cb)(const UserLightChanged *info, void *userData), void *userData)
void setOnHostConnected(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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.
void setOnVFBLayersChanged(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
void setOnLicenseError(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
RenderMode getRenderMode() const
Get the current render mode.
int appendAsTextFiltered(const std::vector< const char * > &sceneTexts, T &obj, const void *userData=nullptr)
InteractiveStatistics getInteractiveStatistics() const
Returns some performance statistics from the Interactive (RT) engine.
bool setInteractiveTimeout(int timeoutMsec)
bool addVRayProfilerMetadata(const char *category, const char *key, const char *value)
bool waitForRenderEnd(const int timeout) const
void setOnCollaborationImageChange(T &object, const void *userData=nullptr)
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=nullptr)
int loadAsTextFiltered(const std::string &fileName, T &obj, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBPauseIPR(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=nullptr)
VRayImage * getImage() const
unsigned long setProgressiveImageUpdateTimeout(unsigned long timeout)
void setOnVFBClick(void(*callback)(VRayRenderer &, VFBMouseButton button, int x, int y, bool ctrl, bool shift, void *userData), const void *userData=nullptr)
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
void setOnVFBClick(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
float getIESPrescribedIntensity(const char *iesLightFileName) const
void setOnVFBUpdateIPR(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 append(const std::vector< const char * > &fileNames)
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)
int appendAsTextFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
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 setOnVFBSaveSettingsNotify(T &object, const void *userData=nullptr)
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)
std::vector< ComputeDeviceInfo > getComputeDevicesMetal() const
void setOnVFBSaveSettingsNotify(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
void setOnVFBDebugShadingNotify(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T getPlugin(const std::string &pluginName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBRenderLast(T &object, const void *userData=nullptr)
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...
int appendFiltered(const std::vector< const char * > &fileNames, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
void setOnVFBAddRenderElementToScene(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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...
void setOnCollaborationImageChange(void(*callback)(VRayRenderer &, int imageLoaded, int enhanceSupported, double instant, void *userData), const void *userData=nullptr)
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)
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)
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...
int appendAsTextFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
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
void setOnVFBOpenUpdateNotify(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBCameraSelection(void(*callback)(VRayRenderer &renderer, int itemId, VFBSourceButton sourceButton, void *userData), const void *userData=nullptr)
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....
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=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
UserPropertyType
Property types for UserPropertyChanged.
Definition: vraysdk.hpp:8065
void setOnVFBClosed(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool saveIrradianceMapFile(const std::string &fileName)
int exportScene(const char *filePath) const
void setOnVFBCameraSelection(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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.
bool operator!() const
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.
void setOnStateChanged(void(*callback)(VRayRenderer &, RendererState oldState, RendererState newState, double instant, void *), const void *userData=nullptr)
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
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...
void setOnVFBShowMessagesWindow(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setUpdatedDefaultProperties()
int loadAsTextFiltered(const char *fileName, T &obj, const void *userData=nullptr)
std::string getUserSceneName()
T newPlugin()
This is an overloaded member function, provided for convenience. It differs from the above function o...
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...
void setVFBCameraSelectionItems(const std::vector< const char * > &items)
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...
void setOnUploadToCollaboration(int(*callback)(VRayRenderer &, const std::vector< std::string > &fileList, double instant, void *), const void *userData=nullptr)
Plugin getInstanceOrCreate(const std::string &pluginName, PluginTypeId pluginTypeId)
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)
void setOnProgressiveImageUpdated(void(*callback)(VRayRenderer &, VRayImage *img, unsigned long long changeIndex, ImagePassType pass, double instant, void *userData), const void *userData=nullptr)
bool waitForVFBClosed() const
void setOnProgress(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int append(const char *fileName, bool drSendNameOnly=false)
void setOnUploadToCollaboration(T &object, const void *userData=nullptr)
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
int appendAsTextFiltered(const char *fileName, T &obj, const void *userData=nullptr)
int appendFiltered(const char *fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
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 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()
int loadAsTextFiltered(const std::string &fileName, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
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...
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...
int appendAsTextFiltered(const std::vector< std::string > &sceneTexts, bool(*callback)(VRayRenderer &, const char *pluginType, std::string &pluginName, void *), const void *userData=nullptr)
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...
std::vector< std::string > getPluginTypesOfCategories(const std::vector< PluginCategories > &categories) const
Plugin pickPlugin(int x, int y) const
void setOnVFBInteractiveStart(void(*callback)(VRayRenderer &, bool isRendering, double instant, void *userData), const void *userData=nullptr)
std::vector< ComputeDeviceInfo > getComputeDevicesDenoiser() const
bool getRenderRegion(int &rgnLeft, int &rgnTop, int &rgnWidth, int &rgnHeight) const
void setOnVFBOpenUpdateNotify(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
int exportScene(const std::string &filePath) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnVFBLayersChanged(T &object, const void *userData=nullptr)
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
void setOnVFBAddRenderElementToScene(bool(*callback)(VRayRenderer &, VFBRenderElementType type, double instant, void *userData), const void *userData=nullptr)
void setOnVFBCopyToHostFrameBufferNotify(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
bool setCamera(const Plugin &plugin)
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
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
void setOnLicenseError(void(*callback)(VRayRenderer &, const char *msg, int errorCode, LicenseUserStatus userStatus, double instant, void *userData), const void *userData=nullptr)
RendererState getState() const
int appendAsText(const char *text)
bool setCropRegion(int srcWidth, int srcHeight, float rgnLeft, float rgnTop)
void setOnRendererClose(void(*callback)(VRayRenderer &, double instant, void *userData), const void *userData=nullptr)
void renderSequence(SubSequenceDesc descriptions[], size_t count) const
void setOnBucketReady(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setOnPostEffectsUpdated(T &object, const void *userData=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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:9090
void setOnHostConnected(void(*callback)(VRayRenderer &, const char *hostName, double instant, void *userData), const void *userData=nullptr)
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
int loadAsText(const char *text, size_t length, void(*freeFn)(char *text, size_t size, T *holderObject)=nullptr, T *holderObject=nullptr)
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:5761
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:403
@ stampFontWeight_light
Light font.
Definition: vraysdk.hpp:405
@ stampFontWeight_bold
Bold font.
Definition: vraysdk.hpp:406
@ stampFontWeight_normal
Normal weight.
Definition: vraysdk.hpp:404
StampFontStyle
Describes the style of a UI font.
Definition: vraysdk.hpp:397
@ stampFontStyle_italic
Italic style.
Definition: vraysdk.hpp:399
@ stampFontStyle_normal
Normal style.
Definition: vraysdk.hpp:398
BlendMode
Definition: vraysdk.hpp:422
@ BlendMode_Saturation
Uses the saturation from the FG, while the value and hue are taken from the BG.
Definition: vraysdk.hpp:445
@ BlendMode_LinearBurn
Same as Color Burn but with less contrast.
Definition: vraysdk.hpp:430
@ BlendMode_Last
Last element.
Definition: vraysdk.hpp:457
@ BlendMode_SplotlightBlend
Also known as 'Spotlight Blend (8bit)'. Same as Spotlight, but additionally brightens the BG.
Definition: vraysdk.hpp:436
@ BlendMode_FgWhiteMask
Definition: vraysdk.hpp:455
@ BlendMode_Add
Adds the FG to the BG.
Definition: vraysdk.hpp:425
@ BlendMode_Subtract
Subtracts the FG from the BG. Does not affect completely black areas.
Definition: vraysdk.hpp:426
@ BlendMode_Hardlight
Also known as 'Hard Light (8bit)'. Spotlight is applied to pixels where the FG is dark and Screen is ...
Definition: vraysdk.hpp:439
@ 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:441
@ BlendMode_Exclusion
Same as Difference but with less contrast.
Definition: vraysdk.hpp:443
@ BlendMode_ColorDodge
Also known as 'Color Dodge (8bit)'. The color of the FG is applied to lighter pixels in the BG.
Definition: vraysdk.hpp:433
@ BlendMode_Background
Use as background.
Definition: vraysdk.hpp:450
@ BlendMode_Lighten
Compares the FG to the BG and takes the lighter of the two.
Definition: vraysdk.hpp:431
@ BlendMode_Overlay
Also known as 'Overlay (8bit)'. Darker pixels become darker where the BG is dark and brighter pixels ...
Definition: vraysdk.hpp:437
@ BlendMode_Multiply
Multiplies the FG by the BG.
Definition: vraysdk.hpp:428
@ BlendMode_Spotlight
Also known as 'Spotlight (8bit)'. Same as Multiply, but with twice the brightness.
Definition: vraysdk.hpp:435
@ BlendMode_Hue
Uses the hue from the FG , while the value and saturation are taken from the BG.
Definition: vraysdk.hpp:444
@ BlendMode_ColorBurn
The color of the FG is applied to darker pixels in the BG.
Definition: vraysdk.hpp:429
@ BlendMode_Average
The average of the current layer (FG) and the result from the layers below it (BG).
Definition: vraysdk.hpp:424
@ BlendMode_Darken
Compares the FG to the BG and takes the darker pixel values of the two.
Definition: vraysdk.hpp:427
@ BlendMode_Difference
Compares the pixels in the BG and FG and subtracts the darker pixels from the brighter ones.
Definition: vraysdk.hpp:442
@ BlendMode_Value
Uses the value from the FG, while the hue and saturation are taken from the BG.
Definition: vraysdk.hpp:447
@ BlendMode_Softlight
Also known as 'Soft Light (8bit)'. Darker pixels become darker where the FG is dark and brighter pixe...
Definition: vraysdk.hpp:438
@ BlendMode_LinearDodge
Also known as 'Linear Dodge (8bit)'. Same as Color Dodge but with less contrast.
Definition: vraysdk.hpp:434
@ 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:440
@ BlendMode_Screen
Makes both light and dark areas lighter.
Definition: vraysdk.hpp:432
@ BlendMode_Color
Uses the hue and saturation from the FG, while the value is taken from the BG.
Definition: vraysdk.hpp:446
@ BlendMode_Foreground
Use as foreground.
Definition: vraysdk.hpp:451
@ BlendMode_Divide
Subtracts the BG from the FG. Dark areas of the render are brightened, while bright areas of the rend...
Definition: vraysdk.hpp:448
@ BlendMode_Overwrite
Displays the current layer (FG) on top of all layers (BG) without blending. This is the default.
Definition: vraysdk.hpp:423
@ BlendMode_Normal
Blends the alpha of the VRayMtlSelect render element's material and other layers.
Definition: vraysdk.hpp:449
Flags
Definition: vraysdk.hpp:348
@ EnumRadioButtons
Specific to Int properties, the UI should use radio buttons.
Definition: vraysdk.hpp:352
@ Stretched
Specifies that when a widget is added it has to be stretched.
Definition: vraysdk.hpp:382
@ NonResettable
Properties with this flag won't be reset by calls to resetPropsToDefaults (e.g. Layer name).
Definition: vraysdk.hpp:368
@ WithoutLineEdit
Definition: vraysdk.hpp:379
@ HorizontalRolloutControls
Definition: vraysdk.hpp:361
@ Hidden
If this flag is raised the property should be temporarily hidden from its "Properties" UI.
Definition: vraysdk.hpp:351
@ Advanced
Indicate a property only visible when toggling advanced properties visibility/export mode or whatever...
Definition: vraysdk.hpp:370
@ ReadOnly
Properties with this flag should be shown with a read only UI.
Definition: vraysdk.hpp:364
@ EnumComboBox
Specific to Int properties, the UI should use a combo box.
Definition: vraysdk.hpp:353
@ Command
Definition: vraysdk.hpp:357
@ ScrollableVerticalRollout
Scrollable rollouts will have their contents in a scroll area.
Definition: vraysdk.hpp:366
@ CollapsibleVerticalRollout
Collapsible rollouts have buttons to collapse/expand them.
Definition: vraysdk.hpp:365
@ NoCustomStyleTag
Properties with this flag will not have Q_PROPERTY for custom styling (e.g. horizontal_rollout_groupb...
Definition: vraysdk.hpp:367
@ HasPipetteTool
Specific to Color property, add an additional pipette tool next to the color swatch button.
Definition: vraysdk.hpp:372
@ Transient
Parameter that is not stored in files.
Definition: vraysdk.hpp:363
@ Internal
No UI should be created in its "Properties" UI.
Definition: vraysdk.hpp:350
@ NoUndo
Properties with this flag don't need undo on changes. Example calculated images, curves for now.
Definition: vraysdk.hpp:369
@ Const
Properties marked as "Const" cannot have their internal value modified (i.e. const).
Definition: vraysdk.hpp:375
StampFontFamily
Describes the family of a UI font.
Definition: vraysdk.hpp:386
@ stampFontFamily_monospaced
Monospaced font.
Definition: vraysdk.hpp:393
@ stampFontFamily_sansSerif
A sans serif font.
Definition: vraysdk.hpp:391
@ stampFontFamily_default
Default family.
Definition: vraysdk.hpp:387
@ stampFontFamily_script
Script font (handwriting).
Definition: vraysdk.hpp:390
@ stampFontFamily_modern
Modern font.
Definition: vraysdk.hpp:392
@ stampFontFamily_roman
Roman (serif) font.
Definition: vraysdk.hpp:389
@ stampFontFamily_decorated
Decorated font.
Definition: vraysdk.hpp:388
Type
Definition: vraysdk.hpp:326
@ Rollout
Not in use!
Definition: vraysdk.hpp:336
@ Double
Not in use!
Definition: vraysdk.hpp:337
@ StampString
Holds two strings - raw string with user entered text and one string with fields replaced.
Definition: vraysdk.hpp:344
@ Image
Not in use!
Definition: vraysdk.hpp:340
@ Stream
Not in use! Binary stream holder.
Definition: vraysdk.hpp:345
@ IntEnum
It is an Int with a fixed number of values.
Definition: vraysdk.hpp:327
@ Curve
Not in use!
Definition: vraysdk.hpp:339
@ CustomPopup
Not in use! Holds a pointer to a CustomPopupMenuCallback, can be nullptr.
Definition: vraysdk.hpp:341
@ UInt32
Not in use!
Definition: vraysdk.hpp:338
@ MaskItemList
Not in use! Holds a list of items used for masking - each item is represented with some id,...
Definition: vraysdk.hpp:342
@ StampFont
Holds a StampFontDesc structure describing a font.
Definition: vraysdk.hpp:343
RGBA color, float32.
Definition: vraysdk.hpp:1571
AColor toSRGB() const noexcept
Creates the copy of this AColor with the values converted from linear to sRGB.
Definition: vraysdk.hpp:1704
void operator-=(const AColor &c) noexcept
Definition: vraysdk.hpp:1605
void operator*=(const AColor &c) noexcept
Definition: vraysdk.hpp:1612
void operator/=(const AColor &c) noexcept
Definition: vraysdk.hpp:1640
void makeWhiteComplement() noexcept
Definition: vraysdk.hpp:1683
void operator+=(const AColor &c) noexcept
Definition: vraysdk.hpp:1598
AColor getWhiteComplement() const noexcept
Returns the white complement of the AColor.
Definition: vraysdk.hpp:1677
float getLength() const noexcept
Returns the length of the RGBA components.
Definition: vraysdk.hpp:1667
float getLengthSquared() const noexcept
Returns the squared sum of the RGBA components.
Definition: vraysdk.hpp:1672
float maxComponentValue() const noexcept
Calculates the magnitude of the greatest color component (the alpha is not taken into account)
Definition: vraysdk.hpp:1689
AColor fromSRGB() const noexcept
Creates the copy of this AColor with the values converted from sRGB to linear.
Definition: vraysdk.hpp:1694
Used in Proxy::createMeshFile() and Proxy::createCombinedMeshFile()
Definition: vraysdk.hpp:2613
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:2614
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:2615
Contains the auto-exposure and auto-white balance values computed during the last light cache calcula...
Definition: vraysdk.hpp:3952
float autoWhiteBalance
The auto-white balance (in Kelvin). 0 means that autoWhiteBalance calculations are not enabled.
Definition: vraysdk.hpp:3954
float ISO
Definition: vraysdk.hpp:3955
float autoExposure
The auto-exposure multiplier. 0 means that autoExposure calculations are not enabled.
Definition: vraysdk.hpp:3953
Attributes storage format: [attrName\0|type{uint8}|value{some_bytes}][...][...]\0.
Definition: vraysdk.hpp:11588
void add(const char(&name)[nameLen], const std::string &value)
Definition: vraysdk.hpp:11678
void add(const std::string &name, const AColor &value)
Definition: vraysdk.hpp:11706
void add(const char *name, size_t nameLen, float value)
Definition: vraysdk.hpp:11756
void add(const std::string &name, const char(&value)[valueLen])
Definition: vraysdk.hpp:11722
void add(const std::string &name, const std::string &value)
Definition: vraysdk.hpp:11729
void add(const char(&name)[count], const AColor &value)
Definition: vraysdk.hpp:11653
BinUserAttributeTypeFlags
Definition: vraysdk.hpp:11610
bool hasData() const
Checks if we've written any attributes.
Definition: vraysdk.hpp:11842
void close()
Definition: vraysdk.hpp:11831
void add(const std::string &name, const Vector &value)
Definition: vraysdk.hpp:11699
IntList toIntList()
Definition: vraysdk.hpp:11850
void add(const char *name, size_t nameLen, const AColor &value)
Definition: vraysdk.hpp:11794
void add(const char *name, size_t nameLen, const char *value, size_t valueLen)
Definition: vraysdk.hpp:11820
void add(const std::string &name, float value)
Definition: vraysdk.hpp:11692
void add(const std::string &name, const char *value, size_t valueLen)
Definition: vraysdk.hpp:11714
std::string toString() const
Definition: vraysdk.hpp:11862
BinUserAttributeType
Definition: vraysdk.hpp:11601
void add(const char *name, size_t nameLen, int value)
Definition: vraysdk.hpp:11737
void add(const char(&name)[nameLen], const char *value, size_t valueLen)
Definition: vraysdk.hpp:11662
void add(const char(&name)[count], float value)
Definition: vraysdk.hpp:11637
void add(const char *name, size_t nameLen, const Vector &value)
Definition: vraysdk.hpp:11772
void add(const char(&name)[nameLen], const char(&value)[valueLen])
Definition: vraysdk.hpp:11670
void add(const char(&name)[count], const Vector &value)
Definition: vraysdk.hpp:11645
void add(const std::string &name, int value)
Definition: vraysdk.hpp:11685
size_t getNumBytes() const
Get number of written bytes.
Definition: vraysdk.hpp:11837
void add(const char(&name)[count], int value)
Definition: vraysdk.hpp:11629
Equivalent to the Windows API BITMAPFILEHEADER struct.
Definition: vraysdk.hpp:512
unsigned bfOffBits
Offset of raw pixel data in bytes relative to the start of this header.
Definition: vraysdk.hpp:516
Equivalent to the Windows API BITMAPINFOHEADER struct.
Definition: vraysdk.hpp:520
Wrapper around BMP metainfo with pixel accessor method.
Definition: vraysdk.hpp:535
Axis-aligned bounding box.
Definition: vraysdk.hpp:3154
Vector pmax
The upper bounds for the box along the three axes.
Definition: vraysdk.hpp:3156
void expand(const Box &box)
Definition: vraysdk.hpp:3175
void expand(const Vector &point)
Definition: vraysdk.hpp:3160
Vector pmin
The lower bounds for the box along the three axes.
Definition: vraysdk.hpp:3155
Definition: vraysdk.hpp:11536
int cpuCount
Only ServerReady means no error.
Definition: vraysdk.hpp:11564
int vrayVersion
Server V-Ray version number.
Definition: vraysdk.hpp:11567
Status
Definition: vraysdk.hpp:11537
std::string hostConnectedTo
Server is busy connected to ip. Valid only when status is ServerReady.
Definition: vraysdk.hpp:11573
std::string hostResolved
hostName:port translated to ip:port.
Definition: vraysdk.hpp:11570
std::string revisionTime
The time the server revision is built.
Definition: vraysdk.hpp:11576
RGB color, float32.
Definition: vraysdk.hpp:1243
Color getWhiteComplement() const noexcept
Returns the white complement of the Color.
Definition: vraysdk.hpp:1332
float getIntensity() const noexcept
Returns the intensity of the color (also called chroma or saturation) which is the brightness or dull...
Definition: vraysdk.hpp:1284
void makeWhiteComplement() noexcept
Definition: vraysdk.hpp:1338
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:1431
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:1302
static Matrix getRGBtoRGBmatrix(RGBColorSpace srcColorSpace, RGBColorSpace dstColorSpace)
void operator*=(const Color &c) noexcept
Definition: vraysdk.hpp:1364
Color fromSRGB()
Creates the copy of this Color with the values converted from sRGB to linear.
Definition: vraysdk.hpp:1437
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:1289
RGBColorSpace
These color space do not include their corresponding gamma corrections!
Definition: vraysdk.hpp:1263
float getLengthSquared() const noexcept
Returns the squared length of the color.
Definition: vraysdk.hpp:1297
void operator/=(const Color &c) noexcept
Definition: vraysdk.hpp:1398
Color toSRGB()
Creates the copy of this Color with the values converted from linear to sRGB.
Definition: vraysdk.hpp:1446
void operator-=(const Color &c) noexcept
Definition: vraysdk.hpp:1356
void operator+=(const Color &c) noexcept
Definition: vraysdk.hpp:1348
void setContrast(float k, float middle=0.5f) noexcept
Definition: vraysdk.hpp:1324
void setSaturation(float k) noexcept
Definition: vraysdk.hpp:1313
float getPower() const
Returns the sum of all color components.
Definition: vraysdk.hpp:1307
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:3006
long long deviceHandle
Device handle.
Definition: vraysdk.hpp:3007
int ccMajor
CUDA Compute Capability Major version number.
Definition: vraysdk.hpp:3032
int rtCoreVersion
The version of the raytracing cores (if supported). 0 if the GPU does not support RT Cores.
Definition: vraysdk.hpp:3034
int numConnectedDisplays
Number of displays (monitors) attached to this device. -1 if this information is unavailable.
Definition: vraysdk.hpp:3029
Type
Definition: vraysdk.hpp:3020
@ deviceType_CPU
CPU device.
Definition: vraysdk.hpp:3022
@ deviceType_GPU
GPU device.
Definition: vraysdk.hpp:3023
@ deviceType_default
Default.
Definition: vraysdk.hpp:3021
@ deviceType_ACCEL
Accelerated device.
Definition: vraysdk.hpp:3024
int isCpuEmulation
Is device CPU emulated.
Definition: vraysdk.hpp:3042
std::string name
Non-unique displayable name. Device index is its unique identifier.
Definition: vraysdk.hpp:3010
int cudaOrdinalIndex
Cuda ordinal index.
Definition: vraysdk.hpp:3039
int useForRendering
Device is used for rendering.
Definition: vraysdk.hpp:3014
int tccMode
TCC mode.
Definition: vraysdk.hpp:3040
Type deviceType
Device type.
Definition: vraysdk.hpp:3027
int busId
Bus ID.
Definition: vraysdk.hpp:3037
int totalMemoryMB
MegaBytes.
Definition: vraysdk.hpp:3028
int localIndex
Local index.
Definition: vraysdk.hpp:3038
long long platform
Platform.
Definition: vraysdk.hpp:3008
int ccMinor
CUDA Compute Capability Minor version number.
Definition: vraysdk.hpp:3033
int shaderProcessorsCount
Shader processors count.
Definition: vraysdk.hpp:3036
int useForDenoising
Device is used for denoising.
Definition: vraysdk.hpp:3015
int frequencyMHz
Base clock frequency or -1 if not available.
Definition: vraysdk.hpp:3030
int isSupported
Is device supported.
Definition: vraysdk.hpp:3016
int gFlops
Theoretical GFLOPS. 0 or -1 if not available.
Definition: vraysdk.hpp:3031
int gfxArchNum
HIP device architecture.
Definition: vraysdk.hpp:3044
Definition: vraysdk.hpp:3853
FlagVal skipAlpha
True if the alpha channel should NOT be denoised.
Definition: vraysdk.hpp:3862
FlagVal
Definition: vraysdk.hpp:3854
@ Enabled
Will reset the flag.
Definition: vraysdk.hpp:3856
@ Default
Will set the flag.
Definition: vraysdk.hpp:3857
FlagVal panorama
True if denoised image is wrapped around the left/right border.
Definition: vraysdk.hpp:3861
FlagVal hideDest
Hide destination channel in VFB.
Definition: vraysdk.hpp:3860
FlagVal optixUpscale
True if the optix denoiser should use the upscaling mode. Does nothing for other engines.
Definition: vraysdk.hpp:3863
FlagVal allowInSingleChannelFiles
True to allow writing to single channel files too. Off by default.
Definition: vraysdk.hpp:3864
FlagVal skipAuxElementsInFiles
True to skip writing the additional channels to files.
Definition: vraysdk.hpp:3865
The necessary parameters passed to the VRayRenderer::enableDRClient interface.
Definition: vraysdk.hpp:4037
bool withBroadcastListener
True if a broadcast listener socket was created.
Definition: vraysdk.hpp:4044
std::string httpProxy
server:port connection parameter for http connections via proxy
Definition: vraysdk.hpp:4039
int connectTimeout
Initial connection timeout in seconds.
Definition: vraysdk.hpp:4050
std::string dispatcher
can either be an empty string or host[:port]
Definition: vraysdk.hpp:4038
int verboseLevel
Numeric progress verbosity level from 0 (none) to 4 (all, incl. debug)
Definition: vraysdk.hpp:4052
bool enableAssigningWUsAsBackups
TransferrableDrOptions.
Definition: vraysdk.hpp:4046
bool localRendering
True if, when local dispatcher selected, it's configured to spawn a local render server.
Definition: vraysdk.hpp:4043
int upstreamChannels
Number of upstream connections, which the client side will use, when pipelining is not enabled.
Definition: vraysdk.hpp:4051
bool pipelinedUpstream
Whether to use pipelining. Note pipelining will be disabled internally (even if requested),...
Definition: vraysdk.hpp:4045
Used by VRayRenderer::getImage() and RenderElement::getImage()
Definition: vraysdk.hpp:2656
ImageRegion region
Optional crop rectangle.
Definition: vraysdk.hpp:2657
bool flipImage
Flip image top-bottom.
Definition: vraysdk.hpp:2660
bool doColorCorrect
Whether to apply VFB color corrections.
Definition: vraysdk.hpp:2658
bool stripAlpha
Set alpha to 1.
Definition: vraysdk.hpp:2659
A rectangle defined by top-left and bottom-right frame coordinates.
Definition: vraysdk.hpp:254
Options passed to VRayRenderer::saveImage.
Definition: vraysdk.hpp:877
enum VRay::ImageWriterOptions::CompressionType compressionType
for EXR format only
int bitsPerChannel
for EXR format only - either 16 or 32
Definition: vraysdk.hpp:912
Additional parameter flags for Instancer and Instancer2 plugins.
Definition: vraysdk.hpp:3932
static const int useUserAttributesBin
Use binary user attributes.
Definition: vraysdk.hpp:3944
static const int useObjectProperties
Use object properties.
Definition: vraysdk.hpp:3945
static const int useParentTimesAtleastForGeometry
Definition: vraysdk.hpp:3937
static const int useSkipCryptomatte
Skip registering Node for the Cryptomatte.
Definition: vraysdk.hpp:3942
static const int useMaterial
Use material override.
Definition: vraysdk.hpp:3939
static const int useGeometry
Use geometry override.
Definition: vraysdk.hpp:3940
static const int useMapChannels
Use additional map channels.
Definition: vraysdk.hpp:3941
static const int useRenderIDOverride
Use renderIDOverride.
Definition: vraysdk.hpp:3943
unsigned long long usage
The name of the memory type category.
Definition: vraysdk.hpp:3125
Current rendering progress.
Definition: vraysdk.hpp:3114
std::string name
name of the device
Definition: vraysdk.hpp:3115
float totalMem
total mem in mega bytes
Definition: vraysdk.hpp:3118
float utilization
usage (from 0.0f to 100.0f)
Definition: vraysdk.hpp:3116
float freeMem
free mem in mega bytes
Definition: vraysdk.hpp:3117
Returned by VRayRenderer::getInteractiveStatistics when rendering in interactive mode.
Definition: vraysdk.hpp:3106
float currentNoiseThreshold
Current noise threshold. Useful when dynamic noise threshold is enabled.
Definition: vraysdk.hpp:3111
unsigned elapsedTicks
Time since start.
Definition: vraysdk.hpp:3108
std::vector< ComputeDeviceStatistics > computeDevices
array of statistics for each device with valid data
Definition: vraysdk.hpp:3121
std::vector< ComputeDeviceMemoryType > computeDevicesMemUsage
Memory usage by memory type.
Definition: vraysdk.hpp:3128
double pathsPerSecond
Number of camera rays traced per second.
Definition: vraysdk.hpp:3107
int sampleLevel
Number of samples per pixel accumulated.
Definition: vraysdk.hpp:3109
int numPasses
Number of sampling passes done.
Definition: vraysdk.hpp:3110
Parameters for setLicenseServer(). Only serverName is obligatory.
Definition: vraysdk.hpp:4278
std::string proxyUserName
Optional http proxy server.
Definition: vraysdk.hpp:4292
std::string serverName1
Optional alternative server if the primary doesn't work.
Definition: vraysdk.hpp:4286
std::string serverName2
Optional second alternative server.
Definition: vraysdk.hpp:4289
int serverPort
default port is 30304
Definition: vraysdk.hpp:4280
std::string proxyName
Optional http proxy server.
Definition: vraysdk.hpp:4281
bool useSecureConnection
Must be true to enable the secure connection.
Definition: vraysdk.hpp:4295
std::string username
Optional login.
Definition: vraysdk.hpp:4283
std::string serverName
Primary license server - hostname or IP address.
Definition: vraysdk.hpp:4279
bool useCustomCertificate
True to enable the usage of the custom certificate file path to be used for secure connection.
Definition: vraysdk.hpp:4300
int safeModeFlags
Do not use without explicit instructions. Added as precaution.
Definition: vraysdk.hpp:4298
std::string secureServer
Must be set to "ols.chaos.com" to use the Chaos Cloud licensing.
Definition: vraysdk.hpp:4296
std::string proxyPassword
Login for the optional proxy server.
Definition: vraysdk.hpp:4293
std::string password
For the optional login.
Definition: vraysdk.hpp:4284
Definition: vraysdk.hpp:6225
bool isApplied
[In] Is the channel enabled.
Definition: vraysdk.hpp:6230
Color colorMult
[In] Can be empty for the rest channel.
Definition: vraysdk.hpp:6227
float intensityMult
[In] Color multiplier.
Definition: vraysdk.hpp:6228
bool enabled
[In] Intensity multiplier.
Definition: vraysdk.hpp:6229
3x3 column-major matrix, float32
Definition: vraysdk.hpp:1853
void simpleDecompose(const Matrix &m, Vector &rotation, Vector &scale, Vector &shear) noexcept
Definition: vraysdk.hpp:2289
void setRow(const int i, const Vector &a) noexcept
Definition: vraysdk.hpp:1925
Matrix makeMatrixFromRowMajor(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:2272
void makeTranspose(void) noexcept
Make the matrix to be the transpose of its currrent value.
Definition: vraysdk.hpp:1958
Vector & operator[](const int index) noexcept
Return the i-th column of the matrix (i=0,1,2).
Definition: vraysdk.hpp:1859
void operator+=(const Matrix &m) noexcept
Definition: vraysdk.hpp:2016
Matrix inverse(const Matrix &m) noexcept
Definition: vraysdk.hpp:2056
Matrix makeRotationMatrixX(float xrot) noexcept
Definition: vraysdk.hpp:2230
Matrix makeRotationMatrixY(float yrot) noexcept
Definition: vraysdk.hpp:2239
Matrix noScale(const Matrix &m) noexcept
Definition: vraysdk.hpp:2192
void makeIdentity(void) noexcept
Make the matrix the identity matrix.
Definition: vraysdk.hpp:1937
bool makeInverse(void) noexcept
Definition: vraysdk.hpp:1968
void makeDiagonal(const Vector &a) noexcept
Definition: vraysdk.hpp:1945
Matrix() noexcept=default
Constructor - initializes all components to zero.
void setCol(const int i, const Vector &a) noexcept
Definition: vraysdk.hpp:1918
Matrix makeRotationMatrixZ(float zrot) noexcept
Definition: vraysdk.hpp:2248
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:2031
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:2010
Matrix(Vector diagonal) noexcept
Constructor to diagonal matrix.
Definition: vraysdk.hpp:1880
void makeZero(void) noexcept
Make the matrix the zero matrix (all elements are zeroes).
Definition: vraysdk.hpp:1930
void set(float value) noexcept
Make diagonal matrix.
Definition: vraysdk.hpp:1901
Matrix normalize(const Matrix &m) noexcept
Definition: vraysdk.hpp:2184
void operator-=(const Matrix &m) noexcept
Definition: vraysdk.hpp:2024
Vector rotationAngles(const Matrix &m) noexcept
Definition: vraysdk.hpp:2204
void set(const Matrix &other) noexcept
Definition: vraysdk.hpp:1909
Vector scale(const Matrix &m) noexcept
Definition: vraysdk.hpp:2198
Matrix(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:1886
void operator*=(float x) noexcept
Multiply all elements in the matrix by the given number.
Definition: vraysdk.hpp:2005
Matrix rotate(const Matrix &m, const Vector &axis) noexcept
Definition: vraysdk.hpp:2178
void set(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:1896
A container for the data necessary to a export vrmesh with geometry, hair or particles....
Definition: vraysdk.hpp:6158
ValueList hairVertices
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:6169
ValueList vertices
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:6159
ValueList mapChannels
ValueList( ValueList(int, VectorList, IntList) )
Definition: vraysdk.hpp:6165
ValueList hairWidths
ValueList( FloatList ) (single frame) OR ValueList( ValueList(int, FloatList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6171
ValueList hairVerticesPerStrand
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6170
ValueList particleWidths
ValueList( FloatList ) (single frame) OR ValueList( ValueList(int, FloatList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6173
ValueList faces
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6160
ValueList mapChNames
ValueList( StringList )
Definition: vraysdk.hpp:6166
ValueList shaderNames
ValueList( ValueList(int, string) )
Definition: vraysdk.hpp:6167
ValueList faceNormals
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6162
ValueList normals
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:6161
ValueList velocities
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:6163
ValueList faceMtlIDs
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6164
ValueList edgeVisibility
ValueList( IntList ) (single frame) OR ValueList( ValueList(int, IntList ) ) (multiple frames - ...
Definition: vraysdk.hpp:6168
ValueList particleVertices
ValueList( VectorList ) (single frame) OR ValueList( ValueList(int, VectorList) ) (multiple frames - ...
Definition: vraysdk.hpp:6172
Helper structure storing the relevant configuration entries as they were read from the configuration ...
Definition: vraysdk.hpp:10889
char familySeparator
The separator that is used to distinguish different families for UI separation.
Definition: vraysdk.hpp:10905
std::string getErrorString() const
Get whether there was any error with the loading of the OCIO configuration.
Definition: vraysdk.hpp:10943
OCIOConfigurationData(const char *fileName=nullptr, SourceMode vraySourceType=SourceMode::Automatic)
Definition: vraysdk.hpp:10911
std::vector< std::string > roles
List of the stored roles in the configuration.
Definition: vraysdk.hpp:10895
std::vector< std::string > looks
List of the looks in the configuration.
Definition: vraysdk.hpp:10899
std::vector< std::string > viewTransforms
List of unique view transformations from the configuration.
Definition: vraysdk.hpp:10903
std::vector< std::string > colorSpaces
List of the stored color spaces in the configuration.
Definition: vraysdk.hpp:10891
std::vector< std::string > devices
List of devices as read from the configuration.
Definition: vraysdk.hpp:10901
std::vector< std::string > roleColorSpaces
List of corresponding color spaces for each role. Size will match the roles size.
Definition: vraysdk.hpp:10897
std::vector< std::string > colorSpaceFamilies
List of stored color space families for the configuration. May be empty.
Definition: vraysdk.hpp:10893
Definition: vraysdk.hpp:10996
std::string name
Name of the parameter.
Definition: vraysdk.hpp:10997
OSLParameterType type
Type of the parameter.
Definition: vraysdk.hpp:10998
Value defaultValue
Default value defined in the shader file.
Definition: vraysdk.hpp:10999
Definition: vraysdk.hpp:11002
std::vector< OSLInputParameter > inputParams
Input parameters defined in the shader file.
Definition: vraysdk.hpp:11006
std::vector< std::string > outputColorParams
Output color parameters defined in the shader file.
Definition: vraysdk.hpp:11003
std::vector< std::string > outputFloatParams
Output float parameters defined in the shader file.
Definition: vraysdk.hpp:11004
std::vector< std::string > outputClosureParams
Output closure parameters defined in the shader file.
Definition: vraysdk.hpp:11005
The info contained in geometry, hair or particle objects.
Definition: vraysdk.hpp:3139
std::string name
the name of the object
Definition: vraysdk.hpp:3140
int id
the id of the object
Definition: vraysdk.hpp:3141
int vEnd
the end of the voxel range of the object (vEnd is excluded from the range)
Definition: vraysdk.hpp:3143
int vBegin
the begin of the voxel range of the object (vBegin is included in the range)
Definition: vraysdk.hpp:3142
Returned by VRayRenderer::getLastParserError. Use to diagnose problems when loading vrscene files.
Definition: vraysdk.hpp:4382
See VRayRenderer::pickPlugins.
Definition: vraysdk.hpp:6177
This struct is used to determine if a plugin type is of certain category.
Definition: vraysdk.hpp:4643
bool hasGeometricObjectCategory() const noexcept
Is the plugin of category_geometric_object.
Definition: vraysdk.hpp:4665
bool hasInstancerCategory() const noexcept
Is the plugin of category_instancer.
Definition: vraysdk.hpp:4750
unsigned long long pluginCategoryField
bitfield of the plugin categories
Definition: vraysdk.hpp:4644
bool hasTextureFloatCategory() const noexcept
Is the plugin of category_texture_float.
Definition: vraysdk.hpp:4705
bool hasHairCategory() const noexcept
Is the plugin of category_hair.
Definition: vraysdk.hpp:4745
bool hasUvwgenCategory() const noexcept
Is the plugin of category_uvwgen.
Definition: vraysdk.hpp:4730
bool hasBsdfCategory() const noexcept
Is the plugin of category_bsdf.
Definition: vraysdk.hpp:4660
bool hasRenderChannelCategory() const noexcept
Is the plugin of category_render_channel.
Definition: vraysdk.hpp:4685
bool hasSettingsCategory() const noexcept
Is the plugin of category_settings.
Definition: vraysdk.hpp:4695
bool hasMaterialCategory() const noexcept
Is the plugin of category_material.
Definition: vraysdk.hpp:4680
bool hasBitmapCategory() const noexcept
Is the plugin of category_bitmap.
Definition: vraysdk.hpp:4655
bool hasRenderViewCategory() const noexcept
Is the plugin of category_render_view.
Definition: vraysdk.hpp:4690
bool hasGeometrySourceCategory() const noexcept
Is the plugin of category_geometry_source.
Definition: vraysdk.hpp:4670
bool hasLightCategory() const noexcept
Is the plugin of category_light.
Definition: vraysdk.hpp:4675
bool hasVolumetricCategory() const noexcept
Is the plugin of category_volumetric.
Definition: vraysdk.hpp:4735
bool hasTextureIntCategory() const noexcept
Is the plugin of category_texture_int.
Definition: vraysdk.hpp:4710
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:4725
bool hasTextureCategory() const noexcept
Is the plugin of category_texture.
Definition: vraysdk.hpp:4700
bool hasCameraCategory() const noexcept
Is the plugin of category_camera.
Definition: vraysdk.hpp:4740
bool hasTextureMatrixCategory() const noexcept
Is the plugin of category_texture_matrix.
Definition: vraysdk.hpp:4715
bool hasTextureTransformCategory() const noexcept
Is the plugin of category_texture_transform.
Definition: vraysdk.hpp:4720
Used by VRay::Proxy::createMeshFile()
Definition: vraysdk.hpp:3755
std::string customPreviewFile
file name to read and use its vertices and faces for the preview voxel
Definition: vraysdk.hpp:3791
int previewType
Definition: vraysdk.hpp:3783
std::string destination
destination file name
Definition: vraysdk.hpp:3780
int startFrame
used if animOn is true
Definition: vraysdk.hpp:3785
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:3789
PreviewTypes
Definition: vraysdk.hpp:3756
@ SIMPLIFY_FACE_SAMPLING
Definition: vraysdk.hpp:3760
@ SIMPLIFY_COMBINED
Definition: vraysdk.hpp:3775
@ SIMPLIFY_CLUSTERING
Definition: vraysdk.hpp:3764
@ SIMPLIFY_EDGE_COLLAPSE
Definition: vraysdk.hpp:3768
int endFrame
used if animOn is true
Definition: vraysdk.hpp:3786
Bool exportPointCloud
when enabled, adds a point cloud representation of the mesh separated into different levels of detail...
Definition: vraysdk.hpp:3796
float pointSize
determines the size of point cloud disks at the most detailed level. If this value is small,...
Definition: vraysdk.hpp:3797
int previewParticles
number of preview particles (default 20000)
Definition: vraysdk.hpp:3799
std::vector< Color > voxelInfoWireColor
array of diffuse (wire) colors - 1 Color per mesh object
Definition: vraysdk.hpp:3792
std::vector< int > objectIDs
array of unique IDs for the respective meshes. This should usually match Node.objectID values.
Definition: vraysdk.hpp:3790
int previewFaces
approximate number of preview triangles (default 10000; set to 0 to disable preview)
Definition: vraysdk.hpp:3782
int mergeVoxels
merge all voxels of the same type, before subdivision
Definition: vraysdk.hpp:3787
std::vector< Bool > voxelInfoFlipNormals
array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be flipped)
Definition: vraysdk.hpp:3794
int previewHairs
number of preview hairs (default 1000)
Definition: vraysdk.hpp:3798
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:3793
Bool bakeTransforms
when enabled (default), applies the input Transform(s) to the geometry data, otherwise writes the Tra...
Definition: vraysdk.hpp:3800
int elementsPerVoxel
number of triangles in each voxel
Definition: vraysdk.hpp:3781
int animOn
enables saving multiple animated frames in the proxy
Definition: vraysdk.hpp:3784
The necessary parameters for reading data in a proxy file.
Definition: vraysdk.hpp:3804
int flip_axis
0 do not rotate; 1 transform from Maya to 3dsMax coordinate system (90 deg. rotation around x axis); ...
Definition: vraysdk.hpp:3808
float particle_width_multiplier
a multiplier to the particle width data
Definition: vraysdk.hpp:3825
float smooth_angle
smooth angle in degrees
Definition: vraysdk.hpp:3813
int compute_normals
true to calculate smooth normals
Definition: vraysdk.hpp:3807
int num_preview_faces
number of faces in preview
Definition: vraysdk.hpp:3812
bool use_full_names
read the full path instead of only the name
Definition: vraysdk.hpp:3817
float hair_width_multiplier
a multiplier to the hair width data
Definition: vraysdk.hpp:3824
bool compute_bbox
true to compute the bounding box, false to read it from the file
Definition: vraysdk.hpp:3818
std::string file
file name to read
Definition: vraysdk.hpp:3805
bool subdiv_uvs
subdivide or skip mapping channels
Definition: vraysdk.hpp:3820
int subdiv_level
the subdivision level
Definition: vraysdk.hpp:3809
std::string object_path
starting object path in Alembic hierarchy
Definition: vraysdk.hpp:3806
bool use_alembic_offset
true to use Alembic animation frame offset
Definition: vraysdk.hpp:3823
float fps
frames per second for calculation of current time and frame
Definition: vraysdk.hpp:3816
bool instancing
turns on/off the instancing of Alembic duplicated objects
Definition: vraysdk.hpp:3822
bool subdiv_preserve_geom_borders
if true, the borders won't be subdivided
Definition: vraysdk.hpp:3821
int anim_type
animated proxy playback type(0 - loop; 1 - once; 2 - ping - pong; 3 - still)
Definition: vraysdk.hpp:3811
float anim_speed
animated proxy playback speed
Definition: vraysdk.hpp:3814
int subdiv_preserve_map_borders
determines the smoothing mode of the mapping channels' borders. 0-None, 1-Internal and 2-All
Definition: vraysdk.hpp:3810
bool subdiv_all_meshes
true to subdivide Alembic PolyMesh and SubD objects; false to subdivide only SubD objects
Definition: vraysdk.hpp:3819
float anim_offset
animated proxy initial frame offset
Definition: vraysdk.hpp:3815
Controls what the buffer returned by getData() contains.
Definition: vraysdk.hpp:2896
Plugin * alphaChannelPlugin
The plugin describing the alpha channel render element. Can be nullptr.
Definition: vraysdk.hpp:2906
bool rgbOrder
true - RGB order, false - BGR order
Definition: vraysdk.hpp:2909
bool useDefaultAlpha
Use any existing alpha render channel.
Definition: vraysdk.hpp:2907
PixelFormat format
The desired pixel format.
Definition: vraysdk.hpp:2908
int layerIndex
For multi-layer elements only. The Cryptomatte layer index (between 0 and num_level/2)....
Definition: vraysdk.hpp:2911
ImageRegion * region
An optional image region rectange; nullptr means the whole image.
Definition: vraysdk.hpp:2910
This structure is used to return information about a particular channel in the VFB.
Definition: vraysdk.hpp:2841
BinaryFormat binaryFormat
The channel binary format.
Definition: vraysdk.hpp:2843
Type type
The channel type/alias.
Definition: vraysdk.hpp:2844
const char * name
The name of the channel as it appears in the VFB.
Definition: vraysdk.hpp:2842
Definition: vraysdk.hpp:6197
int rgnLeft
Render region left.
Definition: vraysdk.hpp:6211
int rgnTop
Render region top.
Definition: vraysdk.hpp:6212
float cropRgnHeight
Crop region height.
Definition: vraysdk.hpp:6204
int bmpHeight
Output bitmap height. This is the sampling resolution, not the file resolution.
Definition: vraysdk.hpp:6200
int imgHeight
Output image height.
Definition: vraysdk.hpp:6208
float cropRgnLeft
Crop region left.
Definition: vraysdk.hpp:6201
int rgnHeight
Render region height.
Definition: vraysdk.hpp:6214
float cropRgnTop
Crop region top.
Definition: vraysdk.hpp:6202
int bmpWidth
Output bitmap width. This is the sampling resolution, not the file resolution.
Definition: vraysdk.hpp:6199
int imgWidth
Output image width.
Definition: vraysdk.hpp:6207
int rgnWidth
Render region width.
Definition: vraysdk.hpp:6213
int bitmask
Bitmask which indicates which part to be set or has been set.
Definition: vraysdk.hpp:6222
float cropRgnWidth
Crop region width.
Definition: vraysdk.hpp:6203
Combines various options required for the rendering process.
Definition: vraysdk.hpp:3970
bool showVfbButtonCopyToHostFrameBuffer
show "Duplicate to host frame buffer" button
Definition: vraysdk.hpp:4001
bool showVfbButtonIPRUpdate
show "Update IPR" button
Definition: vraysdk.hpp:4000
bool showVfbAddDenoiserREToSceneButton
show "Add Denoiser to the scene" button
Definition: vraysdk.hpp:4003
std::string vfbLanguage
[OPTIONAL] A language code string telling the VFB which builtin language to load (from VRay::Language...
Definition: vraysdk.hpp:4014
bool showVfbAddLightMixREToSceneButton
show "Add LightMix to the scene" button
Definition: vraysdk.hpp:4002
ThemeStyle vfbDrawStyle
specifies VFB drawing style
Definition: vraysdk.hpp:3981
bool useVfbLog
use built-in VFB log
Definition: vraysdk.hpp:3995
bool noRenderLicensePreCheck
if set appsdk will not check for render node license before rendering is started
Definition: vraysdk.hpp:3988
bool showVfbButtonTestResolution
show "Test Resolution" button
Definition: vraysdk.hpp:3998
bool enableVfbPlugins
Allow the VFB to load plugins.
Definition: vraysdk.hpp:3996
bool showVfbButtonIPRPause
show "Pause IPR" button
Definition: vraysdk.hpp:3999
ThemeStyle
Specifies the drawing style of the VFB widgets.
Definition: vraysdk.hpp:3973
bool hideToSceneButton
hide Light Mix To Scene button
Definition: vraysdk.hpp:3994
bool useDefaultVfbTheme
enabled by default. If set to false the parent application theme is inherited
Definition: vraysdk.hpp:3989
bool enableFrameBuffer
true to enable the frame buffer
Definition: vraysdk.hpp:3986
bool showVfbButtonDebugShading
show "IPR Debug Shading" button
Definition: vraysdk.hpp:3997
bool dockFrameBuffer
dock V-Ray Frame Buffer window
Definition: vraysdk.hpp:3993
bool allowInvalidCharactersInPluginNames
allow invalid characters in plugin names
Definition: vraysdk.hpp:3992
std::string pluginLibraryPath
[OPTIONAL] specifies additional, non-default plugin library paths to load vray_*.dll (libvray_*....
Definition: vraysdk.hpp:4012
bool showFrameBuffer
true to initially show the frame buffer
Definition: vraysdk.hpp:3987
bool previewRenderer
optimize the renderer for small preview purposes
Definition: vraysdk.hpp:3991
bool showVfbButtonInteractiveStart
show "Start IPR" button
Definition: vraysdk.hpp:3990
Definition: vraysdk.hpp:3830
std::string outputFileName
Definition: vraysdk.hpp:3833
bool compressProgressiveFiles
Set to false to disable compression. (These files can get quite large)
Definition: vraysdk.hpp:3836
int progressiveAutoSaveSeconds
Definition: vraysdk.hpp:3846
bool deleteResumableFileOnSuccess
Definition: vraysdk.hpp:3841
See encodeScannedMaterialParams() and getScannedMaterialUILicense()
Definition: vraysdk.hpp:4389
This structure contains the parameters used in the rendering of the scanned materials.
Definition: vraysdk.hpp:4404
int dome
the mapping channel
Definition: vraysdk.hpp:4450
int triplanar
Clear coat multiplier.
Definition: vraysdk.hpp:4472
float ccmul
This parameter modifies the clear coat reflection to metalic behavior, i.e., it modulates the reflect...
Definition: vraysdk.hpp:4471
float cutoff
the reflection rays count, the UI contains subdivision parameter, this must be seto to the square val...
Definition: vraysdk.hpp:4448
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:4463
float sceneScale
used when the plain option is set to PL_SCRAMBLE, determines the size of the pieces that are continuo...
Definition: vraysdk.hpp:4454
Bool noCachedGI
the output color space (Not used anymore, replaced by the vray color space)
Definition: vraysdk.hpp:4469
ColorSpace
Definition: vraysdk.hpp:4425
@ CS_PP
adobe rgb
Definition: vraysdk.hpp:4428
@ CS_ADOBE
sRGB - linear
Definition: vraysdk.hpp:4427
float saturation
inverse gamma
Definition: vraysdk.hpp:4439
Transform uvtrans
general result multiplier (tint)
Definition: vraysdk.hpp:4443
int noPrimGI
edge displacement, used to prevent the flat appearance of the edges
Definition: vraysdk.hpp:4461
MapChannelsMask mapChBitmask
multiplies the transparency (only the transparency, the translucency remains!) (Not used anymore)
Definition: vraysdk.hpp:4465
float fltStrength
strength of the replace paint effect
Definition: vraysdk.hpp:4467
int disablewmap
displacement/paralax multiplier
Definition: vraysdk.hpp:4441
float sssmul
Clear coat glossiness variation, the measured value is kept in presets.scratchdens.
Definition: vraysdk.hpp:4477
Triplanar
Definition: vraysdk.hpp:4431
@ TP_RNDOFFS
Enable triplanar.
Definition: vraysdk.hpp:4433
@ TP_RNDROT
Enable random offset.
Definition: vraysdk.hpp:4434
float retrace
the primary rays are rendered without using the GI engine (better acuracity, lower speed) (Not used a...
Definition: vraysdk.hpp:4462
ColorSpace clrSpace
strength of the filter
Definition: vraysdk.hpp:4468
int twoside
uniform reflections distribution, when nonzero the importance sampling is not used
Definition: vraysdk.hpp:4459
int displace
same as two side in the standard material
Definition: vraysdk.hpp:4460
int fasttrans
Controls the triplanar mapping, combination of enum Triplanar flags.
Definition: vraysdk.hpp:4473
int nsamples
the z value of the view vector below which bump is gradualy applied
Definition: vraysdk.hpp:4447
MapChannels
Definition: vraysdk.hpp:4412
@ VRSM_FILTER
the color of the material
Definition: vraysdk.hpp:4414
@ VRSM_CCMULT
general color multiplier
Definition: vraysdk.hpp:4415
float paintStrength
bitmask for the maps used in the rendering
Definition: vraysdk.hpp:4466
MapChannelsMask
These values can be combined. Each bit enables the corresponding feature.
Definition: vraysdk.hpp:4419
float transpMul
force opaque rendering even if backside lighting is present.
Definition: vraysdk.hpp:4464
Plain
Definition: vraysdk.hpp:4405
@ PL_HMGSYM
the material is homogenous and potentially anisotropic, an averaged brdf is used instead texture,...
Definition: vraysdk.hpp:4408
@ PL_TRIPLANAR
the material is homogenous and isotropic , no uv mapping is needed
Definition: vraysdk.hpp:4409
@ PL_HMG
no plain strategy
Definition: vraysdk.hpp:4407
int mapChannel
stop of the indirect ray if the total weight is below this value
Definition: vraysdk.hpp:4449
float multdirect
prevent double lighting by direct and reflection rays (not used anymore)
Definition: vraysdk.hpp:4451
float bumpstart
bump multiplier for the inclined views
Definition: vraysdk.hpp:4446
float scrambleSize
limit for the tracing recursion
Definition: vraysdk.hpp:4453
float ccglossyvar
Clear coat glossiness, the measured value is kept in presets.specbell.
Definition: vraysdk.hpp:4476
int usemap
uv mapping transformation matrix
Definition: vraysdk.hpp:4444
float ccbump
clear coat highlights
Definition: vraysdk.hpp:4457
float bumpmul
not used
Definition: vraysdk.hpp:4445
int traceDepth
multipliers for different parts of the light (not used anymore)
Definition: vraysdk.hpp:4452
ScannedMaterialParams()
sss thickness multiplier
int cchlight
the clear coat ior, used for carpaints and other materials with thin refractive layer
Definition: vraysdk.hpp:4456
Color filter
disable use of the enlargement, directly the original small sample is used for rendering (Not used an...
Definition: vraysdk.hpp:4442
float ccmetalrefl
rendering without using the GI engine at all (but most scenes have low scanned materials in count)
Definition: vraysdk.hpp:4470
int BWforGI
Used in volumetric translucency calculation, switches between two models of calculation,...
Definition: vraysdk.hpp:4474
float ccior
the size of one scene unit in cm
Definition: vraysdk.hpp:4455
int unfRefl
used to make the clear coat not perfect
Definition: vraysdk.hpp:4458
float invgamma
this option modifies the rendering in order to improve the result for materials without large details
Definition: vraysdk.hpp:4438
float ccglossy
The material is represented as non colored for the GI rays, used to prevent the color bleeding when t...
Definition: vraysdk.hpp:4475
Definition: vraysdk.hpp:4517
float specbell
Controls how to use the smooth brdf model.
Definition: vraysdk.hpp:4538
int plain
ClearCoat index of reflection.
Definition: vraysdk.hpp:4524
float shdmul
Height multiplier for self shadowing.
Definition: vraysdk.hpp:4535
float fuzzy
Controls the pure reflective behavior for inclined angles, a feature typical for brushed metal.
Definition: vraysdk.hpp:4542
float bumpstart
Bump multiplier for the inclined views.
Definition: vraysdk.hpp:4526
float topvLs_A
Used mostly with top view fabrics, modifies the rendering of the inclined views making them blurred a...
Definition: vraysdk.hpp:4543
float bumpmul
Plain materials strategy.
Definition: vraysdk.hpp:4525
float lfsizecm
value used to control the function converting translucency to transparency
Definition: vraysdk.hpp:4551
float free7
CC specular multiplier (Not used anymore)
Definition: vraysdk.hpp:4540
float orgglvar
the clear coat glossiness the inverse angle deviation width (60 is one degree), since 20....
Definition: vraysdk.hpp:4530
float specmul
CC specular highlights, inverse bell width (60 is one degree)
Definition: vraysdk.hpp:4539
float ccmetalrefl
Multiplier of the indirect light, used to handle the fluorescent materials by putting value below 1 i...
Definition: vraysdk.hpp:4547
ScannedMaterialPreset()
The large feature map physical size.
float orggls
Clear coat noise-like bump amount (there is separate hmap bump)
Definition: vraysdk.hpp:4529
int forcebrdf
Used to render materials with sharp sparks, a procedural map with relative size this param is used to...
Definition: vraysdk.hpp:4537
float indmul
When flakes is nonzero (spark mode) this parameter specifies to not scramble the uv coordinates.
Definition: vraysdk.hpp:4546
int triplanar
The sample thickness in mm, used to introduce alpha/translucency correction of thick materials.
Definition: vraysdk.hpp:4549
int keepflakesuv
Not used anymore (set to 1)
Definition: vraysdk.hpp:4545
float topvLs_B
Used in top view materials to control the light direction correction.
Definition: vraysdk.hpp:4544
int flakes
Brightness multiplier for self shadowing.
Definition: vraysdk.hpp:4536
float depthmul
The z-value of the view vector below which bump is gradualy applied.
Definition: vraysdk.hpp:4527
float transpf
used to force triplanar mapping when certain customer has old vray (luxottica)
Definition: vraysdk.hpp:4550
SmoothModelFlags
Definition: vraysdk.hpp:4518
@ SMF_PS
when set, the BRDF is "forced"
Definition: vraysdk.hpp:4520
@ SMF_FORCE
used in forcebrdf
Definition: vraysdk.hpp:4519
float shdhmul
Clear coat effect multiplier.
Definition: vraysdk.hpp:4534
float ccbump
Displacement multiplier.
Definition: vraysdk.hpp:4528
float free4
the material thumnail relative offset - this is kind of a hack, using the place of an old obsolete pa...
Definition: vraysdk.hpp:4532
int thumbpos
the clearcoat glossiness variation (0-none 1-the shallow anglesare glossy), since 20....
Definition: vraysdk.hpp:4531
The necessary parameters for reading the data in the preset config file (.mbc)
Definition: vraysdk.hpp:9839
std::string fileName
Scatter preset config file (.mbc)
Definition: vraysdk.hpp:9840
float unitRescale
Rescale to specific callers units setup, e.g. the default Cosmos asset units are centimeters,...
Definition: vraysdk.hpp:9842
Plugin scatterPlugin
A GeomScatter plugin instance to be filled by the Scatter preset config.
Definition: vraysdk.hpp:9841
bool isYAxisUp
If true - process as if Y is up axis and otherwise default to Z.
Definition: vraysdk.hpp:9843
Definition: vraysdk.hpp:11373
Object material
Material used for the particle, can be empty/invalid if no material override present.
Definition: vraysdk.hpp:11383
Transform transform
Particle transform.
Definition: vraysdk.hpp:11380
Object node
Particle object, always valid (unless the Particle is invalid).
Definition: vraysdk.hpp:11377
Definition: vraysdk.hpp:11190
CoordinateSystem
The coordinate system in which the preview will be loaded.
Definition: vraysdk.hpp:11203
CacheType
Definition: vraysdk.hpp:11191
Definition: vraysdk.hpp:11113
Definition: vraysdk.hpp:11118
A helper struct with info regarding file exports for plugins of a specified type.
Definition: vraysdk.hpp:2993
std::string fileNameSuffix
Substring to append at the end of the common part of the filename passed to the export function.
Definition: vraysdk.hpp:2997
std::string pluginType
Allowed types: "view", "lights", "geometry", "nodes", "materials", "textures", "bitmaps",...
Definition: vraysdk.hpp:2995
Describes a sub-sequence of an animation range at regular steps (usually step=1)
Definition: vraysdk.hpp:3001
A math object used to define object position, rotation and scale in 3D space.
Definition: vraysdk.hpp:2446
void operator-=(const Transform &tm) noexcept
Subtract another tranformation from this one.
Definition: vraysdk.hpp:2496
Transform() noexcept=default
Default constructor - zero initializes all components.
void translate(const Vector &offsetParameter) noexcept
Apply a translation to the current offset.
Definition: vraysdk.hpp:2520
void scale(const Vector &scale) noexcept
Apply a scale operation after the current transformation.
Definition: vraysdk.hpp:2525
Vector transformVec(const Vector &a) const noexcept
Definition: vraysdk.hpp:2503
Transform(int i) noexcept
Definition: vraysdk.hpp:2466
Vector inverseTransform(const Vector &a, const Transform &tm) noexcept
Definition: vraysdk.hpp:2597
void makeInverse(void) noexcept
Make the transformation the inverse of its current value.
Definition: vraysdk.hpp:2508
void operator*=(float x) noexcept
Multiply the transformation by a number.
Definition: vraysdk.hpp:2484
void operator+=(const Transform &tm) noexcept
Add another transformation to this one.
Definition: vraysdk.hpp:2490
void rotate(const Vector &axis) noexcept
Apply a rotation after the current transformation.
Definition: vraysdk.hpp:2515
void makeIdentity(void) noexcept
Make the transformation the identity transformation.
Definition: vraysdk.hpp:2478
void makeZero(void) noexcept
Make the transformation the zero transformation.
Definition: vraysdk.hpp:2472
Structure representing an enumerated item with a value and a name.
Definition: vraysdk.hpp:10269
int value
The integer value of the enum item.
Definition: vraysdk.hpp:10270
std::string name
The string name of the enum item.
Definition: vraysdk.hpp:10271
Definition: vraysdk.hpp:6248
bool skipAllSuccessorsOfCurrentPlugin
Definition: vraysdk.hpp:6261
bool overwriteExistingPlugin
Definition: vraysdk.hpp:6268
bool skipOnlyCurrentPlugin
Definition: vraysdk.hpp:6257
std::string name
Definition: vraysdk.hpp:6252
This stuct is used to describe a menu item in the VFB's custom context menu.
Definition: vraysdk.hpp:6189
int id
ID of the menu item. Should be greater than or equal to 0.
Definition: vraysdk.hpp:6190
bool enabled
False if the menu should be disabled.
Definition: vraysdk.hpp:6193
std::string text
Display text of the menu item.
Definition: vraysdk.hpp:6194
VFBMenuItemType type
Type of the menu item.
Definition: vraysdk.hpp:6191
int defaultValue
Initial value of the item. Used only when the type is "checkbox". 0 means cleared and 1 means checked...
Definition: vraysdk.hpp:6192
Describes a UI font.
Definition: vraysdk.hpp:410
StampFontFamily fontFamily
Font family.
Definition: vraysdk.hpp:412
char fontFace[100]
Name of the font face ("Arial" etc).
Definition: vraysdk.hpp:415
StampFontWeight fontWeight
Font weight.
Definition: vraysdk.hpp:414
int pointSize
Size of text, in points.
Definition: vraysdk.hpp:411
StampFontStyle fontStyle
Font style.
Definition: vraysdk.hpp:413
A struct that encapsulates the export scene options.
Definition: vraysdk.hpp:6089
bool appendFrameSuffix
valid only when currentFrameOnly=true - appends a %04d frame number to the file name
Definition: vraysdk.hpp:6098
std::string sceneBasePath
Optional absolute scene base path that can be used for resolving relative paths for the ....
Definition: vraysdk.hpp:6132
bool renderElementsSeparateFolders
controls the default value of SettingsOutput.relements_separateFolders
Definition: vraysdk.hpp:6094
bool compressed
enables zlib compression of large data arrays; requires hexArrays==true
Definition: vraysdk.hpp:6090
bool stripPaths
If enabled, the paths for bitmap textures and other external files are stripped from the file so that...
Definition: vraysdk.hpp:6099
bool hexArraysHash
data arrays hash will be computed and written for duplicate data
Definition: vraysdk.hpp:6092
bool printHeader
whether to write the comment section with version and time info
Definition: vraysdk.hpp:6095
std::vector< std::string > additionalIncludeFiles
Optional list of files to #include at the end of the main vrscene.
Definition: vraysdk.hpp:6117
bool hexTransforms
transforms will be encoded in hex (mainly useful with large instancers)
Definition: vraysdk.hpp:6093
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:6114
double rightInterval
Definition: vraysdk.hpp:6108
bool incremental
valid only when currentFrameOnly=true && appendFrameSuffix=false - set to true to incrementally appen...
Definition: vraysdk.hpp:6097
double leftInterval
Definition: vraysdk.hpp:6104
std::vector< SubFileInfo > subFileInfos
A list of files to split the scene into, based on plugin type. See SubFileInfo struct comments.
Definition: vraysdk.hpp:6111
bool hexArrays
data arrays will be encoded in hex
Definition: vraysdk.hpp:6091
int vrfilesComputeHashes
True if MD5 and SHA256 hashes should be computed and written in the .vrfiles file for each resolved a...
Definition: vraysdk.hpp:6134
int vrfilesExport
Enable or disable vrfiles file writing.
Definition: vraysdk.hpp:6130
std::string hostAppString
An optional string identifying the host application, version, etc.
Definition: vraysdk.hpp:6120
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:6125
bool currentFrameOnly
if true only the current keyframe is exported, otherwise the whole timeline
Definition: vraysdk.hpp:6096
bool vrdataExport
Enable or disable vrdata file writing.
Definition: vraysdk.hpp:6123
int vrdataFileSizeLimitMiB
Limit the size of the vrdata file. If this limit is reached another file is started.
Definition: vraysdk.hpp:6127
Definition: vraysdk.hpp:780
unsigned fillerBytes
Force the alpha channel to the given value in the [0, 255] range. Forces BGRA/RGBA format....
Definition: vraysdk.hpp:798
unsigned flags
The byte offset between the beginning of two consecutive rows of the output bitmap (optional,...
Definition: vraysdk.hpp:796
int dstHeight
The width of the target bitmap in pixels (mandatory).
Definition: vraysdk.hpp:792
int x
The height of the target bitmap in pixels (mandatory).
Definition: vraysdk.hpp:793
int alphaValue
A combination of enum Flags.
Definition: vraysdk.hpp:797
int dstStride
Y coordinate at which to draw the source image. If x==INT_MIN and y==INT_MIN, the image will be cente...
Definition: vraysdk.hpp:795
int y
X coordinate at which to draw the source image. If x==INT_MIN and y==INT_MIN, the image will be cente...
Definition: vraysdk.hpp:794
Flags
Definition: vraysdk.hpp:781
@ USE_FILLER_BYTES
0 - BGR/RGB (bytes_per_pixel = 3), 1 - BGRA/RGBA (bytes_per_pixel = 4).
Definition: vraysdk.hpp:785
@ REVERSE_Y
0 - BGR(A) order, 1 - RGB(A) order.
Definition: vraysdk.hpp:783
@ PRESERVE_ALPHA
0 - fill top-bottom bitmap, 1 - fill bottom-top bitmap.
Definition: vraysdk.hpp:784
DrawMode mode
the parts of the target bitmap outside of the drawn region if USE_FILLER_BYTES is set.
Definition: vraysdk.hpp:800
int dstWidth
The address of the memory buffer / target bitmap to write into (mandatory).
Definition: vraysdk.hpp:791
Definition: vraysdk.hpp:564
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.
static VRayImage * createFromIntList(const IntList &buffer, IntList_DataType dataType, int width, int height)
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)
DrawMode
Definition: vraysdk.hpp:690
@ DRAW_MODE_BLEND_FAST
Alpha-blend using only the source image alpha but keep the original destination image alpha unchanged...
Definition: vraysdk.hpp:692
@ DRAW_MODE_COPY
Overwrite destination image pixels with the source image pixels.
Definition: vraysdk.hpp:691
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:621
@ rgba_float
8-bit int BGRA
Definition: vraysdk.hpp:623
@ bgr_byte
16-bit unsigned int RGBA
Definition: vraysdk.hpp:625
@ rgba_16bit
32-bit float RGBA (sRGB or gamma won't be applied automatically)
Definition: vraysdk.hpp:624
@ rgba_float16
8-bit int BGR
Definition: vraysdk.hpp:626
bool setGamma(float gamma)
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...
size_t drawToBitmap(const DrawToBitmapParams &params) const
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:4070
std::string outputDirectory
The directory where the profiler reports will be created. If nullptr is passed, temp directory is use...
Definition: vraysdk.hpp:4087
std::string productName
Name of the host product.
Definition: vraysdk.hpp:4089
FileType
Definition: vraysdk.hpp:4080
@ FileType_JSON
This is the raw profiler output, which is passed when an HTML file could not be generated.
Definition: vraysdk.hpp:4082
@ FileType_HTML
An html output file. Needs a valid htmlTemplatePath or valid installation of the default path.
Definition: vraysdk.hpp:4081
int maxDepth
The maximum ray bounces that will be profiled. Range [1, 8].
Definition: vraysdk.hpp:4086
Mode
Definition: vraysdk.hpp:4071
@ 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:4088
Mode mode
Specifies the operational mode of the Profiler.
Definition: vraysdk.hpp:4085
std::string productVersion
Version of the host product.
Definition: vraysdk.hpp:4090
std::string sceneName
Name of the scene that will be profiled. Used as a suffix to the generated filename.
Definition: vraysdk.hpp:4091
Definition: vraysdk.hpp:8090
Definition: vraysdk.hpp:8100
Definition: vraysdk.hpp:8114
Definition of one changed property for LiveLink scene updates.
Definition: vraysdk.hpp:8076
Definition: vraysdk.hpp:9640
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:918
float lengthSqr(const Vector &a) noexcept
Definition: vraysdk.hpp:1205
Vector & makeZero(void) noexcept
Sets the components of the vector.
Definition: vraysdk.hpp:947
Vector & makeNormalized(void) noexcept
Makes this vector a unit vector.
Definition: vraysdk.hpp:953
float length(const Vector &a) noexcept
Definition: vraysdk.hpp:1199
Vector & set(T1 x_, T2 y_, T3 z_) noexcept
Sets the components of the vector.
Definition: vraysdk.hpp:941
Vector rotate(const Vector &v, const Vector &axis) noexcept
Definition: vraysdk.hpp:1224
bool makeNormalized0(void)
Makes this vector a unit vector. Returns true if the vector is normalized successfully,...
Definition: vraysdk.hpp:963
float length(void) const noexcept
Returns the length of the vector.
Definition: vraysdk.hpp:1040
float & operator[](const int index) noexcept
Returns the i-th component (0 for x, 1 for y, 2 for z)
Definition: vraysdk.hpp:1030
Vector & operator-=(const Vector &other) noexcept
Subtracts the components of the given vector.
Definition: vraysdk.hpp:983
double mixed(const Vector &a, const Vector &b, const Vector &c) noexcept
Definition: vraysdk.hpp:1184
Vector mul(const Vector &a, const Vector &b) noexcept
Definition: vraysdk.hpp:1155
Vector & operator*=(int factor) noexcept
Multiplies all components by the given number.
Definition: vraysdk.hpp:989
Vector normalize(const Vector &a) noexcept
Definition: vraysdk.hpp:1193
Vector & operator/=(int divisor) noexcept
Divides all components by the given number.
Definition: vraysdk.hpp:1007
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:1025
float lengthSqr(void) const noexcept
Returns the squared length of the vector.
Definition: vraysdk.hpp:1045
Vector & operator+=(const Vector &other) noexcept
Adds the components of the given vector.
Definition: vraysdk.hpp:977
The information about a voxel.
Definition: vraysdk.hpp:3147
Color wireColor
the diffuse (wire) color of the voxel
Definition: vraysdk.hpp:3148
Bool smoothed
true, if the voxel should be rendered with smoothed normals
Definition: vraysdk.hpp:3149
Bool flipNormals
true, if the geometric normals should be flipped
Definition: vraysdk.hpp:3150
bool multipleFiles
unused
Definition: vraysdk.hpp:882
bool multiChannel
create a single multi-channel file if the file format supports it
Definition: vraysdk.hpp:890
bool velocityZeroBased
unused
Definition: vraysdk.hpp:889
bool skipRGB
do not write the RGB channel into a separate file
Definition: vraysdk.hpp:887
bool frameNumber
the current frame number will be appended to the file name(s)
Definition: vraysdk.hpp:884
bool applyColorCorrections
bake the VFB corrections to the output file
Definition: vraysdk.hpp:891
bool writeExifData
add all the available EXIF data to the written image, if the type supports it
Definition: vraysdk.hpp:892
bool noAlpha
do not write the alpha channel together with the color data
Definition: vraysdk.hpp:885
bool singleChannel
only a single channel is written to the file (the current one in vfb)
Definition: vraysdk.hpp:886
bool skipAlpha
do not write the alpha channel into a separate file
Definition: vraysdk.hpp:883
bool writeIntegerIDs
write to EXR as integer data
Definition: vraysdk.hpp:888
Definition: vraysdk.hpp:3732
static double None()
The None value (double) of the TiMe union In case used in Plugin::setValue(), the given plugin proper...
Definition: vraysdk.hpp:3751
TiMe(double time)
Constructs a TiMe object from a given time (double)
Definition: vraysdk.hpp:3741
static double Default()
Definition: vraysdk.hpp:3747
TiMe()
Default constructor.
Definition: vraysdk.hpp:3739
Definition: vraysdk.hpp:3901