~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to doc/python_api/examples/bpy.types.Object.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Basic Object Operations Example
 
3
+++++++++++++++++++++++++++++++
 
4
This script demonstrates basic operations on object like creating new
 
5
object, placing it into scene, selecting it and making it active.
 
6
"""
 
7
 
 
8
import bpy
 
9
from mathutils import Matrix
 
10
 
 
11
scene = bpy.context.scene
 
12
 
 
13
# Create new lamp datablock
 
14
lamp_data = bpy.data.lamps.new(name="New Lamp", type='POINT')
 
15
 
 
16
# Create new object with our lamp datablock
 
17
lamp_object = bpy.data.objects.new(name="New Lamp", object_data=lamp_data)
 
18
 
 
19
# Link lamp object to the scene so it'll appear in this scene
 
20
scene.objects.link(lamp_object)
 
21
 
 
22
# Place lamp to a specified location
 
23
lamp_object.location = (5.0, 5.0, 5.0)
 
24
 
 
25
# And finally select it make active
 
26
lamp_object.select = True
 
27
scene.objects.active = lamp_object