forked from prman-pixar/RenderManForBlender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
properties.py
2548 lines (2197 loc) · 104 KB
/
properties.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ##### BEGIN MIT LICENSE BLOCK #####
#
# Copyright (c) 2015 Brian Savery
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#
# ##### END MIT LICENSE BLOCK #####
import bpy
import os
import sys
import xml.etree.ElementTree as ET
import time
from mathutils import Vector
from .util import guess_rmantree
from .util import args_files_in_path
from .shader_parameters import class_generate_properties
from bpy.props import PointerProperty, StringProperty, BoolProperty, \
EnumProperty, IntProperty, FloatProperty, FloatVectorProperty, \
CollectionProperty, BoolVectorProperty
from . import engine
from bpy.app.handlers import persistent
integrator_names = []
projection_names = [('none', 'None', 'None')]
class RendermanCameraSettings(bpy.types.PropertyGroup):
bl_label = "Renderman Camera Settings"
bl_idname = 'RendermanCameraSettings'
def get_projection_name(self):
return self.projection_type.replace('_settings', '')
def get_projection_node(self):
return getattr(self, self.projection_type + '_settings')
projection_type = EnumProperty(
items=projection_names, name='Projection Plugin')
use_physical_camera = BoolProperty(
name="Use Physical Camera", default=False)
fstop = FloatProperty(
name="F-Stop",
description="Aperture size for depth of field. Decreasing this value increases the blur on out of focus areas",
default=4.0)
dof_aspect = FloatProperty(
name="DOF Aspect", default=1, max=2, min=0,
description="The ratio of blur in the 'x' and 'y' directions. Changing this value from the default will simulate anamorphic lens bokeh effects. Values less than 1 elongate the blur on the 'y' axis. Values greater than 1 elongate the blur on the 'x' axis")
aperture_sides = IntProperty(
name="Aperture Blades", default=0, min=0,
description="The number of sides of the aperture. If this value is less than 3 the aperture will appear circular")
aperture_angle = FloatProperty(
name="Aperture Angle", default=0.0, max=180.0, min=-180.0,
description="The aperture polygon's orientation, in degrees from some arbitrary reference direction. (A value of 0 aligns a vertex horizontally with the center of the aperture.)")
aperture_roundness = FloatProperty(
name="Aperture Roundness", default=0.0, max=1.0, min=-1.0,
description="A shape parameter, from -1 to 1. When 0, the aperture is a regular polygon with straight sides. Values between 0 and 1 give polygons with curved edges bowed out and values between 0 and -1 make the edges bow in")
aperture_density = FloatProperty(
name="Aperture Density", default=0.0, max=1.0, min=-1.0,
description="The slope, between -1 and 1, of the (linearly varying) aperture density. A value of zero gives uniform density. Negative values make the aperture brighter near the center. Positive values make it brighter near the rim")
# Blender data
# --------------------------
class RendermanPath(bpy.types.PropertyGroup):
name = StringProperty(
name="", subtype='DIR_PATH')
class RendermanInlineRIB(bpy.types.PropertyGroup):
name = StringProperty(name="Text Block")
class RendermanGroup(bpy.types.PropertyGroup):
name = StringProperty(name="Group Name")
members = CollectionProperty(type=bpy.types.PropertyGroup,
name='Group Members')
members_index = IntProperty(min=-1, default=-1)
class LightLinking(bpy.types.PropertyGroup):
def update_link(self, context):
if engine.is_ipr_running():
engine.ipr.update_light_link(context, self)
illuminate = EnumProperty(
name="Illuminate",
update=update_link,
items=[('DEFAULT', 'Default', ''),
('ON', 'On', ''),
('OFF', 'Off', '')])
class RendermanAOV(bpy.types.PropertyGroup):
def aov_list(self, context):
items = [
# Basic lpe
("", "Basic LPE's", "Basic LPE's", "", 0),
("color rgba", "rgba", "Combined (beauty)", "", 1),
("color lpe:C<.D%G><L.%LG>", "Diffuse", "Diffuse", "", 2),
("color lpe:(C<RD%G>[DS]+<L.%LG>)|(C<RD%G>[DS]*O)",
"IndirectDiffuse", "IndirectDiffuse", "", 3),
("color lpe:C<.S%G><L.%LG>", "Specular", "Specular", "", 4),
("color lpe:(C<RS%G>[DS]+<L.%LG>)|(C<RS%G>[DS]*O)",
"IndirectSpecular", "IndirectSpecular", "", 5),
("color lpe:(C<TD%G>[DS]+<L.%LG>)|(C<TD%G>[DS]*O)",
"Subsurface", "Subsurface", "", 6),
("color lpe:C<RS%G>([DS]+<L.%LG>)|([DS]*O)",
"Reflection", "Reflection", "", 7),
("color lpe:(C<T[S]%G>[DS]+<L.%LG>)|(C<T[S]%G>[DS]*O)",
"Refraction", "Refraction", "", 8),
("color lpe:emission", "Emission", "Emission", "", 9),
("color lpe:shadows;C[<.D%G><.S%G>]<L.%LG>",
"Shadows", "Shadows", "", 10),
("color lpe:nothruput;noinfinitecheck;noclamp;unoccluded;overwrite;C(U2L)|O",
"Albedo", "Albedo", "", 11),
("color lpe:C<.D%G>[S]+<L.%LG>",
"Caustics", "Caustics", "", 12),
# Matte ID
("", "Matte ID's", "Matte ID's", "", 0),
("color MatteID0", "MatteID0", "MatteID0", "", 13),
("color MatteID1", "MatteID1", "MatteID1", "", 14),
("color MatteID2", "MatteID2", "MatteID2", "", 15),
("color MatteID3", "MatteID3", "MatteID3", "", 16),
("color MatteID4", "MatteID4", "MatteID4", "", 17),
("color MatteID5", "MatteID5", "MatteID5", "", 18),
("color MatteID6", "MatteID6", "MatteID6", "", 19),
("color MatteID7", "MatteID7", "MatteID7", "", 20),
# PxrSurface lpe
("", "PxrSurface lobe LPE's", "PxrSurface lobe LPE's", "", 0),
("color lpe:C<.D2%G>[<L.%LG>O]",
"directDiffuseLobe", "", "", 22),
("color lpe:C<.D2%G>[DS]+[<L.%LG>O]",
"indirectDiffuseLobe", "", "", 23),
("color lpe:C<.D3%G>[DS]*[<L.%LG>O]",
"subsurfaceLobe", "", "", 24),
("color lpe:C<.S2%G>[<L.%LG>O]",
"directSpecularPrimaryLobe", "", "", 25),
("color lpe:C<.S2%G>[DS]+[<L.%LG>O]",
"indirectSpecularPrimaryLobe", "", "", 26),
("color lpe:C<.S3%G>[<L.%LG>O]",
"directSpecularRoughLobe", "", "", 27),
("color lpe:C<.S3%G>[DS]+[<L.%LG>O]",
"indirectSpecularRoughLobe", "", "", 28),
("color lpe:C<.S4%G>[<L.%LG>O]",
"directSpecularClearcoatLobe", "", "", 29),
("color lpe:C<.S4%G>[DS]+[<L.%LG>O]",
"indirectSpecularClearcoatLobe", "", "", 30),
("color lpe:C<.S5%G>[<L.%LG>O]",
"directSpecularIridescenceLobe", "", "", 31),
("color lpe:C<.S5%G>[DS]+[<L.%LG>O]",
"indirectSpecularIridescenceLobe", "", "", 32),
("color lpe:C<.S6%G>[<L.%LG>O]",
"directSpecularFuzzLobe", "", "", 33),
("color lpe:C<.S6%G>[DS]+[<L.%LG>O]",
"indirectSpecularFuzzLobe", "", "", 34),
("color lpe:C<.S7%G>[DS]*[<L.%LG>O]",
"transmissiveSingleScatterLobe", "", "", 35),
("color lpe:C<RS8%G>[<L.%LG>O]",
"directSpecularGlassLobe", "", "", 36),
("color lpe:C<RS8%G>[DS]+[<L.%LG>O]",
"indirectSpecularGlassLobe", "", "", 37),
("color lpe:C<TS8%G>[DS]*[<L.%LG>O]",
"transmissiveGlassLobe", "", "", 38),
# Data AOV's
("", "Data AOV's", "Data AOV's", "", 0),
("float a", "alpha", "", "", 39),
("float id", "id", "Returns the integer assigned via the 'identifier' attribute as the pixel value", "", 40),
("float z", "z_depth", "Depth from the camera in world space", "", 41),
("float zback", "z_back",
"Depth at the back of volumetric objects in world space", "", 42),
("point P", "P", "Position of the point hit by the incident ray", "", 43),
("float PRadius", "PRadius",
"Cross-sectional size of the ray at the hit point", "", 44),
("float cpuTime", "cpuTime",
"The time taken to render a pixel", "", 45),
("float sampleCount", "sampleCount",
"The number of samples taken for the resulting pixel", "", 46),
("normal Nn", "Nn", "Normalized shading normal", "", 47),
("normal Ngn", "Ngn", "Normalized geometric normal", "", 48),
("vector Tn", "Tn", "Normalized shading tangent", "", 49),
("vector Vn", "Vn",
"Normalized view vector (reverse of ray direction)", "", 50),
("float VLen", "VLen", "Distance to hit point along the ray", "", 51),
("float curvature", "curvature", "Local surface curvature", "", 52),
("float incidentRaySpread", "incidentRaySpread",
"Rate of spread of incident ray", "", 53),
("float mpSize", "mpSize",
"Size of the micropolygon that the ray hit", "", 54),
("float u", "u", "The parametric coordinates on the primitive", "", 55),
("float v", "v", "The parametric coordinates on the primitive", "", 56),
("float w", "w", "The parametric coordinates on the primitive", "", 57),
("float du", "du",
"Derivatives of u, v, and w to adjacent micropolygons", "", 58),
("float dv", "dv",
"Derivatives of u, v, and w to adjacent micropolygons", "", 59),
("float dw", "dw",
"Derivatives of u, v, and w to adjacent micropolygons", "", 60),
("vector dPdu", "dPdu",
"Direction of maximal change in u, v, and w", "", 61),
("vector dPdv", "dPdv",
"Direction of maximal change in u, v, and w", "", 62),
("vector dPdw", "dPdw",
"Direction of maximal change in u, v, and w", "", 63),
("float dufp", "dufp",
"Multiplier to dPdu, dPdv, dPdw for ray differentials", "", 64),
("float dvfp", "dvfp",
"Multiplier to dPdu, dPdv, dPdw for ray differentials", "", 65),
("float dwfp", "dwfp",
"Multiplier to dPdu, dPdv, dPdw for ray differentials", "", 66),
("float time", "time", "Time sample of the ray", "", 67),
("vector dPdtime", "dPdtime", "Motion vector", "", 68),
("float id", "id", "Returns the integer assigned via the identifier attribute as the pixel value", "", 69),
("float outsideIOR", "outsideIOR",
"Index of refraction outside this surface", "", 70),
("point __Pworld", "Pworld", "P in world-space", "", 71),
("normal __Nworld", "Nworld", "Nn in world-space", "", 72),
("float __depth", "depth", "Multi-purpose AOV\nr : depth from camera in world-space\ng : height in world-space\nb : geometric facing ratio : abs(Nn.V)", "", 73),
("float[2] __st", "st", "Texture coords", "", 74),
("point __Pref", "Pref",
"Reference Position primvar (if available)", "", 75),
("normal __Nref", "Nref",
"Reference Normal primvar (if available)", "", 76),
("point __WPref", "WPref",
"Reference World Position primvar (if available)", "", 77),
("normal __WNref", "WNref",
"Reference World Normal primvar (if available)", "", 78),
# Custom lpe
("", "Custom", "Custom", "", 0),
("color custom_lpe", "Custom LPE", "Custom LPE", "", 79)
]
return items
def update_type(self, context):
types = self.aov_list(context)
for item in types:
if self.aov_name == item[0]:
self.name = item[1]
self.channel_name = item[1]
show_advanced = BoolProperty(name='Advanced Options', default=False)
name = StringProperty(name='Channel Name')
channel_name = StringProperty()
aov_name = EnumProperty(name="AOV Type",
description="",
items=aov_list, update=update_type)
custom_lpe_string = StringProperty(
name="lpe String",
description="This is where you enter the custom lpe string")
stats_type = EnumProperty(
name="Statistics",
description="this is the name of the statistics to display in this AOV (if any)",
items=[
('none', 'None', ''),
('variance', 'Variance',
'estimates the variance of the samples in each pixel'),
('mse', 'MSE', 'the estimate of the variance divided by the actual number of samples per pixel'),
('even', 'Even', 'this image is created from half the total camera samples'),
('odd', 'Odd', 'this image is created from the other half of the camera samples')],
default='none')
exposure_gain = FloatProperty(
name="Gain",
description="The gain of the exposure. This is the overall brightness of the image",
default=1.0)
exposure_gamma = FloatProperty(
name="Gamma",
description="The gamma of the exposure. This determines how flat the brightness curve is. Raising gamma leads to lighter shadows",
default=1.0)
remap_a = FloatProperty(
name="a",
description="A value for remap",
default=0.0)
remap_b = FloatProperty(
name="b",
description="B value for remap",
default=0.0)
remap_c = FloatProperty(
name="c",
description="C value for remap",
default=0.0)
quantize_zero = IntProperty(
name="Zero",
description="Zero value for quantization",
default=0)
quantize_one = IntProperty(
name="One",
description="One value for quantization",
default=0)
quantize_min = IntProperty(
name="Min",
description="Minimum value for quantization",
default=0)
quantize_max = IntProperty(
name="Max",
description="Max value for quantization",
default=0)
aov_pixelfilter = EnumProperty(
name="Pixel Filter",
description="Filter to use to combine pixel samples. If 'default' is selected the aov will use the filter set in the render panel",
items=[('default', 'Default', ''),
('box', 'Box', ''),
('sinc', 'Sinc', ''),
('gaussian', 'Gaussian', ''),
('triangle', 'Triangle', ''),
('catmull-rom', 'Catmull-Rom', '')],
default='default')
aov_pixelfilter_x = IntProperty(
name="Filter Size X",
description="Size of the pixel filter in X dimension",
min=0, max=16, default=2)
aov_pixelfilter_y = IntProperty(
name="Filter Size Y",
description="Size of the pixel filter in Y dimension",
min=0, max=16, default=2)
class RendermanRenderLayerSettings(bpy.types.PropertyGroup):
render_layer = StringProperty()
custom_aovs = CollectionProperty(type=RendermanAOV,
name='Custom AOVs')
custom_aov_index = IntProperty(min=-1, default=-1)
camera = StringProperty()
object_group = StringProperty(name='Object Group')
light_group = StringProperty(name='Light Group')
export_multilayer = BoolProperty(
name="Export Multilayer",
description="Enabling this will combine passes and output as a multilayer file",
default=False)
exr_format_options = EnumProperty(
name="EXR Bit Depth",
description="Sets the bit depth of the .exr file. Leaving at 'default' will use the Renderman defaults",
items=[
('default', 'Default', ''),
('half', 'Half (16 bit)', ''),
('float', 'Float (32 bit)', '')],
default='default')
use_deep = BoolProperty(
name="Use Deep Data",
description="The output file will contain extra 'deep' information that can aid with compositing. This can increase file sizes dramatically. Z channels will automatically be generated so they do not need to be added to the AOV panel",
default=False)
exr_compression = EnumProperty(
name="EXR Compression",
description="Determined the compression used on the EXR file. Leaving at 'default' will use the Renderman defaults",
items=[
('default', 'Default', ''),
('none', 'None', ''),
('rle', 'rle', ''),
('zip', 'zip', ''),
('zips', 'zips', ''),
('pixar', 'pixar', ''),
('b44', 'b44', ''),
('piz', 'piz', '')],
default='default')
exr_storage = EnumProperty(
name="EXR Storage Mode",
description="This determines how the EXR file is formatted. Tile-based may reduce the amount of memory used by the display buffer",
items=[
('scanline', 'Scanline Storage', ''),
('tiled', 'Tiled Storage', '')],
default='scanline')
displayfilter_names = []
class RendermanDisplayFilterSettings(bpy.types.PropertyGroup):
def get_filter_name(self):
return self.filter_type.replace('_settings', '')
def get_filter_node(self):
return getattr(self, self.filter_type + '_settings')
filter_type = EnumProperty(items=displayfilter_names, name='Filter')
samplefilter_names = []
class RendermanSampleFilterSettings(bpy.types.PropertyGroup):
def get_filter_name(self):
return self.filter_type.replace('_settings', '')
def get_filter_node(self):
return getattr(self, self.filter_type + '_settings')
filter_type = EnumProperty(items=samplefilter_names, name='Filter')
class RendermanSceneSettings(bpy.types.PropertyGroup):
display_filters = CollectionProperty(
type=RendermanDisplayFilterSettings, name='Display Filters')
display_filters_index = IntProperty(min=-1, default=-1)
sample_filters = CollectionProperty(
type=RendermanSampleFilterSettings, name='Sample Filters')
sample_filters_index = IntProperty(min=-1, default=-1)
light_groups = CollectionProperty(type=RendermanGroup,
name='Light Groups')
light_groups_index = IntProperty(min=-1, default=-1)
ll = CollectionProperty(type=LightLinking,
name='Light Links')
# we need these in case object/light selector changes
def reset_ll_light_index(self, context):
self.ll_light_index = -1
def reset_ll_object_index(self, context):
self.ll_object_index = -1
ll_light_index = IntProperty(min=-1, default=-1)
ll_object_index = IntProperty(min=-1, default=-1)
ll_light_type = EnumProperty(
name="Select by",
description="Select by",
items=[('light', 'Lights', ''),
('group', 'Light Groups', '')],
default='group', update=reset_ll_light_index)
ll_object_type = EnumProperty(
name="Select by",
description="Select by",
items=[('object', 'Objects', ''),
('group', 'Object Groups', '')],
default='group', update=reset_ll_object_index)
render_layers = CollectionProperty(type=RendermanRenderLayerSettings,
name='Custom AOVs')
solo_light = BoolProperty(name="Solo Light", default=False)
pixelsamples_x = IntProperty(
name="Pixel Samples X",
description="Number of AA samples to take in X dimension",
min=0, max=16, default=2)
pixelsamples_y = IntProperty(
name="Pixel Samples Y",
description="Number of AA samples to take in Y dimension",
min=0, max=16, default=2)
pixelfilter = EnumProperty(
name="Pixel Filter",
description="Filter to use to combine pixel samples",
items=[('box', 'Box', ''),
('sinc', 'Sinc', ''),
('gaussian', 'Gaussian', ''),
('triangle', 'Triangle', ''),
('catmull-rom', 'Catmull-Rom', '')],
default='gaussian')
pixelfilter_x = IntProperty(
name="Filter Size X",
description="Size of the pixel filter in X dimension",
min=0, max=16, default=2)
pixelfilter_y = IntProperty(
name="Filter Size Y",
description="Size of the pixel filter in Y dimension",
min=0, max=16, default=2)
pixel_variance = FloatProperty(
name="Pixel Variance",
description="If a pixel changes by less than this amount when updated, it will not receive further samples in adaptive mode. Lower values lead to increased render times and higher quality images",
min=0, max=1, default=.01)
dark_falloff = FloatProperty(
name="Dark Falloff",
description="Deprioritizes adaptive sampling in dark areas. Raising this can potentially reduce render times but may increase noise in dark areas",
min=0, max=1, default=.025)
min_samples = IntProperty(
name="Min Samples",
description="The minimum number of camera samples per pixel. If this is set to '0' then the min samples will be the square root of the max_samples",
min=0, default=4)
max_samples = IntProperty(
name="Max Samples",
description="The maximum number of camera samples per pixel. This should be set in 'power of two' numbers (1, 2, 4, 8, 16, etc)",
min=0, default=128)
bucket_shape = EnumProperty(
name="Bucket Order",
description="The order buckets are rendered in",
items=[('HORIZONTAL', 'Horizontal', 'Render scanline from top to bottom'),
('VERTICAL', 'Vertical',
'Render scanline from left to right'),
('ZIGZAG-X', 'Reverse Horizontal',
'Exactly the same as Horizontal but reverses after each scan'),
('ZIGZAG-Y', 'Reverse Vertical',
'Exactly the same as Vertical but reverses after each scan'),
('SPACEFILL', 'Hilber spacefilling curve',
'Renders the buckets along a hilbert spacefilling curve'),
('SPIRAL', 'Spiral rendering',
'Renders in a spiral from the center of the image or a custom defined point'),
('RANDOM', 'Random', 'Renders buckets in a random order WARNING: Inefficient memory footprint')],
default='SPIRAL')
bucket_sprial_x = IntProperty(
name="X",
description="X coordinate of bucket spiral start",
min=-1, default=-1)
bucket_sprial_y = IntProperty(
name="Y",
description="Y coordinate of bucket spiral start",
min=-1, default=-1)
render_selected_objects_only = BoolProperty(
name="Only Render Selected",
description="Render only the selected object(s)",
default=False)
shadingrate = FloatProperty(
name="Micropolygon Length",
description="Default maximum distance between displacement samples. This can be left at 1 unless you need more detail on displaced objects",
default=1.0)
dicing_strategy = EnumProperty(
name="Dicing Strategy",
description="Sets the method that PRMan uses to tessellate objects. Spherical may help with volume rendering",
items=[
("planarprojection", "Planar Projection", "Tessellates using the screen space coordinates of a primitive projected onto a plane"),
("sphericalprojection", "Spherical Projection", "Tessellates using the coordinates of a primitive projected onto a sphere"),
("worlddistance", "World Distance", "Tessellation is determined using distances measured in world space units compared to the current micropolygon length")],
default="sphericalprojection")
worlddistancelength = FloatProperty(
name="World Distance Length",
description="If this is a value above 0, it sets the length of a micropolygon after tessellation",
default=-1.0)
instanceworlddistancelength = FloatProperty(
name="Instance World Distance Length",
description="Set the length of a micropolygon for tessellated instanced meshes",
default=1e30)
motion_blur = BoolProperty(
name="Motion Blur",
description="Enable motion blur",
default=False)
sample_motion_blur = BoolProperty(
name="Sample Motion Blur",
description="Determines if motion blur is rendered in the final image. If this is disabled the motion vectors are still calculated and can be exported with the dPdTime AOV. This allows motion blur to be added as a post process effect",
default=True)
motion_segments = IntProperty(
name="Motion Samples",
description="Number of motion samples to take for motion blur. Set this higher if you notice segment artifacts in blurs",
min=2, max=16, default=2)
shutter_timing = EnumProperty(
name="Shutter Timing",
description="Controls when the shutter opens for a given frame",
items=[('CENTER', 'Center on frame', 'Motion is centered on frame #.'),
('PRE', 'Pre frame', 'Motion ends on frame #'),
('POST', 'Post frame', 'Motion starts on frame #')],
default='CENTER')
shutter_angle = FloatProperty(
name="Shutter Angle",
description="Fraction of time that the shutter is open (360 is one full second). 180 is typical for North America 24fps cameras, 172.8 is typical in Europe",
default=180.0, min=0.0, max=360.0)
shutter_efficiency_open = FloatProperty(
name="Shutter open speed",
description="Shutter open efficiency - controls the speed of the shutter opening. 0 means instantaneous, > 0 is a gradual opening",
default=0.0)
shutter_efficiency_close = FloatProperty(
name="Shutter close speed",
description="Shutter close efficiency - controls the speed of the shutter closing. 1 means instantaneous, < 1 is a gradual closing",
default=1.0)
depth_of_field = BoolProperty(
name="Depth of Field",
description="Enable depth of field blur",
default=False)
threads = IntProperty(
name="Rendering Threads",
description="Number of processor threads to use. Note, 0 uses all cores, -1 uses all cores but one",
min=-32, max=32, default=-1)
max_trace_depth = IntProperty(
name="Max Trace Depth",
description="Maximum number of times a ray can bounce before the path is ended. Lower settings will render faster but may change lighting",
min=0, max=32, default=10)
max_specular_depth = IntProperty(
name="Max Specular Depth",
description="Maximum number of specular ray bounces",
min=0, max=32, default=4)
max_diffuse_depth = IntProperty(
name="Max Diffuse Depth",
description="Maximum number of diffuse ray bounces",
min=0, max=32, default=1)
use_statistics = BoolProperty(
name="Statistics",
description="Print statistics to stats.xml after render",
default=False)
editor_override = StringProperty(
name="Text Editor",
description="The editor to open RIB file in (Overrides system default!)",
default="")
statistics_level = IntProperty(
name="Statistics Level",
description="Verbosity level of output statistics",
min=0, max=3, default=1)
# RIB output properties
path_rib_output = StringProperty(
name="RIB Output Path",
description="Path to generated .rib files",
subtype='FILE_PATH',
default=os.path.join('$OUT', '{scene}.####.rib'))
path_object_archive_static = StringProperty(
name="Object archive RIB Output Path",
description="Path to generated rib file for a non-deforming objects' geometry",
subtype='FILE_PATH',
default=os.path.join('$ARC', 'static', '{object}.rib'))
path_object_archive_animated = StringProperty(
name="Object archive RIB Output Path",
description="Path to generated rib file for an animated objects geometry",
subtype='FILE_PATH',
default=os.path.join('$ARC', '####', '{object}.rib'))
path_texture_output = StringProperty(
name="Teture Output Path",
description="Path to generated .tex files",
subtype='FILE_PATH',
default=os.path.join('$OUT', 'textures'))
out_dir = StringProperty(
name="Shader Output Path",
description="Path to compiled .oso files",
subtype='FILE_PATH',
default="./shaders")
rib_format = EnumProperty(
name="RIB Format",
items=[
("ascii", "ASCII", ""),
("binary", "Binary", "")],
default="binary")
rib_compression = EnumProperty(
name="RIB Compression",
items=[
("none", "None", ""),
("gzip", "GZip", "")],
default="none")
texture_cache_size = IntProperty(
name="Texture Cache Size (MB)",
description="Maximum number of megabytes to devote to texture caching",
default=2048
)
geo_cache_size = IntProperty(
name="Tesselation Cache Size (MB)",
description="Maximum number of megabytes to devote to tesselation cache for tracing geometry",
default=2048
)
opacity_cache_size = IntProperty(
name="Opacity Cache Size (MB)",
description="Maximum number of megabytes to devote to caching opacity and presence values. 0 turns this off",
default=1000
)
output_action = EnumProperty(
name="Action",
description="Action to take when rendering",
items=[('EXPORT_RENDER', 'Export RIB and Render', 'Generate RIB file and render it with the renderer'),
('EXPORT', 'Export RIB Only', 'Generate RIB file only')],
default='EXPORT_RENDER')
lazy_rib_gen = BoolProperty(
name="Cache Rib Generation",
description="On unchanged objects, don't re-emit rib. Will result in faster spooling of renders",
default=True)
always_generate_textures = BoolProperty(
name="Always Recompile Textures",
description="Recompile used textures at export time to the current rib folder. Leave this unchecked to speed up re-render times",
default=False)
# preview settings
preview_pixel_variance = FloatProperty(
name="Preview Pixel Variance",
description="If a pixel changes by less than this amount when updated, it will not receive further samples in adaptive mode",
min=0, max=1, default=.05)
preview_bucket_order = EnumProperty(
name="Preview Bucket Order",
description="Bucket order to use when rendering",
items=[('HORIZONTAL', 'Horizontal', 'Render scanline from top to bottom'),
('VERTICAL', 'Vertical',
'Render scanline from left to right'),
('ZIGZAG-X', 'Reverse Horizontal',
'Exactly the same as Horizontal but reverses after each scan'),
('ZIGZAG-Y', 'Reverse Vertical',
'Exactly the same as Vertical but reverses after each scan'),
('SPACEFILL', 'Hilber spacefilling curve',
'Renders the buckets along a hilbert spacefilling curve'),
('SPIRAL', 'Spiral rendering',
'Renders in a spiral from the center of the image or a custom defined point'),
('RANDOM', 'Random', 'Renders buckets in a random order WARNING: Inefficient memory footprint')],
default='SPIRAL')
preview_min_samples = IntProperty(
name="Preview Min Samples",
description="The minimum number of camera samples per pixel. Setting this to '0' causes the min_samples to be set to the square root of max_samples",
min=0, default=0)
preview_max_samples = IntProperty(
name="Preview Max Samples",
description="The maximum number of camera samples per pixel. This should be set lower than the final render setting to imporove speed",
min=0, default=64)
preview_max_specular_depth = IntProperty(
name="Max Preview Specular Depth",
description="Maximum number of specular ray bounces",
min=0, max=32, default=2)
preview_max_diffuse_depth = IntProperty(
name="Max Preview Diffuse Depth",
description="Maximum number of diffuse ray bounces",
min=0, max=32, default=1)
enable_external_rendering = BoolProperty(
name="Enable External Rendering",
description="This will allow extended rendering modes, which allow batch rendering to PRMan outside of Blender",
default=False)
display_driver = EnumProperty(
name="Display Driver",
description="File Type for output pixels, 'it' will send to an external framebuffer",
items=[
('openexr', 'OpenEXR',
'Render to a OpenEXR file, to be read back into Blender\'s Render Result'),
('tiff', 'Tiff',
'Render to a TIFF file, to be read back into Blender\'s Render Result'),
('it', 'it', 'External framebuffer display (must have RMS installed)')
], default='it')
exr_format_options = EnumProperty(
name="Bit Depth",
description="Sets the bit depth of the main EXR file. Leaving at 'default' will use the Renderman defaults",
items=[
('default', 'Default', ''),
('half', 'Half (16 bit)', ''),
('float', 'Float (32 bit)', '')],
default='default')
exr_compression = EnumProperty(
name="Compression",
description="Determined the compression used on the main EXR file. Leaving at 'default' will use the Renderman defaults",
items=[
('default', 'Default', ''),
('none', 'None', ''),
('rle', 'rle', ''),
('zip', 'zip', ''),
('zips', 'zips', ''),
('pixar', 'pixar', ''),
('b44', 'b44', ''),
('piz', 'piz', '')],
default='default')
render_into = EnumProperty(
name="Render to",
description="Render to blender or external framebuffer",
items=[('blender', 'Blender', 'Render to the Image Editor'),
('it', 'it', 'External framebuffer display (must have RMS installed)')],
default='blender')
external_action = EnumProperty(
name="Action",
description="Action for rendering externally",
items=[('ribgen', 'Generate RIB only',
'Only Generate RIB and job file (no render)'),
('spool', 'Spool Job', 'Spool Job to queuing system')],
default='spool')
custom_alfname = StringProperty(
name="Custom Spool Name",
description="Allows a custom name for the spool .alf file. This would allow you to export multiple spool files for the same scene",
default='spool')
queuing_system = EnumProperty(
name="Spool to",
description="System to spool to",
items=[('lq', 'LocalQueue', 'LocalQueue, must have RMS installed'),
('tractor', 'tractor', 'Tractor, must have tractor setup')],
default='lq')
recover = BoolProperty(
name="Enable Recovery",
description="Attempt to resume render from a previous checkpoint (if possible)",
default=False)
custom_cmd = StringProperty(
name="Custom Render Commands",
description="Inserts a string of custom command arguments into the render process",
default='')
denoise_cmd = StringProperty(
name="Custom Denoise Commands",
description="Inserts a string of custom commands arguments into the denoising process, if selected",
default='')
spool_denoise_aov = BoolProperty(
name="Process denoisable AOV's",
description="Denoises tagged AOV's",
default=False)
denoise_gpu = BoolProperty(
name="Use GPU for denoising",
description="The denoiser will attempt to use the GPU (if available)",
default=True)
external_animation = BoolProperty(
name="Render Animation",
description="Spool Animation",
default=False)
enable_checkpoint = BoolProperty(
name="Enable Checkpointing",
description="Allows partial images to be output at specific intervals while the renderer continued to run. The user may also set a point at which the render will terminate",
default=False)
checkpoint_type = EnumProperty(
name="Checkpoint Method",
description="Sets the method that the checkpointing will use",
items=[('i', 'Iterations', 'Number of samples per pixel'),
('s', 'Seconds', ''),
('m', 'Minutes', ''),
('h', 'Hours', ''),
('d', 'Days', '')],
default='s')
checkpoint_interval = IntProperty(
name="Interval",
description="The interval between checkpoint images",
default=60)
render_limit = IntProperty(
name="Limit",
description="The maximum interval that will be reached before the render terminates. 0 will disable this option",
default=0)
asfinal = BoolProperty(
name="Final Image as Checkpoint",
description="Saves the final image as a checkpoint. This allows you to resume it after raising the sample count",
default=False)
header_rib_boxes = StringProperty(
name="External RIB File",
description="Injects an external RIB into the header of the output file",
subtype='FILE_PATH',
default="")
do_denoise = BoolProperty(
name="Denoise Post-Process",
description="Use PRMan's image denoiser to post process your render. This allows you to use a higher pixel variance (and therefore faster render) while still producing a high quality image",
default=False)
external_denoise = BoolProperty(
name="Denoise Post-Process",
description="Use PRMan's image denoiser to post process your render. This allows you to use a higher pixel variance (and therefore faster render) while still producing a high quality image",
default=False)
crossframe_denoise = BoolProperty(
name="Crossframe Denoise",
description="Only available when denoising an external render.\n This is more efficient especially with motion blur",
default=False)
update_frequency = IntProperty(
name="Update frequency",
description="Number of seconds between display update when rendering to Blender",
min=0, default=10)
import_images = BoolProperty(
name="Import AOV's into Blender",
description="Imports all AOV's from the render session into Blender's image editor",
default=True)
incremental = BoolProperty(
name="Incremental Render",
description="When enabled every pixel is sampled once per render pass. This allows the user to quickly see the entire image during rendering, and as each pass completes the image will become clearer. NOTE-This mode is automatically enabled with some render integrators (PxrVCM)",
default=True)
raytrace_progressive = BoolProperty(
name="Progressive Rendering",
description="Enables progressive rendering (the entire image is refined at once).\nThis is only visible with some display drivers (such as it)",
default=False)
integrator = EnumProperty(
name="Integrator",
description="Integrator for rendering",
items=integrator_names,
default='PxrPathTracer')
show_integrator_settings = BoolProperty(
name="Integration Settings",
description="Show Integrator Settings",
default=False
)
# Rib Box Properties
frame_rib_box = StringProperty(
name="Frame RIB box",
description="Injects RIB into the 'frame' block",
default="")
# Trace Sets (grouping membership)
object_groups = CollectionProperty(
type=RendermanGroup, name="Trace Sets")
object_groups_index = IntProperty(min=-1, default=-1)
use_default_paths = BoolProperty(
name="Use 3Delight default paths",
description="Includes paths for default shaders etc. from 3Delight install",
default=True)
use_builtin_paths = BoolProperty(
name="Use built in paths",
description="Includes paths for default shaders etc. from Blender->3Delight exporter",
default=False)
path_rmantree = StringProperty(
name="RMANTREE Path",
description="Path to RenderManProServer installation folder",
subtype='DIR_PATH',
default=guess_rmantree())
path_renderer = StringProperty(
name="Renderer Path",
description="Path to renderer executable",
subtype='FILE_PATH',
default="prman")
path_shader_compiler = StringProperty(
name="Shader Compiler Path",
description="Path to shader compiler executable",
subtype='FILE_PATH',
default="shader")
path_shader_info = StringProperty(
name="Shader Info Path",
description="Path to shaderinfo executable",
subtype='FILE_PATH',
default="sloinfo")
path_texture_optimiser = StringProperty(
name="Texture Optimiser Path",
description="Path to tdlmake executable",
subtype='FILE_PATH',
default="txmake")