|
31 | 31 | import struct |
32 | 32 | import subprocess |
33 | 33 | import shutil |
| 34 | +import tempfile |
34 | 35 | import threading |
35 | 36 | from shutil import copyfile |
36 | 37 |
|
37 | 38 | import bpy |
38 | | -from extensions_framework import util as efutil |
39 | 39 |
|
40 | 40 | from . import projectwriter |
41 | 41 | from . import util |
@@ -69,7 +69,7 @@ def __render_scene(self, scene): |
69 | 69 | """ |
70 | 70 |
|
71 | 71 | # Name and location of the exported project. |
72 | | - project_dir = os.path.join(efutil.temp_directory(), "blenderseed", "render") |
| 72 | + project_dir = os.path.join(tempfile.gettempdir(), "blenderseed", "render") |
73 | 73 | project_filepath = os.path.join(project_dir, "render.appleseed") |
74 | 74 |
|
75 | 75 | # Create target directories if necessary. |
@@ -117,7 +117,7 @@ def __render_material_preview(self, scene): |
117 | 117 | return |
118 | 118 |
|
119 | 119 | # Build the path to the output preview project. |
120 | | - preview_output_dir = os.path.join(efutil.temp_directory(), "blenderseed", "material_preview") |
| 120 | + preview_output_dir = os.path.join(tempfile.gettempdir(), "blenderseed", "material_preview") |
121 | 121 | preview_project_filepath = os.path.join(preview_output_dir, "material_preview.appleseed") |
122 | 122 |
|
123 | 123 | # Create target directories if necessary. |
@@ -160,6 +160,9 @@ def __render_project_file(self, scene, project_filepath, project_dir=None): |
160 | 160 | self.report({'ERROR'}, "The path to the folder containing the appleseed.cli executable has not been specified. Set the path in the add-on user preferences.") |
161 | 161 | return |
162 | 162 |
|
| 163 | + # Properly handle relative Blender paths. |
| 164 | + appleseed_bin_dir = util.realpath(appleseed_bin_dir) |
| 165 | + |
163 | 166 | # Check that the path to the bin folder indeed points to a folder. |
164 | 167 | if not os.path.isdir(appleseed_bin_dir): |
165 | 168 | self.report({'ERROR'}, "The path to the folder containing the appleseed.cli executable was set to {0} but this does not appear to be a valid folder.".format(appleseed_bin_dir)) |
|
0 commit comments