diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-12-28 14:09:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-12-28 14:09:36 +0300 |
commit | 2feea3dcc36fbd250445e4efca756e50d221be29 (patch) | |
tree | 2fd20815b65bdd9dce61af704bc2be4d3fbe57fa /source/blender/python/api2_2x/doc | |
parent | 356ea2ff28517cc8e32c5af117e0f697174d8ee7 (diff) |
made scn.objects more flexible... you can now things like...
scn.objects.selected = [] # deselect all
scn.objects.selected = scn.objects # select all
scn.objects.context = [ob1, ob2...]
Added epydoc examples and updates importer scripts to use this de-select-all method.
Diffstat (limited to 'source/blender/python/api2_2x/doc')
-rw-r--r-- | source/blender/python/api2_2x/doc/Scene.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/Scene.py b/source/blender/python/api2_2x/doc/Scene.py index 2ada3062826..4fd9f896edc 100644 --- a/source/blender/python/api2_2x/doc/Scene.py +++ b/source/blender/python/api2_2x/doc/Scene.py @@ -315,6 +315,27 @@ class SceneObjects: ========================================= This object gives access to the Objects in a Scene in Blender. + Example:: + from Blender import Scene + scn = Scene.GetCurrent() + + scn.objects.selected = [] # select none + scn.objects.selected = scn.objects # select all + scn.objects.context = scn.objects # select all and move into the scenes display layer + + # get a list of mesh objects + obs = [ob for ob in scn.objects if ob.type == 'Mesh'] + + # Select only these mesh objects + scn.objects.selected = obs + + # print all object names + for ob in scn.objects: print ob.name + + # make a list of objects that you can add and remove to + # will not affect the current scene + scene_obs = list(scn.objects) + @ivar selected: an iterator over all the selected objects in a scene. @type selected: sequence of L{Object} @ivar context: an iterator over all the visible selected objects in a scene. |