Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-28 04:59:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-28 04:59:42 +0400
commitfbb89fffb7e443e911a047aa6f645969a8f4ec6e (patch)
treef35174ebda0a7a2c5537ac0dd020044bea48178e /system_demo_mode
parent7ea523d8d30d96c92c5dfc097746a5ad77a63bd3 (diff)
use directory selection for demo-mode.
Diffstat (limited to 'system_demo_mode')
-rw-r--r--system_demo_mode/__init__.py12
-rw-r--r--system_demo_mode/config.py5
2 files changed, 6 insertions, 11 deletions
diff --git a/system_demo_mode/__init__.py b/system_demo_mode/__init__.py
index e4ae9e73..ce2537c5 100644
--- a/system_demo_mode/__init__.py
+++ b/system_demo_mode/__init__.py
@@ -56,11 +56,11 @@ class DemoModeSetup(bpy.types.Operator):
# to the class instance from the operator settings before calling.
# these are used to create the file list.
- filepath = StringProperty(
- name="File Path",
- description="Filepath used for importing the file",
+ directory = StringProperty(
+ name="Search Path",
+ description="directory used for importing the file",
maxlen=1024,
- subtype='FILE_PATH',
+ subtype='DIR_PATH',
)
random_order = BoolProperty(
name="Random Order",
@@ -139,8 +139,8 @@ class DemoModeSetup(bpy.types.Operator):
def execute(self, context):
from . import config
- keywords = self.as_keywords(ignore=("filepath", "random_order", "run", "exit"))
- cfg_str, dirpath = config.as_string(self.filepath,
+ keywords = self.as_keywords(ignore=("directory", "random_order", "run", "exit"))
+ cfg_str, dirpath = config.as_string(self.directory,
self.random_order,
self.exit,
**keywords)
diff --git a/system_demo_mode/config.py b/system_demo_mode/config.py
index 93379061..74111127 100644
--- a/system_demo_mode/config.py
+++ b/system_demo_mode/config.py
@@ -15,11 +15,6 @@ def blend_list(path):
def generate(dirpath, random_order, **kwargs):
-
- # in case file is selected!
- if not os.path.exists(dirpath) or not os.path.isdir(dirpath):
- dirpath = os.path.dirname(dirpath)
-
files = list(blend_list(dirpath))
if random_order:
import random