Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added os.path.join for concatenation of paths #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,43 @@

import sys
import os

if "bpy" in locals():
import imp

imp.reload(bLT_main)
imp.reload(bLT_utils)
print("bLT: Reloaded multifiles")
else:
from . import bLT_main
from . import bLT_utils

print("bLT: Imported multifiles")

import bpy

from bpy.types import AddonPreferences
from bpy.props import StringProperty,CollectionProperty,IntProperty,BoolProperty


class d0obqp1l(AddonPreferences):
bl_idname = __name__

dboqpl01 = StringProperty(name="GDAL",
description="Path to GDAL",
maxlen= 1024,
subtype='DIR_PATH',
default='c:\Program Files\GDAL\\')

default="/usr/bin/" if os.name == "posix" else "c:\\Program Files\\GDAL\\"
)
# Actually, this option makes little sense on Linux/Mac Systems, as the executables of GDAL are
# usually available in the path environment anyway.

d0p1olqb = StringProperty(name="Output",
description="Path to Output folder",
maxlen= 1024,
subtype='DIR_PATH',
default='{}\\Documents\\'.format(os.environ['USERPROFILE']))
default="{}".format(os.environ["HOME"]) if os.name == "posix" else os.path.join(os.environ['USERPROFILE'], "Documents")
)

def draw(self, context):
layout = self.layout
Expand Down Expand Up @@ -85,7 +90,7 @@ def register():
bpy.types.Scene.dq0p1bol = IntProperty(default=-1)

bpy.context.user_preferences.filepaths.use_relative_paths = False

def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
Expand All @@ -94,4 +99,4 @@ def unregister():
del bpy.types.Scene.dq0p1bol

if __name__ == "__main__":
register()
register()
Loading