Module Material

Source Code for Module Material

   1  # Blender.Material module and the Material PyObject 
   2   
   3  """ 
   4  The Blender.Material submodule. 
   5   
   6  B{New}: access to shader data. 
   7   
   8  Material  
   9  ======== 
  10   
  11  This module provides access to B{Material} objects in Blender. 
  12   
  13  Example:: 
  14          import Blender 
  15          from Blender import Material 
  16          mat = Material.New('newMat')          # create a new Material called 'newMat' 
  17          print mat.rgbCol                      # print its rgb color triplet sequence 
  18          mat.rgbCol = [0.8, 0.2, 0.2]          # change its color 
  19          mat.setAlpha(0.2)                     # mat.alpha = 0.2 -- almost transparent 
  20          mat.emit = 0.7                        # equivalent to mat.setEmit(0.8) 
  21          mat.mode |= Material.Modes.ZTRANSP    # turn on Z-Buffer transparency 
  22          mat.setName('RedBansheeSkin')         # change its name 
  23          mat.setAdd(0.8)                       # make it glow 
  24          mat.setMode('Halo')                   # turn 'Halo' "on" and all others "off" 
  25   
  26  @type Modes: readonly dictionary 
  27  @var Modes: The available Material Modes. 
  28   
  29          B{Note}: Some Modes are only available when the 'Halo' mode is I{off} and 
  30          others only when it is I{on}.  But these two subsets of modes share the same 
  31          numerical values in their Blender C #defines. So, for example, if 'Halo' is 
  32          on, then 'NoMist' is actually interpreted as 'HaloShaded'.  We marked all 
  33          such possibilities in the Modes dict below: each halo-related mode that 
  34          uses an already taken value is preceded by "+" and appear below the normal 
  35          mode which also uses that value. 
  36   
  37                  - TRACEABLE    - Make Material visible for shadow lamps. 
  38                  - SHADOW       - Enable Material for shadows. 
  39                  - SHADOWBUF    - Enable Material to cast shadows with shadow buffers. 
  40                  - SHADELESS    - Make Material insensitive to light or shadow. 
  41                  - WIRE         - Render only the edges of faces. 
  42                  - VCOL_LIGHT   - Add vertex colors as extra light. 
  43                  - VCOL_PAINT   - Replace basic colors with vertex colors. 
  44                  - HALO         - Render as a halo. 
  45                  - ZTRANSP      - Z-buffer transparent faces. 
  46                  - ZINVERT      - Render with inverted Z-buffer. 
  47                  - + HALORINGS  - Render rings over the basic halo. 
  48                  - ENV          - Do not render Material. 
  49                  - + HALOLINES  - Render star shaped lines over the basic halo. 
  50                  - ONLYSHADOW   - Let alpha be determined on the degree of shadow. 
  51                  - + HALOXALPHA - Use extreme alpha. 
  52                  - TEXFACE      - UV-Editor assigned texture gives color and texture info for faces. 
  53                  - TEXFACE_ALPHA - When TEXFACE is enabled, use the alpha as well. 
  54                  - + HALOSTAR   - Render halo as a star. 
  55                  - NOMIST       - Set the Material insensitive to mist. 
  56                  - + HALOSHADED - Let halo receive light. 
  57                  - HALOTEX      - Give halo a texture. 
  58                  - HALOPUNO     - Use the vertex normal to specify the dimension of the halo. 
  59                  - HALOFLARE    - Render halo as a lens flare. 
  60                  - RAYMIRROR    - Enables raytracing for mirror reflection rendering. 
  61                  - RAYTRANSP    - Enables raytracing for transparency rendering. 
  62                  - RAYBIAS      - Prevent ray traced shadow errors with Phong interpolated normals. 
  63                  - RAMPCOL      - Status of colorband ramp for Material's diffuse color.  This is a read-only bit. 
  64                  - RAMPSPEC     - Status of colorband ramp for Material's specular color.  This is a read-only bit. 
  65                  - TANGENTSTR   - Uses direction of strands as normal for tangent-shading. 
  66                  - TRANSPSHADOW - Lets Material receive transparent shadows based on material color and alpha. 
  67                  - FULLOSA      - Force rendering of all OSA samples. 
  68                  - TANGENT_V    - Use the tangent vector in V direction for shading 
  69                  - NMAP_TS      - Tangent space normal mapping. 
  70                  - GROUP_EXCLUSIVE       - Light from this group even if the lights are on a hidden Layer. 
  71   
  72  @type Shaders: readonly dictionary 
  73  @var Shaders: The available Material Shaders. 
  74                  - DIFFUSE_LAMBERT    - Make Material use the lambert diffuse shader. 
  75                  - DIFFUSE_ORENNAYAR       - Make Material use the Oren-Nayer diffuse shader. 
  76                  - DIFFUSE_TOON    - Make Material use the toon diffuse shader. 
  77                  - DIFFUSE_MINNAERT  - Make Material use the minnaert diffuse shader. 
  78                  - SPEC_COOKTORR   - Make Material use the Cook-Torr specular shader. 
  79                  - SPEC_PHONG   - Make Material use the Phong specular shader. 
  80                  - SPEC_BLINN         - Make Material use the Blinn specular shader. 
  81                  - SPEC_TOON      - Make Material use the toon specular shader. 
  82                  - SPEC_WARDISO      - Make Material use the Ward-iso specular shader. 
  83  """ 
  84   
85 -def New (name = 'Mat'):
86 """ 87 Create a new Material object. 88 @type name: string 89 @param name: The Material name. 90 @rtype: Blender Material 91 @return: The created Material object. 92 """
93
94 -def Get (name = None):
95 """ 96 Get the Material object(s) from Blender. 97 @type name: string 98 @param name: The name of the Material. 99 @rtype: Blender Material or a list of Blender Materials 100 @return: It depends on the 'name' parameter: 101 - (name): The Material object with the given name; 102 - (): A list with all Material objects in the current scene. 103 """
104
105 -class Material:
106 """ 107 The Material object 108 =================== 109 This object gives access to Materials in Blender. 110 @ivar B: Diffuse color (L{rgbCol}) blue component. 111 Value is clamped to the range [0.0,1.0]. 112 @type B: float 113 @ivar G: Diffuse color (L{rgbCol}) green component. 114 Value is clamped to the range [0.0,1.0]. 115 @type G: float 116 @ivar IOR: Angular index of refraction for raytrace. 117 Value is clamped to the range [1.0,3.0]. 118 @type IOR: float 119 @ivar R: Diffuse color (L{rgbCol}) red component. 120 Value is clamped to the range [0.0,1.0]. 121 @type R: float 122 @ivar add: Strength of the add effect. 123 Value is clamped to the range [0.0,1.0]. 124 @type add: float 125 @ivar alpha: Alpha (translucency) component of the material. 126 Value is clamped to the range [0.0,1.0]. 127 @type alpha: float 128 @ivar shadAlpha: Shadow Alpha for irregular shadow buffer. 129 Value is clamped to the range [0.0,1.0]. 130 @type shadAlpha: float 131 @ivar amb: Amount of global ambient color material receives. 132 Value is clamped to the range [0.0,1.0]. 133 @type amb: float 134 @ivar diffuseDarkness: Material's diffuse darkness ("Minnaert" diffuse shader only). 135 Value is clamped to the range [0.0,2.0]. 136 @type diffuseDarkness: float 137 @ivar diffuseShader: Diffuse shader type (see L{Shaders}). 138 Value must be in the range [0,3]. 139 @type diffuseShader: int 140 @ivar diffuseSize: Material's diffuse area size ("Toon" diffuse shader only). 141 Value is clamped to the range [0.0,3.14]. 142 @type diffuseSize: float 143 @ivar diffuseSmooth: Material's diffuse area smoothing ("Toon" diffuse shader only). 144 Value is clamped to the range [0.0,1.0]. 145 @type diffuseSmooth: float 146 @ivar emit: Amount of light the material emits. 147 Value is clamped to the range [0.0,1.0]. 148 @type emit: float 149 @ivar filter: Amount of filtering when transparent raytrace is enabled. 150 Value is clamped to the range [0.0,1.0]. 151 @type filter: float 152 @ivar flareBoost: Flare's extra strength. 153 Value is clamped to the range [0.1,1.0]. 154 @type flareBoost: float 155 @ivar flareSeed: Offset in the flare seed table. 156 Value is clamped to the range [1,255]. 157 @type flareSeed: int 158 @ivar flareSize: Ratio of flare size to halo size. 159 Value is clamped to the range [0.1,25.0]. 160 @type flareSize: float 161 @ivar fresnelDepth: Power of Fresnel for mirror reflection. 162 Value is clamped to the range [0.0,5.0]. 163 @type fresnelDepth: float 164 @ivar fresnelDepthFac: Blending factor for Fresnel mirror. 165 Value is clamped to the range [1.0,5.0]. 166 @type fresnelDepthFac: float 167 @ivar fresnelTrans: Power of Fresnel for transparency. 168 Value is clamped to the range [0.0,5.0]. 169 @type fresnelTrans: float 170 @ivar fresnelTransFac: Blending factor for Fresnel transparency. 171 Value is clamped to the range [1.0,5.0]. 172 @type fresnelTransFac: float 173 @ivar rbFriction: Rigid Body Friction coefficient. 174 Value is clamped to the range [0.0,100.0]. 175 @type rbFriction: float 176 @ivar rbRestitution: Rigid Body Friction restitution. 177 Value is clamped to the range [0.0,1.0]. 178 @type rbRestitution: float 179 @ivar haloSeed: Randomizes halo ring dimension and line location. 180 Value is clamped to the range [1,255]. 181 @type haloSeed: int 182 @ivar haloSize: Dimension of the halo. 183 Value is clamped to the range [0.0,100.0]. 184 @type haloSize: float 185 @ivar hard: Hardness of the specularity. 186 Value is clamped to the range [1,255]. 187 @type hard: int 188 @ivar ipo: Material Ipo data. 189 Contains the Ipo if one is assigned to the object, None otherwise. Setting to None clears the current Ipo. 190 @type ipo: Blender Ipo 191 192 @ivar mirCol: Mirror RGB color triplet. 193 Components are clamped to the range [0.0,1.0]. 194 @type mirCol: list of 3 floats 195 @ivar mirB: Mirror color (L{mirCol}) blue component. 196 Value is clamped to the range [0.0,1.0]. 197 @type mirB: float 198 @ivar mirG: Mirror color (L{mirCol}) green component. 199 Value is clamped to the range [0.0,1.0]. 200 @type mirG: float 201 @ivar mirR: Mirror color (L{mirCol}) red component. 202 Value is clamped to the range [0.0,1.0]. 203 @type mirR: float 204 205 @ivar sssCol: SubSsurface scattering RGB color triplet. 206 Components are clamped to the range [0.0,1.0]. 207 @type sssCol: list of 3 floats 208 @ivar sssB: SubSsurface scattering color (L{sssCol}) blue component. 209 Value is clamped to the range [0.0,1.0]. 210 @type sssB: float 211 @ivar sssG: SubSsurface scattering color (L{sssCol}) green component. 212 Value is clamped to the range [0.0,1.0]. 213 @type sssG: float 214 @ivar sssR: SubSsurface scattering color (L{sssCol}) red component. 215 Value is clamped to the range [0.0,1.0]. 216 @type sssR: float 217 218 @ivar mode: Mode mode bitfield. See L{the Modes dictionary<Modes>} keys and descriptions. 219 @type mode: int 220 @ivar nFlares: Number of subflares with halo. 221 Value is clamped to the range [1,32]. 222 @type nFlares: int 223 @ivar nLines: Number of star-shaped lines with halo. 224 Value is clamped to the range [0,250]. 225 @type nLines: int 226 @ivar nRings: Number of rings with halo. 227 Value is clamped to the range [0,24]. 228 @type nRings: int 229 @ivar nStars: Number of star points with halo. 230 Value is clamped to the range [3,50]. 231 @type nStars: int 232 @ivar oopsLoc: Material OOPs location. Returns None if material not found in list. 233 @type oopsLoc: list of 2 floats 234 @ivar oopsSel: Material OOPs selection flag. 235 Value must be in the range [0,1]. 236 @type oopsSel: int 237 @ivar rayMirr: Mirror reflection amount for raytrace. 238 Value is clamped to the range [0.0,1.0]. 239 @type rayMirr: float 240 @ivar glossMir: Amount of reflection glossy. 241 Value is clamped to the range [0.0,1.0]. 242 @type glossMir: float 243 @ivar sampGloss_mir: Reflection glossy samples. 244 Value is clamped to the range [1,1024]. 245 @type sampGloss_mir: int 246 @ivar glossTra: Amount of refraction glossy. 247 Value is clamped to the range [0.0,1.0]. 248 @type glossTra: float 249 @ivar sampGlossTra: Refraction glossy samples. 250 Value is clamped to the range [1,1024]. 251 @type sampGlossTra: int 252 @ivar rayMirrDepth: Amount of raytrace inter-reflections. 253 Value is clamped to the range [0,10]. 254 @type rayMirrDepth: int 255 @ivar ref: Amount of reflections (for shader). 256 Value is clamped to the range [0.0,1.0]. 257 @type ref: float 258 @ivar refracIndex: Material's Index of Refraction (applies to the "Blinn" Specular Shader only. 259 Value is clamped to the range [1.0,10.0]. 260 @type refracIndex: float 261 @ivar rgbCol: Diffuse RGB color triplet. 262 Components are clamped to the range [0.0,1.0]. 263 @type rgbCol: list of 3 floats 264 @ivar rms: Material's surface slope standard deviation ("WardIso" specular shader only). 265 Value is clamped to the range [0.0,0.4]. 266 @type rms: float 267 @ivar roughness: Material's roughness ("Oren Nayar" diffuse shader only). 268 Value is clamped to the range [0.0,3.14]. 269 @type roughness: float 270 @ivar spec: Degree of specularity. 271 Value is clamped to the range [0.0,2.0]. 272 @type spec: float 273 @ivar specB: Specular color (L{specCol}) blue component. 274 Value is clamped to the range [0.0,1.0]. 275 @type specB: float 276 @ivar specCol: Specular RGB color triplet. 277 Components are clamped to the range [0.0,1.0]. 278 @type specCol: list of 3 floats 279 @ivar specG: Specular color (L{specCol}) green component. 280 Value is clamped to the range [0.0,1.0]. 281 @type specG: float 282 @ivar specR: Specular color (L{specCol}) red component. 283 Value is clamped to the range [0.0,1.0]. 284 @type specR: float 285 @ivar specShader: Specular shader type. See L{Shaders}. 286 Value must be in the range [0,4]. 287 @type specShader: int 288 @ivar specSize: Material's specular area size ("Toon" specular shader only). 289 Value is clamped to the range [0.0,1.53]. 290 @type specSize: float 291 @ivar specSmooth: Sets the smoothness of specular toon area. 292 Value is clamped to the range [0.0,1.0]. 293 @type specSmooth: float 294 @ivar specTransp: Makes specular areas opaque on transparent materials. 295 Value is clamped to the range [0.0,1.0]. 296 @type specTransp: float 297 @ivar subSize: Dimension of subflares, dots and circles. 298 Value is clamped to the range [0.1,25.0]. 299 @type subSize: float 300 @ivar transDepth: calculated maximal. Amount of refractions for raytrace. 301 Value is clamped to the range [0,10]. 302 @type transDepth: int 303 @ivar translucency: Amount of diffuse shading of the back side. 304 Value is clamped to the range [0.0,1.0]. 305 @type translucency: float 306 @ivar zOffset: Artificial offset in the Z buffer (for Ztransp option). 307 Value is clamped to the range [0.0,10.0]. 308 @type zOffset: float 309 @ivar lightGroup: Limits lights that affect this material to a group. 310 @type lightGroup: Group or None 311 @ivar uvlayer: The uv layer name to use, when UV mapping is enabled. 312 @type uvlayer: string 313 @ivar colorband: Material colorband, a list of colors, 314 each color a list of 5 floats [0 - 1], [r,g,b,a,pos]. 315 The colorband can have between 1 and 31 colors. 316 @type colorband: list 317 318 @ivar colorbandDiffuse: Material colorband, a list of colors, 319 each color a list of 5 floats [0 - 1], [r,g,b,a,pos]. 320 The colorband can have between 1 and 31 colors. 321 @type colorbandDiffuse: list 322 @ivar colorbandSpecular: Material colorband, a list of colors, 323 each color a list of 5 floats [0 - 1], [r,g,b,a,pos]. 324 The colorband can have between 1 and 31 colors. 325 @type colorbandSpecular: list 326 327 @ivar enableSSS: If True, subsurface scattering will be rendered on this material. 328 @type enableSSS: bool 329 @ivar sssScale: If True, subsurface scattering will be rendered on this material. 330 Value is clamped to the range [0.1,1000.0]. 331 @type sssScale: bool 332 @ivar sssRadiusRed: Mean red scattering path length. 333 Value is clamped to the range [0.0,10000.0]. 334 @type sssRadiusRed: float 335 @ivar sssRadiusGreen: Mean green scattering path length. 336 Value is clamped to the range [0.0,10000.0]. 337 @type sssRadiusGreen: float 338 @ivar sssRadiusBlue: Mean blue scattering path length. 339 Value is clamped to the range [0.0,10000.0]. 340 @type sssRadiusBlue: float 341 @ivar sssIOR: Refraction index. 342 Value is clamped to the range [0.1,2.0]. 343 @type sssIOR: float 344 @ivar sssError: Error allowance for the calculation (a low value is slower). 345 Value is clamped to the range [0.0,10.0]. 346 @type sssError: float 347 @ivar sssColorBlend: Blend factor for SSS colors. 348 Value is clamped to the range [0.0,1.0]. 349 @type sssColorBlend: float 350 @ivar sssTextureScatter: Texture scattering factor. 351 Value is clamped to the range [0.0,1.0]. 352 @type sssTextureScatter: float 353 @ivar sssFront: Front scattering weight. 354 Value is clamped to the range [0.0,2.0]. 355 @type sssFront: float 356 @ivar sssBack: Back scattering weight 357 Value is clamped to the range [0.0,10.0]. 358 @type sssBack: float 359 360 @warning: Most member variables assume values in some [Min, Max] interval. 361 When trying to set them, the given parameter will be clamped to lie in 362 that range: if val < Min, then val = Min, if val > Max, then val = Max. 363 364 """ 365
366 - def getName():
367 """ 368 Get the name of this Material object. 369 @rtype: string 370 """
371
372 - def setName(name):
373 """ 374 Set the name of this Material object. 375 @type name: string 376 @param name: The new name. 377 """
378
379 - def getIpo():
380 """ 381 Get the Ipo associated with this material, if any. 382 @rtype: Ipo 383 @return: the wrapped ipo or None. 384 """
385
386 - def setIpo(ipo):
387 """ 388 Link an ipo to this material. 389 @type ipo: Blender Ipo 390 @param ipo: a material type ipo. 391 """
392
393 - def clearIpo():
394 """ 395 Unlink the ipo from this material. 396 @return: True if there was an ipo linked or False otherwise. 397 """
398
399 - def insertIpoKey(keytype):
400 """ 401 Inserts keytype values in material ipo at curframe. Uses module constants. 402 @type keytype: Integer 403 @param keytype: 404 -RGB 405 -ALPHA 406 -HALOSIZE 407 -MODE 408 -ALLCOLOR 409 -ALLMIRROR 410 -OFS 411 -SIZE 412 -ALLMAPPING 413 @return: py_none 414 """
415
416 - def getMode():
417 """ 418 Get this Material's mode flags. 419 @rtype: int 420 @return: B{OR'ed value}. Use the Modes dictionary to check which flags 421 are 'on'. 422 423 Example:: 424 import Blender 425 from Blender import Material 426 flags = mymat.getMode() 427 if flags & Material.Modes['HALO']: 428 print "This material is rendered as a halo" 429 else: 430 print "Not a halo" 431 """
432
433 - def setMode(param, stringN=None):
434 """ 435 Set this Material's mode flags. Up to 22 mode strings can be given 436 and specify the modes which are turned 'on'. Those not provided are 437 turned 'off', so mat.setMode() -- without arguments -- turns off all 438 mode flags for Material mat. Valid mode strings are "Traceable", 439 "Shadow", "Shadeless", "Wire", "VColLight", "VColPaint", "Halo", 440 "ZTransp", "ZInvert", "HaloRings", "HaloLines", "OnlyShadow", 441 "HaloXAlpha", "HaloStar", "TexFace", "HaloTex", "HaloPuno", "NoMist", 442 "HaloShaded", "HaloFlare", "Radio", "RayMirr", "ZTransp", "RayTransp", 443 "Env" 444 445 An integer can also be given, which directly sets the mode flag. The 446 Modes dictionary keys can (and should) be added or ORed to specify 447 which modes to turn 'on'. The value returned from getMode() can 448 also be modified and input to this method. 449 450 @type param: string, None or int 451 @param param: A mode value (int) or flag (string). Can also be None. 452 @type stringN: string 453 @param stringN: A mode flag. Up to 22 flags can be set at the same time. 454 """
455
456 - def getRGBCol():
457 """ 458 Get the rgb color triplet sequence. 459 @rtype: list of 3 floats 460 @return: [r, g, b] 461 """
462
463 - def setRGBCol(rgb = None):
464 """ 465 Set the rgb color triplet sequence. If B{rgb} is None, set the color to black. 466 @type rgb: three floats or a list of three floats 467 @param rgb: The rgb color values in [0.0, 1.0] as: 468 - a list of three floats: setRGBCol ([r, g, b]) B{or} 469 - three floats as separate parameters: setRGBCol (r,g,b). 470 """
471
472 - def getSpecCol():
473 """ 474 Get the specular color triplet sequence. 475 @rtype: list of 3 floats 476 @return: [specR, specG, specB] 477 """
478
479 - def setSpecCol(rgb = None):
480 """ 481 Set the specular color triplet sequence. If B{rgb} is None, set the color to black. 482 @type rgb: three floats or a list of three floats 483 @param rgb: The rgb color values in [0.0, 1.0] as: 484 - a list of three floats: setSpecCol ([r, g, b]) B{or} 485 - three floats as separate parameters: setSpecCol (r,g,b). 486 """
487
488 - def getMirCol():
489 """ 490 Get the mirror color triplet sequence. 491 @rtype: list of 3 floats 492 @return: [mirR, mirG, mirb] 493 """
494
495 - def setMirCol(rgb = None):
496 """ 497 Set the mirror color triplet sequence. If B{rgb} is None, set the color to black. 498 @type rgb: three floats or a list of three floats 499 @param rgb: The rgb color values in [0.0, 1.0] as: 500 - a list of three floats: setMirCol ([r, g, b]) B{or} 501 - three floats as separate parameters: setMirCol (r,g,b). 502 """
503
504 - def getAlpha():
505 """ 506 Get the alpha (transparency) value. 507 @rtype: float 508 """
509
510 - def setAlpha(alpha):
511 """ 512 Set the alpha (transparency) value. 513 @type alpha: float 514 @param alpha: The new value in [0.0, 1.0]. 515 """
516
517 - def getAmb():
518 """ 519 Get the ambient color blend factor. 520 @rtype: float 521 """
522
523 - def setAmb(amb):
524 """ 525 Set the ambient color blend factor. 526 @type amb: float 527 @param amb: The new value in [0.0, 1.0]. 528 """
529
530 - def getEmit():
531 """ 532 Get the emitting light intensity. 533 @rtype: float 534 """
535
536 - def setEmit(emit):
537 """ 538 Set the emitting light intensity. 539 @type emit: float 540 @param emit: The new value in [0.0, 1.0]. 541 """
542
543 - def getRef():
544 """ 545 Get the reflectivity value. 546 @rtype: float 547 """
548
549 - def setRef(ref):
550 """ 551 Set the reflectivity value. 552 @type ref: float 553 @param ref: The new value in [0.0, 1.0]. 554 """
555
556 - def getSpec():
557 """ 558 Get the specularity value. 559 @rtype: float 560 """
561
562 - def setSpec(spec):
563 """ 564 Set the specularity value. 565 @type spec: float 566 @param spec: The new value in [0.0, 2.0]. 567 """
568
569 - def getSpecTransp():
570 """ 571 Get the specular transparency. 572 @rtype: float 573 """
574
575 - def setSpecTransp(spectransp):
576 """ 577 Set the specular transparency. 578 @type spectransp: float 579 @param spectransp: The new value in [0.0, 1.0]. 580 """
581
582 - def setSpecShader(specShader):
583 """ 584 Set the material's specular shader from one of the shaders in Material.Shaders dict. 585 @type specShader: int 586 @param specShader: The new value in [0, 4]. 587 """
588
589 - def getSpecShader(specShader):
590 """ 591 Get the material's specular shader from one of the shaders in Material.Shaders dict. 592 @rtype: int 593 """
594
595 - def setDiffuseShader(diffuseShader):
596 """ 597 Set the material's diffuse shader from one of the shaders in Material.Shaders dict. 598 @type diffuseShader: int 599 @param diffuseShader: The new value in [0, 3]. 600 """
601
602 - def getDiffuseShader():
603 """ 604 Get the material's diffuse shader from one of the shaders in Material.Shaders dict. 605 @rtype: int 606 """
607
608 - def setRoughness(roughness):
609 """ 610 Set the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only) 611 @type roughness: float 612 @param roughness: The new value in [0.0, 3.14]. 613 """
614
615 - def getRoughness():
616 """ 617 Get the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only) 618 @rtype: float 619 """
620
621 - def setSpecSize(specSize):
622 """ 623 Set the material's size of specular area (applies to the \"Toon\" Specular Shader only) 624 @type specSize: float 625 @param specSize: The new value in [0.0, 1.53]. 626 """
627
628 - def getSpecSize():
629 """ 630 Get the material's size of specular area (applies to the \"Toon\" Specular Shader only) 631 @rtype specSize: float 632 """
633
634 - def setSpecSize(diffuseSize):
635 """ 636 Set the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only) 637 @type diffuseSize: float 638 @param diffuseSize: The new value in [0.0, 3.14]. 639 """
640
641 - def getSpecSize():
642 """ 643 Get the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only) 644 @rtype: float 645 """
646
647 - def setSpecSmooth(specSmooth):
648 """ 649 Set the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only) 650 @type specSmooth: float 651 @param specSmooth: The new value in [0.0, 1.0]. 652 """
653
654 - def getSpecSmooth():
655 """ 656 Get the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only) 657 @rtype: float 658 """
659
660 - def setDiffuseSmooth(diffuseSmooth):
661 """ 662 Set the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only) 663 @type diffuseSmooth: float 664 @param diffuseSmooth: The new value in [0.0, 1.0]. 665 """
666
667 - def getDiffuseSmooth():
668 """ 669 Get the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only) 670 @rtype: float 671 """
672
673 - def setDiffuseDarkness(diffuseDarkness):
674 """ 675 Set the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only) 676 @type diffuseDarkness: float 677 @param diffuseDarkness: The new value in [0.0, 2.0]. 678 """
679
680 - def getDiffuseDarkness():
681 """ 682 Get the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only) 683 @rtype: float 684 """
685
686 - def setRefracIndex(refracIndex):
687 """ 688 Set the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only) 689 @type refracIndex: float 690 @param refracIndex: The new value in [1.0, 10.0]. 691 """
692
693 - def getRefracIndex():
694 """ 695 Get the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only) 696 @rtype: float 697 """
698
699 - def setRms(rms):
700 """ 701 Set the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only) 702 @type rms: float 703 @param rms: The new value in [0.0, 0.4]. 704 """
705
706 - def getRms():
707 """ 708 Get the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only) 709 @rtype: float 710 """
711
712 - def setFilter(filter):
713 """ 714 Set the material's amount of filtering when transparent raytrace is enabled 715 @type filter: float 716 @param filter: The new value in [0.0, 1.0]. 717 """
718
719 - def getFilter():
720 """ 721 Get the material's amount of filtering when transparent raytrace is enabled 722 @rtype: float 723 """
724
725 - def setTranslucency(translucency):
726 """ 727 Set the material's amount of diffuse shading of the back side 728 @type translucency: float 729 @param translucency: The new value in [0.0, 1.0]. 730 """
731
732 - def getTranslucency():
733 """ 734 Get the material's amount of diffuse shading of the back side 735 @rtype: float 736 """
737
738 - def getAdd():
739 """ 740 Get the glow factor. 741 @rtype: float 742 """
743
744 - def setAdd(add):
745 """ 746 Set the glow factor. 747 @type add: float 748 @param add: The new value in [0.0, 1.0]. 749 """
750
751 - def getZOffset():
752 """ 753 Get the artificial offset for faces with this Material. 754 @rtype: float 755 """
756
757 - def setZOffset(zoffset):
758 """ 759 Set the artificial offset for faces with this Material. 760 @type zoffset: float 761 @param zoffset: The new value in [0.0, 10.0]. 762 """
763
764 - def getHaloSize():
765 """ 766 Get the halo size. 767 @rtype: float 768 """
769
770 - def setHaloSize(halosize):
771 """ 772 Set the halo size. 773 @type halosize: float 774 @param halosize: The new value in [0.0, 100.0]. 775 """
776
777 - def getHaloSeed():
778 """ 779 Get the seed for random ring dimension and line location in halos. 780 @rtype: int 781 """
782
783 - def setHaloSeed(haloseed):
784 """ 785 Set the seed for random ring dimension and line location in halos. 786 @type haloseed: int 787 @param haloseed: The new value in [0, 255]. 788 """
789
790 - def getFlareSize():
791 """ 792 Get the ratio: flareSize / haloSize. 793 @rtype: float 794 """
795
796 - def setFlareSize(flaresize):
797 """ 798 Set the ratio: flareSize / haloSize. 799 @type flaresize: float 800 @param flaresize: The new value in [0.1, 25.0]. 801 """
802
803 - def getFlareSeed():
804 """ 805 Get flare's offset in the seed table. 806 @rtype: int 807 """
808
809 - def setFlareSeed(flareseed):
810 """ 811 Set flare's offset in the seed table. 812 @type flareseed: int 813 @param flareseed: The new value in [0, 255]. 814 """
815
816 - def getFlareBoost():
817 """ 818 Get the flare's extra strength. 819 @rtype: float 820 """
821
822 - def setFlareBoost(flareboost):
823 """ 824 Set the flare's extra strength. 825 @type flareboost: float 826 @param flareboost: The new value in [0.1, 10.0]. 827 """
828
829 - def getSubSize():
830 """ 831 Get the dimension of subflare, dots and circles. 832 @rtype: float 833 """
834
835 - def setSubSize(subsize):
836 """ 837 Set the dimension of subflare, dots and circles. 838 @type subsize: float 839 @param subsize: The new value in [0.1, 25.0]. 840 """
841
842 - def getHardness():
843 """ 844 Get the hardness of the specularity. 845 @rtype: int 846 """
847
848 - def setHardness(hardness):
849 """ 850 Set the hardness of the specularity. 851 @type hardness: int 852 @param hardness: The new value in [1, 511]. 853 """
854
855 - def getNFlares():
856 """ 857 Get the number of halo subflares. 858 @rtype: int 859 """
860
861 - def setNFlares(nflares):
862 """ 863 Set the number of halo subflares. 864 @type nflares: int 865 @param nflares: The new value in [1, 32]. 866 """
867
868 - def getNStars():
869 """ 870 Get the number of points in the halo stars. 871 @rtype: int 872 """
873
874 - def setNStars(nstars):
875 """ 876 Set the number of points in the halo stars. 877 @type nstars: int 878 @param nstars: The new value in [3, 50]. 879 """
880
881 - def getNLines():
882 """ 883 Get the number of star shaped lines on each halo. 884 @rtype: int 885 """
886
887 - def setNLines(nlines):
888 """ 889 Set the number of star shaped lines on each halo. 890 @type nlines: int 891 @param nlines: The new value in [0, 250]. 892 """
893
894 - def getNRings():
895 """ 896 Get the number of rings on each halo. 897 @rtype: int 898 """
899
900 - def setNRings(nrings):
901 """ 902 Set the number of rings on each halo. 903 @type nrings: int 904 @param nrings: The new value in [0, 24]. 905 """
906
907 - def getRayMirr():
908 """ 909 Get amount mirror reflection for raytrace. 910 @rtype: float 911 """
912
913 - def setRayMirr(nrmirr):
914 """ 915 Set amount mirror reflection for raytrace. 916 @type nrmirr: float 917 @param nrmirr: The new value in [0.0, 1.0]. 918 """
919
920 - def getRayMirrDepth():
921 """ 922 Get amount of inter-reflections calculated maximal. 923 @rtype: int 924 """
925
926 - def setRayMirrDepth(nrmirr):
927 """ 928 Set amount mirror reflection for raytrace. 929 @type nrmirr: int 930 @param nrmirr: The new value in [0.0, 1.0]. 931 """
932
933 - def getFresnelMirr():
934 """ 935 Get power of Fresnel for mirror reflection. 936 @rtype: float 937 """
938
939 - def setFresnelMirr(nrmirr):
940 """ 941 Set power of Fresnel for mirror reflection. 942 @type nrmirr: float 943 @param nrmirr: The new value in [0.0, 1.0]. 944 """
945
946 - def getFresnelMirrFac():
947 """ 948 Get the number of Ray Mirror. 949 @rtype: float 950 """
951
952 - def setFresnelMirrFac(nrmirr):
953 """ 954 Set the number of ray mirror 955 @type nrmirr: float 956 @param nrmirr: The new value in [0.0, 1.0]. 957 """
958
959 - def getIOR():
960 """ 961 Get the angular index of refraction for raytrace. 962 @rtype: float 963 """
964
965 - def setIOR(nrmirr):
966 """ 967 Set the angular index of refraction for raytrace. 968 @type nrmirr: float 969 @param nrmirr: The new value in [0.0, 1.0]. 970 """
971
972 - def getTransDepth():
973 """ 974 Get amount of refractions calculated maximal. 975 @rtype: int 976 """
977
978 - def setTransDepth(nrmirr):
979 """ 980 Set amount of refractions calculated maximal. 981 @type nrmirr: int 982 @param nrmirr: The new value in [0.0, 1.0]. 983 """
984
985 - def getFresnelTrans():
986 """ 987 Get power of Fresnel for transparency. 988 @rtype: float 989 """
990
991 - def setFresnelTrans(nrmirr):
992 """ 993 Set power of Fresnel for transparency. 994 @type nrmirr: float 995 @param nrmirr: The new value in [0.0, 1.0]. 996 """
997
998 - def getFresnelTransFac():
999 """ 1000 Get blending factor for Fresnel. 1001 @rtype: float 1002 """
1003
1004 - def setFresnelTransFac(nrmirr):
1005 """ 1006 Set blending factor for Fresnel. 1007 @type nrmirr: float 1008 @param nrmirr: The new value in [0.0, 1.0]. 1009 """
1010
1011 - def setTexture(index, texture, texco, mapto):
1012 """ 1013 Assign a Blender Texture object to slot number 'number'. 1014 @type index: int 1015 @param index: material's texture index in [0, 9]. 1016 @type texture: Blender Texture 1017 @param texture: a Blender Texture object. 1018 @type texco: int 1019 @param texco: optional ORed bitflag -- defaults to TexCo.ORCO. See TexCo var in L{Texture}. 1020 @type mapto: int 1021 @param mapto: optional ORed bitflag -- defaults to MapTo.COL. See MapTo var in L{Texture}. 1022 """
1023
1024 - def clearTexture(index):
1025 """ 1026 Clear the ith (given by 'index') texture channel of this material. 1027 @type index: int 1028 @param index: material's texture channel index in [0, 9]. 1029 """
1030
1031 - def getTextures ():
1032 """ 1033 Get this Material's Texture list. 1034 @rtype: list of MTex 1035 @return: a list of Blender MTex objects. None is returned for each empty 1036 texture slot. 1037 """
1038 1048 1056 1065
1066 - def __copy__ ():
1067 """ 1068 Make a copy of this material 1069 @rtype: Material 1070 @return: a copy of this material 1071 """
1072 1073 import id_generics 1074 Material.__doc__ += id_generics.attributes 1075