/usr/share/blender/scripts/addons/yafaray/prop/yaf_material.py is in yafaray-exporter 0.1.2+really0.1.2~beta5-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | # ##### 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 #####
# <pep8 compliant>
import bpy
from bpy.props import (FloatProperty,
BoolProperty,
EnumProperty,
FloatVectorProperty,
StringProperty)
Material = bpy.types.Material
def items_mat1(self, context):
a = []
for mat in [m for m in bpy.data.materials if m.name not in self.name]:
a.append((mat.name, mat.name, "First blend material"))
return(a)
def items_mat2(self, context):
a = []
for mat in [m for m in bpy.data.materials if m.name not in self.name]:
a.append((mat.name, mat.name, "Second blend material"))
return(a)
def register():
Material.mat_type = EnumProperty(
name="Material type",
items=(
('shinydiffusemat', "Shiny Diffuse", "Assign a material type"),
('glossy', "Glossy", "Assign a material type"),
('coated_glossy', "Coated Glossy", "Assign a material type"),
('glass', "Glass", "Assign a material type"),
('rough_glass', "Rough Glass", "Assign a material type"),
('blend', "Blend", "Assign a material type")
),
default='shinydiffusemat')
Material.diffuse_reflect = FloatProperty(
name="Reflection strength",
description="Amount of diffuse reflection",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=1.000)
Material.specular_reflect = FloatProperty(
name="Reflection strength",
description="Amount of perfect specular reflection (mirror)",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=0.000)
Material.transparency = FloatProperty(
name="Transparency",
description="Material transparency",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=0.000)
Material.transmit_filter = FloatProperty(
name="Transmit filter",
description="Amount of tinting of light passing through the Material",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=1.000)
Material.fresnel_effect = BoolProperty(
name="Fresnel effect",
description="Apply a fresnel effect to specular reflection",
default=False)
Material.brdf_type = EnumProperty(
name="Reflectance model",
items=(
('oren-nayar', "Oren-Nayar", "Reflectance Model"),
('lambert', "Lambert", "Reflectance Model"),
),
default='lambert')
Material.glossy_color = FloatVectorProperty(
name="Glossy color",
description="Glossy Color",
subtype='COLOR',
min=0.0, max=1.0,
default=(1.0, 1.0, 1.0))
# added mirror col property for coated glossy material
Material.coat_mir_col = FloatVectorProperty(
name="Mirror color",
description="Reflection color of coated layer",
subtype='COLOR',
min=0.0, max=1.0,
default=(1.0, 1.0, 1.0))
# added mirror color property for glass material
Material.glass_mir_col = FloatVectorProperty(
name="Reflection color",
description="Reflection color of glass material",
subtype='COLOR',
min=0.0, max=1.0,
default=(1.0, 1.0, 1.0))
Material.glossy_reflect = FloatProperty(
name="Reflection strength",
description="Amount of glossy reflection",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=0.000)
Material.exp_u = FloatProperty(
name="Exponent U",
description="Horizontal anisotropic exponent value",
min=1.0, max=10000.0,
step=10, precision=2,
soft_min=1.0, soft_max=10000.0,
default=50.00)
Material.exp_v = FloatProperty(
name="Exponent V",
description="Vertical anisotropic exponent value",
min=1.0, max=10000.0,
step=10, precision=2,
soft_min=1.0, soft_max=10000.0,
default=50.00)
Material.exponent = FloatProperty(
name="Exponent",
description="Blur of the glossy reflection, higher exponent = sharper reflections",
min=1.0, max=10000.0,
step=10, precision=2,
soft_min=1.0, soft_max=10000.0,
default=500.00)
Material.as_diffuse = BoolProperty(
name="Use photon map",
description="Treat glossy component as diffuse",
default=False)
Material.anisotropic = BoolProperty(
name="Anisotropic",
description="Use anisotropic reflections",
default=False)
# added IOR property for refraction
Material.IOR_refraction = FloatProperty(
name="IOR",
description="Index of refraction",
min=0.0, max=30.0,
step=1, precision=3,
soft_min=0.0, soft_max=30.0,
default=1.520)
# added IOR property for reflection
Material.IOR_reflection = FloatProperty(
name="IOR",
description="Fresnel reflection strength",
min=1.0, max=30.0,
step=1, precision=3,
soft_min=1.0, soft_max=30.0,
default=1.800)
Material.absorption = FloatVectorProperty(
name="Color and absorption",
description="Glass volumetric absorption color. White disables absorption",
subtype='COLOR',
min=0.0, max=1.0,
default=(1.0, 1.0, 1.0))
Material.absorption_dist = FloatProperty(
name="Abs. distance",
description="Absorption distance scale",
min=0.0, max=100.0,
step=1, precision=4,
soft_min=0.0, soft_max=100.0,
default=1.0000)
# added transmit filter for glass material
Material.glass_transmit = FloatProperty(
name="Transmit filter",
description="Filter strength applied to refracted light",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=1.000)
Material.filter_color = FloatVectorProperty(
name="Filter color",
description="Filter color for refracted light of glass, also tint transparent shadows if enabled",
subtype='COLOR',
min=0.0, max=1.0,
default=(1.0, 1.0, 1.0))
Material.dispersion_power = FloatProperty(
name="Disp. power",
description="Strength of dispersion effect, disabled when 0",
min=0.0, max=5.0,
step=1, precision=4,
soft_min=0.0, soft_max=5.0,
default=0.0000)
# added refraction roughness propertie for roughglass material
Material.refr_roughness = FloatProperty(
name="Exponent",
description="Roughness factor for glass material",
min=0.0, max=1.0,
step=1, precision=3,
soft_min=0.0, soft_max=1.0,
default=0.200)
Material.fake_shadows = BoolProperty(
name="Fake shadows",
description="Let light straight through for shadow calculation. Not to be used with dispersion",
default=False)
Material.blend_value = FloatProperty(
name="Blend value",
description="The mixing balance: 0 -> only material 1, 1.0 -> only material 2",
min=0.0, max=1.0,
step=3, precision=3,
soft_min=0.0, soft_max=1.0,
default=0.500)
Material.sigma = FloatProperty(
name="Sigma",
description="Roughness of the surface",
min=0.0, max=1.0,
step=1, precision=5,
soft_min=0.0, soft_max=1.0,
default=0.10000)
Material.rough = BoolProperty(
name="rough",
description="",
default=False)
Material.coated = BoolProperty(
name="coated",
description="",
default=False)
Material.material1 = EnumProperty(
name="Material one",
description="First blend material",
items=items_mat1)
Material.material2 = EnumProperty(
name="Material two",
description="Second blend material",
items=items_mat2)
def unregister():
del Material.mat_type
del Material.diffuse_reflect
del Material.specular_reflect
del Material.transparency
del Material.transmit_filter
del Material.fresnel_effect
del Material.brdf_type
del Material.glossy_color
del Material.coat_mir_col
del Material.glass_mir_col
del Material.glossy_reflect
del Material.exp_u
del Material.exp_v
del Material.exponent
del Material.as_diffuse
del Material.anisotropic
del Material.IOR_refraction
del Material.IOR_reflection
del Material.absorption
del Material.absorption_dist
del Material.glass_transmit
del Material.filter_color
del Material.dispersion_power
del Material.refr_roughness
del Material.fake_shadows
del Material.blend_value
del Material.sigma
del Material.rough
del Material.coated
del Material.material1
del Material.material2
|