1
2
3 """
4 The Blender.Object submodule
5
6 B{New}:
7 - Addition of attributes for particle deflection, softbodies, and
8 rigidbodies.
9 - Objects now increment the Blender user count when they are created and
10 decremented it when they are destroyed. This means Python scripts can
11 keep the object "alive" if it is deleted in the Blender GUI.
12 - L{Object.getData} now accepts two optional bool keyword argument to
13 define (1) if the user wants the data object or just its name
14 and (2) if a mesh object should use NMesh or Mesh.
15 - L{Object.clearScriptLinks} accepts a parameter now.
16 - Object attributes: renamed Layer to L{Layers<Object.Object.Layers>} and
17 added the easier L{layers<Object.Object.layers>}. The old form "Layer"
18 will continue to work.
19
20
21 Object
22 ======
23
24 This module provides access to the B{Objects} in Blender.
25
26 Example::
27
28 import Blender
29 scn = Blender.Scene.GetCurrent() # get the current scene
30 cam = Blender.Camera.New('ortho') # make ortho camera data object
31 ob = scn.objects.new(cam) # make a new object in this scene using the camera data
32 ob.setLocation (0.0, -5.0, 1.0) # position the object in the scene
33
34 Blender.Redraw() # redraw the scene to show the updates.
35
36 @type DrawModes: readonly dictionary
37 @var DrawModes: Constant dict used for with L{Object.drawMode} bitfield
38 attribute. Values can be ORed together. Individual bits can also
39 be set/cleared with boolean attributes.
40 - AXIS: Enable display of active object's center and axis.
41 - TEXSPACE: Enable display of active object's texture space.
42 - NAME: Enable display of active object's name.
43 - WIRE: Enable the active object's wireframe over solid drawing.
44 - XRAY: Enable drawing the active object in front of others.
45 - TRANSP: Enable transparent materials for the active object (mesh only).
46
47 @type DrawTypes: readonly dictionary
48 @var DrawTypes: Constant dict used for with L{Object.drawType} attribute.
49 Only one type can be selected at a time.
50 - BOUNDBOX: Only draw object with bounding box
51 - WIRE: Draw object in wireframe
52 - SOLID: Draw object in solid
53 - SHADED: Draw object with shaded or textured
54
55 @type ParentTypes: readonly dictionary
56 @var ParentTypes: Constant dict used for with L{Object.parentType} attribute.
57 - OBJECT: Object parent type.
58 - CURVE: Curve deform parent type.
59 - LATTICE: Lattice deform parent type. Note: This is the same as ARMATURE, 2.43 was released with LATTICE as an invalid value.
60 - ARMATURE: Armature deform parent type.
61 - VERT1: 1 mesh vert parent type.
62 - VERT3: 1 mesh verts parent type.
63 - BONE: Armature bone parent type.
64
65
66 @type ProtectFlags: readonly dictionary
67 @var ProtectFlags: Constant dict used for with L{Object.protectFlags} attribute.
68 Values can be ORed together.
69 - LOCX, LOCY, LOCZ: lock x, y or z location individually
70 - ROTX, ROTY, ROTZ: lock x, y or z rotation individually
71 - SCALEX, SCALEY, SCALEZ: lock x, y or z scale individually
72 - LOC, ROT, SCALE: lock all 3 attributes for location, rotation or scale
73
74 @type PITypes: readonly dictionary
75 @var PITypes: Constant dict used for with L{Object.piType} attribute.
76 Only one type can be selected at a time.
77 - NONE: No force influence on particles
78 - FORCE: Object center attracts or repels particles ("Spherical")
79 - VORTEX: Particles swirl around Z-axis of the object
80 - WIND: Constant force applied in direction of object Z axis
81 - GUIDE: Use a Curve Path to guide particles
82
83 @type RBFlags: readonly dictionary
84 @var RBFlags: Constant dict used for with L{Object.rbFlags} attribute.
85 Values can be ORed together.
86 - SECTOR: All game elements should be in the Sector boundbox
87 - PROP: An Object fixed within a sector
88 - BOUNDS: Specify a bounds object for physics
89 - ACTOR: Enables objects that are evaluated by the engine
90 - DYNAMIC: Enables motion defined by laws of physics (requires ACTOR)
91 - GHOST: Enable objects that don't restitute collisions (requires ACTOR)
92 - MAINACTOR: Enables MainActor (requires ACTOR)
93 - RIGIDBODY: Enable rolling physics (requires ACTOR, DYNAMIC)
94 - COLLISION_RESPONSE: Disable auto (de)activation (requires ACTOR, DYNAMIC)
95 - USEFH: Use Fh settings in Materials (requires ACTOR, DYNAMIC)
96 - ROTFH: Use face normal to rotate Object (requires ACTOR, DYNAMIC)
97 - ANISOTROPIC: Enable anisotropic friction (requires ACTOR, DYNAMIC)
98 - CHILD: reserved
99
100 @type IpoKeyTypes: readonly dictionary
101 @var IpoKeyTypes: Constant dict used for with L{Object.insertIpoKey} attribute.
102 Values can be ORed together.
103 - LOC
104 - ROT
105 - SIZE
106 - LOCROT
107 - LOCROTSIZE
108 - LAYER
109 - PI_STRENGTH
110 - PI_FALLOFF
111 - PI_SURFACEDAMP
112 - PI_RANDOMDAMP
113 - PI_PERM
114
115 @type RBShapes: readonly dictionary
116 @var RBShapes: Constant dict used for with L{Object.rbShapeBoundType}
117 attribute. Only one type can be selected at a time. Values are
118 BOX, SPHERE, CYLINDER, CONE, and POLYHEDERON
119
120 @type EmptyShapes: readonly dictionary
121 @var EmptyShapes: Constant dict used for with L{Object.emptyShape} attribute.
122 Only one type can be selected at a time. Values are
123 ARROW, ARROWS, AXES, CIRCLE, CONE, CUBE AND SPHERE
124 """
125
126 -def New (type, name='type'):
127 """
128 Creates a new Object. Deprecated; instead use Scene.objects.new().
129 @type type: string
130 @param type: The Object type: 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
131 'Mball', 'Mesh', 'Surf' or 'Empty'.
132 @type name: string
133 @param name: The name of the object. By default, the name will be the same
134 as the object type.
135 If the name is already in use, this new object will have a number at the end of the name.
136 @return: The created Object.
137
138 I{B{Example:}}
139
140 The example below creates a new Lamp object and puts it at the default
141 location (0, 0, 0) in the current scene::
142 import Blender
143
144 object = Blender.Object.New('Lamp')
145 lamp = Blender.Lamp.New('Spot')
146 object.link(lamp)
147 sce = Blender.Scene.GetCurrent()
148 sce.link(object)
149
150 Blender.Redraw()
151 @Note: if an object is created but is not linked to object data, and the
152 object is not linked to a scene, it will be deleted when the Python
153 object is deallocated. This is because Blender does not allow objects
154 to exist without object data unless they are Empty objects. Scene.link()
155 will automatically create object data for an object if it has none.
156 """
157
158 -def Get (name = None):
159 """
160 Get the Object from Blender.
161 @type name: string
162 @param name: The name of the requested Object.
163 @return: It depends on the 'name' parameter:
164 - (name): The Object with the given name;
165 - (): A list with all Objects in the current scene.
166
167 I{B{Example 1:}}
168
169 The example below works on the default scene. The script returns the plane object and prints the location of the plane::
170 import Blender
171
172 object = Blender.Object.Get ('plane')
173 print object.getLocation()
174
175 I{B{Example 2:}}
176
177 The example below works on the default scene. The script returns all objects
178 in the scene and prints the list of object names::
179 import Blender
180
181 objects = Blender.Object.Get ()
182 print objects
183 @note: Get will return objects from all scenes.
184 Most user tools should only operate on objects from the current scene - Blender.Scene.GetCurrent().getChildren()
185 """
186
188 """
189 Get the user selection. If no objects are selected, an empty list will be returned.
190
191 @return: A list of all selected Objects in the current scene.
192
193 I{B{Example:}}
194
195 The example below works on the default scene. Select one or more objects and
196 the script will print the selected objects::
197 import Blender
198
199 objects = Blender.Object.GetSelected()
200 print objects
201 @note: The active object will always be the first object in the list (if selected).
202 @note: The user selection is made up of selected objects from Blender's current scene only.
203 @note: The user selection is limited to objects on visible layers;
204 if the user's last active 3d view is in localview then the selection will be limited to the objects in that localview.
205 """
206
207
208 -def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=0, material=0, texture=0, ipo=0):
209 """
210 Duplicate selected objects on visible layers from Blenders current scene,
211 de-selecting the currently visible, selected objects and making a copy where all new objects are selected.
212 By default no data linked to the object is duplicated; use the keyword arguments to change this.
213 L{Object.GetSelected()<GetSelected>} will return the list of objects resulting from duplication.
214
215 B{Note}: This command will raise an error if used from the command line (background mode) because it uses the 3D view context.
216
217 @type mesh: bool
218 @param mesh: When non-zero, mesh object data will be duplicated with the objects.
219 @type surface: bool
220 @param surface: When non-zero, surface object data will be duplicated with the objects.
221 @type curve: bool
222 @param curve: When non-zero, curve object data will be duplicated with the objects.
223 @type text: bool
224 @param text: When non-zero, text object data will be duplicated with the objects.
225 @type metaball: bool
226 @param metaball: When non-zero, metaball object data will be duplicated with the objects.
227 @type armature: bool
228 @param armature: When non-zero, armature object data will be duplicated with the objects.
229 @type lamp: bool
230 @param lamp: When non-zero, lamp object data will be duplicated with the objects.
231 @type material: bool
232 @param material: When non-zero, materials used by the object or its object data will be duplicated with the objects.
233 @type texture: bool
234 @param texture: When non-zero, texture data used by the object's materials will be duplicated with the objects.
235 @type ipo: bool
236 @param ipo: When non-zero, Ipo data linked to the object will be duplicated with the objects.
237
238 I{B{Example:}}
239
240 The example below creates duplicates the active object 10 times
241 and moves each object 1.0 on the X axis::
242 import Blender
243
244 scn = Scene.GetCurrent()
245 ob_act = scn.objects.active
246
247 # Unselect all
248 scn.objects.selected = []
249 ob_act.sel = 1
250
251 for x in xrange(10):
252 Blender.Object.Duplicate() # Duplicate linked
253 ob_act = scn.objects.active
254 ob_act.LocX += 1
255 Blender.Redraw()
256 """
257
258 from IDProp import IDGroup, IDArray
260 """
261 The Object object
262 =================
263 This object gives access to generic data from all objects in Blender.
264
265 B{Note}:
266 When dealing with properties and functions such as LocX/RotY/getLocation(), getSize() and getEuler(),
267 keep in mind that these transformation properties are relative to the object itself, ignoring any other transformations.
268
269 To get these values in worldspace (taking into account vertex parents, constraints, etc.)
270 pass the argument 'worldspace' to these functions.
271
272 @ivar restrictDisplay: Don't display this object in the 3D view: disabled by default, use the outliner to toggle.
273 @type restrictDisplay: bool
274 @ivar restrictSelect: Don't select this object in the 3D view: disabled by default, use the outliner to toggle.
275 @type restrictSelect: bool
276 @ivar restrictRender: Don't render this object: disabled by default, use the outliner to toggle.
277 @type restrictRender: bool
278 @ivar LocX: The X location coordinate of the object.
279 @type LocX: float
280 @ivar LocY: The Y location coordinate of the object.
281 @type LocY: float
282 @ivar LocZ: The Z location coordinate of the object.
283 @type LocZ: float
284 @ivar loc: The (X,Y,Z) location coordinates of the object.
285 @type loc: tuple of 3 floats
286 @ivar dLocX: The delta X location coordinate of the object.
287 This variable applies to IPO Objects only.
288 @type dLocX: float
289 @ivar dLocY: The delta Y location coordinate of the object.
290 This variable applies to IPO Objects only.
291 @type dLocY: float
292 @ivar dLocZ: The delta Z location coordinate of the object.
293 This variable applies to IPO Objects only.
294 @type dLocZ: float
295 @ivar dloc: The delta (X,Y,Z) location coordinates of the object (vector).
296 This variable applies to IPO Objects only.
297 @type dloc: tuple of 3 floats
298 @ivar RotX: The X rotation angle (in radians) of the object.
299 @type RotX: float
300 @ivar RotY: The Y rotation angle (in radians) of the object.
301 @type RotY: float
302 @ivar RotZ: The Z rotation angle (in radians) of the object.
303 @type RotZ: float
304 @ivar rot: The (X,Y,Z) rotation angles (in radians) of the object.
305 @type rot: euler (Py_WRAPPED)
306 @ivar dRotX: The delta X rotation angle (in radians) of the object.
307 This variable applies to IPO Objects only.
308 @type dRotX: float
309 @ivar dRotY: The delta Y rotation angle (in radians) of the object.
310 This variable applies to IPO Objects only.
311 @type dRotY: float
312 @ivar dRotZ: The delta Z rotation angle (in radians) of the object.
313 This variable applies to IPO Objects only.
314 @type dRotZ: float
315 @ivar drot: The delta (X,Y,Z) rotation angles (in radians) of the object.
316 This variable applies to IPO Objects only.
317 @type drot: tuple of 3 floats
318 @ivar SizeX: The X size of the object.
319 @type SizeX: float
320 @ivar SizeY: The Y size of the object.
321 @type SizeY: float
322 @ivar SizeZ: The Z size of the object.
323 @type SizeZ: float
324 @ivar size: The (X,Y,Z) size of the object.
325 @type size: tuple of 3 floats
326 @ivar dSizeX: The delta X size of the object.
327 @type dSizeX: float
328 @ivar dSizeY: The delta Y size of the object.
329 @type dSizeY: float
330 @ivar dSizeZ: The delta Z size of the object.
331 @type dSizeZ: float
332 @ivar dsize: The delta (X,Y,Z) size of the object.
333 @type dsize: tuple of 3 floats
334 @ivar Layers: The object layers (also check the newer attribute
335 L{layers<layers>}). This value is a bitmask with at
336 least one position set for the 20 possible layers starting from the low
337 order bit. The easiest way to deal with these values in in hexadecimal
338 notation.
339 Example::
340 ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
341 After setting the Layer value, call Blender.Redraw( -1 ) to update
342 the interface.
343 @type Layers: integer (bitmask)
344 @type layers: list of integers
345 @ivar layers: The layers this object is visible in (also check the older
346 attribute L{Layers<Layers>}). This returns a list of
347 integers in the range [1, 20], each number representing the respective
348 layer. Setting is done by passing a list of ints or an empty list for
349 no layers.
350 Example::
351 ob.layers = [] # object won't be visible
352 ob.layers = [1, 4] # object visible only in layers 1 and 4
353 ls = o.layers
354 ls.append(10)
355 o.layers = ls
356 print ob.layers # will print: [1, 4, 10]
357 B{Note}: changes will only be visible after the screen (at least
358 the 3d View and Buttons windows) is redrawn.
359 @ivar parent: The parent object of the object (if defined). Read-only.
360 @type parent: Object or None
361 @ivar data: The Datablock object linked to this object. Read-only.
362 @type data: varies
363 @ivar ipo: Contains the Ipo if one is assigned to the object, B{None}
364 otherwise. Setting to B{None} clears the current Ipo.
365 @type ipo: Ipo
366 @ivar mat: The matrix of the object in world space (absolute, takes vertex parents, tracking
367 and Ipos into account). Read-only.
368 @type mat: Matrix
369 @ivar matrix: Same as L{mat}. Read-only.
370 @type matrix: Matrix
371 @ivar matrixLocal: The matrix of the object relative to its parent; if there is no parent,
372 returns the world matrix (L{matrixWorld<Object.Object.matrixWorld>}).
373 @type matrixLocal: Matrix
374 @ivar matrixParentInverse: The inverse if the parents local matrix, set when the objects parent is set (wrapped).
375 @type matrixParentInverse: Matrix
376 @ivar matrixOldWorld: Old-type worldspace matrix (prior to Blender 2.34).
377 Read-only.
378 @type matrixOldWorld: Matrix
379 @ivar matrixWorld: Same as L{mat}. Read-only.
380 @type matrixWorld: Matrix
381 @ivar colbits: The Material usage mask. A set bit #n means: the Material
382 #n in the Object's material list is used. Otherwise, the Material #n
383 of the Objects Data material list is displayed.
384 Example::
385 object.colbits = (1<<0) + (1<<5) # use mesh materials 0 (1<<0) and 5 (1<<5)
386 # use object materials for all others
387 @ivar sel: The selection state of the object in the current scene.
388 True is selected, False is unselected. Setting makes the object active.
389 @type sel: boolean
390 @ivar effects: The list of particle effects associated with the object. (depricated, will always return an empty list)
391 Read-only.
392 @type effects: list of Effect objects
393 @ivar parentbonename: The string name of the parent bone (if defined).
394 This can be set to another bone in the armature if the object already has a bone parent.
395 @type parentbonename: string or None
396 @ivar parentVertexIndex: A list of vertex parent indicies, with a length of 0, 1 or 3. When there are 1 or 3 vertex parents, the indicies can be assigned to a sequence of the same length.
397 @type parentVertexIndex: list
398 @ivar protectFlags: The "transform locking" bitfield flags for the object.
399 See L{ProtectFlags} const dict for values.
400 @type protectFlags: int
401 @ivar DupGroup: The DupliGroup Animation Property. Assign a group to
402 DupGroup to make this object an instance of that group.
403 This does not enable or disable the DupliGroup option, for that use
404 L{enableDupGroup}.
405 The attribute returns None when this object does not have a dupliGroup,
406 and setting the attrbute to None deletes the object from the group.
407 @type DupGroup: Group or None
408 @ivar DupObjects: The Dupli object instances. Read-only.
409 Returns of list of tuples for object duplicated
410 by dupliframe, dupliverts dupligroups and other animation properties.
411 The first tuple item is the original object that is duplicated,
412 the second is the 4x4 worldspace dupli-matrix.
413 Example::
414 import Blender
415 from Blender import Object, Scene, Mathutils
416
417 ob= Object.Get('Cube')
418 dupe_obs= ob.DupObjects
419 scn= Scene.GetCurrent()
420 for dupe_ob, dupe_matrix in dupe_obs:
421 print dupe_ob.name
422 empty_ob = scn.objects.new('Empty')
423 empty_ob.setMatrix(dupe_matrix)
424 Blender.Redraw()
425 @type DupObjects: list of tuples containing (object, matrix)
426 @ivar enableNLAOverride: Whether the object uses NLA or active Action for animation. When True the NLA is used.
427 @type enableNLAOverride: boolean
428 @ivar enableDupVerts: The DupliVerts status of the object.
429 Does not indicate that this object has any dupliVerts,
430 (as returned by L{DupObjects}) just that dupliVerts are enabled.
431 @type enableDupVerts: boolean
432 @ivar enableDupFaces: The DupliFaces status of the object.
433 Does not indicate that this object has any dupliFaces,
434 (as returned by L{DupObjects}) just that dupliFaces are enabled.
435 @type enableDupFaces: boolean
436 @ivar enableDupFacesScale: The DupliFacesScale status of the object.
437 @type enableDupFacesScale: boolean
438 @ivar dupFacesScaleFac: Scale factor for dupliface instance, 1.0 by default.
439 @type dupFacesScaleFac: float
440 @ivar enableDupFrames: The DupliFrames status of the object.
441 Does not indicate that this object has any dupliFrames,
442 (as returned by L{DupObjects}) just that dupliFrames are enabled.
443 @type enableDupFrames: boolean
444 @ivar enableDupGroup: The DupliGroup status of the object.
445 Set True to make this object an instance of the object's L{DupGroup},
446 and set L{DupGroup} to a group for this to take effect,
447 Use L{DupObjects} to get the object data from this instance.
448 @type enableDupGroup: boolean
449 @ivar enableDupRot: The DupliRot status of the object.
450 Use with L{enableDupVerts} to rotate each instance
451 by the vertex normal.
452 @type enableDupRot: boolean
453 @ivar enableDupNoSpeed: The DupliNoSpeed status of the object.
454 Use with L{enableDupFrames} to ignore dupliFrame speed.
455 @type enableDupNoSpeed: boolean
456 @ivar DupSta: The DupliFrame starting frame. Use with L{enableDupFrames}.
457 Value clamped to [1,32767].
458 @type DupSta: int
459 @ivar DupEnd: The DupliFrame end frame. Use with L{enableDupFrames}.
460 Value clamped to [1,32767].
461 @type DupEnd: int
462 @ivar DupOn: The DupliFrames in succession between DupOff frames.
463 Value is clamped to [1,1500].
464 Use with L{enableDupFrames} and L{DupOff} > 0.
465 @type DupOn: int
466 @ivar DupOff: The DupliFrame removal of every Nth frame for this object.
467 Use with L{enableDupFrames}. Value is clamped to [0,1500].
468 @type DupOff: int
469 @ivar passIndex: Index # for the IndexOB render pass.
470 Value is clamped to [0,1000].
471 @type passIndex: int
472 @ivar activeMaterial: The active material index for this object.
473
474 The active index is used to select the material to edit in the material buttons,
475 new data created will also use the active material.
476
477 Value is clamped to [1,len(ob.materials)]. - [0,0] when there is no materials applied to the object.
478 @type activeMaterial: int
479 @ivar activeShape: The active shape key index for this object.
480
481 The active index is used to select the material to edit in the material buttons,
482 new data created will also use the active material.
483
484 Value is clamped to [1,len(ob.data.key.blocks)]. - [0,0] when there are no keys.
485
486 @type activeShape: int
487
488 @ivar pinShape: If True, only the activeShape will be displayed.
489 @type pinShape: bool
490 @ivar drawSize: The size to display the Empty.
491 Value clamped to [0.01,10.0].
492 @type drawSize: float
493 @ivar modifiers: The modifiers associated with the object.
494 Example::
495 # copy the active objects modifiers to all other visible selected objects
496 from Blender import *
497 scn = Scene.GetCurrent()
498 ob_act = scn.objects.active
499 for ob in scn.objects.context:
500 # Cannot copy modifiers to an object of a different type
501 if ob.type == ob_act.type:
502 ob.modifiers = ob_act.modifiers
503 @type modifiers: L{Modifier Sequence<Modifier.ModSeq>}
504 @ivar constraints: a L{sequence<Constraint.Constraints>} of
505 L{constraints<Constraint.Constraint>} for the object. Read-only.
506 @type constraints: Constraint Sequence
507 @ivar actionStrips: a L{sequence<NLA.ActionStrips>} of
508 L{action strips<NLA.ActionStrip>} for the object. Read-only.
509 @type actionStrips: BPy_ActionStrips
510 @ivar action: The action associated with this object (if defined).
511 @type action: L{Action<NLA.Action>} or None
512 @ivar oopsLoc: Object's (X,Y) OOPs location. Returns None if object
513 is not found in list.
514 @type oopsLoc: tuple of 2 floats
515 @ivar oopsSel: Object OOPs selection flag.
516 @type oopsSel: boolean
517 @ivar game_properties: The object's properties. Read-only.
518 @type game_properties: list of Properties.
519 @ivar timeOffset: The time offset of the object's animation.
520 Value clamped to [-300000.0,300000.0].
521 @type timeOffset: float
522 @ivar track: The object's tracked object. B{None} is returned if no
523 object is tracked. Also, assigning B{None} clear the tracked object.
524 @type track: Object or None
525 @ivar type: The object's type. Read-only.
526 @type type: string
527 @ivar boundingBox: The bounding box of this object. Read-only.
528 @type boundingBox: list of 8 3D vectors
529 @ivar drawType: The object's drawing type.
530 See L{DrawTypes} constant dict for values.
531 @type drawType: int
532 @ivar emptyShape: The empty drawing shape.
533 See L{EmptyShapes} constant dict for values.
534 @ivar parentType: The object's parent type. Read-only.
535 See L{ParentTypes} constant dict for values.
536 @type parentType: int
537 @ivar axis: Enable display of active object's center and axis.
538 Also see B{AXIS} bit in L{drawMode} attribute.
539 @type axis: boolean
540 @ivar texSpace: Enable display of active object's texture space.
541 Also see B{TEXSPACE} bit in L{drawMode} attribute.
542 @type texSpace: boolean
543 @ivar nameMode: Enable display of active object's name.
544 Also see B{NAME} bit in L{drawMode} attribute.
545 @type nameMode: boolean
546 @ivar wireMode: Enable the active object's wireframe over solid drawing.
547 Also see B{WIRE} bit in L{drawMode} attribute.
548 @type wireMode: boolean
549 @ivar xRay: Enable drawing the active object in front of others.
550 Also see B{XRAY} bit in L{drawMode} attribute.
551 @type xRay: boolean
552 @ivar transp: Enable transparent materials for the active object
553 (mesh only). Also see B{TRANSP} bit in L{drawMode} attribute.
554 @type transp: boolean
555 @ivar color: Object color used by the game engine and optionally for materials, 4 floats for RGBA object color.
556 @type color: tuple of 4 floats between 0 and 1
557 @ivar drawMode: The object's drawing mode bitfield.
558 See L{DrawModes} constant dict for values.
559 @type drawMode: int
560
561 @ivar piType: Type of particle interaction.
562 See L{PITypes} constant dict for values.
563 @type piType: int
564 @ivar piFalloff: The particle interaction falloff power.
565 Value clamped to [0.0,10.0].
566 @type piFalloff: float
567 @ivar piMaxDist: Max distance for the particle interaction field to work.
568 Value clamped to [0.0,1000.0].
569 @type piMaxDist: float
570 @ivar piPermeability: Probability that a particle will pass through the
571 mesh. Value clamped to [0.0,1.0].
572 @type piPermeability: float
573 @ivar piRandomDamp: Random variation of particle interaction damping.
574 Value clamped to [0.0,1.0].
575 @type piRandomDamp: float
576 @ivar piSoftbodyDamp: Damping factor for softbody deflection.
577 Value clamped to [0.0,1.0].
578 @type piSoftbodyDamp: float
579 @ivar piSoftbodyIThick: Inner face thickness for softbody deflection.
580 Value clamped to [0.001,1.0].
581 @type piSoftbodyIThick: float
582 @ivar piSoftbodyOThick: Outer face thickness for softbody deflection.
583 Value clamped to [0.001,1.0].
584 @type piSoftbodyOThick: float
585 @ivar piStrength: Particle interaction force field strength.
586 Value clamped to [0.0,1000.0].
587 @type piStrength: float
588 @ivar piSurfaceDamp: Amount of damping during particle collision.
589 Value clamped to [0.0,1.0].
590 @type piSurfaceDamp: float
591 @ivar piUseMaxDist: Use a maximum distance for the field to work.
592 @type piUseMaxDist: boolean
593
594 @ivar isSoftBody: True if object is a soft body. Read-only.
595 @type isSoftBody: boolean
596 @ivar SBDefaultGoal: Default softbody goal value, when no vertex group used.
597 Value clamped to [0.0,1.0].
598 @type SBDefaultGoal: float
599 @ivar SBErrorLimit: Softbody Runge-Kutta ODE solver error limit (low values give more precision).
600 Value clamped to [0.01,1.0].
601 @type SBErrorLimit: float
602 @ivar SBFriction: General media friction for softbody point movements.
603 Value clamped to [0.0,10.0].
604 @type SBFriction: float
605 @ivar SBGoalFriction: Softbody goal (vertex target position) friction.
606 Value clamped to [0.0,10.0].
607 @type SBGoalFriction: float
608 @ivar SBGoalSpring: Softbody goal (vertex target position) spring stiffness.
609 Value clamped to [0.0,0.999].
610 @type SBGoalSpring: float
611 @ivar SBGrav: Apply gravitation to softbody point movement.
612 Value clamped to [0.0,10.0].
613 @type SBGrav: float
614 @ivar SBInnerSpring: Softbody edge spring stiffness.
615 Value clamped to [0.0,0.999].
616 @type SBInnerSpring: float
617 @ivar SBInnerSpringFrict: Softbody edge spring friction.
618 Value clamped to [0.0,10.0].
619 @type SBInnerSpringFrict: float
620 @ivar SBMass: Softbody point mass (heavier is slower).
621 Value clamped to [0.001,50.0].
622 @type SBMass: float
623 @ivar SBMaxGoal: Softbody goal maximum (vertex group weights scaled to
624 match this range). Value clamped to [0.0,1.0].
625 @type SBMaxGoal: float
626 @ivar SBMinGoal: Softbody goal minimum (vertex group weights scaled to
627 match this range). Value clamped to [0.0,1.0].
628 @type SBMinGoal: float
629 @ivar SBSpeed: Tweak timing for physics to control softbody frequency and
630 speed. Value clamped to [0.0,10.0].
631 @type SBSpeed: float
632 @ivar SBStiffQuads: Softbody adds diagonal springs on 4-gons enabled.
633 @type SBStiffQuads: boolean
634 @ivar SBUseEdges: Softbody use edges as springs enabled.
635 @type SBUseEdges: boolean
636 @ivar SBUseGoal: Softbody forces for vertices to stick to animated position enabled.
637 @type SBUseGoal: boolean
638
639 @ivar rbFlags: Rigid body bitfield. See L{RBFlags} for valid values.
640 @type rbFlags: int
641 @ivar rbMass: Rigid body mass. Must be a positive value.
642 @type rbMass: float
643 @ivar rbRadius: Rigid body bounding sphere size. Must be a positive
644 value.
645 @type rbRadius: float
646 @ivar rbShapeBoundType: Rigid body shape bound type. See L{RBShapes}
647 const dict for values.
648 @type rbShapeBoundType: int
649 @ivar trackAxis: Track axis. Return string 'X' | 'Y' | 'Z' | '-X' | '-Y' | '-Z' (readonly)
650 @type trackAxis: string
651 @ivar upAxis: Up axis. Return string 'Y' | 'Y' | 'Z' (readonly)
652 @type upAxis: string
653 """
655 """
656 Return a list of particle systems linked to this object (see Blender.Particle).
657 """
658
659 - def newParticleSystem(name = None):
660 """
661 Link a particle system (see Blender.Particle). If no name is
662 given, a new particle system is created. If a name is given and a
663 particle system with that name exists, it is linked to the object.
664 @type name: string
665 @param name: The name of the requested Particle system (optional).
666 """
667
669 """
670 Add vertex groups from armature using the bone heat method
671 This method can be only used with an Object of the type Mesh when NOT in edit mode.
672 @type object: a bpy armature
673 """
674
676 """
677 Recomputes the particle system. This method only applies to an Object of
678 the type Effect. (depricated, does nothing now, use makeDisplayList instead to update the modifier stack)
679 """
680
682 """
683 Insert a Shape Key in the current object. It applies to Objects of
684 the type Mesh, Lattice, or Curve.
685 """
686
688 """
689 Gets the current Pose of the object.
690 @rtype: Pose object
691 @return: the current pose object
692 """
693
695 """
696 Evaluates the Pose based on its currently bound action at a certain frame.
697 @type framenumber: Int
698 @param framenumber: The frame number to evaluate to.
699 """
700
702 """
703 Unlinks the ipo from this object.
704 @return: True if there was an ipo linked or False otherwise.
705 """
706
708 """
709 Clears parent object.
710 @type mode: Integer
711 @type fast: Integer
712 @param mode: A mode flag. If mode flag is 2, then the object transform will
713 be kept. Any other value, or no value at all will update the object
714 transform.
715 @param fast: If the value is 0, the scene hierarchy will not be updated. Any
716 other value, or no value at all will update the scene hierarchy.
717 """
718
719 - def getData(name_only=False, mesh=False):
720 """
721 Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this
722 Object. If the keyword parameter B{name_only} is True, only the Datablock
723 name is returned as a string. It the object is of type Mesh, then the
724 B{mesh} keyword can also be used; the data return is a Mesh object if
725 True, otherwise it is an NMesh object (the default).
726 The B{mesh} keyword is ignored for non-mesh objects.
727 @type name_only: bool
728 @param name_only: This is a keyword parameter. If True (or nonzero),
729 only the name of the data object is returned.
730 @type mesh: bool
731 @param mesh: This is a keyword parameter. If True (or nonzero),
732 a Mesh data object is returned.
733 @rtype: specific Object type or string
734 @return: Depends on the type of Datablock linked to the Object. If
735 B{name_only} is True, it returns a string.
736 @note: Mesh is faster than NMesh because Mesh is a thin wrapper.
737 @note: This function is different from L{NMesh.GetRaw} and L{Mesh.Get}
738 because it keeps a link to the original mesh, which is needed if you are
739 dealing with Mesh weight groups.
740 @note: Make sure the object you are getting the data from isn't in
741 EditMode before calling this function; otherwise you'll get the data
742 before entering EditMode. See L{Window.EditMode}.
743 """
744
746 """
747 Returns None, or the 'sub-name' of the parent (eg. Bone name)
748 @return: string
749 """
750
752 """
753 Returns the object's delta location in a list (x, y, z)
754 @rtype: A vector triple
755 @return: (x, y, z)
756 """
757
759 """
760 Returns the object draw mode.
761 @rtype: Integer
762 @return: a sum of the following:
763 - 2 - axis
764 - 4 - texspace
765 - 8 - drawname
766 - 16 - drawimage
767 - 32 - drawwire
768 - 64 - xray
769 """
770
772 """
773 Returns the object draw type
774 @rtype: Integer
775 @return: One of the following:
776 - 1 - Bounding box
777 - 2 - Wire
778 - 3 - Solid
779 - 4 - Shaded
780 - 5 - Textured
781 """
782
784 """
785 @type space: string
786 @param space: The desired space for the size:
787 - localspace: (default) location without other transformations
788 - worldspace: location taking vertex parents, tracking and
789 Ipos into account
790 Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ). Angles are in radians.
791 @rtype: Py_Euler
792 @return: A python Euler. Data is wrapped when euler is present.
793 """
794
796 """
797 Returns the object's inverse matrix.
798 @rtype: Py_Matrix
799 @return: A python matrix 4x4
800 """
801
803 """
804 Returns the Ipo associated to this object or None if there's no linked ipo.
805 @rtype: Ipo
806 @return: the wrapped ipo or None.
807 """
809 """
810 Returns the objects selection state in the current scene as a boolean value True or False.
811 @rtype: Boolean
812 @return: Selection state as True or False
813 """
814
816 """
817 @type space: string
818 @param space: The desired space for the location:
819 - localspace: (default) location without other transformations
820 - worldspace: location taking vertex parents, tracking and
821 Ipos into account
822 Returns the object's location (x, y, z).
823 @return: (x, y, z)
824
825 I{B{Example:}}
826
827 The example below works on the default scene. It retrieves all objects in
828 the scene and prints the name and location of each object::
829 import Blender
830
831 sce = Blender.Scene.GetCurrent()
832
833 for ob in sce.objects:
834 print obj.name
835 print obj.loc
836 @note: the worldspace location is the same as ob.matrixWorld[3][0:3]
837 """
838
840 """
841 Returns an action if one is associated with this object (only useful for armature types).
842 @rtype: Py_Action
843 @return: a python action.
844 """
845
847 """
848 Returns a list of materials assigned to the object.
849 @type what: int
850 @param what: if nonzero, empty slots will be returned as None's instead
851 of being ignored (default way). See L{NMesh.NMesh.getMaterials}.
852 @rtype: list of Material Objects
853 @return: list of Material Objects assigned to the object.
854 """
855
857 """
858 Returns the object matrix.
859 @type space: string
860 @param space: The desired matrix:
861 - worldspace (default): absolute, taking vertex parents, tracking and
862 Ipo's into account;
863 - localspace: relative to the object's parent (returns worldspace
864 matrix if the object doesn't have a parent);
865 - old_worldspace: old behavior, prior to Blender 2.34, where eventual
866 changes made by the script itself were not taken into account until
867 a redraw happened, either called by the script or upon its exit.
868 Returns the object matrix.
869 @rtype: Py_Matrix (WRAPPED DATA)
870 @return: a python 4x4 matrix object. Data is wrapped for 'worldspace'
871 """
872
874 """
875 Returns the name of the object
876 @return: The name of the object
877
878 I{B{Example:}}
879
880 The example below works on the default scene. It retrieves all objects in
881 the scene and prints the name of each object::
882 import Blender
883
884 sce= Blender.Scene.GetCurrent()
885
886 for ob in sce.objects:
887 print ob.getName()
888 """
889
891 """
892 Returns the object's parent object.
893 @rtype: Object
894 @return: The parent object of the object. If not available, None will be
895 returned.
896 """
897
899 """
900 @type space: string
901 @param space: The desired space for the size:
902 - localspace: (default) location without other transformations
903 - worldspace: location taking vertex parents, tracking and
904 Ipos into account
905 Returns the object's size.
906 @return: (SizeX, SizeY, SizeZ)
907 @note: the worldspace size will not return negative (flipped) scale values.
908 """
909
911 """
912 Returns the object's parent object's sub name, or None.
913 For objects parented to bones, this is the name of the bone.
914 @rtype: String
915 @return: The parent object sub-name of the object.
916 If not available, None will be returned.
917 """
918
920 """
921 Returns the time offset of the object's animation.
922 @return: TimeOffset
923 """
924
926 """
927 Returns the object's tracked object.
928 @rtype: Object
929 @return: The tracked object of the object. If not available, None will be
930 returned.
931 """
932
934 """
935 Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
936 'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases.
937
938 I{B{Example:}}
939
940 The example below works on the default scene. It retrieves all objects in
941 the scene and updates the location and rotation of the camera. When run,
942 the camera will rotate 180 degrees and moved to the opposite side of the X
943 axis. Note that the number 'pi' in the example is an approximation of the
944 true number 'pi'. A better, less error-prone value of pi is math.pi from the python math module.::
945 import Blender
946
947 sce = Blender.Scene.GetCurrent()
948
949 for obj in sce.objects:
950 if obj.type == 'Camera':
951 obj.LocY = -obj.LocY
952 obj.RotZ = 3.141592 - obj.RotZ
953
954 Blender.Redraw()
955
956 @return: The type of object.
957 @rtype: String
958 """
959
961 """
962 Inserts keytype values in object ipo at curframe.
963 @type keytype: int
964 @param keytype: A constant from L{IpoKeyTypes<Object.IpoKeyTypes>}
965 @return: None
966 """
967
968 - def link(datablock):
969 """
970 Links Object with ObData datablock provided in the argument. The data must match the
971 Object's type, so you cannot link a Lamp to a Mesh type object.
972 @type datablock: Blender ObData datablock
973 @param datablock: A Blender datablock matching the objects type.
974 """
975
976 - def makeParent(objects, noninverse = 0, fast = 0):
977 """
978 Makes the object the parent of the objects provided in the argument which
979 must be a list of valid Objects.
980 @type objects: Sequence of Blender Object
981 @param objects: The children of the parent
982 @type noninverse: Integer
983 @param noninverse:
984 0 - make parent with inverse
985 1 - make parent without inverse
986 @type fast: Integer
987 @param fast:
988 0 - update scene hierarchy automatically
989 1 - don't update scene hierarchy (faster). In this case, you must
990 explicitely update the Scene hierarchy.
991 @warn: objects must first be linked to a scene before they can become
992 parents of other objects. Calling this makeParent method for an
993 unlinked object will result in an error.
994 """
995
997 """
998 Uses the object as a base for all of the objects in the provided list to join into.
999
1000 @type objects: Sequence of Blender Object
1001 @param objects: A list of objects matching the object's type.
1002 @note: Objects in the list will not be removed from the scene.
1003 To avoid overlapping data you may want to remove them manually after joining.
1004 @note: Join modifies the base object's data in place so that
1005 other objects are joined into it. No new object or data is created.
1006 @note: Join will only work for object types Mesh, Armature, Curve and Surface;
1007 an excption will be raised if the object is not of these types.
1008 @note: Objects in the list will be ignored if they to not match the base object.
1009 @note: The base object must be in the current scene to be joined.
1010 @note: This function will not work in background mode (no user interface).
1011 @note: An error in the function input will raise a TypeError or AttributeError,
1012 otherwise an error in the data input will raise a RuntimeError.
1013 For situations where you don't have tight control on the data that is being joined,
1014 you should handle the RuntimeError error, letting the user know the data can't be joined.
1015 """
1016
1039
1041 """
1042 Makes the object the vertex parent of the objects provided in the argument
1043 which must be a list of valid Objects.
1044 The parent object must be a Mesh, Curve or Surface.
1045 @type objects: Sequence of Blender Object
1046 @param objects: The children of the parent
1047 @type indices: Tuple of Integers
1048 @param indices: The indices of the vertices you want to parent to (1 or 3 values)
1049 @type noninverse: Integer
1050 @param noninverse:
1051 0 - make parent with inverse
1052 1 - make parent without inverse
1053 @type fast: Integer
1054 @param fast:
1055 0 - update scene hierarchy automatically
1056 1 - don't update scene hierarchy (faster). In this case, you must
1057 explicitely update the Scene hierarchy.
1058 @warn: objects must first be linked to a scene before they can become
1059 parents of other objects. Calling this makeParent method for an
1060 unlinked object will result in an error.
1061 """
1063 """
1064 Makes one of the object's bones the parent of the objects provided in the argument
1065 which must be a list of valid objects. The parent object must be an Armature.
1066 @type objects: Sequence of Blender Object
1067 @param objects: The children of the parent
1068 @type bonename: string
1069 @param bonename: a valid bone name from the armature
1070 @type noninverse: integer
1071 @param noninverse:
1072 0 - make parent with inverse
1073 1 - make parent without inverse
1074 @type fast: integer
1075 @param fast:
1076 0 - update scene hierarchy automatically
1077 1 - don't update scene hierarchy (faster). In this case, you must
1078 explicitly update the Scene hierarchy.
1079 @warn: Objects must first be linked to a scene before they can become
1080 parents of other objects. Calling this method for an
1081 unlinked object will result in an exception.
1082 """
1083
1085 """
1086 Sets the object's delta location which must be a vector triple.
1087 @type delta_location: A vector triple
1088 @param delta_location: A vector triple (x, y, z) specifying the new
1089 location.
1090 """
1091
1093 """
1094 Sets the object's drawing mode. The drawing mode can be a mix of modes. To
1095 enable these, add up the values.
1096 @type drawmode: Integer
1097 @param drawmode: A sum of the following:
1098 - 2 - axis
1099 - 4 - texspace
1100 - 8 - drawname
1101 - 16 - drawimage
1102 - 32 - drawwire
1103 - 64 - xray
1104 """
1105
1107 """
1108 Sets the object's drawing type.
1109 @type drawtype: Integer
1110 @param drawtype: One of the following:
1111 - 1 - Bounding box
1112 - 2 - Wire
1113 - 3 - Solid
1114 - 4 - Shaded
1115 - 5 - Textured
1116 """
1117
1119 """
1120 Sets the object's localspace rotation according to the specified Euler angles.
1121 @type euler: Py_Euler or a list of floats
1122 @param euler: a python Euler or x,y,z rotations as floats
1123 """
1124
1126 """
1127 Links an ipo to this object.
1128 @type ipo: Blender Ipo
1129 @param ipo: an object type ipo.
1130 """
1131
1133 """
1134 Sets the object's location relative to the parent object (if any).
1135 @type x: float
1136 @param x: The X coordinate of the new location.
1137 @type y: float
1138 @param y: The Y coordinate of the new location.
1139 @type z: float
1140 @param z: The Z coordinate of the new location.
1141 """
1142
1144 """
1145 Sets the materials. The argument must be a list 16 items or less. Each
1146 list element is either a Material or None. Also see L{colbits}.
1147 @type materials: Materials list
1148 @param materials: A list of Blender material objects.
1149 @note: Materials are assigned to the object's data by default. Unless
1150 you know the material is applied to the object or are changing the
1151 object's L{colbits}, you need to look at the object data's materials.
1152 """
1153
1155 """
1156 Sets the object's matrix and updates its transformation. If the object
1157 has a parent, the matrix transform is relative to the parent.
1158 @type matrix: Py_Matrix 3x3 or 4x4
1159 @param matrix: a 3x3 or 4x4 Python matrix. If a 3x3 matrix is given,
1160 it is extended to a 4x4 matrix.
1161 @Note: This method is "bad": when called it changes the location,
1162 rotation and size attributes of the object (since Blender uses these
1163 values to calculate the object's transformation matrix). Ton is
1164 not happy having a method which "pretends" to do a matrix operation.
1165 In the future, this method may be replaced with other methods which
1166 make it easier for the user to determine the correct loc/rot/size values
1167 for necessary for the object.
1168 """
1169
1171 """
1172 Sets the name of the object. A string longer than 20 characters will be shortened.
1173 @type name: String
1174 @param name: The new name for the object.
1175 """
1176
1178 """
1179 Sets the object's size, relative to the parent object (if any), clamped
1180 @type x: float
1181 @param x: The X size multiplier.
1182 @type y: float
1183 @param y: The Y size multiplier.
1184 @type z: float
1185 @param z: The Z size multiplier.
1186 """
1187
1189 """
1190 Sets the time offset of the object's animation.
1191 @type timeOffset: float
1192 @param timeOffset: The new time offset for the object's animation.
1193 """
1194
1196 """
1197 Link data of a specified argument with this object. This works only
1198 if both objects are of the same type.
1199 @type object: Blender Object
1200 @param object: A Blender Object of the same type.
1201 @note: This function is faster than using L{getData()} and setData()
1202 because it skips making a Python object from the object's data.
1203 """
1204
1206 """
1207 Sets the object's selection state in the current scene.
1208 setting the selection will make this object the active object of this scene.
1209 @type boolean: Integer
1210 @param boolean:
1211 - 0 - unselected
1212 - 1 - selected
1213 """
1214
1216 """
1217 Returns the worldspace bounding box of this object. This works for meshes (out of
1218 edit mode) and curves.
1219 @type worldspace: int
1220 @param worldspace: An optional argument. When zero, the bounding values will be localspace.
1221 @rtype: list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA)
1222 @return: The coordinates of the 8 corners of the bounding box. Data is wrapped when
1223 bounding box is present.
1224 """
1225
1227 """
1228 Forces an update to the objects display data. If the object isn't modified,
1229 there's no need to recalculate this data.
1230 This method is here for the *few cases* where it is needed.
1231
1232 Example::
1233 import Blender
1234
1235 scn = Blender.Scene.GetCurrent()
1236 object = scn.objects.active
1237 object.modifiers.append(Blender.Modifier.Type.SUBSURF)
1238 object.makeDisplayList()
1239 Blender.Window.RedrawAll()
1240
1241 If you try this example without the line to update the display list, the
1242 object will disappear from the screen until you press "SubSurf".
1243 @warn: If after running your script objects disappear from the screen or
1244 are not displayed correctly, try this method function. But if the script
1245 works properly without it, there's no reason to use it.
1246 """
1247
1249 """
1250 Get a list with this Object's script links of type 'event'.
1251 @type event: string
1252 @param event: "FrameChanged", "Redraw" or "Render".
1253 @rtype: list
1254 @return: a list with Blender L{Text} names (the script links of the given
1255 'event' type) or None if there are no script links at all.
1256 """
1257
1259 """
1260 Delete script links from this Object. If no list is specified, all
1261 script links are deleted.
1262 @type links: list of strings
1263 @param links: None (default) or a list of Blender L{Text} names.
1264 """
1265
1267 """
1268 Add a new script link to this Object.
1269 @type text: string
1270 @param text: the name of an existing Blender L{Text}.
1271 @type event: string
1272 @param event: "FrameChanged", "Redraw" or "Render".
1273 """
1274
1276 """
1277 Make this Object track another.
1278 @type tracked: Blender Object
1279 @param tracked: the object to be tracked.
1280 @type fast: int (bool)
1281 @param fast: if zero, the scene hierarchy is updated automatically. If
1282 you set 'fast' to a nonzero value, don't forget to update the scene
1283 yourself (see L{Scene.Scene.update}).
1284 @note: you also need to clear the rotation (L{setEuler}) of this object
1285 if it was not (0,0,0) already.
1286 """
1287
1289 """
1290 Make this Object not track another anymore.
1291 @type mode: int (bool)
1292 @param mode: if nonzero the matrix transformation used for tracking is kept.
1293 @type fast: int (bool)
1294 @param fast: if zero, the scene hierarchy is updated automatically. If
1295 you set 'fast' to a nonzero value, don't forget to update the scene
1296 yourself (see L{Scene.Scene.update}).
1297 """
1298
1300 """
1301 Return a list of all game properties from this object.
1302 @rtype: PyList
1303 @return: List of Property objects.
1304 """
1305
1307 """
1308 Return a game property from this object matching the name argument.
1309 @type name: string
1310 @param name: the name of the property to get.
1311 @rtype: Property object
1312 @return: The first property that matches name.
1313 """
1314
1316 """
1317 Add or create a game property for an object. If called with only a
1318 property object, the property is assigned to the object. If called
1319 with a property name string and data object, a new property is
1320 created and added to the object.
1321 @type name_or_property: string or Property object
1322 @param name_or_property: the property name, or a property object.
1323 @type data: string, int or float
1324 @param data: Only valid when I{name_or_property} is a string.
1325 Value depends on what is passed in:
1326 - string: string type property
1327 - int: integer type property
1328 - float: float type property
1329 @type type: string (optional)
1330 @param type: Only valid when I{name_or_property} is a string.
1331 Can be the following:
1332 - 'BOOL'
1333 - 'INT'
1334 - 'FLOAT'
1335 - 'TIME'
1336 - 'STRING'
1337 @warn: If a type is not declared string data will
1338 become string type, int data will become int type
1339 and float data will become float type. Override type
1340 to declare bool type, and time type.
1341 @warn: A property object can be added only once to an object;
1342 you must remove the property from an object to add it elsewhere.
1343 """
1344
1346 """
1347 Remove a game property from an object.
1348 @type property: Property object or string
1349 @param property: Property object or property name to be removed.
1350 """
1351
1353 """
1354 Removes all game properties from an object.
1355 """
1356
1358 """
1359 Copies all game properties from one object to another.
1360 @type object: Object object
1361 @param object: Object that will receive the properties.
1362 """
1363
1365 """
1366 Get the Object's Particle Interaction Strength.
1367 @rtype: float
1368 """
1369
1371 """
1372 Set the Object's Particle Interaction Strength.
1373 Values between -1000.0 to 1000.0
1374 @rtype: None
1375 @type strength: float
1376 @param strength: the Object's Particle Interaction New Strength.
1377 """
1378
1380 """
1381 Get the Object's Particle Interaction falloff.
1382 @rtype: float
1383 """
1384
1386 """
1387 Set the Object's Particle Interaction falloff.
1388 Values between 0 to 10.0
1389 @rtype: None
1390 @type falloff: float
1391 @param falloff: the Object's Particle Interaction New falloff.
1392 """
1393
1395 """
1396 Get the Object's Particle Interaction MaxDist.
1397 @rtype: float
1398 """
1399
1401 """
1402 Set the Object's Particle Interaction MaxDist.
1403 Values between 0 to 1000.0
1404 @rtype: None
1405 @type MaxDist: float
1406 @param MaxDist: the Object's Particle Interaction New MaxDist.
1407 """
1408
1410 """
1411 Get the Object's Particle Interaction Type.
1412 @rtype: int
1413 """
1414
1416 """
1417 Set the Object's Particle Interaction type.
1418 Use Module Constants
1419 - NONE
1420 - WIND
1421 - FORCE
1422 - VORTEX
1423 - MAGNET
1424 @rtype: None
1425 @type type: int
1426 @param type: the Object's Particle Interaction Type.
1427 """
1428
1430 """
1431 Get the Object's Particle Interaction if using MaxDist.
1432 @rtype: int
1433 """
1434
1436 """
1437 Set the Object's Particle Interaction MaxDist.
1438 0 = Off, 1 = on
1439 @rtype: None
1440 @type status: int
1441 @param status: the new status
1442 """
1443
1445 """
1446 Get the Object's Particle Interaction Deflection Setting.
1447 @rtype: int
1448 """
1449
1451 """
1452 Set the Object's Particle Interaction Deflection Setting.
1453 0 = Off, 1 = on
1454 @rtype: None
1455 @type status: int
1456 @param status: the new status
1457 """
1458
1460 """
1461 Get the Object's Particle Interaction Permeability.
1462 @rtype: float
1463 """
1464
1466 """
1467 Set the Object's Particle Interaction Permeability.
1468 Values between 0 to 10.0
1469 @rtype: None
1470 @type perm: float
1471 @param perm: the Object's Particle Interaction New Permeability.
1472 """
1473
1475 """
1476 Get the Object's Particle Interaction RandomDamp.
1477 @rtype: float
1478 """
1479
1481 """
1482 Set the Object's Particle Interaction RandomDamp.
1483 Values between 0 to 10.0
1484 @rtype: None
1485 @type damp: float
1486 @param damp: the Object's Particle Interaction New RandomDamp.
1487 """
1488
1490 """
1491 Get the Object's Particle Interaction SurfaceDamp.
1492 @rtype: float
1493 """
1494
1496 """
1497 Set the Object's Particle Interaction SurfaceDamp.
1498 Values between 0 to 10.0
1499 @rtype: None
1500 @type damp: float
1501 @param damp: the Object's Particle Interaction New SurfaceDamp.
1502 """
1503
1505 """
1506 Get the Object's SoftBody Mass.
1507 @rtype: float
1508 """
1509
1511 """
1512 Set the Object's SoftBody Mass.
1513 Values between 0 to 50.0
1514 @rtype: None
1515 @type mass: float
1516 @param mass: the Object's SoftBody New mass.
1517 """
1518
1520 """
1521 Get the Object's SoftBody Gravity.
1522 @rtype: float
1523 """
1524
1526 """
1527 Set the Object's SoftBody Gravity.
1528 Values between 0 to 10.0
1529 @rtype: None
1530 @type grav: float
1531 @param grav: the Object's SoftBody New Gravity.
1532 """
1533
1535 """
1536 Get the Object's SoftBody Friction.
1537 @rtype: float
1538 """
1539
1541 """
1542 Set the Object's SoftBody Friction.
1543 Values between 0 to 10.0
1544 @rtype: None
1545 @type frict: float
1546 @param frict: the Object's SoftBody New Friction.
1547 """
1548
1550 """
1551 Get the Object's SoftBody ErrorLimit.
1552 @rtype: float
1553 """
1554
1556 """
1557 Set the Object's SoftBody ErrorLimit.
1558 Values between 0 to 1.0
1559 @rtype: None
1560 @type err: float
1561 @param err: the Object's SoftBody New ErrorLimit.
1562 """
1563
1565 """
1566 Get the Object's SoftBody GoalSpring.
1567 @rtype: float
1568 """
1569
1571 """
1572 Set the Object's SoftBody GoalSpring.
1573 Values between 0 to 0.999
1574 @rtype: None
1575 @type gs: float
1576 @param gs: the Object's SoftBody New GoalSpring.
1577 """
1578
1580 """
1581 Get the Object's SoftBody GoalFriction.
1582 @rtype: float
1583 """
1584
1586 """
1587 Set the Object's SoftBody GoalFriction.
1588 Values between 0 to 10.0
1589 @rtype: None
1590 @type gf: float
1591 @param gf: the Object's SoftBody New GoalFriction.
1592 """
1593
1595 """
1596 Get the Object's SoftBody MinGoal.
1597 @rtype: float
1598 """
1599
1601 """
1602 Set the Object's SoftBody MinGoal.
1603 Values between 0 to 1.0
1604 @rtype: None
1605 @type mg: float
1606 @param mg: the Object's SoftBody New MinGoal.
1607 """
1608
1610 """
1611 Get the Object's SoftBody MaxGoal.
1612 @rtype: float
1613 """
1614
1616 """
1617 Set the Object's SoftBody MaxGoal.
1618 Values between 0 to 1.0
1619 @rtype: None
1620 @type mg: float
1621 @param mg: the Object's SoftBody New MaxGoal.
1622 """
1623
1625 """
1626 Get the Object's SoftBody InnerSpring.
1627 @rtype: float
1628 """
1629
1631 """
1632 Set the Object's SoftBody InnerSpring.
1633 Values between 0 to 0.999
1634 @rtype: None
1635 @type sprr: float
1636 @param sprr: the Object's SoftBody New InnerSpring.
1637 """
1638
1640 """
1641 Get the Object's SoftBody InnerSpringFriction.
1642 @rtype: float
1643 """
1644
1646 """
1647 Set the Object's SoftBody InnerSpringFriction.
1648 Values between 0 to 10.0
1649 @rtype: None
1650 @type sprf: float
1651 @param sprf: the Object's SoftBody New InnerSpringFriction.
1652 """
1653
1655 """
1656 Get the Object's SoftBody DefaultGoal.
1657 @rtype: float
1658 """
1659
1661 """
1662 Set the Object's SoftBody DefaultGoal.
1663 Values between 0 to 1.0
1664 @rtype: None
1665 @type goal: float
1666 @param goal: the Object's SoftBody New DefaultGoal.
1667 """
1668
1670 """
1671 Returns the Object's SoftBody enabled state.
1672 @rtype: boolean
1673 """
1674
1675 - def getSBPostDef():
1676 """
1677 get SoftBodies PostDef option
1678 @rtype: int
1679 """
1680
1681 - def setSBPostDef(switch):
1682 """
1683 Enable / Disable SoftBodies PostDef option
1684 1: on
1685 0: off
1686 @rtype: None
1687 @type switch: int
1688 @param switch: the Object's SoftBody New PostDef Value.
1689 """
1690
1692 """
1693 get SoftBodies UseGoal option
1694 @rtype: int
1695 """
1696
1698 """
1699 Enable / Disable SoftBodies UseGoal option
1700 1: on
1701 0: off
1702 @rtype: None
1703 @type switch: int
1704 @param switch: the Object's SoftBody New UseGoal Value.
1705 """
1707 """
1708 get SoftBodies UseEdges option
1709 @rtype: int
1710 """
1711
1713 """
1714 Enable / Disable SoftBodies UseEdges option
1715 1: on
1716 0: off
1717 @rtype: None
1718 @type switch: int
1719 @param switch: the Object's SoftBody New UseEdges Value.
1720 """
1721
1723 """
1724 get SoftBodies StiffQuads option
1725 @rtype: int
1726 """
1727
1729 """
1730 Enable / Disable SoftBodies StiffQuads option
1731 1: on
1732 0: off
1733 @rtype: None
1734 @type switch: int
1735 @param switch: the Object's SoftBody New StiffQuads Value.
1736 """
1737
1738
1740 """
1741 The Property object
1742 ===================
1743 This property gives access to object property data in Blender, used by the game engine.
1744 @ivar name: The property name.
1745 @ivar data: Data for this property. Depends on property type.
1746 @ivar type: The property type.
1747 @warn: Comparisons between properties will only be true when
1748 both the name and data pairs are the same.
1749 """
1750
1752 """
1753 Get the name of this property.
1754 @rtype: string
1755 @return: The property name.
1756 """
1757
1759 """
1760 Set the name of this property.
1761 @type name: string
1762 @param name: The new name of the property
1763 """
1764
1766 """
1767 Get the data for this property.
1768 @rtype: string, int, or float
1769 """
1770
1772 """
1773 Set the data for this property.
1774 @type data: string, int, or float
1775 @param data: The data to set for this property.
1776 @warn: See object.setProperty(). Changing data
1777 which is of a different type then the property is
1778 set to (i.e. setting an int value to a float type'
1779 property) will change the type of the property
1780 automatically.
1781 """
1782
1784 """
1785 Get the type for this property.
1786 @rtype: string
1787 """
1788
1789 import id_generics
1790 Object.__doc__ += id_generics.attributes
1791