diff options
author | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2016-05-23 22:20:39 +0300 |
---|---|---|
committer | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2016-05-23 22:20:39 +0300 |
commit | 7e05091168f0b1bb01c4164dcfeb80be7b2318b4 (patch) | |
tree | ad4ebdbb68b80d00946c9dbd6d75019f4e2ec4f3 /render_povray/shading.py | |
parent | 4eafe3195c9a18aae0813ccf39371ff910d47a5a (diff) |
*converted all calls to file.write of .shading.py to tabWrite function to no longer pass the file variable
*added a conversion of all image paths to forward slashes, preferred by POV, sending less warning.
*repaired basic handling of packed textures
*rearranged Material UI
Diffstat (limited to 'render_povray/shading.py')
-rw-r--r-- | render_povray/shading.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/render_povray/shading.py b/render_povray/shading.py index 1939cbe9..deb2ab86 100644 --- a/render_povray/shading.py +++ b/render_povray/shading.py @@ -266,7 +266,7 @@ def exportPattern(texture, string_strip_hyphen): 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': + if tex.type!='NONE' and pat.tex_pattern_type == 'emulator': texStrg+="pigment {\n" ####################### EMULATE BLENDER VORONOI TEXTURE #################### if tex.type == 'VORONOI': @@ -547,7 +547,7 @@ def exportPattern(texture, string_strip_hyphen): texStrg+="function{pigment{%s}}\n"%PATname texStrg+="\n" - else: + elif pat.tex_pattern_type != 'emulator': texStrg+="pigment {\n" texStrg+="%s\n"%pat.tex_pattern_type if pat.tex_pattern_type == 'agate': @@ -706,8 +706,8 @@ def exportPattern(texture, string_strip_hyphen): def writeTextureInfluence(mater, materialNames, LocalMaterialNames, path_image, - imageFormat, imgMap, imgMapTransforms, file, - tabWrite, string_strip_hyphen, safety, col): + imageFormat, imgMap, imgMapTransforms, tabWrite, + string_strip_hyphen, safety, col, os, preview_dir, unpacked_images): material_finish = materialNames[mater.name] if mater.use_transparency: trans = 1.0 - mater.alpha @@ -809,17 +809,17 @@ def writeTextureInfluence(mater, materialNames, LocalMaterialNames, path_image, #################################################################################### - file.write("\n") + tabWrite("\n") # THIS AREA NEEDS TO LEAVE THE TEXTURE OPEN UNTIL ALL MAPS ARE WRITTEN DOWN. # --MR currentMatName = string_strip_hyphen(materialNames[mater.name]) LocalMaterialNames.append(currentMatName) - file.write("\n#declare MAT_%s = \ntexture{\n" % currentMatName) + tabWrite("\n#declare MAT_%s = \ntexture{\n" % currentMatName) ################################################################################ if mater.pov.replacement_text != "": - file.write("%s\n" % mater.pov.replacement_text) + tabWrite("%s\n" % mater.pov.replacement_text) ################################################################################# if mater.diffuse_shader == 'MINNAERT': tabWrite("\n") @@ -1107,9 +1107,9 @@ def writeTextureInfluence(mater, materialNames, LocalMaterialNames, path_image, ## scale 1 rotate y*0 #imageMap = ("{image_map {%s \"%s\" %s }" % \ # (imageFormat(textures), textures,imgMap(t_dif))) - #file.write("\n\t\t\tuv_mapping pigment %s} %s finish {%s}" % \ + #tabWrite("\n\t\t\tuv_mapping pigment %s} %s finish {%s}" % \ # (imageMap, mapping, safety(material_finish))) - #file.write("\n\t\t\tpigment {uv_mapping image_map " \ + #tabWrite("\n\t\t\tpigment {uv_mapping image_map " \ # "{%s \"%s\" %s}%s} finish {%s}" % \ # (imageFormat(texturesDif), texturesDif,imgMap(t_dif), # mappingDif, safety(material_finish))) @@ -1170,7 +1170,7 @@ def writeTextureInfluence(mater, materialNames, LocalMaterialNames, path_image, if colored_specular_found and not special_texture_found: if comments: - file.write(" // colored highlights with a stransparent metallic layer\n") + tabWrite(" // colored highlights with a stransparent metallic layer\n") else: tabWrite("\n") |