diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-06-11 00:50:43 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-06-11 00:50:43 +0400 |
commit | 8135cc9f954e0d63ab3e97d4a7c52ff5e573eef0 (patch) | |
tree | a12ec0daccfc45b7e3c68e4a2d7099655daf619d /doc/python_api | |
parent | 0f33d5719fd0adc666e7e92e0f062281f4285f13 (diff) | |
parent | 298feff39006c14aa28b5e0232aa7ed70a83a496 (diff) |
Merged changes in the trunk up to revision 47700.
Conflicts resolved:
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/library.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/interface/resources.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/SConscript
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/windowmanager/WM_types.h
Diffstat (limited to 'doc/python_api')
-rw-r--r-- | doc/python_api/examples/bpy.types.Object.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.Object.py b/doc/python_api/examples/bpy.types.Object.py new file mode 100644 index 00000000000..5301797aae2 --- /dev/null +++ b/doc/python_api/examples/bpy.types.Object.py @@ -0,0 +1,27 @@ +""" +Basic Object Operations Example ++++++++++++++++++++++++++++++++ +This script demonstrates basic operations on object like creating new +object, placing it into scene, selecting it and making it active +""" + +import bpy +from mathutils import Matrix + +scene = bpy.context.scene + +# Create new lamp datablock +lamp_data = bpy.data.lamps.new(name="New Lamp", type="POINT") + +# Create new object with out lamp datablock +lamp_object = bpy.data.objects.new(name="New Lamp", object_data=lamp_data) + +# Link lamp object to the scene so it'll appear in this scene +scene.objects.link(lamp_object) + +# Place lamp to specified location +lamp_object.location = (5.0, 5.0, 5.0) + +# And finally select it make active +lamp_object.select = True +scene.objects.active = lamp_object |