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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-03 14:02:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-03 14:02:02 +0300
commit1e3ec65edcc5b04307f2923d6496524ce9302a62 (patch)
tree71b84854943e134a4bf4560c3ec8045b6b8cda22 /source
parent07e688125a7b2079ac48600b70263d32b28471f2 (diff)
remove unused variable
also clear scene data before running batch import (utility script).
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/screen_ops.c1
-rw-r--r--source/tests/batch_import.py29
2 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 4433484eeaf..b6c92982560 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2695,7 +2695,6 @@ int ED_screen_animation_play(bContext *C, int sync, int mode)
sound_stop_scene(scene);
}
else {
- ScrArea *sa= CTX_wm_area(C);
int refresh= SPACE_TIME; /* these settings are currently only available from a menu in the TimeLine */
if (mode == 1) // XXX only play audio forwards!?
diff --git a/source/tests/batch_import.py b/source/tests/batch_import.py
index 6a941f3f06c..29b6bb8b9aa 100644
--- a/source/tests/batch_import.py
+++ b/source/tests/batch_import.py
@@ -20,12 +20,38 @@
"""
Example Usage:
- blender --background --python source/tests/batch_import.py -- --operator="bpy.ops.import_scene.obj" --path="/fe/obj" --match="*.obj" --start=0 --end=10 --save_path=/tmp/test
+
+./blender.bin --background --python source/tests/batch_import.py -- \
+ --operator="bpy.ops.import_scene.obj" \
+ --path="/fe/obj" \
+ --match="*.obj" \
+ --start=0 --end=10 \
+ --save_path=/tmp/test
+
+./blender.bin --background --python source/tests/batch_import.py -- \
+ --operator="bpy.ops.import_scene.autodesk_3ds" \
+ --path="/fe/" \
+ --match="*.3ds" \
+ --start=0 --end=1000 \
+ --save_path=/tmp/test
"""
import os
import sys
+def clear_scene():
+ import bpy
+ unique_obs = set()
+ for scene in bpy.data.scenes:
+ for obj in scene.objects[:]:
+ scene.objects.unlink(obj)
+ unique_obs.add(obj)
+
+ # remove obdata, for now only worry about the startup scene
+ for bpy_data_iter in (bpy.data.objects, bpy.data.meshes, bpy.data.lamps, bpy.data.cameras):
+ for id_data in bpy_data_iter:
+ bpy_data_iter.remove(id_data)
+
def batch_import(operator="",
path="",
@@ -74,6 +100,7 @@ def batch_import(operator="",
for i, f in enumerate(files):
print(" %s(filepath=%r) # %d of %d" % (operator, f, i + start, len(files)))
bpy.ops.wm.read_factory_settings()
+ clear_scene()
op(filepath=f)