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/render.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/render.py')
-rw-r--r-- | render_povray/render.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/render_povray/render.py b/render_povray/render.py index 822e1be7..d773e96b 100644 --- a/render_povray/render.py +++ b/render_povray/render.py @@ -142,8 +142,9 @@ def imgMapBG(wts): def path_image(image): - return bpy.path.abspath(image.filepath, library=image.library) - + return bpy.path.abspath(image.filepath, library=image.library).replace("\\","/") + # .replace("\\","/") to get only forward slashes as it's what POV prefers, + # even on windows # end find image texture # ----------------------------------------------------------------------------- @@ -425,7 +426,7 @@ def write_pov(filename, scene=None, info_callback=None): if material.pov.photons_reflection: pov_photons_reflection = True - if material.pov.refraction_type == "0": + if not material.pov.refraction_caustics: pov_fake_caustics = False pov_photons_refraction = False elif material.pov.refraction_type == "1": @@ -2709,9 +2710,9 @@ def write_pov(filename, scene=None, info_callback=None): LocalMaterialNames, path_image, imageFormat, imgMap, imgMapTransforms, - file, tabWrite, + tabWrite, string_strip_hyphen, - safety, col) + safety, col, os, preview_dir, unpacked_images) ################################################################### index[0] = idx idx += 1 @@ -3153,7 +3154,8 @@ def write_pov(filename, scene=None, info_callback=None): #string_strip_hyphen(patternNames[texture.name]) #maybe instead of the above LocalPatternNames.append(currentPatName) #use above list to prevent writing texture instances several times and assign in mats? - file.write("\n#declare PAT_%s = \n" % currentPatName) + if (texture.type!='NONE' and texture.pov.tex_pattern_type == 'emulator')or(texture.type =='NONE' and texture.pov.tex_pattern_type != 'emulator'): + file.write("\n#declare PAT_%s = \n" % currentPatName) file.write(shading.exportPattern(texture, string_strip_hyphen)) file.write("\n") if comments: |