Module Material
[hide private]
[frames] | no frames]

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