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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-01-10 11:58:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-10 11:58:05 +0300
commit2b56faebe5f2a8e2b37004485206007d22cdac1d (patch)
treef96042f4c8f9b9c06b3b9f694d207f1bc62a5a5c /release/scripts/templates_py
parent5ff33ecdf0ed319db2e589926a614f67738531a6 (diff)
parent18f53d8822518928baceab1407eac195ab9bf817 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r--release/scripts/templates_py/background_job.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/release/scripts/templates_py/background_job.py b/release/scripts/templates_py/background_job.py
index 2911740abf9..ddd8ce1384e 100644
--- a/release/scripts/templates_py/background_job.py
+++ b/release/scripts/templates_py/background_job.py
@@ -22,20 +22,18 @@ import bpy
def example_function(text, save_path, render_path):
- scene = bpy.context.scene
-
# Clear existing objects.
- scene.camera = None
- for obj in scene.objects:
- scene.objects.unlink(obj)
+ bpy.ops.wm.read_factory_settings(use_empty=True)
+
+ scene = bpy.context.scene
txt_data = bpy.data.curves.new(name="MyText", type='FONT')
# Text Object
txt_ob = bpy.data.objects.new(name="MyText", object_data=txt_data)
- scene.objects.link(txt_ob) # add the data to the scene as an object
- txt_data.body = text # the body text to the command line arg given
- txt_data.align = 'CENTER' # center text
+ scene.objects.link(txt_ob) # add the data to the scene as an object
+ txt_data.body = text # the body text to the command line arg given
+ txt_data.align_x = 'CENTER' # center text
# Camera
cam_data = bpy.data.cameras.new("MyCam")