Skip to content

Commit

Permalink
Merge pull request #162 from drichardson/fix-102
Browse files Browse the repository at this point in the history
Use tempfile.gettempdir() instead of script addon directory for temp files
  • Loading branch information
james-baber authored Nov 20, 2020
2 parents 1817c5c + bfe4ef0 commit 7e87cf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion send2ue/addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
bl_info = {
"name": "Send to Unreal",
"author": "Epic Games Inc.",
"version": (1, 4, 11), # addon plugin version
"version": (1, 4, 12), # addon plugin version
"blender": (2, 83, 0), # minimum blender version
"location": "Header > Pipeline > Export > Send to Unreal",
"description": "Sends an asset to the first open Unreal Editor instance on your machine.",
Expand Down
6 changes: 3 additions & 3 deletions send2ue/addon/functions/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import re
import bpy
import tempfile
from . import unreal
from . import utilities
from . import validations
Expand Down Expand Up @@ -37,9 +38,8 @@ def get_fbx_paths(asset_name, asset_type):

if properties.path_mode in ['send_to_unreal', 'both']:
fbx_paths['unreal'] = os.path.join(
bpy.utils.user_resource('SCRIPTS', "addons"),
tempfile.gettempdir(),
properties_window_manger.module_name,
'temp',
f'{get_unreal_asset_name(asset_name, properties)}.fbx'
)

Expand Down Expand Up @@ -894,4 +894,4 @@ def send2ue(properties):
f'You do not have the correct objects under the "{properties.mesh_collection_name}" or '
f'"{properties.rig_collection_name}" collections or your rig does not have any '
f'actions to export!'
)
)
6 changes: 3 additions & 3 deletions send2ue/addon/functions/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import bpy
import shutil
import tempfile


def get_action_name(action_name, properties):
Expand Down Expand Up @@ -203,9 +204,8 @@ def remove_temp_folder():
"""
properties_window_manger = bpy.context.window_manager.send2ue
temp_folder = os.path.join(
bpy.utils.user_resource('SCRIPTS', "addons"),
properties_window_manger.module_name,
'temp'
tempfile.gettempdir(),
properties_window_manger.module_name
)
try:
original_umask = os.umask(0)
Expand Down

0 comments on commit 7e87cf9

Please sign in to comment.