Fix background_job template
Update attribute and use empty file operator
This commit is contained in:
@@ -22,20 +22,18 @@ import bpy
|
|||||||
|
|
||||||
def example_function(text, save_path, render_path):
|
def example_function(text, save_path, render_path):
|
||||||
|
|
||||||
scene = bpy.context.scene
|
|
||||||
|
|
||||||
# Clear existing objects.
|
# Clear existing objects.
|
||||||
scene.camera = None
|
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||||
for obj in scene.objects:
|
|
||||||
scene.objects.unlink(obj)
|
scene = bpy.context.scene
|
||||||
|
|
||||||
txt_data = bpy.data.curves.new(name="MyText", type='FONT')
|
txt_data = bpy.data.curves.new(name="MyText", type='FONT')
|
||||||
|
|
||||||
# Text Object
|
# Text Object
|
||||||
txt_ob = bpy.data.objects.new(name="MyText", object_data=txt_data)
|
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
|
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.body = text # the body text to the command line arg given
|
||||||
txt_data.align = 'CENTER' # center text
|
txt_data.align_x = 'CENTER' # center text
|
||||||
|
|
||||||
# Camera
|
# Camera
|
||||||
cam_data = bpy.data.cameras.new("MyCam")
|
cam_data = bpy.data.cameras.new("MyCam")
|
||||||
|
Reference in New Issue
Block a user