diff options
author | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2022-01-26 03:02:18 +0300 |
---|---|---|
committer | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2022-01-26 03:02:18 +0300 |
commit | 692611358a9189c2f54f916c42a08e1ddf54bb84 (patch) | |
tree | 68ee4016d4be897fd53d5c51419c43443cd9dbe9 /render_povray/scripting_gui.py | |
parent | fd5697ebcf879894d84875b593fe00ede14e79a4 (diff) |
POV: Add primitives workspace tools icons, blurry reflections, equation based isourface ; various fixes
* fix tiny formatting of quotes, docstrings, parenthesis
* fix pov centered worspaces
* fix (revert) bad default for text block insertion
* fix primitive exports sorted by most frequent for (slight) speed up
* fix some uninitialized hairstrand root diameter variable
* fix extracted function for CSG inside vector
* fix too big size of proxy mesh for ininite plane caused it to blink
* fix end of render speach error handling
* fix max specular value to better map out under a texture influence
* fix emit, ambient, translucency shading properties UI broken post 2.8
* add workspace tools icons for pov primitives
* add a user input equation based isosurface primitive
* add micro normals based blurry reflections (glossy UI slider)
Diffstat (limited to 'render_povray/scripting_gui.py')
-rwxr-xr-x | render_povray/scripting_gui.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/render_povray/scripting_gui.py b/render_povray/scripting_gui.py index 0dcdc4f1..60774f29 100755 --- a/render_povray/scripting_gui.py +++ b/render_povray/scripting_gui.py @@ -112,12 +112,13 @@ class TEXT_OT_POV_insert(Operator): def execute(self, context): if self.filepath and isfile(self.filepath): - file = open(self.filepath, "r") - bpy.ops.text.insert(text=file.read()) + with open(self.filepath, "r") as file: + bpy.ops.text.insert(text=file.read()) - # places the cursor at the end without scrolling -.- - # context.space_data.text.write(file.read()) - file.close() + # places the cursor at the end without scrolling -.- + # context.space_data.text.write(file.read()) + if not file.closed: + file.close() return {'FINISHED'} @@ -137,10 +138,9 @@ class TEXT_MT_POV_insert(Menu): prop = self.layout.operator("wm.path_open", text="Open folder", icon='FILE_FOLDER') prop.filepath = pov_documents self.layout.separator() - - pov_insert_items_list = [] - for root, dirs, files in os.walk(pov_documents): # todo: structure submenus by dir - pov_insert_items_list.append(root) + + # todo: structure submenus by dir + pov_insert_items_list = [root for root, dirs, files in os.walk(pov_documents)] print(pov_insert_items_list) self.path_menu( pov_insert_items_list, |