[Bf-extensions-cvs] [59ea4fc] master: fixed: *transmit value removed from ambient light to avoid parse warning How do we generate a transparent background now ?
Maurice Raybaud
noreply at git.blender.org
Fri Apr 29 18:12:03 CEST 2016
Commit: 59ea4fc9f11f47922aaec7f48ea0f2633ad4dc80
Author: Maurice Raybaud
Date: Fri Apr 29 18:11:48 2016 +0200
Branches: master
https://developer.blender.org/rBA59ea4fc9f11f47922aaec7f48ea0f2633ad4dc80
fixed:
*transmit value removed from ambient light to avoid parse warning
How do we generate a transparent background now ?
*name 'using_uberpov' was not defined in shading.py
added:
*moved exportPattern(texture) from render.py to shading.py
*moved texture influences from render.py to a function in shading.py
===================================================================
M render_povray/render.py
M render_povray/shading.py
===================================================================
diff --git a/render_povray/render.py b/render_povray/render.py
index acc27a0..822e1be 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -52,8 +52,8 @@ def imageFormat(imgF):
'HDR': "hdr",
}.get(os.path.splitext(imgF)[-1].upper(), "")
- if not ext:
- print(" WARNING: texture image format not supported ")
+ #if not ext:
+ #print(" WARNING: texture image has no extension") #too verbose
return ext
@@ -312,477 +312,7 @@ def write_object_modifiers(scene,ob,File):
# if scene.pov.photon_enable == False:
# File.write("caustics %.4g\n"%ob.pov.fake_caustics_power)
-def exportPattern(texture):
- tex=texture
- pat = tex.pov
- PATname = "PAT_%s"%string_strip_hyphen(bpy.path.clean_name(tex.name))
- mappingDif = ("translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>" % \
- (pat.tex_mov_x, pat.tex_mov_y, pat.tex_mov_z,
- 1.0 / pat.tex_scale_x, 1.0 / pat.tex_scale_y, 1.0 / pat.tex_scale_z))
- texStrg=""
- def exportColorRamp(texture):
- tex=texture
- pat = tex.pov
- colRampStrg="color_map {\n"
- numColor=0
- for el in tex.color_ramp.elements:
- numColor+=1
- pos = el.position
- col=el.color
- colR,colG,colB,colA = col[0],col[1],col[2],1-col[3]
- if pat.tex_pattern_type not in {'checker', 'hexagon', 'square', 'triangular', 'brick'} :
- colRampStrg+="[%.4g color rgbf<%.4g,%.4g,%.4g,%.4g>] \n"%(pos,colR,colG,colB,colA)
- if pat.tex_pattern_type in {'brick','checker'} and numColor < 3:
- colRampStrg+="color rgbf<%.4g,%.4g,%.4g,%.4g> \n"%(colR,colG,colB,colA)
- if pat.tex_pattern_type == 'hexagon' and numColor < 4 :
- colRampStrg+="color rgbf<%.4g,%.4g,%.4g,%.4g> \n"%(colR,colG,colB,colA)
- if pat.tex_pattern_type == 'square' and numColor < 5 :
- colRampStrg+="color rgbf<%.4g,%.4g,%.4g,%.4g> \n"%(colR,colG,colB,colA)
- if pat.tex_pattern_type == 'triangular' and numColor < 7 :
- colRampStrg+="color rgbf<%.4g,%.4g,%.4g,%.4g> \n"%(colR,colG,colB,colA)
-
- colRampStrg+="} \n"
- #end color map
- return colRampStrg
- #much work to be done here only defaults translated for now:
- #pov noise_generator 3 means perlin noise
- if pat.tex_pattern_type == 'emulator':
- texStrg+="pigment {\n"
- ####################### EMULATE BLENDER VORONOI TEXTURE ####################
- if tex.type == 'VORONOI':
- texStrg+="crackle\n"
- texStrg+=" offset %.4g\n"%tex.nabla
- texStrg+=" form <%.4g,%.4g,%.4g>\n"%(tex.weight_1, tex.weight_2, tex.weight_3)
- if tex.distance_metric == 'DISTANCE':
- texStrg+=" metric 2.5\n"
- if tex.distance_metric == 'DISTANCE_SQUARED':
- texStrg+=" metric 2.5\n"
- texStrg+=" poly_wave 2\n"
- if tex.distance_metric == 'MINKOVSKY':
- texStrg+=" metric %s\n"%tex.minkovsky_exponent
- if tex.distance_metric == 'MINKOVSKY_FOUR':
- texStrg+=" metric 4\n"
- if tex.distance_metric == 'MINKOVSKY_HALF':
- texStrg+=" metric 0.5\n"
- if tex.distance_metric == 'CHEBYCHEV':
- texStrg+=" metric 10\n"
- if tex.distance_metric == 'MANHATTAN':
- texStrg+=" metric 1\n"
-
- if tex.color_mode == 'POSITION':
- texStrg+="solid\n"
- texStrg+="scale 0.25\n"
-
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbt<0,0,0,1>]\n"
- texStrg+="[1 color rgbt<1,1,1,0>]\n"
- texStrg+="}\n"
- ####################### EMULATE BLENDER CLOUDS TEXTURE ####################
- if tex.type == 'CLOUDS':
- if tex.noise_type == 'SOFT_NOISE':
- texStrg+="wrinkles\n"
- texStrg+="scale 0.25\n"
- else:
- texStrg+="granite\n"
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbt<0,0,0,1>]\n"
- texStrg+="[1 color rgbt<1,1,1,0>]\n"
- texStrg+="}\n"
- ####################### EMULATE BLENDER WOOD TEXTURE ####################
- if tex.type == 'WOOD':
- if tex.wood_type == 'RINGS':
- texStrg+="wood\n"
- texStrg+="scale 0.25\n"
- if tex.wood_type == 'RINGNOISE':
- texStrg+="wood\n"
- texStrg+="scale 0.25\n"
- texStrg+="turbulence %.4g\n"%(tex.turbulence/100)
- if tex.wood_type == 'BANDS':
- texStrg+="marble\n"
- texStrg+="scale 0.25\n"
- texStrg+="rotate <45,-45,45>\n"
- if tex.wood_type == 'BANDNOISE':
- texStrg+="marble\n"
- texStrg+="scale 0.25\n"
- texStrg+="rotate <45,-45,45>\n"
- texStrg+="turbulence %.4g\n"%(tex.turbulence/10)
-
- if tex.noise_basis_2 == 'SIN':
- texStrg+="sine_wave\n"
- if tex.noise_basis_2 == 'TRI':
- texStrg+="triangle_wave\n"
- if tex.noise_basis_2 == 'SAW':
- texStrg+="ramp_wave\n"
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbt<0,0,0,0>]\n"
- texStrg+="[1 color rgbt<1,1,1,0>]\n"
- texStrg+="}\n"
- ####################### EMULATE BLENDER STUCCI TEXTURE ####################
- if tex.type == 'STUCCI':
- texStrg+="bozo\n"
- texStrg+="scale 0.25\n"
- if tex.noise_type == 'HARD_NOISE':
- texStrg+="triangle_wave\n"
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbf<1,1,1,0>]\n"
- texStrg+="[1 color rgbt<0,0,0,1>]\n"
- texStrg+="}\n"
- else:
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbf<0,0,0,1>]\n"
- texStrg+="[1 color rgbt<1,1,1,0>]\n"
- texStrg+="}\n"
- ####################### EMULATE BLENDER MAGIC TEXTURE ####################
- if tex.type == 'MAGIC':
- texStrg+="leopard\n"
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbt<1,1,1,0.5>]\n"
- texStrg+="[0.25 color rgbf<0,1,0,0.75>]\n"
- texStrg+="[0.5 color rgbf<0,0,1,0.75>]\n"
- texStrg+="[0.75 color rgbf<1,0,1,0.75>]\n"
- texStrg+="[1 color rgbf<0,1,0,0.75>]\n"
- texStrg+="}\n"
- texStrg+="scale 0.1\n"
- ####################### EMULATE BLENDER MARBLE TEXTURE ####################
- if tex.type == 'MARBLE':
- texStrg+="marble\n"
- texStrg+="turbulence 0.5\n"
- texStrg+="noise_generator 3\n"
- texStrg+="scale 0.75\n"
- texStrg+="rotate <45,-45,45>\n"
- if tex.use_color_ramp == True:
- texStrg+=exportColorRamp(tex)
- else:
- if tex.marble_type == 'SOFT':
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbt<0,0,0,0>]\n"
- texStrg+="[0.05 color rgbt<0,0,0,0>]\n"
- texStrg+="[1 color rgbt<0.9,0.9,0.9,0>]\n"
- texStrg+="}\n"
- elif tex.marble_type == 'SHARP':
- texStrg+="color_map {\n"
- texStrg+="[0 color rgbt<0,0,0,0>]\n"
- texStrg+="[0.025 color rgbt<0,0,0,0>]\n"
- texStrg+="[1 color rgbt<0.9,0.9,0.9,0>]\n"
- texStrg+="}\n"
- else:
- texStrg+="[0 color rgbt<0,0,0,0>]\n"
- texStrg+="[1 color rgbt<1,1,1,0>]\n"
- texStrg+="}\n"
- if tex.noise_basis_2 == 'SIN':
- texStrg+="sine_wave\n"
- if tex.noise_basis_2 == 'TRI':
- texStrg+="triangle_wave\n"
- if tex.noise_basis_2 == 'SAW':
- texStrg+="ramp_wave\n"
- ####################### EMULATE BLENDER BLEND TEXTURE ####################
- if tex.type == 'BLEND':
- if tex.progression=='RADIAL':
- texStrg+="radial\n"
- if tex.use_flip_axis=='HORIZONTAL':
- texStrg+="rotate x*90\n"
- else:
- texStrg+="rotate <-90,0,90>\n"
- texStrg+="ramp_wave\n"
- elif tex.progression=='SPHERICAL':
- texStrg+="spherical\n"
- texStrg+="scale 3\n"
- texStrg+="poly_wave 1\n"
- elif tex.progression=='QUADRATIC_SPHERE':
- texStrg+="spherical\n"
- texStrg+="scale 3\n"
- texStrg+=" poly_wave 2\n"
- elif tex.progression=='DIAGONAL':
- texStrg+="gradient <1,1,0>\n"
- texStrg+="scale 3\n"
- elif tex.use_flip_axis=='HORIZONTAL':
- texStrg+="gradient x\n"
- texStrg+="scale 2.01\n"
- elif tex.use_flip_axis=='VERTICAL':
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list