Newer
Older
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
"author": "Campbell Barton, Silvio Falcinelli, Maurice Raybaud, "
"Constantin Rahn, Bastien Montagne, Leonid Desyatkov",
Jonathan Smith
committed
"location": "Render > Engine > POV-Ray 3.7",
"description": "Basic POV-Ray 3.7 integration for blender",
Campbell Barton
committed
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
"Scripts/Render/POV-Ray",
"category": "Render",
}
import importlib
importlib.reload(ui)
importlib.reload(render)
importlib.reload(update_files)
from bpy.utils import register_class
Maurice Raybaud
committed
#import addon_utils # To use some other addons
import nodeitems_utils #for Nodes
from nodeitems_utils import NodeCategory, NodeItem #for Nodes
from bpy.types import (
AddonPreferences,
PropertyGroup,
)
from bpy.props import (
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
EnumProperty,
PointerProperty,
)
from . import (
ui,
render,
update_files,
)
CoDEmanX
committed
def string_strip_hyphen(name):
return name.replace("-", "")
Maurice Raybaud
committed
Bastien Montagne
committed
###############################################################################
# Scene POV properties.
###############################################################################
class RenderPovSettingsScene(PropertyGroup):
name="Enable SDL window",
description="Enable the SDL window in Linux OS",
default=True)
Maurice Raybaud
committed
name="Text Scene Name",
description="Name of POV-Ray scene to use. "
"Set when clicking Run to render current text only",
maxlen=1024)
description="Enable the OS-Tempfiles. Otherwise set the path where"
" to save the files",
name="POV-Ray editor",
description="Don't Close POV-Ray editor after rendering (Overridden"
description="Delete files after rendering. "
"Doesn't work with the image",
description="Name of POV-Ray scene to create. Empty name will use "
"the name of the blend file",
# Bug in POV-Ray RC3
# description="Path to directory where the exported scene "
description="Path to directory where the files are created",
maxlen=1024, subtype="DIR_PATH")
renderimage_path: StringProperty(
description="Full path to directory where the rendered image is "
"saved",
maxlen=1024, subtype="DIR_PATH")
description="Enable line breaks in lists (vectors and indices). "
"Disabled: lists are exported in one line",
# Not a real pov option, just to know if we should write
description="Enable POV-Rays radiosity calculation",
radio_display_advanced: BoolProperty(
name="Advanced Options",
description="Show advanced options",
default=False)
name="Enable Media",
description="Enable POV-Rays atmospheric media",
default=False)
Bastien Montagne
committed
name="Samples",
Campbell Barton
committed
description="Number of samples taken from camera to first object "
Bastien Montagne
committed
"encountered along ray path for media calculation",
min=1, max=100, default=35)
media_scattering_type: EnumProperty(
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
name="Scattering Type",
description="Scattering model",
items=(('1', "1 Isotropic", "The simplest form of scattering because"
" it is independent of direction."),
('2', "2 Mie haze ", "For relatively small particles such as "
"minuscule water droplets of fog, cloud "
"particles, and particles responsible "
"for the polluted sky. In this model the"
" scattering is extremely directional in"
" the forward direction i.e. the amount "
"of scattered light is largest when the "
"incident light is anti-parallel to the "
"viewing direction (the light goes "
"directly to the viewer). It is smallest"
" when the incident light is parallel to"
" the viewing direction. "),
('3', "3 Mie murky", "Like haze but much more directional"),
('4', "4 Rayleigh", "For extremely small particles such as "
"molecules of the air. The amount of "
"scattered light depends on the incident"
" light angle. It is largest when the "
"incident light is parallel or "
"anti-parallel to the viewing direction "
"and smallest when the incident light is "
"perpendicular to viewing direction."),
('5', "5 Henyey-Greenstein", "The default eccentricity value "
"of zero defines isotropic "
"scattering while positive "
"values lead to scattering in "
"the direction of the light and "
"negative values lead to "
"scattering in the opposite "
"direction of the light. Larger "
"values of e (or smaller values "
"in the negative case) increase "
"the directional property of the"
media_diffusion_scale: FloatProperty(
name="Scale", description="Scale factor of Media Diffusion Color",
precision=12, step=0.00000001, min=0.000000001, max=1.0,
default=(1.0))
media_diffusion_color: FloatVectorProperty(
name="Media Diffusion Color", description="The atmospheric media color",
Bastien Montagne
committed
precision=4, step=0.01, min=0, soft_max=1,
default=(0.001, 0.001, 0.001),
Bastien Montagne
committed
media_absorption_scale: FloatProperty(
name="Scale", description="Scale factor of Media Absorption Color. "
"use 1/depth of media volume in meters",
precision=12, step=0.000001, min=0.000000001, max=1.0,
default=(0.00002))
media_absorption_color: FloatVectorProperty(
name="Media Absorption Color", description="The atmospheric media absorption color",
precision=4, step=0.01, min=0, soft_max=1,
default=(0.0, 0.0, 0.0),
options={'ANIMATABLE'},
media_eccentricity: FloatProperty(
name="Media Eccenticity Factor", description="Positive values lead"
" to scattering in the direction of the light and negative "
"values lead to scattering in the opposite direction of the "
"light. Larger values of e (or smaller values in the negative"
" case) increase the directional property of the scattering.",
precision=2, step=0.01, min=-1.0, max=1.0,
default=(0.0),
options={'ANIMATABLE'})
description="Enable POV-Rays texture baking",
indentation_character: EnumProperty(
name="Indentation",
description="Select the indentation type",
Campbell Barton
committed
items=(('NONE', "None", "No indentation"),
('TAB', "Tabs", "Indentation with tabs"),
('SPACE', "Spaces", "Indentation with spaces")),
default='SPACE')
name="Quantity of spaces",
description="The number of spaces for indentation",
Constantin Rahn
committed
description="Add comments to pov file",
command_line_switches: StringProperty(
Bastien Montagne
committed
name="Command Line Switches",
description="Command line switches consist of a + (plus) or - "
"(minus) sign, followed by one or more alphabetic "
"characters and possibly a numeric value",
name="Anti-Alias", description="Enable Anti-Aliasing",
default=True)
description="AA-sampling method. Type 1 is an adaptive, "
"non-recursive, super-sampling method. Type 2 is an "
"adaptive and recursive super-sampling method. Type 3 "
"is a stochastic halton based super-sampling method",
items=(("0", "non-recursive AA", "Type 1 Sampling in POV-Ray"),
("1", "recursive AA", "Type 2 Sampling in POV-Ray"),
("2", "stochastic AA", "Type 3 Sampling in UberPOV")),
antialias_confidence: FloatProperty(
name="Antialias Confidence",
description="how surely the computed color "
"of a given pixel is indeed"
"within the threshold error margin",
min=0.0001, max=1.0000, default=0.9900, precision=4)
name="Antialias Depth", description="Depth of pixel for sampling",
min=1, max=9, default=3)
antialias_threshold: FloatProperty(
name="Antialias Threshold", description="Tolerance for sub-pixels",
min=0.0, max=1.0, soft_min=0.05, soft_max=0.5, default=0.03)
Bastien Montagne
committed
name="Jitter",
description="Enable Jittering. Adds noise into the sampling "
"process (it should be avoided to use jitter in "
"animation)",
default=False)
name="Jitter Amount", description="Amount of jittering",
min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=1.0)
Bastien Montagne
committed
name="Antialias Gamma",
description="POV-Ray compares gamma-adjusted values for super "
"sampling. Antialias Gamma sets the Gamma before "
"comparison",
min=0.0, max=5.0, soft_min=0.01, soft_max=2.5, default=2.5)
Bastien Montagne
committed
name="Max Trace Level",
description="Number of reflections/refractions allowed on ray "
"path",
adc_bailout_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="ADC Bailout",
description="",
min=0.0, max=1000.0,default=0.00392156862745, precision=3)
ambient_light_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
ambient_light: FloatVectorProperty(
name="Ambient Light",
description="Ambient light is used to simulate the effect of inter-diffuse reflection",
Maurice Raybaud
committed
precision=4, step=0.01, min=0, soft_max=1,
default=(1, 1, 1), options={'ANIMATABLE'}, subtype='COLOR',
)
global_settings_advanced: BoolProperty(
Maurice Raybaud
committed
name="Advanced",
description="",
default=False)
irid_wavelength_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
irid_wavelength: FloatVectorProperty(
name="Irid Wavelength",
description=(
"Iridescence calculations depend upon the dominant "
"wavelengths of the primary colors of red, green and blue light"
),
Maurice Raybaud
committed
precision=4, step=0.01, min=0, soft_max=1,
default=(0.25,0.18,0.14), options={'ANIMATABLE'}, subtype='COLOR')
Maurice Raybaud
committed
name="Charset",
description="This allows you to specify the assumed character set of all text strings",
Maurice Raybaud
committed
items=(("ascii", "ASCII", ""),
("utf8", "UTF-8", ""),
("sys", "SYS", "")),
default="utf8")
max_intersections_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="Max Intersections",
description="POV-Ray uses a set of internal stacks to collect ray/object intersection points",
Maurice Raybaud
committed
min=2, max=1024, default=64)
number_of_waves_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="Number Waves",
description=(
"The waves and ripples patterns are generated by summing a series of waves, "
"each with a slightly different center and size"
),
Maurice Raybaud
committed
min=1, max=10, default=1000)
noise_generator_enable: BoolProperty(
Maurice Raybaud
committed
name="Enable",
description="",
default=False)
Maurice Raybaud
committed
name="Noise Generator",
description="There are three noise generators implemented",
Maurice Raybaud
committed
min=1, max=3, default=2)
########################### PHOTONS #######################################
name="Photons",
description="Enable global photons",
default=False)
photon_enable_count: BoolProperty(
name="Spacing / Count",
description="Enable count photons",
default=False)
name="Count",
description="Photons count",
min=1, max=100000000, default=20000)
Bastien Montagne
committed
name="Spacing",
description="Average distance between photons on surfaces. half "
"this get four times as many surface photons",
min=0.001, max=1.000, default=0.005,
soft_min=0.001, soft_max=1.000, precision=3)
photon_max_trace_level: IntProperty(
Bastien Montagne
committed
name="Max Trace Level",
description="Number of reflections/refractions allowed on ray "
"path",
photon_adc_bailout: FloatProperty(
Bastien Montagne
committed
name="ADC Bailout",
Campbell Barton
committed
description="The adc_bailout for photons. Use adc_bailout = "
Bastien Montagne
committed
"0.01 / brightest_ambient_object for good results",
min=0.0, max=1000.0, default=0.1,
soft_min=0.0, soft_max=1.0, precision=3)
name="Gather Min", description="Minimum number of photons gathered"
"for each point",
name="Gather Max", description="Maximum number of photons gathered for each point",
min=1, max=256, default=100)
photon_map_file_save_load: EnumProperty(
name="Operation",
description="Load or Save photon map file",
items=(("NONE", "None", ""),
("save", "Save", ""),
("load", "Load", "")),
default="NONE")
photon_map_filename: StringProperty(
name="Filename",
description="",
maxlen=1024)
name="Directory",
description="",
maxlen=1024, subtype="DIR_PATH")
name="File",
description="",
maxlen=1024, subtype="FILE_PATH")
radio_adc_bailout: FloatProperty(
Bastien Montagne
committed
name="ADC Bailout",
Campbell Barton
committed
description="The adc_bailout for radiosity rays. Use "
Bastien Montagne
committed
"adc_bailout = 0.01 / brightest_ambient_object for good results",
min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.0039, precision=4)
radio_always_sample: BoolProperty(
Bastien Montagne
committed
name="Always Sample",
Campbell Barton
committed
description="Only use the data from the pretrace step and not gather "
Bastien Montagne
committed
"any new samples during the final radiosity pass",
Maurice Raybaud
committed
default=False)
Bastien Montagne
committed
name="Brightness",
Campbell Barton
committed
description="Amount objects are brightened before being returned "
Bastien Montagne
committed
"upwards to the rest of the system",
min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default=1.0)
Bastien Montagne
committed
name="Ray Count",
Campbell Barton
committed
description="Number of rays for each new radiosity value to be calculated "
Bastien Montagne
committed
"(halton sequence over 1600)",
radio_error_bound: FloatProperty(
Bastien Montagne
committed
name="Error Bound",
Campbell Barton
committed
description="One of the two main speed/quality tuning values, "
Bastien Montagne
committed
"lower values are more accurate",
min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1.8)
radio_gray_threshold: FloatProperty(
Bastien Montagne
committed
name="Gray Threshold",
Campbell Barton
committed
description="One of the two main speed/quality tuning values, "
Bastien Montagne
committed
"lower values are more accurate",
min=0.0, max=1.0, soft_min=0, soft_max=1, default=0.0)
radio_low_error_factor: FloatProperty(
Bastien Montagne
committed
name="Low Error Factor",
Campbell Barton
committed
description="Just enough samples is slightly blotchy. Low error changes error "
Bastien Montagne
committed
"tolerance for less critical last refining pass",
Maurice Raybaud
committed
min=0.000001, max=1.0, soft_min=0.000001, soft_max=1.0, default=0.5)
name="Media", description="Radiosity estimation can be affected by media",
Maurice Raybaud
committed
name="Subsurface", description="Radiosity estimation can be affected by Subsurface Light Transport",
default=False)
radio_minimum_reuse: FloatProperty(
Bastien Montagne
committed
name="Minimum Reuse",
Campbell Barton
committed
description="Fraction of the screen width which sets the minimum radius of reuse "
Bastien Montagne
committed
"for each sample point (At values higher than 2% expect errors)",
Maurice Raybaud
committed
min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015, precision=3)
radio_maximum_reuse: FloatProperty(
Maurice Raybaud
committed
name="Maximum Reuse",
description="The maximum reuse parameter works in conjunction with, and is similar to that of minimum reuse, "
"the only difference being that it is an upper bound rather than a lower one",
Maurice Raybaud
committed
min=0.0, max=1.0,default=0.2, precision=3)
radio_nearest_count: IntProperty(
Bastien Montagne
committed
name="Nearest Count",
Campbell Barton
committed
description="Number of old ambient values blended together to "
Bastien Montagne
committed
"create a new interpolated value",
name="Normals", description="Radiosity estimation can be affected by normals",
default=False)
radio_recursion_limit: IntProperty(
Bastien Montagne
committed
name="Recursion Limit",
Campbell Barton
committed
description="how many recursion levels are used to calculate "
Bastien Montagne
committed
"the diffuse inter-reflection",
min=1, max=20, default=1)
radio_pretrace_start: FloatProperty(
Bastien Montagne
committed
name="Pretrace Start",
Campbell Barton
committed
description="Fraction of the screen width which sets the size of the "
Bastien Montagne
committed
"blocks in the mosaic preview first pass",
min=0.01, max=1.00, soft_min=0.02, soft_max=1.0, default=0.08)
radio_pretrace_end: FloatProperty(
Bastien Montagne
committed
name="Pretrace End",
Campbell Barton
committed
description="Fraction of the screen width which sets the size of the blocks "
Bastien Montagne
committed
"in the mosaic preview last pass",
min=0.000925, max=1.00, soft_min=0.01, soft_max=1.00, default=0.04, precision=3)
Bastien Montagne
committed
###############################################################################
# Material POV properties.
###############################################################################
class RenderPovSettingsMaterial(PropertyGroup):
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
######################Begin Old Blender Internal Props#########################
use_transparency: BoolProperty(
name="Transparency", description="Render material as transparent",
default=False)
alpha: FloatProperty(
name="Alpha",
description="Alpha transparency of the material",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=1.0, precision=3)
ambient: FloatProperty(
name="Ambient",
description="Amount of global ambient color the material receives",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=1.0, precision=3)
diffuse_color: FloatVectorProperty(
name="Diffuse color",
description=("Diffuse color of the material"),
precision=4, step=0.01, min=0, #max=inf, soft_max=1,
default=(0.6,0.6,0.6), options={'ANIMATABLE'}, subtype='COLOR')
darkness: FloatProperty(
name="Darkness",
description="Minnaert darkness",
min=0.0, max=2.0, soft_min=0.0, soft_max=2.0, default=1.0, precision=3)
diffuse_fresnel: FloatProperty(
name="Diffuse fresnel",
description="Power of Fresnel",
min=0.0, max=5.0, soft_min=0.0, soft_max=5.0, default=1.0, precision=3)
diffuse_fresnel_factor: FloatProperty(
name="Diffuse fresnel factor",
description="Blending factor of Fresnel",
min=0.0, max=5.0, soft_min=0.0, soft_max=5.0, default=0.5, precision=3)
diffuse_intensity: FloatProperty(
name="Diffuse intensity",
description="Amount of diffuse reflection multiplying color",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.8, precision=3)
diffuse_ramp_blend: EnumProperty(
name="Diffuse ramp blend",
description="Blending method of the ramp and the diffuse color",
items=(("MIX", "Mix", ""),
("ADD", "Add", ""),
("MULTIPLY", "Multiply", ""),
("SUBTRACT", "Subtract", ""),
("SCREEN", "Screen", ""),
("DIVIDE", "Divide", ""),
("DIFFERENCE", "Difference", ""),
("DARKEN", "Darken", ""),
("LIGHTEN", "Lighten", ""),
("OVERLAY", "Overlay", ""),
("DODGE", "Dodge", ""),
("BURN", "Burn", ""),
("HUE", "Hue", ""),
("SATURATION", "Saturation", ""),
("VALUE", "Value", ""),
("COLOR", "Color", ""),
("SOFT_LIGHT", "Soft light", ""),
("LINEAR_LIGHT", "Linear light", "")),
default="MIX")
diffuse_ramp_factor: FloatProperty(
name="Factor",
description="Blending factor (also uses alpha in Colorband)",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=1.0, precision=3)
diffuse_ramp_input: EnumProperty(
name="Input",
description="How the ramp maps on the surface",
items=(("SHADER", "Shader", ""),
("ENERGY", "Energy", ""),
("NORMAL", "Normal", ""),
("RESULT", "Result", "")),
default="SHADER")
diffuse_shader: EnumProperty(
name="Diffuse Shader Model",
description="How the ramp maps on the surface",
items=(("LAMBERT", "Lambert", "Use a Lambertian shader"),
("OREN_NAYAR", "Oren-Nayar", "Use an Oren-Nayar shader"),
("MINNAERT", "Minnaert", "Use a Minnaert shader"),
("FRESNEL", "Fresnel", "Use a Fresnel shader")),
default="LAMBERT")
diffuse_toon_size: FloatProperty(
name="Size",
description="Size of diffuse toon area",
min=0.0, max=3.14, soft_min=0.0, soft_max=3.14, default=0.5, precision=3)
diffuse_toon_smooth: FloatProperty(
name="Smooth",
description="Smoothness of diffuse toon area",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.1, precision=3)
emit: FloatProperty(
name="Emit",
description="Amount of light to emit",
min=0.0, soft_min=0.0, #max=inf, soft_max=inf,
default=0.0, precision=3)
mirror_color: FloatVectorProperty(
name="Mirror color",
description=("Mirror color of the material"),
precision=4, step=0.01, min=0, #max=inf, soft_max=1,
default=(0.6,0.6,0.6), options={'ANIMATABLE'}, subtype='COLOR')
roughness: FloatProperty(
name="Roughness",
description="Oren-Nayar Roughness",
min=0.0, max=3.14, soft_min=0.0, soft_max=3.14, default=0.5, precision=3)
halo: BoolProperty(
name="Halo", description=" Halo settings for the material",
default=False)
#(was readonly in Blender2.79, never None)
line_color: FloatVectorProperty(
name="Line color",
description=("Line color used for Freestyle line rendering"),
precision=4, step=0.01, min=0, #max=inf, soft_max=1,
default=(0.0,0.0,0.0), options={'ANIMATABLE'}, subtype='COLOR')
#diffuse_ramp:
##Color ramp used to affect diffuse shading
##Type: ColorRamp, (readonly)
#cr_node = bpy.data.materials['Material'].node_tree.nodes['ColorRamp']
#layout.template_color_ramp(cr_node, "color_ramp", expand=True)
#ou
#class bpy.types.ColorRamp(bpy_struct)
line_priority: IntProperty(
name="Recursion Limit",
description="The line color of a higher priority is used at material boundaries",
min=0, max=32767, default=0)
specular_color: FloatVectorProperty(
name="Specular color",
description=("Specular color of the material "),
precision=4, step=0.01, min=0, #max=inf, soft_max=1,
default=(1.0,1.0,1.0), options={'ANIMATABLE'}, subtype='COLOR')
specular_hardness: IntProperty(
name="Hardness",
description="How hard (sharp) the specular reflection is",
min=1, max=511, default=50)
specular_intensity: FloatProperty(
name="Intensity",
description="How intense (bright) the specular reflection is",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.5, precision=3)
# specular_ior: FloatProperty(
# name="IOR",
# description="Specular index of refraction",
# min=-10.0, max=10.0, soft_min=0.0, soft_max=10.0, default=1.0, precision=3)
# ior: FloatProperty(
# name="IOR",
# description="Index of refraction",
# min=-10.0, max=10.0, soft_min=0.0, soft_max=10.0, default=1.0, precision=3)
specular_shader: EnumProperty(
name="Specular Shader Model",
description="How the ramp maps on the surface",
items=(("COOKTORR", "CookTorr", "Use a Cook-Torrance shader"),
("PHONG", "Phong", "Use a Phong shader"),
("BLINN", "Blinn", "Use a Blinn shader"),
("TOON", "Toon", "Use a Toon shader"),
("WARDISO", "WardIso", "Use a Ward anisotropic shader")),
default="COOKTORR")
specular_slope: FloatProperty(
name="Slope",
description="The standard deviation of surface slope",
min=0.0, max=0.4, soft_min=0.0, soft_max=0.4, default=0.1, precision=3)
specular_toon_size: FloatProperty(
name="Size",
description="Size of specular toon area",
min=0.0, max=0.53, soft_min=0.0, soft_max=0.53, default=0.5, precision=3)
specular_toon_smooth: FloatProperty(
name="Smooth",
description="Smoothness of specular toon area",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.1, precision=3)
translucency: FloatProperty(
name="Translucency",
description="Amount of diffuse shading on the back side",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.0, precision=3)
transparency_method: EnumProperty(
name="Specular Shader Model",
description="Method to use for rendering transparency",
items=(("MASK", "Mask", "Mask the background"),
("Z_TRANSPARENCY", "Z Transparency", "Use alpha buffer for transparent faces"),#TO DEPRECATE
("RAYTRACE", "Raytrace", "Use raytracing for transparent refraction rendering")),
default="MASK")
type: EnumProperty(
name="Type",
description="Material type defining how the object is rendered",
items=(("SURFACE", "Surface", "Render object as a surface"),
("WIRE", "Wire", "Render the edges of faces as wires (not supported in raytracing)"),#TO UPDATE > USE MACRO AND CHNGE DESCRIPTION
("VOLUME", "Volume", "Render object as a volume"),
("‘HALO’", "Halo", "Render object as halo particles")), #TO UPDATE > USE MACRO AND CHNGE DESCRIPTION
default="SURFACE")
use_cast_shadows: BoolProperty(
name="Cast", description="Allow this material to cast shadows",
default=True)
use_cast_shadows_only: BoolProperty(
name="Cast Only", description="Make objects with this material "
"appear invisible (not rendered), only "
"casting shadows",
default=False)
use_cubic: BoolProperty(
name="Cubic Interpolation", description="Use cubic interpolation for diffuse "
"values, for smoother transitions",
default=False)
use_diffuse_ramp: BoolProperty(
name="Ramp", description="Toggle diffuse ramp operations",
default=False)
use_light_group_exclusive: BoolProperty(
name="Exclusive", description="Material uses the light group exclusively"
"- these lamps are excluded from other "
"scene lighting",
default=False)
use_light_group_local: BoolProperty(
name="Local", description="When linked in, material uses local light"
" group with the same name",
default=False)
use_mist: BoolProperty(
name="Use Mist", description="Use mist with this material "
"(in world settings)",
default=True)
use_nodes: BoolProperty(
name="Nodes", description="Use shader nodes to render the material",#Add Icon in UI or here? icon='NODES'
default=False)
use_object_color: BoolProperty(
name="Object Color", description="Modulate the result with a per-object color",
default=False)
use_only_shadow: BoolProperty(
name="Shadows Only", description="Render shadows as the material’s alpha "
"value, making the material transparent "
"except for shadowed areas",
default=False)
use_shadeless: BoolProperty(
name="Shadeless", description="Make this material insensitive to "
"light or shadow",
default=False)
use_shadows: BoolProperty(
name="Receive", description="Allow this material to receive shadows",
default=True)
use_sky: BoolProperty(
name="Sky", description="Render this material with zero alpha, "
"with sky background in place (scanline only)",
default=False)
use_specular_ramp: BoolProperty(
name="Ramp", description="Toggle specular ramp operations",
default=False)
use_tangent_shading: BoolProperty(
name="Tangent Shading", description="Use the material’s tangent vector instead"
"of the normal for shading - for "
"anisotropic shading effects",
default=False)
use_transparent_shadows: BoolProperty(
name="Receive Transparent", description="Allow this object to receive transparent "
"shadows cast through other object",
default=False) #linked to fake caustics
use_vertex_color_light: BoolProperty(
name="Vertex Color Light", description="Add vertex colors as additional lighting",
default=False)
use_vertex_color_paint: BoolProperty(
name="Vertex Color Paint", description="Replace object base color with vertex "
"colors (multiply with ‘texture face’ "
"face assigned textures)",
default=False)
specular_ramp_blend: EnumProperty(
name="Specular ramp blend",
description="Blending method of the ramp and the specular color",
items=(("MIX", "Mix", ""),
("ADD", "Add", ""),
("MULTIPLY", "Multiply", ""),
("SUBTRACT", "Subtract", ""),
("SCREEN", "Screen", ""),
("DIVIDE", "Divide", ""),
("DIFFERENCE", "Difference", ""),
("DARKEN", "Darken", ""),
("LIGHTEN", "Lighten", ""),
("OVERLAY", "Overlay", ""),
("DODGE", "Dodge", ""),
("BURN", "Burn", ""),
("HUE", "Hue", ""),
("SATURATION", "Saturation", ""),
("VALUE", "Value", ""),
("COLOR", "Color", ""),
("SOFT_LIGHT", "Soft light", ""),
("LINEAR_LIGHT", "Linear light", "")),
default="MIX")
specular_ramp_factor: FloatProperty(
name="Factor",
description="Blending factor (also uses alpha in Colorband)",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=1.0, precision=3)
specular_ramp_input: EnumProperty(
name="Input",
description="How the ramp maps on the surface",
items=(("SHADER", "Shader", ""),
("ENERGY", "Energy", ""),
("NORMAL", "Normal", ""),
("RESULT", "Result", "")),
default="SHADER")
Maurice Raybaud
committed
name="Iridescence coating",
Campbell Barton
committed
description="Newton's thin film interference (like an oil slick on a puddle of "
Bastien Montagne
committed
"water or the rainbow hues of a soap bubble.)",
Campbell Barton
committed
description="Use same IOR as raytrace transparency to calculate mirror reflections. "
Bastien Montagne
committed
"More physically correct",
name="Metallic Reflection",
description="mirror reflections get colored as diffuse (for metallic materials)",
default=False)
Campbell Barton
committed
description="Light transmitted is more correctly reduced by mirror reflections, "
Bastien Montagne
committed
"also the sum of diffuse and translucency gets reduced below one ",
Campbell Barton
committed
description="Contribution of the iridescence effect to the overall surface color. "
"As a rule of thumb keep to around 0.25 (25% contribution) or less, "
"but experiment. If the surface is coming out too white, try lowering "
"the diffuse and possibly the ambient values of the surface",
min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=0.25)
Campbell Barton
committed
description="A very thin film will have a high frequency of color changes while a "
"thick film will have large areas of color",
min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1)
name="turbulence", description="This parameter varies the thickness",
min=0.0, max=10.0, soft_min=0.000, soft_max=1.0, default=0)
interior_fade_color: FloatVectorProperty(
Maurice Raybaud
committed
name="Interior Fade Color", description="Color of filtered attenuation for transparent "
Bastien Montagne
committed
precision=4, step=0.01, min=0.0, soft_max=1.0,
default=(0, 0, 0), options={'ANIMATABLE'}, subtype='COLOR')
Campbell Barton
committed
description="use only fake refractive caustics (default) or photon based "
Bastien Montagne
committed
"reflective/refractive caustics",
Bastien Montagne
committed
name="Fake Caustics", description="use only (Fast) fake refractive caustics",
fake_caustics_power: FloatProperty(
Campbell Barton
committed
description="Values typically range from 0.0 to 1.0 or higher. Zero is no caustics. "
"Low, non-zero values give broad hot-spots while higher values give "
Bastien Montagne
committed
"tighter, smaller simulated focal points",
Maurice Raybaud
committed
min=0.00, max=10.0, soft_min=0.00, soft_max=5.0, default=0.07)
refraction_caustics: BoolProperty(
Maurice Raybaud
committed
name="Refractive Caustics", description="hotspots of light focused when going through the material",
default=True)
photons_dispersion: FloatProperty(
Maurice Raybaud
committed
name="Chromatic Dispersion",
Campbell Barton
committed
description="Light passing through will be separated according to wavelength. "
"This ratio of refractive indices for violet to red controls how much "
Bastien Montagne
committed
"the colors are spread out 1 = no dispersion, good values are 1.01 to 1.1",
Maurice Raybaud
committed
min=1.0000, max=10.000, soft_min=1.0000, soft_max=1.1000, precision=4, default=1.0000)
photons_dispersion_samples: IntProperty(
Maurice Raybaud
committed
name="Dispersion Samples", description="Number of color-steps for dispersion",
min=2, max=128, default=7)
photons_reflection: BoolProperty(
name="Reflective Photon Caustics",
description="Use this to make your Sauron's ring ;-P",
default=False)
Maurice Raybaud
committed
items=[
("1", "Fake Caustics", "use fake caustics"),
Bastien Montagne
committed
("2", "Photons Caustics", "use photons for refractive caustics")],
Maurice Raybaud
committed
name="Refraction Type:",
description="use fake caustics (fast) or true photons for refractive Caustics",
Maurice Raybaud
committed
default="1")
Bastien Montagne
committed
##################################CustomPOV Code############################
replacement_text: StringProperty(
Campbell Barton
committed
name="Declared name:",
Campbell Barton
committed
description="Type the declared name in custom POV code or an external "
Bastien Montagne
committed
".inc it points at. texture {} expected",
Maurice Raybaud
committed
default="")
def use_material_nodes_callback(self, context):
if hasattr(context.space_data, "tree_type"):
context.space_data.tree_type = 'ObjectNodeTree'
mat=context.object.active_material
if mat.pov.material_use_nodes: