~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/doc/Scene.py

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
"""
4
4
The Blender.Scene submodule.
5
5
 
 
6
B{New}:
 
7
  - L{Scene.clearScriptLinks} accepts a parameter now.
 
8
  - L{Scene.getLayers}, L{Scene.setLayers} and the L{layers<Scene.layers>} and
 
9
    L{Layers<Scene.Layers>} Scene attributes. 
 
10
  - L{Scene.getActiveObject} method.
 
11
 
6
12
Scene
7
13
=====
8
14
 
73
79
  The Scene object
74
80
  ================
75
81
    This object gives access to Scene data in Blender.
76
 
  @cvar name: The Scene name.
 
82
  @type name: string
 
83
  @ivar name: The Scene name.
 
84
  @type Layers: integer (bitmask)
 
85
  @ivar Layers: The Scene layers (check also the easier to use
 
86
        L{layers<Scene.Scene.layers>}).  This value is a bitmask with at least
 
87
        one position set for the 20 possible layers starting from the low order
 
88
        bit.  The easiest way to deal with these values in in hexadecimal 
 
89
        notation.
 
90
        Example::
 
91
          scene.Layers = 0x04 # sets layer 3 ( bit pattern 0100 )
 
92
          scene.Layers |= 0x01
 
93
          print scene.Layers # will print: 5 ( meaning bit pattern 0101)
 
94
        After setting the Layers value, the interface (at least the 3d View and
 
95
        the Buttons window) needs to be redrawn to show the changes.
 
96
  @type layers: list of integers
 
97
  @ivar layers: The Scene layers (check also L{Layers<Scene.Scene.Layers>}).
 
98
        This attribute accepts and returns a list of integer values in the
 
99
        range [1, 20].
 
100
        Example::
 
101
          scene.layers = [3] # set layer 3
 
102
          scene.layers = scene.layers.append(1)
 
103
          print scene.layers # will print: [1, 3]
77
104
  """
78
105
 
79
106
  def getName():
89
116
    @param name: The new name.
90
117
    """
91
118
 
92
 
  def getWinSize():
 
119
  def getLayers():
93
120
    """
94
 
    @warn: B{Depricated}: use RenderData.imageSizeX() and RenderData.imageSizeY()
 
121
    Get the layers set for this Scene.
 
122
    @rtype: list of integers
 
123
    @return: a list where each number means the layer with that number is
 
124
       set.
95
125
    """
96
126
 
97
 
  def setWinSize(dimensions):
 
127
  def setLayers(layers):
98
128
    """
99
 
    @warn: B{Depricated}: use RenderData.imageSizeX() and RenderData.imageSizeY
 
129
    Set the visible layers for this scene.
 
130
    @type layers: list of integers
 
131
    @param layers: a list of integers in the range [1, 20], where each available
 
132
       index makes the layer with that number visible.
 
133
    @note: if this Scene is the current one, the 3D View layers are also
 
134
       updated, but the screen needs to be redrawn (at least 3D Views and
 
135
       Buttons windows) for the changes to be seen.
100
136
    """
101
137
 
102
138
  def copy(duplicate_objects = 1):
111
147
    @return: The copied Blender Scene.
112
148
    """
113
149
 
114
 
  def startFrame(frame = None):
115
 
    """
116
 
    @warn: B{Depricated}: use RenderData.startFrame()
117
 
    """
118
 
 
119
 
  def endFrame(frame = None):
120
 
    """
121
 
    @warn: B{Depricated}: use RenderData.endFrame()
122
 
    """
123
 
 
124
 
  def currentFrame(frame = None):
125
 
    """
126
 
    @warn: B{Depricated}: use RenderData.currentFrame
127
 
    """
128
 
 
129
 
  def frameSettings(start = None, end = None, current = None):
130
 
    """
131
 
    @warn: B{Depricated}: use RenderData.startFrame(),  RenderData.endFrame, RenderData.currentFrame
132
 
    """
133
 
 
134
150
  def makeCurrent():
135
151
    """
136
152
    Make this Scene the currently active one in Blender.
147
163
        The "full" update is a recent addition to this method.
148
164
    """
149
165
 
 
166
  def getRenderingContext():
 
167
    """
 
168
    Get the rendering context for this scene, see L{Render}.
 
169
    @rtype: RenderData
 
170
    @return: the render data object for this scene.
 
171
    """
 
172
 
 
173
  def getRadiosityContext():
 
174
    """
 
175
    Get the radiosity context for this scene, see L{Radio}.
 
176
    @rtype: Blender Radiosity
 
177
    @return: the radiosity object for this scene.
 
178
    @note: only the current scene can return a radiosity context.
 
179
    """
 
180
 
 
181
  def getChildren():
 
182
    """
 
183
    Get all objects linked to this Scene.
 
184
    @rtype: list of Blender Objects
 
185
    @return: A list with all Blender Objects linked to this Scene.
 
186
    @note: L{Object.Get} will return all objects currently in Blender, which
 
187
       means all objects from all available scenes.  In most cases (exporter
 
188
       scripts, for example), it's probably better to use this
 
189
       scene.GetChildren instead, since it will only access objects from this
 
190
       particular scene.
 
191
    """
 
192
 
 
193
  def getActiveObject():
 
194
    """
 
195
    Get this scene's active object.
 
196
    @note: the active object, if selected, can also be retrieved with
 
197
      L{Object.GetSelected} -- it is the first item in the returned
 
198
      list.  But even when no object is selected in Blender, there can be
 
199
      an active one (if the user enters editmode, for example, this is the
 
200
      object that should become available for edition).  So what makes this
 
201
      scene method different from C{Object.GetSelected()[0]} is that it can
 
202
      return the active object even when no objects are selected.
 
203
    @rtype: Blender Object or None
 
204
    @return: the active object or None if not available.
 
205
    """
 
206
 
 
207
  def getCurrentCamera():
 
208
    """
 
209
    Get the currently active Camera for this Scene.
 
210
    @rtype: Blender Camera
 
211
    @return: The currently active Camera.
 
212
    """
 
213
 
 
214
  def setCurrentCamera(camera):
 
215
    """
 
216
    Set the currently active Camera in this Scene.
 
217
    @type camera: Blender Camera
 
218
    @param camera: The new active Camera.
 
219
    """
 
220
 
150
221
  def link(object):
151
222
    """
152
223
    Link an Object to this Scene.
160
231
    @type object: Blender Object
161
232
    @param object: A Blender Object.
162
233
    """
 
234
 
 
235
  def getScriptLinks (event):
 
236
    """
 
237
    Get a list with this Scene's script links of type 'event'.
 
238
    @type event: string
 
239
    @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
 
240
    @rtype: list
 
241
    @return: a list with Blender L{Text} names (the script links of the given
 
242
        'event' type) or None if there are no script links at all.
 
243
    """
 
244
 
 
245
  def clearScriptLinks (links = None):
 
246
    """
 
247
    Delete script links from this Scene.  If no list is specified, all
 
248
    script links are deleted.
 
249
    @type links: list of strings
 
250
    @param links: None (default) or a list of Blender L{Text} names.
 
251
    """
 
252
 
 
253
  def addScriptLink (text, event):
 
254
    """
 
255
    Add a new script link to this Scene.
 
256
    @type text: string
 
257
    @param text: the name of an existing Blender L{Text}.
 
258
    @type event: string
 
259
    @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
 
260
    """
 
261
 
 
262
  def play (mode = 0, win = '<VIEW3D>'):
 
263
    """
 
264
    Play a realtime animation.  This is the "Play Back Animation" function in
 
265
    Blender, different from playing a sequence of rendered images (for that
 
266
    check L{Render.RenderData.play}).
 
267
    @type mode: int
 
268
    @param mode: controls playing:
 
269
        - 0: keep playing in the biggest 'win' window;
 
270
        - 1: keep playing in all 'win', VIEW3D and SEQ windows;
 
271
        - 2: play once in the biggest VIEW3D;
 
272
        - 3: play once in all 'win', VIEW3D and SEQ windows.
 
273
    @type win: int
 
274
    @param win: window type, see L{Window.Types}.  Only some of them are
 
275
        meaningful here: VIEW3D, SEQ, IPO, ACTION, NLA, SOUND.  But the others
 
276
        are also accepted, since this function can be used simply as an
 
277
        interruptible timer.  If 'win' is not visible or invalid, VIEW3D is
 
278
        tried, then any bigger visible window.
 
279
    @rtype: bool
 
280
    @return: 0 on normal exit or 1 when play back is canceled by user input.
 
281
    """