-
Notifications
You must be signed in to change notification settings - Fork 147
/
properties.py
1433 lines (1206 loc) · 59.7 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) 2011 Matt Ebb
#
# 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
#from .properties_shader import RendermanCoshader, coshaderShaders
from .util import guess_3dl_path
from .shader_scan import shaders_in_path
from .shader_parameters import rna_type_initialise
from bpy.props import PointerProperty, StringProperty, BoolProperty, EnumProperty, \
IntProperty, FloatProperty, FloatVectorProperty, CollectionProperty
# Shader parameters storage
# --------------------------
def shader_list_items(self, context, shader_type):
defaults = [('null', 'None', ''), ('custom', 'Custom', '')]
return defaults + [ (s, s, '') for s in shaders_in_path(context.scene, context.material, shader_type=shader_type)]
def shader_list_update(self, context, shader_type):
# don't overwrite active when set to custom
if self.shader_list != "custom":
# For safety, we keep the active shader property separate as a string property,
# and update when chosen from the shader list
self.active = str(self.shader_list)
def shader_active_update(self, context, shader_type, location="material"):
# Also initialise shader parameters when chosen from the shader list
if location == 'world':
rm = context.world.renderman
elif location == 'lamp':
rm = context.lamp.renderman
else:
rm = context.material.renderman
rna_type_initialise(context.scene, rm, shader_type, True)
# and for coshaders
for coshader in rm.coshaders:
rna_type_initialise(context.scene, coshader, shader_type, True)
# BBM
class atmosphereShaders(bpy.types.PropertyGroup):
def atmosphere_shader_active_update(self, context):
shader_active_update(self, context, 'atmosphere')
active = StringProperty(
name="Active Atmosphere Shader",
description="Shader name to use for atmosphere",
default="")
def atmosphere_shader_list_items(self, context):
return shader_list_items(self, context, 'atmosphere')
def atmosphere_shader_list_update(self, context):
shader_list_update(self, context, 'atmosphere')
shader_list = EnumProperty(
name="Active atmosphere Shader",
description="Shader name to use for surface",
update=atmosphere_shader_list_update,
items=atmosphere_shader_list_items)
class displacementShaders(bpy.types.PropertyGroup):
def displacement_shader_active_update(self, context):
shader_active_update(self, context, 'displacement')
active = StringProperty(
name="Active Displacement Shader",
description="Shader name to use for displacement",
update=displacement_shader_active_update,
default="null")
def displacement_shader_list_items(self, context):
return shader_list_items(self, context, 'displacement')
def displacement_shader_list_update(self, context):
shader_list_update(self, context, 'displacement')
shader_list = EnumProperty(
name="Active Displacement Shader",
description="Shader name to use for surface",
update=displacement_shader_list_update,
items=displacement_shader_list_items)
class surfaceShaders(bpy.types.PropertyGroup):
def surface_shader_active_update(self, context):
shader_active_update(self, context, 'surface')
active = StringProperty(
name="Active Surface Shader",
description="Shader name to use for surface",
update=surface_shader_active_update,
default="null"
)
def surface_shader_list_items(self, context):
return shader_list_items(self, context, 'surface')
def surface_shader_list_update(self, context):
shader_list_update(self, context, 'surface')
shader_list = EnumProperty(
name="Active Surface Shader",
description="Shader name to use for surface",
update=surface_shader_list_update,
items=surface_shader_list_items
)
class interiorShaders(bpy.types.PropertyGroup):
def interior_shader_active_update(self, context):
shader_active_update(self, context, 'interior')
active = StringProperty(
name="Active Interior Shader",
description="Shader name to use for interior",
update=interior_shader_active_update,
default="null")
def interior_shader_list_items(self, context):
return shader_list_items(self, context, 'interior')
def interior_shader_list_update(self, context):
shader_list_update(self, context, 'interior')
shader_list = EnumProperty(
name="Active Interior Shader",
description="Shader name to use for surface",
update=interior_shader_list_update,
items=interior_shader_list_items)
#BBM modification begin
class lightShaders(bpy.types.PropertyGroup):
def light_shader_active_update(self, context):
shader_active_update(self, context, 'light')
active = StringProperty(
name="Active Light Shader",
description="Shader name to use for light",
default="")
def light_shader_list_items(self, context):
return shader_list_items(self, context, 'light')
def light_shader_list_update(self, context):
shader_list_update(self, context, 'light')
shader_list = EnumProperty(
name="Active Light",
description="Light shader",
update=light_shader_list_update,
items=light_shader_list_items
)
# Blender data
# --------------------------
context_items = [(i.identifier, i.name, "") for i in bpy.types.SpaceProperties.bl_rna.properties['context'].enum_items]
# hack! this is a bit of a hack in itself, but should really be in SpaceProperties.
# However, can't be added there, it's non-ID data.
bpy.types.WindowManager.prev_context = EnumProperty(
name="Previous Context",
description="Previous context viewed in properties editor",
items=context_items,
default=context_items[0][0])
class RendermanPath(bpy.types.PropertyGroup):
name = StringProperty(
name="", subtype='DIR_PATH')
class RendermanInlineRIB(bpy.types.PropertyGroup):
name = StringProperty( name="Text Block" )
class RendermanGrouping(bpy.types.PropertyGroup):
name = StringProperty( name="Group Name" )
class LightLinking(bpy.types.PropertyGroup):
def lights_list_items(self, context):
items = [('No light chosen','Choose a light','')]
for lamp in bpy.data.lamps:
items.append( (lamp.name,lamp.name,'') )
return items
def update_name( self, context ):
infostr = ('(Default)', '(Forced On)', '(Forced Off)')
valstr = ('DEFAULT', 'ON', 'OFF')
self.name = "%s %s" % (self.light, infostr[valstr.index(self.illuminate)])
light = StringProperty(
name="Light",
update=update_name )
illuminate = EnumProperty(
name="Illuminate",
update=update_name,
items=[ ('DEFAULT', 'Default', ''),
('ON', 'On', ''),
('OFF', 'Off', '')] )
class TraceSet(bpy.types.PropertyGroup):
def groups_list_items(self, context):
items = [('No group chosen','Choose a trace set','')]
for grp in context.scene.renderman.grouping_membership:
items.append( (grp.name,grp.name,'') )
return items
def update_name( self, context ):
self.name = self.mode +' '+ self.group
group = EnumProperty ( name="Group",
update=update_name,
items=groups_list_items
)
mode = EnumProperty( name="Include/Exclude",
update=update_name,
items=[ ('included in', 'Include', ''),
('excluded from', 'Exclude', '')]
)
# hmmm, re-evaluate this idea later...
class RendermanPass(bpy.types.PropertyGroup):
name = StringProperty(name="")
type = EnumProperty(name="Pass Type",
items=[
('SHADOW_MAPS_ALL', 'All Shadow Map', 'Single shadow map'),
('SHADOW_MAP', 'Shadow Map', 'Single shadow map'),
('POINTCLOUD', 'Point Cloud', '')],
default='SHADOW_MAPS_ALL')
motion_blur = BoolProperty(name="Motion Blur")
surface_shaders = BoolProperty(name="Surface Shaders", description="Render surface shaders")
displacement_shaders = BoolProperty(name="Displacement Shaders", description="Render displacement shaders")
atmosphere_shaders = BoolProperty(name="Atmosphere Shaders", description="Render atmosphere shaders")
light_shaders = BoolProperty(name="Light Shaders", description="Render light shaders")
class RendermanSceneSettings(bpy.types.PropertyGroup):
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', '')],
default='sinc')
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 X dimension",
min=0, max=16, default=2)
shadingrate = FloatProperty(
name="Shading Rate",
description="Maximum distance between shading samples (lower = more detailed shading)",
default=1.0)
motion_blur = BoolProperty(
name="Motion Blur",
description="Enable motion blur",
default=False)
motion_segments = IntProperty(
name="Motion Segments",
description="Number of motion segments to take for multi-segment motion blur",
min=1, max=16, default=1)
shutter_open = FloatProperty(
name="Shutter Open",
description="Shutter open time",
default=0.0)
shutter_close = FloatProperty(
name="Shutter Close",
description="Shutter close time",
default=1.0)
shutter_efficiency_open = FloatProperty(
name="Open Efficiency",
description="Shutter open efficiency - controls the shape of the shutter opening and closing for motion blur",
default=0.5)
shutter_efficiency_close = FloatProperty(
name="Close Efficiency",
description="Shutter close efficiency - controls the shape of the shutter opening and closing for motion blur",
default=0.5)
depth_of_field = BoolProperty(
name="Depth of Field",
description="Enable depth of field blur",
default=False)
fstop = FloatProperty(
name="F-Stop",
description="Aperture size for depth of field",
default=4.0)
threads = IntProperty(
name="Threads",
description="Number of processor threads to use",
min=1, max=32, default=2)
max_trace_depth = IntProperty(
name="Max Trace Depth",
description="Maximum number of ray bounces (0 disables ray tracing)",
min=0, max=32, default=4)
max_specular_depth = IntProperty(
name="Max Specular Depth",
description="Maximum number of specular ray bounces",
min=0, max=32, default=2)
max_diffuse_depth = IntProperty(
name="Max Diffuse Depth",
description="Maximum number of diffuse ray bounces",
min=0, max=32, default=2)
max_eye_splits = IntProperty(
name="Max Eye Splits",
description="Maximum number of times a primitive crossing the eye plane is split before being discarded",
min=0, max=32, default=6)
trace_approximation = FloatProperty(
name="Raytrace Approximation",
description="Threshold for using approximated geometry during ray tracing. Higher values use more approximated geometry.",
min=0.0, max=1024.0, default=10.0)
use_statistics = BoolProperty(
name="Statistics",
description="Print statistics to /tmp/stats.txt after render",
default=False)
statistics_level = IntProperty(
name="Statistics Level",
description="Verbosity level of output statistics",
min=0, max=3, default=1)
recompile_shaders = BoolProperty(
name="Recompile Shaders",
description="Recompile used shaders at export time to the current 3Delight version. Prevents version mismatch errors at the expense of export speed",
default=True)
# RIB output properties
path_rib_output = StringProperty(
name="RIB Output Path",
description="Path to generated .rib files",
subtype='FILE_PATH',
default="$OUT/{scene}.rib")
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')
'''
def display_driver_update(self, context):
if self.output_action = "custom":
# For safety, we keep the active shader property separate as a string property,
# and update when chosen from the shader list
self.active = str(self.shader_list)
'''
def display_driver_items(self, context):
if self.output_action == 'EXPORT_RENDER':
items = [('AUTO', 'Automatic', 'Render to a temporary file, to be read back into Blender\'s Render Result'),
('idisplay', 'idisplay', 'External 3Delight framebuffer display')]
elif self.output_action == 'EXPORT':
items = [('tiff', 'Tiff', '')]
#('openexr', 'OpenEXR', '')]
return items
display_driver = EnumProperty(
name="Display Driver",
description="Renderman display driver destination for output pixels",
items=display_driver_items)
path_display_driver_image = StringProperty(
name="Display Image",
description="Render output path to export as the Display in the RIB file. When later rendering the RIB file manually, this will be the raw render result directly from the renderer, and won't pass through blender's render pipeline",
subtype='FILE_PATH',
default="$OUT/renders/{scene}_####.tif")
# Hider properties
hider = EnumProperty(
name="Hider",
description="Algorithm to use for determining hidden surfaces",
items=[('hidden', 'Hidden', 'Default hidden surface method'),
('raytrace', 'Raytrace', 'Use ray tracing on the first hit'),
('photon', 'Photon', 'Generate a photon map')],
default='hidden')
hidden_depthfilter = EnumProperty(
name="Depth Filter",
description="Method used for determining sample depth",
items=[('min', 'Min', 'Minimum z value of all the sub samples in a given pixel'),
('max', 'Max', 'Maximum z value of all the sub samples in a given pixel'),
('average', 'Average', 'Average all sub samples’ z values in a given pixel'),
('midpoint', 'Midpoint', 'For each sub sample in a pixel, the renderer takes the average z value of the two closest surfaces')],
default='min')
hidden_jitter = BoolProperty(
name="Jitter",
description="Use a jittered grid for sampling",
default=True)
hidden_samplemotion = BoolProperty(
name="Sample Motion",
description="Disabling this will not render motion blur, but still preserve motion vector information (dPdtime)",
default=True)
hidden_extrememotiondof = BoolProperty(
name="Extreme Motion/DoF",
description="Use a more accurate, but slower algorithm to sample motion blur and depth of field effects. This is useful to fix artifacts caused by extreme amounts of motion or DoF",
default=False)
hidden_midpointratio = FloatProperty(
name="Midpoint Ratio",
description="Amount of blending between the z values of the first two samples when using the midpoint depth filter",
default=0.5)
hidden_maxvpdepth = IntProperty(
name="Max Visible Point Depth",
description="The number of visible points to be composited in the hider or included in deep shadow map creation. Putting a limit on the number of visible points can accelerate deep shadow map creation for depth-complex scenes. The default value of -1 means no limit",
min=-1, max=1024, default=-1)
raytrace_progressive = BoolProperty(
name="Progressive Rendering",
description="Enables progressive rendering. This is only visible with some display drivers (such as idisplay)",
default=False)
# Rib Box Properties
bty_inlinerib_texts = CollectionProperty(type=RendermanInlineRIB, name="Beauty-pass Inline RIB")
bty_inlinerib_index = IntProperty(min=-1, default=-1)
bak_inlinerib_texts = CollectionProperty(type=RendermanInlineRIB, name="Bake-pass Inline RIB")
bak_inlinerib_index = IntProperty(min=-1, default=-1)
# Trace Sets (grouping membership)
grouping_membership = CollectionProperty(type=RendermanGrouping, name="Trace Sets")
grouping_membership_index = IntProperty(min=-1, default=-1)
shader_paths = CollectionProperty(type=RendermanPath, name="Shader Paths")
shader_paths_index = IntProperty(min=-1, default=-1)
texture_paths = CollectionProperty(type=RendermanPath, name="Texture Paths")
texture_paths_index = IntProperty(min=-1, default=-1)
procedural_paths = CollectionProperty(type=RendermanPath, name="Procedural Paths")
procedural_paths_index = IntProperty(min=-1, default=-1)
archive_paths = CollectionProperty(type=RendermanPath, name="Archive Paths")
archive_paths_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=False)
use_builtin_paths = BoolProperty(
name="Use built in paths",
description="Includes paths for default shaders etc. from Blender->3Delight exporter",
default=True)
path_3delight = StringProperty(
name="3Delight Path",
description="Path to 3Delight installation folder",
subtype='DIR_PATH',
default=guess_3dl_path())
path_renderer = StringProperty(
name="Renderer Path",
description="Path to renderer executable",
subtype='FILE_PATH',
default="renderdl")
path_shader_compiler = StringProperty(
name="Shader Compiler Path",
description="Path to shader compiler executable",
subtype='FILE_PATH',
default="shaderdl")
path_shader_info = StringProperty(
name="Shader Info Path",
description="Path to shaderinfo executable",
subtype='FILE_PATH',
default="shaderinfo")
path_texture_optimiser = StringProperty(
name="Texture Optimiser Path",
description="Path to tdlmake executable",
subtype='FILE_PATH',
default="tdlmake")
render_passes = CollectionProperty(type=RendermanPass, name="Render Passes")
render_passes_index = IntProperty(min=-1, default=-1)
gi_primary_types = [
('gi_pointcloud', 'Point Cloud', ''),
('gi_raytrace', 'Ray Tracing', ''),
('gi_photon', 'Photon Map', '')
]
gi_secondary_types = [
('gi_photon', 'Photon Map', ''),
('none', 'None', '')
# XXX: multiple bounces ('gi_raytrace', 'Ray Tracing', '')
]
class GIPrimaryShaders(bpy.types.PropertyGroup):
active = EnumProperty(
name="Primary GI Method",
description="GI method for primary bounces",
items=gi_primary_types,
default=gi_primary_types[0][0])
class GISecondaryShaders(bpy.types.PropertyGroup):
active = EnumProperty(
name="Secondary GI Method",
description="GI method for secondary bounces",
items=gi_secondary_types,
default=gi_secondary_types[1][0])
class IntegratorShaders(bpy.types.PropertyGroup):
active = EnumProperty(
name="Integrator",
description="Integrator to use for light calculation",
items=[('integrator', 'Ray Tracing Integrator', '')],
default='integrator')
class RendermanGIPrimary(bpy.types.PropertyGroup):
light_shaders = PointerProperty(
type=GIPrimaryShaders, name="Primary GI Shader Settings")
class RendermanGISecondary(bpy.types.PropertyGroup):
light_shaders = PointerProperty(
type=GISecondaryShaders, name="Secondary GI Shader Settings")
class RendermanIntegrator(bpy.types.PropertyGroup):
surface_shaders = PointerProperty(
type=IntegratorShaders, name="Integrator Shader Settings")
# Photon Secondary bounce (render) properties
photon_count = IntProperty(
name="Photon Count",
description="Number of photons to emit",
default=10000)
photon_map_global = StringProperty(
name="Global Photon Map",
description="Name of gloabl photon map",
default="DefaultGlobal")
photon_map_caustic = StringProperty(
name="Global Caustic Map",
description="Name of gloabl caustics map",
default="DefaultCaustic")
ptc_generate_auto = BoolProperty(
name="Generate Point Cloud Automatically",
description="Generate a point cloud before each render, when point cloud global illumation is enabled",
default=True)
ptc_path = StringProperty(
name="Point Cloud Path",
description="Path to the temporary pointcloud file",
default="$PTC/{scene}.ptc",
subtype='FILE_PATH')
ptc_coordsys = StringProperty(
name="Point Cloud Coordinate system",
description="Coordinate system to bake the point cloud in",
default="world")
ptc_shadingrate = FloatProperty(
name="Point Cloud Shading Rate",
description="Controls the amount of fine detail in the baked point cloud",
default=6)
class RendermanWorldSettings(bpy.types.PropertyGroup):
atmosphere_shaders = PointerProperty(
type=atmosphereShaders, name="Atmosphere Shader Settings")
global_illumination = BoolProperty(
name="Global Illumination",
description="",
default=False)
gi_primary = PointerProperty(
type=RendermanGIPrimary, name="Primary GI Settings")
gi_secondary = PointerProperty(
type=RendermanGISecondary, name="Secondary GI Settings")
integrator = PointerProperty(
type=RendermanIntegrator, name="Integrator Settings")
# BBM addition begin
#coshaders = CollectionProperty(type=RendermanCoshader, name="World Co-Shaders")
#coshaders_index = IntProperty(min=-1, default=-1)
# BBM addition end
class RendermanMaterialSettings(bpy.types.PropertyGroup):
nodetree = StringProperty(
name="Node Tree",
description="Name of the shader node tree for this material",
default="")
surface_shaders = PointerProperty(
type=surfaceShaders,
name="Surface Shader Settings")
displacement_shaders = PointerProperty(
type=displacementShaders,
name="Displacement Shader Settings")
interior_shaders = PointerProperty(
type=interiorShaders,
name="Interior Shader Settings")
atmosphere_shaders = PointerProperty(
type=atmosphereShaders,
name="Atmosphere Shader Settings")
#coshaders = CollectionProperty(type=RendermanCoshader, name="Material Co-Shaders")
#coshaders_index = IntProperty(min=-1, default=-1)
displacementbound = FloatProperty(
name="Displacement Bound",
description="Maximum distance the displacement shader can displace vertices",
precision=4,
default=0.5)
photon_shadingmodel = EnumProperty(
name="Photon Shading Model",
description="How the object appears to photons",
items=[('matte', 'Matte', 'Diffuse reflection'),
('chrome', 'Chrome', 'Perfect specular reflection'),
('water', 'Water', 'Perfect specular transmission'),
('glass', 'Glass', 'Perfect specular reflection/transmission'),
('transparent', 'Transparent', 'Pass through photons without refraction')],
default='matte')
inherit_world_atmosphere = BoolProperty(
name="Inherit from World",
description="Override this material's atmosphere shader with the world atmosphere shader",
default=True)
preview_render_type = EnumProperty(
name="Preview Render Type",
description="Object to display in material preview",
items=[('SPHERE', 'Sphere', ''),
('CUBE', 'Cube', '')],
default='SPHERE')
preview_render_shadow = BoolProperty(
name="Display Shadow",
description="Render a raytraced shadow in the material preview",
default=True)
# SSS Baking properties
sss_do_bake = BoolProperty(
name="Bake Subsurface Scattering",
description="Bake this object/group to a point cloud for SSS computation",
default=False)
sss_scale = FloatProperty(
name="Scale",
description="Conversion factor from scene scale to sss parameters (defined in millimetres)",
precision=4,
default=0.001)
sss_ior = FloatProperty(
name="IOR",
description="Index of refraction (higher values are denser)",
default=1.3)
sss_meanfreepath = FloatVectorProperty(
name="Radius",
description="The average distance that light will travel in the medium",
subtype="COLOR",
size=3,
default=[1.0,1.0,1.0])
sss_use_reflectance = BoolProperty(
name="Use SSS Reflectance",
description="Override default diffuse color with this color for SSS calculations",
default=False)
sss_reflectance = FloatVectorProperty(
name="Reflectance",
description="Diffuse reflectance",
subtype="COLOR",
size=3,
min=0,
max=0.99,
default=[0.8,0.8,0.8])
sss_shadingrate = FloatProperty(
name="SSS Shading Rate",
description="Controls the amount of irradiance samples taken during the precomputation phase",
default=8)
sss_group = StringProperty(
name="Subsurface Group",
description="Define a group of objects to be considered as the one solid object for SSS calculation. Default empty: this material only",
default="")
class RendermanAnimSequenceSettings(bpy.types.PropertyGroup):
animated_sequence = BoolProperty(
name="Animated Sequence",
description="Interpret this texture as an animated sequence (converts #### in file path to frame number)",
default=False)
sequence_in = IntProperty(
name="Sequence In Point",
description="The first numbered image file to use",
default=1)
sequence_out = IntProperty(
name="Sequence Out Point",
description="The last numbered image file to use",
default=24)
blender_start = IntProperty(
name="Blender Start Frame",
description="The frame in Blender to begin playing back the sequence",
default=1)
'''
extend_in = EnumProperty(
name="Extend In",
items=[('HOLD', 'Hold', ''),
('LOOP', 'Loop', ''),
('PINGPONG', 'Ping-pong', '')],
default='HOLD')
extend_out = EnumProperty(
name="Extend In",
items=[('HOLD', 'Hold', ''),
('LOOP', 'Loop', ''),
('PINGPONG', 'Ping-pong', '')],
default='HOLD')
'''
class RendermanTextureSettings(bpy.types.PropertyGroup):
# animation settings
anim_settings = PointerProperty(
type=RendermanAnimSequenceSettings,
name="Animation Sequence Settings")
# texture optimiser settings
'''
type = bpy.props.EnumProperty(
name="Data type",
description="Type of external file",
items=[('NONE', 'None', ''),
('IMAGE', 'Image', ''),
('POINTCLOUD', 'Point Cloud', '')],
default='NONE')
'''
format = bpy.props.EnumProperty(
name="Format",
description="Image representation",
items=[('TEXTURE', 'Texture Map', ''),
('ENV_LATLONG', 'LatLong Environment Map', '')
],
default='TEXTURE')
auto_generate_texture = BoolProperty(
name="Auto-Generate Optimized",
description="Use the texture optimiser to convert image for rendering",
default=False)
file_path = StringProperty(
name="Source File Path",
description="Path to original image",
subtype='FILE_PATH',
default="")
wrap_s = EnumProperty(
name="Wrapping S",
items=[('black', 'Black', ''),
('clamp', 'Clamp', ''),
('periodic', 'Periodic', '')],
default='clamp')
wrap_t = EnumProperty(
name="Wrapping T",
items=[('black', 'Black', ''),
('clamp', 'Clamp', ''),
('periodic', 'Periodic', '')],
default='clamp')
flip_s = BoolProperty(
name="Flip S",
description="Mirror the texture in S",
default=False)
flip_t = BoolProperty(
name="Flip T",
description="Mirror the texture in T",
default=False)
filter_type = EnumProperty(
name="Downsampling Filter",
items=[('DEFAULT', 'Default', ''),
('box', 'Box', ''),
('triangle', 'Triangle', ''),
('gaussian', 'Gaussian', ''),
('sinc', 'Sinc', ''),
('catmull-rom', 'Catmull-Rom', ''),
('bessel', 'Bessel', '')],
default='DEFAULT',
description='Downsampling filter for generating mipmaps')
filter_window = EnumProperty(
name="Filter Window",
items=[('DEFAULT', 'Default', ''),
('lanczos', 'Lanczos', ''),
('hamming', 'Hamming', ''),
('hann', 'Hann', ''),
('blackman', 'Blackman', '')],
default='DEFAULT',
description='Downsampling filter window for infinite support filters')
filter_width_s = FloatProperty(
name="Filter Width S",
description="Filter diameter in S",
min=0.0, soft_max=1.0, default=1.0)
filter_width_t = FloatProperty(
name="Filter Width T",
description="Filter diameter in T",
min=0.0, soft_max=1.0, default=1.0)
filter_blur = FloatProperty(
name="Filter Blur",
description="Blur factor: > 1.0 is blurry, < 1.0 is sharper",
min=0.0, soft_max=1.0, default=1.0)
input_color_space = EnumProperty(
name="Input Color Space",
items=[('srgb', 'sRGB', ''),
('linear', 'Linear RGB', ''),
('GAMMA', 'Gamma', '')],
default='srgb',
description='Color space of input image')
input_gamma = FloatProperty(
name="Input Gamma",
description="Gamma value of input image if using gamma color space",
min=0.0, soft_max=3.0, default=2.2)
output_color_depth = EnumProperty(
name="Output Color Depth",
items=[('UBYTE', '8-bit unsigned', ''),
('SBYTE', '8-bit signed', ''),
('USHORT', '16-bit unsigned', ''),
('SSHORT', '16-bit signed', ''),
('FLOAT', '32 bit float', '')],
default='UBYTE',
description='Color depth of output image')
output_compression = EnumProperty(
name="Output Compression",
items=[('LZW', 'LZW', ''),
('ZIP', 'Zip', ''),
('PACKBITS', 'PackBits', ''),
('LOGLUV', 'LogLUV (float only)', ''),
('UNCOMPRESSED', 'Uncompressed', '')],
default='ZIP',
description='Compression of output image data')
generate_if_nonexistent = BoolProperty(
name="Generate if Non-existent",
description="Generate if optimised image does not exist in the same folder as source image path",
default=True)
generate_if_older = BoolProperty(
name="Generate if Optimised is Older",
description="Generate if optimised image is older than corresponding source image",
default=True)
class RendermanLightSettings(bpy.types.PropertyGroup):
nodetree = StringProperty(
name="Node Tree",
description="Name of the shader node tree for this light",
default="")
light_shaders = PointerProperty(
type=lightShaders,
name="Light Shader Settings")
emit_photons = BoolProperty(
name="Emit Photons",
description="Emit Photons from this light source",
default=True)
shadow_method = EnumProperty(
name="Shadow Method",
description="How to calculate shadows",
items=[('NONE', 'None', 'No Shadows'),
('SHADOW_MAP', 'Shadow Map', 'Shadow Map'),
('RAYTRACED', 'Raytraced', 'Raytraced')],
default='SHADOW_MAP')
path_shadow_map = StringProperty(
name="Shadow Map Path",
description="Path to generated shadow maps",
subtype='FILE_PATH',
default="$SHD/{object}")
shadow_map_generate_auto = BoolProperty(
name="Generate Shadow Map Automatically",
description="Generate a shadow map for this light before each render, when shadow maps are enabled",
default=True)
shadow_transparent = BoolProperty(
name="Transparent shadows",
description="Use deep shadow maps",
default=True)
shadow_map_resolution = IntProperty(
name="Shadow Map Resolution",
description="Size of the generated shadow map in pixels",
default=256)
pixelsamples_x = IntProperty(
name="Pixel Samples X",
description="Number of AA shadow map samples to take in X dimension",
min=0, max=16, default=2)
pixelsamples_y = IntProperty(
name="Pixel Samples Y",
description="Number of AA shadow map samples to take in Y dimension",
min=0, max=16, default=2)
shadingrate = FloatProperty(
name="Shading Rate",
description="Maximum distance between shading samples when rendering a shadow map (lower = more detailed shading)",
default=1.0)
ortho_scale = FloatProperty(
name="Ortho Scale",
description="Scale factor for orthographic shadow maps",
default=1.0)
# Rib Box Properties
shd_inlinerib_texts = CollectionProperty(type=RendermanInlineRIB, name='Shadow map pass Inline RIB')
shd_inlinerib_index = IntProperty(min=-1, default=-1)
# illuminate
illuminates_by_default = BoolProperty(
name="Illuminates by default",
description="Illuminates by default",
default=True)
# BBM addition begin
#coshaders = CollectionProperty(type=RendermanCoshader, name="Light Co-Shaders")
#coshaders_index = IntProperty(min=-1, default=-1)
# BBM addition end
class RendermanMeshPrimVar(bpy.types.PropertyGroup):