From c78b460fce4b1da228bd60809e281eea358cf2c9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 24 Mar 2009 19:37:17 +0000 Subject: Use Benoits attributes in KX_GameObject. Deprecated.. getPosition, setPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass * swapped set/get to get/set in KX_PYATTRIBUTE_RW_FUNCTION macro to match pythons getsetattrs. * deprecation warnings in the api and notes in epydocs. * added 'state' attribute * gameob.mass = 10 # now works because its not checking only for float values. * dir(gameob) # includes attributes now --- source/gameengine/PyDoc/KX_GameObject.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 4f389a1ae4f..694fe02a7cc 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -24,6 +24,8 @@ class KX_GameObject: @type scaling: list [sx, sy, sz] @ivar timeOffset: adjust the slowparent delay at runtime. @type timeOffset: float + @ivar state: the game object's state bitmask. + @type state: int """ def endObject(visible): """ @@ -37,33 +39,35 @@ class KX_GameObject: """ def getVisible(): """ - Gets the game object's visible flag. + Gets the game object's visible flag. (B{deprecated}) @rtype: boolean """ - def setVisible(visible): + def setVisible(visible, recursive): """ Sets the game object's visible flag. @type visible: boolean + @type recursive: boolean + @param recursive: optional argument to set all childrens visibility flag too. """ def getState(): """ - Gets the game object's state bitmask. + Gets the game object's state bitmask. (B{deprecated}) @rtype: int @return: the objects state. """ def setState(state): """ - Sets the game object's state flag. - The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29) + Sets the game object's state flag. (B{deprecated}). + The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29) @type state: integer """ def setPosition(pos): """ - Sets the game object's position. + Sets the game object's position. (B{deprecated}) Global coordinates for root object, local for child objects. @@ -79,14 +83,14 @@ class KX_GameObject: """ def getPosition(): """ - Gets the game object's position. + Gets the game object's position. (B{deprecated}) @rtype: list [x, y, z] @return: the object's position in world coordinates. """ def setOrientation(orn): """ - Sets the game object's orientation. + Sets the game object's orientation. (B{deprecated}) @type orn: 3x3 rotation matrix, or Quaternion. @param orn: a rotation matrix specifying the new rotation. @@ -117,7 +121,7 @@ class KX_GameObject: """ def getOrientation(): """ - Gets the game object's orientation. + Gets the game object's orientation. (B{deprecated}) @rtype: 3x3 rotation matrix @return: The game object's rotation matrix @@ -231,7 +235,7 @@ class KX_GameObject: """ def getMass(): """ - Gets the game object's mass. + Gets the game object's mass. (B{deprecated}) @rtype: float @return: the object's mass. @@ -280,7 +284,7 @@ class KX_GameObject: """ def getParent(): """ - Gets this object's parent. + Gets this object's parent. (B{deprecated}) @rtype: L{KX_GameObject} @return: this object's parent object, or None if this object has no parent. -- cgit v1.2.3 From bba2bdf41e064c4c6602aa5e6c6c79364f51b08d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 26 Mar 2009 01:42:01 +0000 Subject: Added attributes for Ipo Actuator settings (replacing all methods) --- source/gameengine/PyDoc/KX_IpoActuator.py | 47 ++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 14 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_IpoActuator.py b/source/gameengine/PyDoc/KX_IpoActuator.py index e2fe3b289e3..ebc0b855f0a 100644 --- a/source/gameengine/PyDoc/KX_IpoActuator.py +++ b/source/gameengine/PyDoc/KX_IpoActuator.py @@ -5,10 +5,29 @@ from SCA_IActuator import * class KX_IpoActuator(SCA_IActuator): """ IPO actuator activates an animation. + + @ivar startFrame: Start frame. + @type startFrame: float + @ivar endFrame: End frame. + @type endFrame: float + @ivar propName: Use this property to define the Ipo position + @type propName: string + @ivar framePropName: Assign this property this action current frame number + @type framePropName: string + @ivar type: Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP) + @type type: int + @ivar useIpoAsForce: Apply Ipo as a global or local force depending on the local option (dynamic objects only) + @type useIpoAsForce: bool + @ivar useIpoAdd: Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag + @type useIpoAdd: bool + @ivar useIpoLocal: Let the ipo acts in local coordinates, used in Force and Add mode. + @type useIpoLocal: bool + @ivar useChildren: Update IPO on all children Objects as well + @type useChildren: bool """ def set(mode, startframe, endframe, force): """ - Sets the properties of the actuator. + Sets the properties of the actuator. (B{deprecated}) @param mode: "Play", "PingPong", "Flipper", "LoopStop", "LoopEnd" or "FromProp" @type mode: string @@ -21,70 +40,70 @@ class KX_IpoActuator(SCA_IActuator): """ def setProperty(property): """ - Sets the name of the property to be used in FromProp mode. + Sets the name of the property to be used in FromProp mode. (B{deprecated}) @type property: string """ def setStart(startframe): """ - Sets the frame from which the IPO starts playing. + Sets the frame from which the IPO starts playing. (B{deprecated}) @type startframe: integer """ def getStart(): """ - Returns the frame from which the IPO starts playing. + Returns the frame from which the IPO starts playing. (B{deprecated}) @rtype: integer """ def setEnd(endframe): """ - Sets the frame at which the IPO stops playing. + Sets the frame at which the IPO stops playing. (B{deprecated}) @type endframe: integer """ def getEnd(): """ - Returns the frame at which the IPO stops playing. + Returns the frame at which the IPO stops playing. (B{deprecated}) @rtype: integer """ def setIpoAsForce(force): """ - Set whether to interpret the ipo as a force rather than a displacement. + Set whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) @type force: boolean @param force: KX_TRUE or KX_FALSE """ def getIpoAsForce(): """ - Returns whether to interpret the ipo as a force rather than a displacement. + Returns whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) @rtype: boolean """ def setIpoAdd(add): """ - Set whether to interpret the ipo as additive rather than absolute. + Set whether to interpret the ipo as additive rather than absolute. (B{deprecated}) @type add: boolean @param add: KX_TRUE or KX_FALSE """ def getIpoAdd(): """ - Returns whether to interpret the ipo as additive rather than absolute. + Returns whether to interpret the ipo as additive rather than absolute. (B{deprecated}) @rtype: boolean """ def setType(mode): """ - Sets the operation mode of the actuator. + Sets the operation mode of the actuator. (B{deprecated}) @param mode: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND @type mode: string """ def getType(): """ - Returns the operation mode of the actuator. + Returns the operation mode of the actuator. (B{deprecated}) @rtype: integer @return: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND @@ -92,7 +111,7 @@ class KX_IpoActuator(SCA_IActuator): def setForceIpoActsLocal(local): """ Set whether to apply the force in the object's local - coordinates rather than the world global coordinates. + coordinates rather than the world global coordinates. (B{deprecated}) @param local: Apply the ipo-as-force in the object's local coordinates? (KX_TRUE, KX_FALSE) @@ -101,5 +120,5 @@ class KX_IpoActuator(SCA_IActuator): def getForceIpoActsLocal(): """ Return whether to apply the force in the object's local - coordinates rather than the world global coordinates. + coordinates rather than the world global coordinates. (B{deprecated}) """ -- cgit v1.2.3 From 059c2a10c4df53a7cd96689e8a60be2afd4b4d46 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 27 Mar 2009 21:54:16 +0000 Subject: BGE API cleanup: AddObject, DeleteObject and Scene actuator added. --- source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py | 15 +++++++++++++++ source/gameengine/PyDoc/KX_SceneActuator.py | 14 ++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py index 56068fa641a..974ef718ccf 100644 --- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py @@ -9,6 +9,12 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): @type object: KX_GameObject or None @ivar objectLastCreated: the last added object from this actuator (read only). @type objectLastCreated: KX_GameObject or None + @ivar time: the lifetime of added objects, in frames. + @type time: integer + @ivar linearVelocity: the initial linear velocity of added objects. + @type linearVelocity: list [vx, vy, vz] + @ivar angularVelocity: the initial angular velocity of added objects. + @type angularVelocity: list [vx, vy, vz] @warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer. @@ -19,6 +25,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def setObject(object): """ + DEPRECATED: use the object property Sets the game object to add. A copy of the object will be added to the scene when the actuator is activated. @@ -31,6 +38,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def getObject(name_only = 0): """ + DEPRECATED: use the object property Returns the name of the game object to be added. Returns None if no game object has been assigned to be added. @@ -40,6 +48,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def setTime(time): """ + DEPRECATED: use the time property Sets the lifetime of added objects, in frames. If time == 0, the object will last forever. @@ -49,12 +58,14 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def getTime(): """ + DEPRECATED: use the time property Returns the lifetime of the added object, in frames. @rtype: integer """ def setLinearVelocity(vx, vy, vz): """ + DEPRECATED: use the linearVelocity property Sets the initial linear velocity of added objects. @type vx: float @@ -66,12 +77,14 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def getLinearVelocity(): """ + DEPRECATED: use the linearVelocity property Returns the initial linear velocity of added objects. @rtype: list [vx, vy, vz] """ def setAngularVelocity(vx, vy, vz): """ + DEPRECATED: use the angularVelocity property Sets the initial angular velocity of added objects. @type vx: float @@ -83,12 +96,14 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def getAngularVelocity(): """ + DEPRECATED: use the angularVelocity property Returns the initial angular velocity of added objects. @rtype: list [vx, vy, vz] """ def getLastCreatedObject(): """ + DEPRECATED: use the objectLastCreated property Returns the last object created by this actuator. @rtype: L{KX_GameObject} diff --git a/source/gameengine/PyDoc/KX_SceneActuator.py b/source/gameengine/PyDoc/KX_SceneActuator.py index cfb40ae072f..c8912783ab7 100644 --- a/source/gameengine/PyDoc/KX_SceneActuator.py +++ b/source/gameengine/PyDoc/KX_SceneActuator.py @@ -12,21 +12,32 @@ class KX_SceneActuator(SCA_IActuator): This will generate a warning in the console: C{ERROR: GameObject I{OBName} has a SceneActuator I{ActuatorName} (SetScene) without scene} + + Properties: + + @ivar scene: the name of the scene to change to/overlay/underlay/remove/suspend/resume + @type scene: string. + @ivar camera: the camera to change to. + When setting the attribute, you can use either a L{KX_Camera} or the name of the camera. + @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write """ def setUseRestart(flag): """ + DEPRECATED Set flag to True to restart the scene. @type flag: boolean """ def setScene(scene): """ + DEPRECATED: use the scene property instead Sets the name of the scene to change to/overlay/underlay/remove/suspend/resume. @type scene: string """ def setCamera(camera): """ + DEPRECATED: use the camera property instead Sets the camera to change to. Camera can be either a L{KX_Camera} or the name of the camera. @@ -35,12 +46,14 @@ class KX_SceneActuator(SCA_IActuator): """ def getUseRestart(): """ + DEPRECATED Returns True if the scene will be restarted. @rtype: boolean """ def getScene(): """ + DEPRECATED: use the scene property instead Returns the name of the scene to change to/overlay/underlay/remove/suspend/resume. Returns an empty string ("") if no scene has been set. @@ -49,6 +62,7 @@ class KX_SceneActuator(SCA_IActuator): """ def getCamera(): """ + DEPRECATED: use the camera property instead Returns the name of the camera to change to. @rtype: string -- cgit v1.2.3 From afec4049626690e91e75dc88f3b9097a21f9c168 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 27 Mar 2009 22:11:30 +0000 Subject: BGE API Cleanup: GameActuator (patch from Andre) --- source/gameengine/PyDoc/KX_GameActuator.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameActuator.py b/source/gameengine/PyDoc/KX_GameActuator.py index b916b3b5617..fc5bd6005fc 100644 --- a/source/gameengine/PyDoc/KX_GameActuator.py +++ b/source/gameengine/PyDoc/KX_GameActuator.py @@ -5,15 +5,22 @@ from SCA_IActuator import * class KX_GameActuator(SCA_IActuator): """ The game actuator loads a new .blend file, restarts the current .blend file or quits the game. + + Properties: + + @ivar file: the new .blend file to load + @type file: string. """ def getFile(): """ + DEPRECATED: use the file property Returns the filename of the new .blend file to load. @rtype: string """ def setFile(filename): """ + DEPRECATED: use the file property Sets the new .blend file to load. @param filename: The file name this actuator will load. -- cgit v1.2.3 From d57811ada14ad3f9833e77b2cff0d624c7e1ff89 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 29 Mar 2009 15:17:55 +0000 Subject: BGE API cleanup: CDActuator, ParentActuator, VisibilityActuator done. Thanks to Andre. --- source/gameengine/PyDoc/KX_CDActuator.py | 21 +++++++++++++++++++++ source/gameengine/PyDoc/KX_ParentActuator.py | 5 +++-- source/gameengine/PyDoc/KX_VisibilityActuator.py | 7 ++++++- 3 files changed, 30 insertions(+), 3 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_CDActuator.py b/source/gameengine/PyDoc/KX_CDActuator.py index 2c202476584..ffc8ddefa43 100644 --- a/source/gameengine/PyDoc/KX_CDActuator.py +++ b/source/gameengine/PyDoc/KX_CDActuator.py @@ -3,6 +3,13 @@ from SCA_IActuator import * class KX_CDActuator(SCA_IActuator): + """ + CD Controller actuator. + @ivar volume: controls the volume to set the CD to. 0.0 = silent, 1.0 = max volume. + @type volume: float + @ivar track: the track selected to be played + @type track: integer + """ def startCD(): """ Starts the CD playing. @@ -15,8 +22,21 @@ class KX_CDActuator(SCA_IActuator): """ Pauses the CD. """ + def resumeCD(): + """ + Resumes the CD after a pause. + """ + def playAll(): + """ + Plays the CD from the beginning. + """ + def playTrack(trackNumber): + """ + Plays the track selected. + """ def setGain(gain): """ + DEPRECATED: Use the volume property. Sets the gain (volume) of the CD. @type gain: float @@ -24,6 +44,7 @@ class KX_CDActuator(SCA_IActuator): """ def getGain(): """ + DEPRECATED: Use the volume property. Gets the current gain (volume) of the CD. @rtype: float diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py index 7b5625ec82d..76252e5cfad 100644 --- a/source/gameengine/PyDoc/KX_ParentActuator.py +++ b/source/gameengine/PyDoc/KX_ParentActuator.py @@ -4,13 +4,13 @@ from SCA_IActuator import * class KX_ParentActuator(SCA_IActuator): """ - The parent actuator can set or remove an objects parent object. - + The parent actuator can set or remove an objects parent object. @ivar object: the object this actuator sets the parent too. @type object: KX_GameObject or None """ def setObject(object): """ + DEPRECATED: Use the object property. Sets the object to set as parent. Object can be either a L{KX_GameObject} or the name of the object. @@ -19,6 +19,7 @@ class KX_ParentActuator(SCA_IActuator): """ def getObject(name_only = 1): """ + DEPRECATED: Use the object property. Returns the name of the object to change to. @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject diff --git a/source/gameengine/PyDoc/KX_VisibilityActuator.py b/source/gameengine/PyDoc/KX_VisibilityActuator.py index 22499f25d81..17d22fa5f83 100644 --- a/source/gameengine/PyDoc/KX_VisibilityActuator.py +++ b/source/gameengine/PyDoc/KX_VisibilityActuator.py @@ -5,13 +5,18 @@ from SCA_IActuator import * class KX_VisibilityActuator(SCA_IActuator): """ Visibility Actuator. + @ivar visibility: whether the actuator makes its parent object visible or invisible + @type visibility: boolean + @ivar recursion: whether the visibility/invisibility should be propagated to all children of the object + @type recursion: boolean """ def set(visible): """ + DEPRECATED: Use the visibility property instead. Sets whether the actuator makes its parent object visible or invisible. @param visible: - True: Makes its parent visible. - False: Makes its parent invisible. """ - \ No newline at end of file + -- cgit v1.2.3 From 8518f6e6603ed93d126771e1b372021ae0b4ff98 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 31 Mar 2009 19:02:01 +0000 Subject: BGE API cleanup, patch from Moguri: RaySensor, NetworkMessageActuator, NetworkMessageSensor. --- source/gameengine/PyDoc/GameLogic.py | 8 +++++++ .../gameengine/PyDoc/KX_NetworkMessageActuator.py | 13 +++++++++++ source/gameengine/PyDoc/KX_NetworkMessageSensor.py | 17 +++++++++++++++ source/gameengine/PyDoc/KX_RaySensor.py | 25 ++++++++++++++++++++++ 4 files changed, 63 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 0524a9df355..833d896ba6b 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -148,6 +148,14 @@ Documentation for the GameLogic Module. @var KX_RADAR_AXIS_NEG_X: See L{KX_RadarSensor} @var KX_RADAR_AXIS_NEG_Y: See L{KX_RadarSensor} @var KX_RADAR_AXIS_NEG_Z: See L{KX_RadarSensor} + +@group Ray Sensor: KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z, KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z +@var KX_RAY_AXIS_POS_X: See L{KX_RaySensor} +@var KX_RAY_AXIS_POS_Y: See L{KX_RaySensor} +@var KX_RAY_AXIS_POS_Z: See L{KX_RaySensor} +@var KX_RAY_AXIS_NEG_X: See L{KX_RaySensor} +@var KX_RAY_AXIS_NEG_Y: See L{KX_RaySensor} +@var KX_RAY_AXIS_NEG_Z: See L{KX_RaySensor} """ diff --git a/source/gameengine/PyDoc/KX_NetworkMessageActuator.py b/source/gameengine/PyDoc/KX_NetworkMessageActuator.py index aecd2897743..c9f48d47eb8 100644 --- a/source/gameengine/PyDoc/KX_NetworkMessageActuator.py +++ b/source/gameengine/PyDoc/KX_NetworkMessageActuator.py @@ -5,21 +5,33 @@ from SCA_IActuator import * class KX_NetworkMessageActuator(SCA_IActuator): """ Message Actuator + + @ivar propName: Messages will only be sent to objects with the given property name. + @type propName: string + @ivar subject: The subject field of the message. + @type subject: string + @ivar body: The body of the message. + @type body: string + @ivar usePropBody: Send a property instead of a regular body message. + @type usePropBody: boolean """ def setToPropName(name): """ + DEPRECATED: Use the propName property instead. Messages will only be sent to objects with the given property name. @type name: string """ def setSubject(subject): """ + DEPRECATED: Use the subject property instead. Sets the subject field of the message. @type subject: string """ def setBodyType(bodytype): """ + DEPRECATED: Use the usePropBody property instead. Sets the type of body to send. @type bodytype: boolean @@ -27,6 +39,7 @@ class KX_NetworkMessageActuator(SCA_IActuator): """ def setBody(body): """ + DEPRECATED: Use the body property instead. Sets the message body. @type body: string diff --git a/source/gameengine/PyDoc/KX_NetworkMessageSensor.py b/source/gameengine/PyDoc/KX_NetworkMessageSensor.py index 8f5f3609df7..0fecad58437 100644 --- a/source/gameengine/PyDoc/KX_NetworkMessageSensor.py +++ b/source/gameengine/PyDoc/KX_NetworkMessageSensor.py @@ -7,9 +7,22 @@ class KX_NetworkMessageSensor(SCA_ISensor): The Message Sensor logic brick. Currently only loopback (local) networks are supported. + + @ivar subject: The subject the sensor is looking for. + @type subject: string + @ivar frameMessageCount: The number of messages received since the last frame. + (Read-only) + @type framemessageCount: int + @ivar subjects: The list of message subjects received. (Read-only) + @type subjects: list of strings + @ivar bodies: The list of message bodies received. (Read-only) + @type bodies: list of strings """ + + def setSubjectFilterText(subject): """ + DEPRECATED: Use the subject property instead. Change the message subject text that this sensor is listening to. @type subject: string @@ -18,24 +31,28 @@ class KX_NetworkMessageSensor(SCA_ISensor): def getFrameMessageCount(): """ + DEPRECATED: Use the frameMessageCount property instead. Get the number of messages received since the last frame. @rtype: integer """ def getBodies(): """ + DEPRECATED: Use the bodies property instead. Gets the list of message bodies. @rtype: list """ def getSubject(): """ + DEPRECATED: Use the subject property instead. Gets the message subject this sensor is listening for from the Subject: field. @rtype: string """ def getSubjects(): """ + DEPRECATED: Use the subjects property instead. Gets the list of message subjects received. @rtype: list diff --git a/source/gameengine/PyDoc/KX_RaySensor.py b/source/gameengine/PyDoc/KX_RaySensor.py index e487edcb655..b9de54e92a5 100644 --- a/source/gameengine/PyDoc/KX_RaySensor.py +++ b/source/gameengine/PyDoc/KX_RaySensor.py @@ -5,28 +5,53 @@ from SCA_ISensor import * class KX_RaySensor(SCA_ISensor): """ A ray sensor detects the first object in a given direction. + + @ivar property: The property the ray is looking for. + @type property: string + @ivar range: The distance of the ray. + @type range: float + @ivar useMaterial: Whether or not to look for a material (false = property) + @type useMaterial: boolean + @ivar useXRay: Whether or not to use XRay. + @type useXRay: boolean + @ivar hitObject: The game object that was hit by the ray. (Read-only) + @type hitObject: KX_GameObject + @ivar hitPosition: The position (in worldcoordinates) where the object was hit by the ray. (Read-only) + @type hitPosition: list [x, y, z] + @ivar hitNormal: The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (Read-only) + @type hitNormal: list [x, y, z] + @ivar rayDirection: The direction from the ray (in worldcoordinates). (Read-only) + @type rayDirection: list [x, y, z] + @ivar axis: The axis the ray is pointing on. + @type axis: int from 0 to 5 + KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z, + KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z """ def getHitObject(): """ + DEPRECATED: Use the hitObject property instead. Returns the game object that was hit by this ray. @rtype: KX_GameObject """ def getHitPosition(): """ + DEPRECATED: Use the hitPosition property instead. Returns the position (in worldcoordinates) where the object was hit by this ray. @rtype: list [x, y, z] """ def getHitNormal(): """ + DEPRECATED: Use the hitNormal property instead. Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray. @rtype: list [nx, ny, nz] """ def getRayDirection(): """ + DEPRECATED: Use the rayDirection property instead. Returns the direction from the ray (in worldcoordinates) @rtype: list [dx, dy, dz] -- cgit v1.2.3 From f6f47a08eba8991419853f66ade3b1ad44f5b3e4 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 31 Mar 2009 21:03:15 +0000 Subject: BGE API cleanup: DynamicActuator, ReplaceMeshActuator, TrackToActuator. --- source/gameengine/PyDoc/GameLogic.py | 9 +++++++ source/gameengine/PyDoc/KX_SCA_DynamicActuator.py | 30 ++++++++++++++++++++++ .../gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | 7 +++++ source/gameengine/PyDoc/KX_TrackToActuator.py | 11 ++++++++ 4 files changed, 57 insertions(+) create mode 100644 source/gameengine/PyDoc/KX_SCA_DynamicActuator.py (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 833d896ba6b..f158b410975 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -72,6 +72,7 @@ Documentation for the GameLogic Module. - L{SoundActuator} - L{TrackToActuator} - L{VisibilityActuator} + - L{DynamicActuator} Most logic brick's methods are accessors for the properties available in the logic buttons. Consult the logic bricks documentation for more information on how each logic brick works. @@ -156,6 +157,14 @@ Documentation for the GameLogic Module. @var KX_RAY_AXIS_NEG_X: See L{KX_RaySensor} @var KX_RAY_AXIS_NEG_Y: See L{KX_RaySensor} @var KX_RAY_AXIS_NEG_Z: See L{KX_RaySensor} + +@group Dynamic Actuator: KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS +@var KX_DYN_RESTORE_DYNAMICS: See L{KX_SCA_DynamicActuator} +@var KX_DYN_DISABLE_DYNAMICS: See L{KX_SCA_DynamicActuator} +@var KX_DYN_ENABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator} +@var KX_DYN_DISABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator} +@var KX_DYN_SET_MASS: See L{KX_SCA_DynamicActuator} + """ diff --git a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py new file mode 100644 index 00000000000..a6a3bce1f31 --- /dev/null +++ b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py @@ -0,0 +1,30 @@ +# $Id$ +# Documentation for KX_SCA_DynamicActuator +from SCA_IActuator import * + +class KX_SCA_DynamicActuator(SCA_IActuator): + """ + Dynamic Actuator. + @ivar operation: the type of operation of the actuator, 0-4 + KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, + KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS + @type operation: integer + @ivar mass: the mass value for the KX_DYN_SET_MASS operation + @type mass: float + """ + def setOperation(operation): + """ + DEPRECATED: Use the operation property instead. + Set the type of operation when the actuator is activated: + 0 = restore dynamics + 1 = disable dynamics + 2 = enable rigid body + 3 = disable rigid body + 4 = set mass + """ + def getOperatoin() + """ + DEPRECATED: Use the operation property instead. + return the type of operation + """ + diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py index 498f6072e23..1faf215ed56 100644 --- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py @@ -55,9 +55,15 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): This will generate a warning in the console: C{ERROR: GameObject I{OBName} ReplaceMeshActuator I{ActuatorName} without object} + + Properties: + @ivar mesh: the name of the mesh that will replace the current one + Set to None to disable actuator + @type mesh: string or None if no mesh is set """ def setMesh(name): """ + DEPRECATED: Use the mesh property instead. Sets the name of the mesh that will replace the current one. When the name is None it will unset the mesh value so no action is taken. @@ -65,6 +71,7 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): """ def getMesh(): """ + DEPRECATED: Use the mesh property instead. Returns the name of the mesh that will replace the current one. Returns None if no mesh has been scheduled to be added. diff --git a/source/gameengine/PyDoc/KX_TrackToActuator.py b/source/gameengine/PyDoc/KX_TrackToActuator.py index 730ab21166b..ff533e22ac0 100644 --- a/source/gameengine/PyDoc/KX_TrackToActuator.py +++ b/source/gameengine/PyDoc/KX_TrackToActuator.py @@ -15,9 +15,15 @@ class KX_TrackToActuator(SCA_IActuator): @ivar object: the object this actuator tracks. @type object: KX_GameObject or None + @ivar time: the time in frames with which to delay the tracking motion + @type time: integer + @ivar use3D: the tracking motion to use 3D + @type use3D: boolean + """ def setObject(object): """ + DEPRECATED: Use the object property. Sets the object to track. @type object: L{KX_GameObject}, string or None @@ -25,6 +31,7 @@ class KX_TrackToActuator(SCA_IActuator): """ def getObject(name_only): """ + DEPRECATED: Use the object property. Returns the name of the object to track. @type name_only: bool @@ -33,18 +40,21 @@ class KX_TrackToActuator(SCA_IActuator): """ def setTime(time): """ + DEPRECATED: Use the time property. Sets the time in frames with which to delay the tracking motion. @type time: integer """ def getTime(): """ + DEPRECATED: Use the time property. Returns the time in frames with which the tracking motion is delayed. @rtype: integer """ def setUse3D(use3d): """ + DEPRECATED: Use the use3D property. Sets the tracking motion to use 3D. @type use3d: boolean @@ -53,6 +63,7 @@ class KX_TrackToActuator(SCA_IActuator): """ def getUse3D(): """ + DEPRECATED: Use the use3D property. Returns True if the tracking motion will track in the z direction. @rtype: boolean -- cgit v1.2.3 From 441f26a1702444d256a54e5baf67bc7c07d75af5 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 31 Mar 2009 22:34:34 +0000 Subject: Clean up for the imminent migration from SVN to GIT. --- source/gameengine/PyDoc/KX_ParentActuator.py | 2 +- source/gameengine/PyDoc/SCA_JoystickSensor.py | 2 +- source/gameengine/PyDoc/epy_docgen.sh | 0 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 source/gameengine/PyDoc/epy_docgen.sh (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py index 76252e5cfad..4a5f72e7cc2 100644 --- a/source/gameengine/PyDoc/KX_ParentActuator.py +++ b/source/gameengine/PyDoc/KX_ParentActuator.py @@ -1,4 +1,4 @@ -# $Id: KX_ParentActuator.py 2615 2004-06-02 12:43:27Z kester $ +# $Id$ # Documentation for KX_ParentActuator from SCA_IActuator import * diff --git a/source/gameengine/PyDoc/SCA_JoystickSensor.py b/source/gameengine/PyDoc/SCA_JoystickSensor.py index 111ee7f4cfa..944ff64dc64 100644 --- a/source/gameengine/PyDoc/SCA_JoystickSensor.py +++ b/source/gameengine/PyDoc/SCA_JoystickSensor.py @@ -1,4 +1,4 @@ -# $Id: SCA_RandomSensor.py 15444 2008-07-05 17:05:05Z lukep $ +# $Id$ # Documentation for SCA_RandomSensor from SCA_ISensor import * diff --git a/source/gameengine/PyDoc/epy_docgen.sh b/source/gameengine/PyDoc/epy_docgen.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From 48e4a4834092a8772141e6240e5e70d67110f126 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 1 Apr 2009 08:59:36 +0000 Subject: BGE API cleanup: ReplaceMeshActuator mesh attributes now returns a KX_MeshProxy. Fix a bug in KX_MeshProxy where the Python type was not set right. --- source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py index 1faf215ed56..1013dd53cb9 100644 --- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py @@ -57,9 +57,9 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): C{ERROR: GameObject I{OBName} ReplaceMeshActuator I{ActuatorName} without object} Properties: - @ivar mesh: the name of the mesh that will replace the current one + @ivar mesh: L{KX_MeshProxy} or the name of the mesh that will replace the current one Set to None to disable actuator - @type mesh: string or None if no mesh is set + @type mesh: L{KX_MeshProxy} or None if no mesh is set """ def setMesh(name): """ -- cgit v1.2.3 From 04ef5a492af04fa9317245c7a843afed1cbd8252 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 4 Apr 2009 15:54:07 +0000 Subject: Made KX_MeshProxy use PyAttributeDef. simplified getting the 'materials' attribute (no need to differentiate between types) Added KX_GameObject 'meshes' attribute to replace getMesh(i) --- source/gameengine/PyDoc/KX_GameObject.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 694fe02a7cc..12a395287b0 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -26,6 +26,9 @@ class KX_GameObject: @type timeOffset: float @ivar state: the game object's state bitmask. @type state: int + @ivar meshes: a list of L{KX_MeshProxy} objects. + B{Note}: Changes to this list will not update the KX_GameObject + @type meshes: list """ def endObject(visible): """ -- cgit v1.2.3 From f8cc2725755ae02f9a12ad9a346ddf326533cc3e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Apr 2009 08:48:51 +0000 Subject: added experimental KX_GameObject attributes "sensors", "controllers" and "actuators" --- source/gameengine/PyDoc/KX_GameObject.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 12a395287b0..a8d37cbbe53 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -1,7 +1,13 @@ # $Id$ # Documentation for game objects -class KX_GameObject: +# from SCA_IObject import * +from SCA_ISensor import * +from SCA_IController import * +from SCA_IActuator import * + + +class KX_GameObject: # (SCA_IObject) """ All game objects are derived from this class. @@ -26,9 +32,22 @@ class KX_GameObject: @type timeOffset: float @ivar state: the game object's state bitmask. @type state: int - @ivar meshes: a list of L{KX_MeshProxy} objects. + @ivar meshes: a list meshes for this object. + B{Note}: Most objects use only 1 mesh. + B{Note}: Changes to this list will not update the KX_GameObject. + @type meshes: list of L{KX_MeshProxy} + @ivar sensors: a list of L{SCA_ISensor} objects. + B{Note}: This attribute is experemental and may be removed (but probably wont be). + B{Note}: Changes to this list will not update the KX_GameObject + @type sensors: list of L{SCA_ISensor} + @ivar controllers: a list of L{SCA_ISensor} objects. + B{Note}: This attribute is experemental and may be removed (but probably wont be). + B{Note}: Changes to this list will not update the KX_GameObject + @type controllers: list of L{SCA_IController} + @ivar the actuators assigned to this object. + B{Note}: This attribute is experemental and may be removed (but probably wont be). B{Note}: Changes to this list will not update the KX_GameObject - @type meshes: list + @type actuators: a list of L{SCA_IActuator} """ def endObject(visible): """ -- cgit v1.2.3 From 7d4dc4f0f5d34d91703b2219323ef4a3db28a572 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Apr 2009 10:03:23 +0000 Subject: - fixed errors with bge epydocs - changed epy_docgen.sh so inherited attributes & methods are included inline for each type, removed source option since its not useful and makes the download bigger. --- source/gameengine/PyDoc/BL_ActionActuator.py | 8 ++-- source/gameengine/PyDoc/BL_ShapeActionActuator.py | 3 +- source/gameengine/PyDoc/KX_ActuatorSensor.py | 1 + source/gameengine/PyDoc/KX_CDActuator.py | 36 +++++++++--------- source/gameengine/PyDoc/KX_GameObject.py | 43 +++++++++++----------- source/gameengine/PyDoc/KX_ParentActuator.py | 4 +- source/gameengine/PyDoc/KX_SCA_DynamicActuator.py | 30 +++++++-------- .../gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | 19 +++++----- source/gameengine/PyDoc/KX_Scene.py | 4 +- source/gameengine/PyDoc/KX_SceneActuator.py | 4 +- source/gameengine/PyDoc/KX_TrackToActuator.py | 12 +++--- source/gameengine/PyDoc/KX_VisibilityActuator.py | 14 +++---- source/gameengine/PyDoc/SCA_JoystickSensor.py | 14 +++---- source/gameengine/PyDoc/epy_docgen.sh | 2 +- 14 files changed, 97 insertions(+), 97 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/BL_ActionActuator.py b/source/gameengine/PyDoc/BL_ActionActuator.py index 3e95befe16b..480681dc14a 100644 --- a/source/gameengine/PyDoc/BL_ActionActuator.py +++ b/source/gameengine/PyDoc/BL_ActionActuator.py @@ -1,7 +1,9 @@ # $Id$ # Documentation for BL_ActionActuator +import SCA_ILogicBrick from SCA_IActuator import * + class BL_ActionActuator(SCA_IActuator): """ Action Actuators apply an action to an actor. @@ -10,7 +12,7 @@ class BL_ActionActuator(SCA_IActuator): @type action: string @ivar start: Specifies the starting frame of the animation. @type start: float - @type end: Specifies the ending frame of the animation. + @ivar end: Specifies the ending frame of the animation. @type end: float @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. @type blendin: float @@ -25,9 +27,7 @@ class BL_ActionActuator(SCA_IActuator): @ivar blendTime: Sets the internal frame timer. This property must be in the range from 0.0 to blendin. @type blendTime: float - @ivar type: The operation mode of the actuator. - KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, - KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @ivar type: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND @type type: integer @ivar continue: The actions continue option, True or False. When True, the action will always play from where last left off, diff --git a/source/gameengine/PyDoc/BL_ShapeActionActuator.py b/source/gameengine/PyDoc/BL_ShapeActionActuator.py index 209ff4e5580..e1e8b039749 100644 --- a/source/gameengine/PyDoc/BL_ShapeActionActuator.py +++ b/source/gameengine/PyDoc/BL_ShapeActionActuator.py @@ -1,6 +1,7 @@ # $Id$ # Documentation for BL_ShapeActionActuator from SCA_IActuator import * +from SCA_ILogicBrick import * class BL_ShapeActionActuator(SCA_IActuator): """ @@ -10,7 +11,7 @@ class BL_ShapeActionActuator(SCA_IActuator): @type action: string @ivar start: Specifies the starting frame of the shape animation. @type start: float - @type end: Specifies the ending frame of the shape animation. + @ivar end: Specifies the ending frame of the shape animation. @type end: float @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. @type blendin: float diff --git a/source/gameengine/PyDoc/KX_ActuatorSensor.py b/source/gameengine/PyDoc/KX_ActuatorSensor.py index b0e138a8009..27ee3a475e0 100644 --- a/source/gameengine/PyDoc/KX_ActuatorSensor.py +++ b/source/gameengine/PyDoc/KX_ActuatorSensor.py @@ -2,6 +2,7 @@ # Documentation for KX_ActuatorSensor from SCA_IActuator import * from SCA_ISensor import * +from SCA_ILogicBrick import * class KX_ActuatorSensor(SCA_ISensor): """ diff --git a/source/gameengine/PyDoc/KX_CDActuator.py b/source/gameengine/PyDoc/KX_CDActuator.py index ffc8ddefa43..e1067674e7e 100644 --- a/source/gameengine/PyDoc/KX_CDActuator.py +++ b/source/gameengine/PyDoc/KX_CDActuator.py @@ -3,13 +3,15 @@ from SCA_IActuator import * class KX_CDActuator(SCA_IActuator): - """ - CD Controller actuator. - @ivar volume: controls the volume to set the CD to. 0.0 = silent, 1.0 = max volume. - @type volume: float - @ivar track: the track selected to be played - @type track: integer - """ + """ + CD Controller actuator. + @ivar volume: controls the volume to set the CD to. 0.0 = silent, 1.0 = max volume. + @type volume: float + @ivar track: the track selected to be played + @type track: integer + @ivar gain: the gain (volume) of the CD between 0.0 and 1.0. + @type gain: float + """ def startCD(): """ Starts the CD playing. @@ -26,17 +28,17 @@ class KX_CDActuator(SCA_IActuator): """ Resumes the CD after a pause. """ - def playAll(): - """ - Plays the CD from the beginning. - """ - def playTrack(trackNumber): - """ - Plays the track selected. - """ + def playAll(): + """ + Plays the CD from the beginning. + """ + def playTrack(trackNumber): + """ + Plays the track selected. + """ def setGain(gain): """ - DEPRECATED: Use the volume property. + DEPRECATED: Use the volume property. Sets the gain (volume) of the CD. @type gain: float @@ -44,7 +46,7 @@ class KX_CDActuator(SCA_IActuator): """ def getGain(): """ - DEPRECATED: Use the volume property. + DEPRECATED: Use the volume property. Gets the current gain (volume) of the CD. @rtype: float diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index a8d37cbbe53..88c3a55280e 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -2,9 +2,9 @@ # Documentation for game objects # from SCA_IObject import * -from SCA_ISensor import * -from SCA_IController import * -from SCA_IActuator import * +# from SCA_ISensor import * +# from SCA_IController import * +# from SCA_IActuator import * class KX_GameObject: # (SCA_IObject) @@ -12,19 +12,20 @@ class KX_GameObject: # (SCA_IObject) All game objects are derived from this class. Properties assigned to game objects are accessible as attributes of this class. - + @ivar name: The object's name. (Read only) + - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. @type name: string. @ivar mass: The object's mass (provided the object has a physics controller). Read only. @type mass: float @ivar parent: The object's parent object. (Read only) - @type parent: L{KX_GameObject} + @type parent: L{KX_GameObject} or None @ivar visible: visibility flag. + - note: Game logic will still run for invisible objects. @type visible: boolean @ivar position: The object's position. @type position: list [x, y, z] - @ivar orientation: The object's orientation. 3x3 Matrix. - You can also write a Quaternion or Euler vector. + @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. @type orientation: 3x3 Matrix [[float]] @ivar scaling: The object's scaling factor. list [sx, sy, sz] @type scaling: list [sx, sy, sz] @@ -33,21 +34,21 @@ class KX_GameObject: # (SCA_IObject) @ivar state: the game object's state bitmask. @type state: int @ivar meshes: a list meshes for this object. - B{Note}: Most objects use only 1 mesh. - B{Note}: Changes to this list will not update the KX_GameObject. + - note: Most objects use only 1 mesh. + - note: Changes to this list will not update the KX_GameObject. @type meshes: list of L{KX_MeshProxy} @ivar sensors: a list of L{SCA_ISensor} objects. - B{Note}: This attribute is experemental and may be removed (but probably wont be). - B{Note}: Changes to this list will not update the KX_GameObject - @type sensors: list of L{SCA_ISensor} - @ivar controllers: a list of L{SCA_ISensor} objects. - B{Note}: This attribute is experemental and may be removed (but probably wont be). - B{Note}: Changes to this list will not update the KX_GameObject - @type controllers: list of L{SCA_IController} - @ivar the actuators assigned to this object. - B{Note}: This attribute is experemental and may be removed (but probably wont be). - B{Note}: Changes to this list will not update the KX_GameObject - @type actuators: a list of L{SCA_IActuator} + - note: This attribute is experemental and may be removed (but probably wont be). + - note: Changes to this list will not update the KX_GameObject. + @type sensors: list + @ivar controllers: a list of L{SCA_IController} objects. + - note: This attribute is experemental and may be removed (but probably wont be). + - note: Changes to this list will not update the KX_GameObject. + @type controllers: list of L{SCA_ISensor}. + @ivar actuators: a list of L{SCA_IActuator} objects. + - note: This attribute is experemental and may be removed (but probably wont be). + - note: Changes to this list will not update the KX_GameObject. + @type actuators: list """ def endObject(visible): """ @@ -159,7 +160,7 @@ class KX_GameObject: # (SCA_IObject) @param local: - False: you get the "global" movement ie: relative to world orientation (default). - True: you get the "local" movement ie: relative to object orientation. """ - def applyRotation(movement, local = 0): + def applyRotation(rotation, local = 0): """ Sets the game object's rotation. diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py index 4a5f72e7cc2..2f5d9515d0b 100644 --- a/source/gameengine/PyDoc/KX_ParentActuator.py +++ b/source/gameengine/PyDoc/KX_ParentActuator.py @@ -10,7 +10,7 @@ class KX_ParentActuator(SCA_IActuator): """ def setObject(object): """ - DEPRECATED: Use the object property. + DEPRECATED: Use the object property. Sets the object to set as parent. Object can be either a L{KX_GameObject} or the name of the object. @@ -19,7 +19,7 @@ class KX_ParentActuator(SCA_IActuator): """ def getObject(name_only = 1): """ - DEPRECATED: Use the object property. + DEPRECATED: Use the object property. Returns the name of the object to change to. @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject diff --git a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py index a6a3bce1f31..d65d3c22993 100644 --- a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py @@ -5,26 +5,26 @@ from SCA_IActuator import * class KX_SCA_DynamicActuator(SCA_IActuator): """ Dynamic Actuator. - @ivar operation: the type of operation of the actuator, 0-4 - KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, - KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS - @type operation: integer - @ivar mass: the mass value for the KX_DYN_SET_MASS operation - @type mass: float + @ivar operation: the type of operation of the actuator, 0-4 + KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, + KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS + @type operation: integer + @ivar mass: the mass value for the KX_DYN_SET_MASS operation + @type mass: float """ def setOperation(operation): """ - DEPRECATED: Use the operation property instead. + DEPRECATED: Use the operation property instead. Set the type of operation when the actuator is activated: - 0 = restore dynamics - 1 = disable dynamics - 2 = enable rigid body - 3 = disable rigid body - 4 = set mass - """ - def getOperatoin() + - 0 = restore dynamics + - 1 = disable dynamics + - 2 = enable rigid body + - 3 = disable rigid body + - 4 = set mass """ - DEPRECATED: Use the operation property instead. + def getOperatoin(): + """ + DEPRECATED: Use the operation property instead. return the type of operation """ diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py index 1013dd53cb9..4397a9152d0 100644 --- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py @@ -18,13 +18,13 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): # Mesh (name, near, far) # Meshes overlap so that they don't 'pop' when on the edge of the distance. meshes = ((".Hi", 0.0, -20.0), - (".Med", -15.0, -50.0), - (".Lo", -40.0, -100.0) - ) + (".Med", -15.0, -50.0), + (".Lo", -40.0, -100.0) + ) co = GameLogic.getCurrentController() obj = co.getOwner() - act = co.getActuator("LOD." + obj.getName()) + act = co.getActuator("LOD." + obj.name) cam = GameLogic.getCurrentScene().active_camera def Depth(pos, plane): @@ -39,10 +39,10 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): for mesh in meshes: if depth < mesh[1] and depth > mesh[2]: newmesh = mesh - if "ME" + obj.getName() + mesh[0] == act.getMesh(): + if "ME" + obj.name + mesh[0] == act.getMesh(): curmesh = mesh - if newmesh != None and "ME" + obj.getName() + newmesh[0] != act.getMesh(): + if newmesh != None and "ME" + obj.name + newmesh[0] != act.getMesh(): # The mesh is a different mesh - switch it. # Check the current mesh is not a better fit. if curmesh == None or curmesh[1] < depth or curmesh[2] > depth: @@ -55,15 +55,14 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): This will generate a warning in the console: C{ERROR: GameObject I{OBName} ReplaceMeshActuator I{ActuatorName} without object} - - Properties: + @ivar mesh: L{KX_MeshProxy} or the name of the mesh that will replace the current one Set to None to disable actuator @type mesh: L{KX_MeshProxy} or None if no mesh is set """ def setMesh(name): """ - DEPRECATED: Use the mesh property instead. + DEPRECATED: Use the mesh property instead. Sets the name of the mesh that will replace the current one. When the name is None it will unset the mesh value so no action is taken. @@ -71,7 +70,7 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): """ def getMesh(): """ - DEPRECATED: Use the mesh property instead. + DEPRECATED: Use the mesh property instead. Returns the name of the mesh that will replace the current one. Returns None if no mesh has been scheduled to be added. diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py index 5e357e6eefc..4f7beb9e300 100644 --- a/source/gameengine/PyDoc/KX_Scene.py +++ b/source/gameengine/PyDoc/KX_Scene.py @@ -39,7 +39,7 @@ class KX_Scene: @ivar name: The scene's name @type name: string - @type objects: A list of objects in the scene. + @ivar objects: A list of objects in the scene. @type objects: list [L{KX_GameObject}] @ivar active_camera: The current active camera @type active_camera: L{KX_Camera} @@ -70,7 +70,7 @@ class KX_Scene: @rtype: string """ - def addObject(object, other, time=0) + def addObject(object, other, time=0): """ Adds an object to the scene like the Add Object Actuator would, and returns the created object. diff --git a/source/gameengine/PyDoc/KX_SceneActuator.py b/source/gameengine/PyDoc/KX_SceneActuator.py index c8912783ab7..6e27257533e 100644 --- a/source/gameengine/PyDoc/KX_SceneActuator.py +++ b/source/gameengine/PyDoc/KX_SceneActuator.py @@ -8,12 +8,10 @@ class KX_SceneActuator(SCA_IActuator): @warning: Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty - + This will generate a warning in the console: C{ERROR: GameObject I{OBName} has a SceneActuator I{ActuatorName} (SetScene) without scene} - - Properties: @ivar scene: the name of the scene to change to/overlay/underlay/remove/suspend/resume @type scene: string. diff --git a/source/gameengine/PyDoc/KX_TrackToActuator.py b/source/gameengine/PyDoc/KX_TrackToActuator.py index ff533e22ac0..ee2dc5d6144 100644 --- a/source/gameengine/PyDoc/KX_TrackToActuator.py +++ b/source/gameengine/PyDoc/KX_TrackToActuator.py @@ -23,7 +23,7 @@ class KX_TrackToActuator(SCA_IActuator): """ def setObject(object): """ - DEPRECATED: Use the object property. + DEPRECATED: Use the object property. Sets the object to track. @type object: L{KX_GameObject}, string or None @@ -31,7 +31,7 @@ class KX_TrackToActuator(SCA_IActuator): """ def getObject(name_only): """ - DEPRECATED: Use the object property. + DEPRECATED: Use the object property. Returns the name of the object to track. @type name_only: bool @@ -40,21 +40,21 @@ class KX_TrackToActuator(SCA_IActuator): """ def setTime(time): """ - DEPRECATED: Use the time property. + DEPRECATED: Use the time property. Sets the time in frames with which to delay the tracking motion. @type time: integer """ def getTime(): """ - DEPRECATED: Use the time property. + DEPRECATED: Use the time property. Returns the time in frames with which the tracking motion is delayed. @rtype: integer """ def setUse3D(use3d): """ - DEPRECATED: Use the use3D property. + DEPRECATED: Use the use3D property. Sets the tracking motion to use 3D. @type use3d: boolean @@ -63,7 +63,7 @@ class KX_TrackToActuator(SCA_IActuator): """ def getUse3D(): """ - DEPRECATED: Use the use3D property. + DEPRECATED: Use the use3D property. Returns True if the tracking motion will track in the z direction. @rtype: boolean diff --git a/source/gameengine/PyDoc/KX_VisibilityActuator.py b/source/gameengine/PyDoc/KX_VisibilityActuator.py index 17d22fa5f83..aca8d1ce243 100644 --- a/source/gameengine/PyDoc/KX_VisibilityActuator.py +++ b/source/gameengine/PyDoc/KX_VisibilityActuator.py @@ -5,18 +5,16 @@ from SCA_IActuator import * class KX_VisibilityActuator(SCA_IActuator): """ Visibility Actuator. - @ivar visibility: whether the actuator makes its parent object visible or invisible - @type visibility: boolean - @ivar recursion: whether the visibility/invisibility should be propagated to all children of the object - @type recursion: boolean + @ivar visibility: whether the actuator makes its parent object visible or invisible + @type visibility: boolean + @ivar recursion: whether the visibility/invisibility should be propagated to all children of the object + @type recursion: boolean """ def set(visible): """ - DEPRECATED: Use the visibility property instead. + DEPRECATED: Use the visibility property instead. Sets whether the actuator makes its parent object visible or invisible. - + @param visible: - True: Makes its parent visible. - False: Makes its parent invisible. """ - - diff --git a/source/gameengine/PyDoc/SCA_JoystickSensor.py b/source/gameengine/PyDoc/SCA_JoystickSensor.py index 944ff64dc64..e38e023143d 100644 --- a/source/gameengine/PyDoc/SCA_JoystickSensor.py +++ b/source/gameengine/PyDoc/SCA_JoystickSensor.py @@ -41,13 +41,13 @@ class SCA_JoystickSensor(SCA_ISensor): Returns a list containing the indicies of the currently pressed buttons. @rtype: list """ - def getButtonStatus(buttonIndex): - """ - Returns a bool of the current pressed state of the specified button. - @param buttonIndex: the button index, 0=first button - @type buttonIndex: integer - @rtype: bool - """ + def getButtonStatus(buttonIndex): + """ + Returns a bool of the current pressed state of the specified button. + @param buttonIndex: the button index, 0=first button + @type buttonIndex: integer + @rtype: bool + """ def getIndex(): """ DEPRECATED: use the 'index' property. diff --git a/source/gameengine/PyDoc/epy_docgen.sh b/source/gameengine/PyDoc/epy_docgen.sh index b243101ddcb..ddf39dcc081 100755 --- a/source/gameengine/PyDoc/epy_docgen.sh +++ b/source/gameengine/PyDoc/epy_docgen.sh @@ -8,4 +8,4 @@ LC_ALL=POSIX epydoc --debug -v -o BPY_GE --url "http://www.blender.org" --top GameLogic \ - --name "Blender GameEngine" --no-private --no-frames *.py + --name "Blender GameEngine" --no-private --no-frames --no-sourcecode --inheritance=included *.py -- cgit v1.2.3 From 033a63f8580227582a9695ebdd78ac0b4322e867 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Apr 2009 14:01:49 +0000 Subject: BGE Bugfixes (mostly in the py api) KX_PolygonMaterial and KX_BlenderMaterial - Added a print function (would raise a python error on printing) * Crashes * KX_GameObject SetParent - Disallowed setting a parent to its self, caused a recursion crash. KX_MeshProxy "materials" attribute was segfaulting because of my recent change - I was wrong, you do need to check material types (no idea why since they are both PyObject * at the base) KX_VisibilityActuator - Wasn't initialized with PyType_Ready() making it crash on access (own fault) * Crashes because of missing NULL checks * KX_PolygonMaterial's "gl_texture" attribute wasnt checking for a valid m_tface KX_GameObject - added checks for GetPhysicsController() KX_RayCast::RayTest - didnt check for a valid physics_environment KX_SceneActuator's getCamera python function wasnt checking if there was a camera. --- source/gameengine/PyDoc/KX_GameObject.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 88c3a55280e..97e53ffacaa 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -270,6 +270,8 @@ class KX_GameObject: # (SCA_IObject) The reaction force is the force applied to this object over the last simulation timestep. This also includes impulses, eg from collisions. + (B{This is not implimented for bullet physics at the moment}) + @rtype: list [fx, fy, fz] @return: the reaction force of this object. """ -- cgit v1.2.3 From 960fa534b7690796d463f062edf572ceae88457d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 6 Apr 2009 13:13:25 +0000 Subject: BGE Epydocs were missing some functions renamed KX_Light -> KX_LightObject added some missing controllers --- source/gameengine/PyDoc/GameLogic.py | 23 ++++++- source/gameengine/PyDoc/GameTypes.py | 75 ++++++++++++++++++++++ source/gameengine/PyDoc/KX_ActuatorSensor.py | 33 ---------- source/gameengine/PyDoc/KX_Camera.py | 22 +++++++ source/gameengine/PyDoc/KX_GameObject.py | 11 +++- source/gameengine/PyDoc/KX_Light.py | 45 ------------- source/gameengine/PyDoc/KX_LightObject.py | 45 +++++++++++++ source/gameengine/PyDoc/KX_MouseFocusSensor.py | 40 ++++++++++-- .../gameengine/PyDoc/KX_SCA_AddObjectActuator.py | 7 ++ source/gameengine/PyDoc/KX_SCA_DynamicActuator.py | 2 +- .../gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | 6 +- source/gameengine/PyDoc/KX_Scene.py | 2 +- source/gameengine/PyDoc/KX_VertexProxy.py | 21 ++++++ source/gameengine/PyDoc/SCA_ActuatorSensor.py | 33 ++++++++++ source/gameengine/PyDoc/SCA_MouseSensor.py | 10 +++ source/gameengine/PyDoc/SCA_NANDController.py | 11 ++++ source/gameengine/PyDoc/SCA_NORController.py | 11 ++++ source/gameengine/PyDoc/SCA_XNORController.py | 11 ++++ source/gameengine/PyDoc/SCA_XORController.py | 11 ++++ source/gameengine/PyDoc/WhatsNew.py | 2 +- 20 files changed, 328 insertions(+), 93 deletions(-) create mode 100644 source/gameengine/PyDoc/GameTypes.py delete mode 100644 source/gameengine/PyDoc/KX_ActuatorSensor.py delete mode 100644 source/gameengine/PyDoc/KX_Light.py create mode 100644 source/gameengine/PyDoc/KX_LightObject.py create mode 100644 source/gameengine/PyDoc/SCA_ActuatorSensor.py create mode 100644 source/gameengine/PyDoc/SCA_NANDController.py create mode 100644 source/gameengine/PyDoc/SCA_NORController.py create mode 100644 source/gameengine/PyDoc/SCA_XNORController.py create mode 100644 source/gameengine/PyDoc/SCA_XORController.py (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index f158b410975..da394288e25 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -3,10 +3,17 @@ Documentation for the GameLogic Module. ======================================= - There are only three importable modules in the game engine: + Modules available in the game engine: - GameLogic - L{GameKeys} - L{Rasterizer} + - L{GameTypes} + + Undocumented modules: + - VideoTexture + - CValue + - Expression + - PhysicsConstraints All the other modules are accessible through the methods in GameLogic. @@ -18,7 +25,7 @@ Documentation for the GameLogic Module. # To get the game object this controller is on: obj = co.getOwner() - L{KX_GameObject} and L{KX_Camera} or L{KX_Light} methods are + L{KX_GameObject} and L{KX_Camera} or L{KX_LightObject} methods are available depending on the type of object:: # To get a sensor linked to this controller. # "sensorname" is the name of the sensor as defined in the Blender interface. @@ -165,9 +172,19 @@ Documentation for the GameLogic Module. @var KX_DYN_DISABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator} @var KX_DYN_SET_MASS: See L{KX_SCA_DynamicActuator} -""" +@group Input Status: KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED +@var KX_INPUT_NONE: See L{SCA_MouseSensor} +@var KX_INPUT_JUST_ACTIVATED: See L{SCA_MouseSensor} +@var KX_INPUT_ACTIVE: See L{SCA_MouseSensor} +@var KX_INPUT_JUST_RELEASED: See L{SCA_MouseSensor} +@group Mouse Buttons: KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT +@var KX_MOUSE_BUT_LEFT: See L{SCA_MouseSensor} +@var KX_MOUSE_BUT_MIDDLE: See L{SCA_MouseSensor} +@var KX_MOUSE_BUT_RIGHT: See L{SCA_MouseSensor} +""" + def getCurrentController(): """ Gets the Python controller associated with this Python script. diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py new file mode 100644 index 00000000000..f39e4ed064d --- /dev/null +++ b/source/gameengine/PyDoc/GameTypes.py @@ -0,0 +1,75 @@ +# $Id: GameLogic.py 19483 2009-03-31 21:03:15Z ben2610 $ +""" +GameEngine Types +================ +@var BL_ActionActuator: L{BL_ActionActuator} +@var BL_Shader: L{BL_Shader} +@var BL_ShapeActionActuator: L{BL_ShapeActionActuator} +@var CListValue: L{CListValue} +@var CValue: L{CValue} +@var KX_BlenderMaterial: L{KX_BlenderMaterial} +@var KX_CDActuator: L{KX_CDActuator} +@var KX_Camera: L{KX_Camera} +@var KX_CameraActuator: L{KX_CameraActuator} +@var KX_ConstraintActuator: L{KX_ConstraintActuator} +@var KX_ConstraintWrapper: L{KX_ConstraintWrapper} +@var KX_GameActuator: L{KX_GameActuator} +@var KX_GameObject: L{KX_GameObject} +@var KX_IpoActuator: L{KX_IpoActuator} +@var KX_LightObject: L{KX_LightObject} +@var KX_MeshProxy: L{KX_MeshProxy} +@var KX_MouseFocusSensor: L{KX_MouseFocusSensor} +@var KX_NearSensor: L{KX_NearSensor} +@var KX_NetworkMessageActuator: L{KX_NetworkMessageActuator} +@var KX_NetworkMessageSensor: L{KX_NetworkMessageSensor} +@var KX_ObjectActuator: L{KX_ObjectActuator} +@var KX_ParentActuator: L{KX_ParentActuator} +@var KX_PhysicsObjectWrapper: L{KX_PhysicsObjectWrapper} +@var KX_PolyProxy: L{KX_PolyProxy} +@var KX_PolygonMaterial: L{KX_PolygonMaterial} +@var KX_RadarSensor: L{KX_RadarSensor} +@var KX_RaySensor: L{KX_RaySensor} +@var KX_SCA_AddObjectActuator: L{KX_SCA_AddObjectActuator} +@var KX_SCA_DynamicActuator: L{KX_SCA_DynamicActuator} +@var KX_SCA_EndObjectActuator: L{KX_SCA_EndObjectActuator} +@var KX_SCA_ReplaceMeshActuator: L{KX_SCA_ReplaceMeshActuator} +@var KX_Scene: L{KX_Scene} +@var KX_SceneActuator: L{KX_SceneActuator} +@var KX_SoundActuator: L{KX_SoundActuator} +@var KX_StateActuator: L{KX_StateActuator} +@var KX_TouchSensor: L{KX_TouchSensor} +@var KX_TrackToActuator: L{KX_TrackToActuator} +@var KX_VehicleWrapper: L{KX_VehicleWrapper} +@var KX_VertexProxy: L{KX_VertexProxy} +@var KX_VisibilityActuator: L{KX_VisibilityActuator} +@var PyObjectPlus: L{PyObjectPlus} +@var SCA_2DFilterActuator: L{SCA_2DFilterActuator} +@var SCA_ANDController: L{SCA_ANDController} +@var SCA_ActuatorSensor: L{SCA_ActuatorSensor} +@var SCA_AlwaysSensor: L{SCA_AlwaysSensor} +@var SCA_DelaySensor: L{SCA_DelaySensor} +@var SCA_ILogicBrick: L{SCA_ILogicBrick} +@var SCA_IObject: L{SCA_IObject} +@var SCA_ISensor: L{SCA_ISensor} +@var SCA_JoystickSensor: L{SCA_JoystickSensor} +@var SCA_KeyboardSensor: L{SCA_KeyboardSensor} +@var SCA_MouseSensor: L{SCA_MouseSensor} +@var SCA_NANDController: L{SCA_NANDController} +@var SCA_NORController: L{SCA_NORController} +@var SCA_ORController: L{SCA_ORController} +@var SCA_PropertyActuator: L{SCA_PropertyActuator} +@var SCA_PropertySensor: L{SCA_PropertySensor} +@var SCA_PythonController: L{SCA_PythonController} +@var SCA_RandomActuator: L{SCA_RandomActuator} +@var SCA_RandomSensor: L{SCA_RandomSensor} +@var SCA_XNORController: L{SCA_XNORController} +@var SCA_XORController: L{SCA_XORController} +""" + +if 0: + # Use to print out all the links + for i in a.split('\n'): + if i.startswith('@var'): + var = i.split(' ')[1].split(':')[0] + print '@var %s: L{%s<%s.%s>}' % (var, var, var, var) + diff --git a/source/gameengine/PyDoc/KX_ActuatorSensor.py b/source/gameengine/PyDoc/KX_ActuatorSensor.py deleted file mode 100644 index 27ee3a475e0..00000000000 --- a/source/gameengine/PyDoc/KX_ActuatorSensor.py +++ /dev/null @@ -1,33 +0,0 @@ -# $Id$ -# Documentation for KX_ActuatorSensor -from SCA_IActuator import * -from SCA_ISensor import * -from SCA_ILogicBrick import * - -class KX_ActuatorSensor(SCA_ISensor): - """ - Actuator sensor detect change in actuator state of the parent object. - It generates a positive pulse if the corresponding actuator is activated - and a negative pulse if the actuator is deactivated. - - Properties: - - @ivar actuator: the name of the actuator that the sensor is monitoring. - @type actuator: string - """ - def getActuator(): - """ - DEPRECATED: use the actuator property - Return the Actuator with which the sensor operates. - - @rtype: string - """ - def setActuator(name): - """ - DEPRECATED: use the actuator property - Sets the Actuator with which to operate. If there is no Actuator - of this name, the function has no effect. - - @param name: actuator name - @type name: string - """ diff --git a/source/gameengine/PyDoc/KX_Camera.py b/source/gameengine/PyDoc/KX_Camera.py index 4cadf1c0ed0..f5d0d45f968 100644 --- a/source/gameengine/PyDoc/KX_Camera.py +++ b/source/gameengine/PyDoc/KX_Camera.py @@ -185,3 +185,25 @@ class KX_Camera(KX_GameObject): @param matrix: The new projection matrix for this camera. """ + def enableViewport(viewport): + """ + Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}. + + @type viewport: bool + @param viewport: the new viewport status + """ + def setOnTop(): + """ + Set this cameras viewport ontop of all other viewport. + """ + def setViewport(left, bottom, right, top): + """ + Sets the region of this viewport on the screen in pixels. + + Use L{Rasterizer.getWindowHeight} L{Rasterizer.getWindowWidth} to calculate values relative to the entire display. + + @type left: int + @type bottom: int + @type right: int + @type top: int + """ diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 97e53ffacaa..972a15b7765 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -442,5 +442,12 @@ class KX_GameObject: # (SCA_IObject) If no hit, returns (None,None,None) or (None,None,None,None) If the object hit is not a static mesh, polygon is None """ - - + def setCollisionMargin(margin): + """ + Set the objects collision margin. + + note: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError. + + @type margin: float + @param margin: the collision margin distance in blender units. + """ diff --git a/source/gameengine/PyDoc/KX_Light.py b/source/gameengine/PyDoc/KX_Light.py deleted file mode 100644 index ff0cf071d2d..00000000000 --- a/source/gameengine/PyDoc/KX_Light.py +++ /dev/null @@ -1,45 +0,0 @@ -# $Id$ -# Documentation for Light game objects. -from KX_GameObject import * - -class KX_Light(KX_GameObject): - """ - A Light object. - - Example: - - # Turn on a red alert light. - import GameLogic - - co = GameLogic.getCurrentController() - light = co.getOwner() - - light.energy = 1.0 - light.colour = [1.0, 0.0, 0.0] - - @group Constants: NORMAL, SPOT, SUN - @ivar SPOT: A spot light source. See attribute 'type' - @ivar SUN: A point light source with no attenuation. See attribute 'type' - @ivar NORMAL: A point light source. See attribute 'type' - - @ivar type: The type of light - must be SPOT, SUN or NORMAL - @ivar layer: The layer mask that this light affects object on. - @type layer: bitfield - @ivar energy: The brightness of this light. - @type energy: float - @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only) - @type distance: float - @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0] - @type colour: list [r, g, b] - @ivar color: Synonym for colour. - @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only) - @type lin_attenuation: float - @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only) - @type quad_attenuation: float - @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only) - 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted. - @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only) - Higher values result in a more focused light source. - 0.0 <= spotblend <= 1.0. - - """ diff --git a/source/gameengine/PyDoc/KX_LightObject.py b/source/gameengine/PyDoc/KX_LightObject.py new file mode 100644 index 00000000000..8cc1787887b --- /dev/null +++ b/source/gameengine/PyDoc/KX_LightObject.py @@ -0,0 +1,45 @@ +# $Id$ +# Documentation for Light game objects. +from KX_GameObject import * + +class KX_LightObject(KX_GameObject): + """ + A Light object. + + Example: + + # Turn on a red alert light. + import GameLogic + + co = GameLogic.getCurrentController() + light = co.getOwner() + + light.energy = 1.0 + light.colour = [1.0, 0.0, 0.0] + + @group Constants: NORMAL, SPOT, SUN + @ivar SPOT: A spot light source. See attribute 'type' + @ivar SUN: A point light source with no attenuation. See attribute 'type' + @ivar NORMAL: A point light source. See attribute 'type' + + @ivar type: The type of light - must be SPOT, SUN or NORMAL + @ivar layer: The layer mask that this light affects object on. + @type layer: bitfield + @ivar energy: The brightness of this light. + @type energy: float + @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only) + @type distance: float + @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0] + @type colour: list [r, g, b] + @ivar color: Synonym for colour. + @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only) + @type lin_attenuation: float + @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only) + @type quad_attenuation: float + @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only) + 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted. + @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only) + Higher values result in a more focused light source. + 0.0 <= spotblend <= 1.0. + + """ diff --git a/source/gameengine/PyDoc/KX_MouseFocusSensor.py b/source/gameengine/PyDoc/KX_MouseFocusSensor.py index 28d584037f8..ceab5b8c511 100644 --- a/source/gameengine/PyDoc/KX_MouseFocusSensor.py +++ b/source/gameengine/PyDoc/KX_MouseFocusSensor.py @@ -10,17 +10,45 @@ class KX_MouseFocusSensor(SCA_MouseSensor): space to 3d space then raycasting away from the camera. """ - def GetRayTarget(): + def getHitNormal(): """ - Returns the end point of the sensor ray. + Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. @rtype: list [x, y, z] - @return: the end point of the sensor ray, in world coordinates. + @return: the ray collision normal. """ - def GetRaySource(): + def getHitObject(): """ - Returns the start point of the sensor ray. + Returns the object that was hit by this ray or None. + + @rtype: L{KX_GameObject} or None + @return: the collision object. + """ + def getHitPosition(): + """ + Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. + + @rtype: list [x, y, z] + @return: the ray collision position. + """ + def getRayDirection(): + """ + Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. @rtype: list [x, y, z] - @return: the start point of the sensor ray, in world coordinates. + @return: the ray direction. """ + def getRaySource(): + """ + Returns the position (in worldcoordinates) the ray was cast from by the mouse. + + @rtype: list [x, y, z] + @return: the ray source. + """ + def getRayTarget(): + """ + Returns the target of the ray (in worldcoordinates) that seeks the focus object. + + @rtype: list [x, y, z] + @return: the ray target. + """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py index 974ef718ccf..572b864ff0a 100644 --- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py @@ -109,3 +109,10 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): @rtype: L{KX_GameObject} @return: A L{KX_GameObject} or None if no object has been created. """ + def instantAddObject(): + """ + Returns the last object created by this actuator. The object can then be accessed from L{objectLastCreated}. + + @rtype: None + """ + diff --git a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py index d65d3c22993..22da159ce71 100644 --- a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py @@ -22,7 +22,7 @@ class KX_SCA_DynamicActuator(SCA_IActuator): - 3 = disable rigid body - 4 = set mass """ - def getOperatoin(): + def getOperation(): """ DEPRECATED: Use the operation property instead. return the type of operation diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py index 4397a9152d0..951c118a99a 100644 --- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py @@ -77,4 +77,8 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): @rtype: string or None """ - + def instantReplaceMesh(): + """ + Immediately replace mesh without delay. + @rtype: None + """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py index 4f7beb9e300..a9fd44ffc9a 100644 --- a/source/gameengine/PyDoc/KX_Scene.py +++ b/source/gameengine/PyDoc/KX_Scene.py @@ -55,7 +55,7 @@ class KX_Scene: """ Returns the list of lights in the scene. - @rtype: list [L{KX_Light}] + @rtype: list [L{KX_LightObject}] """ def getObjectList(): """ diff --git a/source/gameengine/PyDoc/KX_VertexProxy.py b/source/gameengine/PyDoc/KX_VertexProxy.py index 8dc2752c037..5baaf76c3d9 100644 --- a/source/gameengine/PyDoc/KX_VertexProxy.py +++ b/source/gameengine/PyDoc/KX_VertexProxy.py @@ -70,6 +70,19 @@ class KX_VertexProxy: """ Sets the UV (texture) coordinates of this vertex. + @type uv: list [u, v] + """ + def getUV2(): + """ + Gets the 2nd UV (texture) coordinates of this vertex. + + @rtype: list [u, v] + @return: this vertexes UV (texture) coordinates. + """ + def setUV2(uv): + """ + Sets the 2nd UV (texture) coordinates of this vertex. + @type uv: list [u, v] """ def getRGBA(): @@ -120,3 +133,11 @@ class KX_VertexProxy: @rtype: list [nx, ny, nz] @return: normalised normal vector. """ + def setNormal(normal): + """ + Sets the normal vector of this vertex. + + @type normal: sequence of floats [r, g, b] + @param normal: the new normal of this vertex. + """ + diff --git a/source/gameengine/PyDoc/SCA_ActuatorSensor.py b/source/gameengine/PyDoc/SCA_ActuatorSensor.py new file mode 100644 index 00000000000..515354e8716 --- /dev/null +++ b/source/gameengine/PyDoc/SCA_ActuatorSensor.py @@ -0,0 +1,33 @@ +# $Id$ +# Documentation for SCA_ActuatorSensor +from SCA_IActuator import * +from SCA_ISensor import * +from SCA_ILogicBrick import * + +class SCA_ActuatorSensor(SCA_ISensor): + """ + Actuator sensor detect change in actuator state of the parent object. + It generates a positive pulse if the corresponding actuator is activated + and a negative pulse if the actuator is deactivated. + + Properties: + + @ivar actuator: the name of the actuator that the sensor is monitoring. + @type actuator: string + """ + def getActuator(): + """ + DEPRECATED: use the actuator property + Return the Actuator with which the sensor operates. + + @rtype: string + """ + def setActuator(name): + """ + DEPRECATED: use the actuator property + Sets the Actuator with which to operate. If there is no Actuator + of this name, the function has no effect. + + @param name: actuator name + @type name: string + """ diff --git a/source/gameengine/PyDoc/SCA_MouseSensor.py b/source/gameengine/PyDoc/SCA_MouseSensor.py index 9550cbb4105..278ebe63b8a 100644 --- a/source/gameengine/PyDoc/SCA_MouseSensor.py +++ b/source/gameengine/PyDoc/SCA_MouseSensor.py @@ -32,3 +32,13 @@ class SCA_MouseSensor(SCA_ISensor): @rtype: integer @return: the current y coordinate of the mouse, in frame coordinates (pixels). """ + def getButtonStatus(button): + """ + Get the mouse button status. + + @type button: int + @param button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT + + @rtype: integer + @return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED + """ diff --git a/source/gameengine/PyDoc/SCA_NANDController.py b/source/gameengine/PyDoc/SCA_NANDController.py new file mode 100644 index 00000000000..81e1dfd6d92 --- /dev/null +++ b/source/gameengine/PyDoc/SCA_NANDController.py @@ -0,0 +1,11 @@ +# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# Documentation for SCA_NANDController +from SCA_IController import * + +class SCA_NANDController(SCA_IController): + """ + An NAND controller activates when all linked sensors are not active. + + There are no special python methods for this controller. + """ + diff --git a/source/gameengine/PyDoc/SCA_NORController.py b/source/gameengine/PyDoc/SCA_NORController.py new file mode 100644 index 00000000000..e3bdeefa63e --- /dev/null +++ b/source/gameengine/PyDoc/SCA_NORController.py @@ -0,0 +1,11 @@ +# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# Documentation for SCA_NORController +from SCA_IController import * + +class SCA_NORController(SCA_IController): + """ + An NOR controller activates only when all linked sensors are de-activated. + + There are no special python methods for this controller. + """ + diff --git a/source/gameengine/PyDoc/SCA_XNORController.py b/source/gameengine/PyDoc/SCA_XNORController.py new file mode 100644 index 00000000000..b1d9dddd9f2 --- /dev/null +++ b/source/gameengine/PyDoc/SCA_XNORController.py @@ -0,0 +1,11 @@ +# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# Documentation for SCA_XNORController +from SCA_IController import * + +class SCA_XNORController(SCA_IController): + """ + An XNOR controller activates when all linked sensors are the same (activated or inative). + + There are no special python methods for this controller. + """ + diff --git a/source/gameengine/PyDoc/SCA_XORController.py b/source/gameengine/PyDoc/SCA_XORController.py new file mode 100644 index 00000000000..b8f2b5feef0 --- /dev/null +++ b/source/gameengine/PyDoc/SCA_XORController.py @@ -0,0 +1,11 @@ +# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# Documentation for SCA_XORController +from SCA_IController import * + +class SCA_XORController(SCA_IController): + """ + An XOR controller activates when there is the input is mixed, but not when all are on or off. + + There are no special python methods for this controller. + """ + diff --git a/source/gameengine/PyDoc/WhatsNew.py b/source/gameengine/PyDoc/WhatsNew.py index 64bef7ee1c8..4d86e6ef3c4 100644 --- a/source/gameengine/PyDoc/WhatsNew.py +++ b/source/gameengine/PyDoc/WhatsNew.py @@ -26,7 +26,7 @@ Blender 2.34 - Added getType() and setType() to L{BL_ActionActuator} and L{KX_SoundActuator} (sgefant) - New Scene module: L{KX_Scene} - New Camera module: L{KX_Camera} - - New Light module: L{KX_Light} + - New Light module: L{KX_LightObject} - Added attributes to L{KX_GameObject}, L{KX_VertexProxy} - L{KX_SCA_AddObjectActuator}.setObject(), L{KX_TrackToActuator}.setObject() and L{KX_SceneActuator}.setCamera() now accept L{KX_GameObject}s as parameters -- cgit v1.2.3 From 46a440c7a5393177dbc74cef466d1eb5643e068d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 6 Apr 2009 13:27:28 +0000 Subject: BGE Python API - added a module for the BGE - GameTypes, only contains types. - added KX_PYATTRIBUTE_DUMMY attributes for KX_Light, KX_PolyProxy, KX_VertexProxy, so all types should give correct results from a dir(). - added a script to check for missing methods in the epydocs - bge_api_validate_py.txt --- source/gameengine/PyDoc/bge_api_validate_py.txt | 66 +++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 source/gameengine/PyDoc/bge_api_validate_py.txt (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt new file mode 100644 index 00000000000..e003f29831b --- /dev/null +++ b/source/gameengine/PyDoc/bge_api_validate_py.txt @@ -0,0 +1,66 @@ +#~ This program is free software; you can redistribute it and/or modify +#~ it under the terms of the GNU General Public License as published by +#~ the Free Software Foundation; version 2 of the License. + +#~ This program is distributed in the hope that it will be useful, +#~ but WITHOUT ANY WARRANTY; without even the implied warranty of +#~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#~ GNU General Public License for more details. + +# This script must run from a logic brick so it has access to the game engine api +# it assumes the root blender source directory is the current working directory +# +# Currently it only prints missing modules and methods (not attributes) + + +BGE_API_DOC_PATH = 'source/gameengine/PyDoc' + +type_members = {} + +for type_name in dir(GameTypes): + if type_name.startswith('__'): + continue + + type_object = getattr(GameTypes, type_name) + + members = [] + type_members[type_object.__name__] = members + + for member in type_object.__dict__.keys(): + if member.startswith('__'): + continue + + # print type_object.__name__ + '.' + k + members.append(member) + +import sys, os + +doc_dir= os.path.join(os.getcwd(), BGE_API_DOC_PATH) + +if doc_dir not in sys.path: + sys.path.append(doc_dir) + +for type_name in sorted(type_members.keys()): + members = type_members[type_name] + + try: + mod = __import__(type_name) + print "type: %s" % type_name + except: + print "missing: %s - %s" % (type_name, str(members)) + continue + + reload(mod) # incase were editing it + + try: + type_class = getattr(mod, type_name) + except: + print "missing class: %s.%s - %s" % (type_name, type_name, str(members)) + continue + + for member in sorted(members): + try: + getattr(type_class, member) + print "\tfound: %s.%s" % (type_name, member) + except: + print "\tmissing: %s.%s" % (type_name, member) -- cgit v1.2.3 From 885fa49aa4cd49a552bfe6210e3cb4701c4a5d04 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Apr 2009 06:23:45 +0000 Subject: BGE Joystick Sensor - Raised limit of 2 axis to 4 axis pairs (4==8 joysticks axis pairs) - Added a new Joystick Sensor type "Single Axis", so you can detect horizontal or vertical movement, rather then just Up/Down/Left/Right - added Python attribute "axisSingle" so you can get the value from the selected axis (rather then getting it out of the axis list) - renamed Py attribute "axisPosition" to "axisValues" (was never in a release) If we need to increase the axis limit again just change JOYAXIS_MAX and the button limits. --- source/gameengine/PyDoc/SCA_JoystickSensor.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/SCA_JoystickSensor.py b/source/gameengine/PyDoc/SCA_JoystickSensor.py index e38e023143d..13b006e8dd6 100644 --- a/source/gameengine/PyDoc/SCA_JoystickSensor.py +++ b/source/gameengine/PyDoc/SCA_JoystickSensor.py @@ -8,10 +8,16 @@ class SCA_JoystickSensor(SCA_ISensor): Properties: - @ivar axisPosition: (read-only) The state of the joysticks axis as a list of 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. - The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. - left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...] - @type axisPosition: [integer, integer, integer, integer] + @ivar axisValues: (read-only) The state of the joysticks axis as a list of values L{numAxis} long. + each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. + The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. + left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...] + @type axisValues: list of ints + + @ivar axisSingle: (read-only) like L{axisValues} but returns a single axis value that is set by the sensor. + Only use this for "Single Axis" type sensors otherwise it will raise an error. + @type axisSingle: int + @ivar numAxis: (read-only) The number of axes for the joystick at this index. @type numAxis: integer @ivar numButtons: (read-only) The number of buttons for the joystick at this index. -- cgit v1.2.3 From 1534eca60f181dc4e4299f6bdf73a66bbdf87970 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Apr 2009 11:45:48 +0000 Subject: Updated bge_api_validate_py.txt to check for undocumented attributes All types methods and attributes are now documented (except for some types have no epydoc .py files for at all) --- source/gameengine/PyDoc/KX_MeshProxy.py | 3 +- source/gameengine/PyDoc/KX_VertexProxy.py | 5 +++ source/gameengine/PyDoc/SCA_RandomSensor.py | 7 ++++ source/gameengine/PyDoc/bge_api_validate_py.txt | 50 +++++++++++++++++++++++-- 4 files changed, 61 insertions(+), 4 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_MeshProxy.py b/source/gameengine/PyDoc/KX_MeshProxy.py index 03bc36b6ac1..c6855d3b0a5 100644 --- a/source/gameengine/PyDoc/KX_MeshProxy.py +++ b/source/gameengine/PyDoc/KX_MeshProxy.py @@ -45,7 +45,8 @@ class KX_MeshProxy: m_i += 1 mesh = obj.getMesh(m_i) - + @ivar materials: + @type materials: list of L{KX_BlenderMaterial} or L{KX_PolygonMaterial} types """ def getNumMaterials(): diff --git a/source/gameengine/PyDoc/KX_VertexProxy.py b/source/gameengine/PyDoc/KX_VertexProxy.py index 5baaf76c3d9..7ee5087b316 100644 --- a/source/gameengine/PyDoc/KX_VertexProxy.py +++ b/source/gameengine/PyDoc/KX_VertexProxy.py @@ -34,6 +34,11 @@ class KX_VertexProxy: @ivar v: The v texture coordinate of the vertex. @type v: float + @ivar u2: The second u texture coordinate of the vertex. + @type u2: float + @ivar v2: The second v texture coordinate of the vertex. + @type v2: float + @group Colour: r, g, b, a @ivar r: The red component of the vertex colour. 0.0 <= r <= 1.0 @type r: float diff --git a/source/gameengine/PyDoc/SCA_RandomSensor.py b/source/gameengine/PyDoc/SCA_RandomSensor.py index 940b8f879ff..6dc0a3c23c0 100644 --- a/source/gameengine/PyDoc/SCA_RandomSensor.py +++ b/source/gameengine/PyDoc/SCA_RandomSensor.py @@ -5,6 +5,11 @@ from SCA_ISensor import * class SCA_RandomSensor(SCA_ISensor): """ This sensor activates randomly. + + @ivar lastDraw: The seed of the random number generator. + @type lastDraw: int + @ivar seed: The seed of the random number generator. + @type seed: int """ def setSeed(seed): @@ -25,4 +30,6 @@ class SCA_RandomSensor(SCA_ISensor): def getLastDraw(): """ Returns the last random number generated. + + @rtype: integer """ diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt index e003f29831b..58dfbadba15 100644 --- a/source/gameengine/PyDoc/bge_api_validate_py.txt +++ b/source/gameengine/PyDoc/bge_api_validate_py.txt @@ -15,6 +15,7 @@ BGE_API_DOC_PATH = 'source/gameengine/PyDoc' +import GameTypes type_members = {} for type_name in dir(GameTypes): @@ -40,12 +41,49 @@ doc_dir= os.path.join(os.getcwd(), BGE_API_DOC_PATH) if doc_dir not in sys.path: sys.path.append(doc_dir) + +def check_attribute(type_mame, member): + filename = os.path.join(doc_dir, type_mame + '.py') + # print filename + + file = open(filename, 'rU') + + for l in file: + l = l.strip() + + ''' + @ivar foo: blah blah + to + foo + + ''' + + if l.startswith('@ivar'): + var = l.split()[1].split(':')[0] + + if var == member: + file.close() + return True + + file.close() + return False + + + + + + +print '\n\n\nChecking Docs' + +PRINT_OK = False + for type_name in sorted(type_members.keys()): members = type_members[type_name] try: mod = __import__(type_name) - print "type: %s" % type_name + if PRINT_OK: + print "type: %s" % type_name except: print "missing: %s - %s" % (type_name, str(members)) continue @@ -61,6 +99,12 @@ for type_name in sorted(type_members.keys()): for member in sorted(members): try: getattr(type_class, member) - print "\tfound: %s.%s" % (type_name, member) + if PRINT_OK: + print "\tfound: %s.%s" % (type_name, member) except: - print "\tmissing: %s.%s" % (type_name, member) + if check_attribute(type_name, member): + if PRINT_OK: + print "\tfound attr: %s.%s" % (type_name, member) + else: + print "\tmissing: %s.%s" % (type_name, member) + -- cgit v1.2.3 From bdfa61fbbe582bd37690ee79cfface325654b61c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Apr 2009 17:54:56 +0000 Subject: BGE api added place holder docs and CListValue docs. --- source/gameengine/PyDoc/BL_Shader.py | 228 +++++++++++++++++++++ source/gameengine/PyDoc/CListValue.py | 39 ++++ source/gameengine/PyDoc/KX_BlenderMaterial.py | 38 ++++ source/gameengine/PyDoc/KX_ConstraintWrapper.py | 28 +++ source/gameengine/PyDoc/KX_GameObject.py | 4 +- source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py | 47 +++++ source/gameengine/PyDoc/KX_Scene.py | 10 +- source/gameengine/PyDoc/KX_TouchSensor.py | 4 +- source/gameengine/PyDoc/KX_VehicleWrapper.py | 158 ++++++++++++++ source/gameengine/PyDoc/bge_api_validate_py.txt | 4 +- 10 files changed, 549 insertions(+), 11 deletions(-) create mode 100644 source/gameengine/PyDoc/BL_Shader.py create mode 100644 source/gameengine/PyDoc/CListValue.py create mode 100644 source/gameengine/PyDoc/KX_BlenderMaterial.py create mode 100644 source/gameengine/PyDoc/KX_ConstraintWrapper.py create mode 100644 source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py create mode 100644 source/gameengine/PyDoc/KX_VehicleWrapper.py (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/BL_Shader.py b/source/gameengine/PyDoc/BL_Shader.py new file mode 100644 index 00000000000..182b73d437b --- /dev/null +++ b/source/gameengine/PyDoc/BL_Shader.py @@ -0,0 +1,228 @@ +class BL_Shader: # (PyObjectPlus) + """ + BL_Shader GLSL shaders. + + All placeholders have a __ prefix + """ + + def __setUniformfv(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __delSource(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getFragmentProg(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getVertexProg(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __isValid(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setAttrib(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setNumberOfPasses(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setSampler(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setSource(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform1f(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform1i(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform2f(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform2i(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform3f(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform3i(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform4f(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniform4i(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniformDef(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniformMatrix3(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniformMatrix4(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setUniformiv(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __validate(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ diff --git a/source/gameengine/PyDoc/CListValue.py b/source/gameengine/PyDoc/CListValue.py new file mode 100644 index 00000000000..33e77395c86 --- /dev/null +++ b/source/gameengine/PyDoc/CListValue.py @@ -0,0 +1,39 @@ +class CListValue: # (PyObjectPlus) + """ + CListValue + + This is a list like object used in the game engine internally that behaves similar to a python list in most ways. + + As well as the normal index lookup. + C{val= clist[i]} + + CListValue supports string lookups. + C{val= scene.objects["OBCube"]} + + Other operations such as C{len(clist), list(clist), clist[0:10]} are also supported. + """ + def append(val): + """ + Add an item to the list (like pythons append) + + Warning: Appending values to the list can cause crashes when the list is used internally by the game engine. + """ + + def count(val): + """ + Count the number of instances of a value in the list. + + @rtype: integer + @return: number of instances + """ + def index(val): + """ + Return the index of a value in the list. + + @rtype: integer + @return: The index of the value in the list. + """ + def reverse(val): + """ + Reverse the order of the list. + """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/KX_BlenderMaterial.py b/source/gameengine/PyDoc/KX_BlenderMaterial.py new file mode 100644 index 00000000000..21417db1802 --- /dev/null +++ b/source/gameengine/PyDoc/KX_BlenderMaterial.py @@ -0,0 +1,38 @@ +class KX_BlenderMaterial: # (PyObjectPlus) + """ + KX_BlenderMaterial + + All placeholders have a __ prefix + """ + + def __getShader(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __setBlending(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getMaterialIndex(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ diff --git a/source/gameengine/PyDoc/KX_ConstraintWrapper.py b/source/gameengine/PyDoc/KX_ConstraintWrapper.py new file mode 100644 index 00000000000..5b34e1609e8 --- /dev/null +++ b/source/gameengine/PyDoc/KX_ConstraintWrapper.py @@ -0,0 +1,28 @@ +class KX_ConstraintWrapper: # (PyObjectPlus) + """ + KX_ConstraintWrapper + + All placeholders have a __ prefix + """ + def __getConstraintId(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __testMethod(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 972a15b7765..97f6dab52bf 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -328,13 +328,13 @@ class KX_GameObject: # (SCA_IObject) def getChildren(): """ Return a list of immediate children of this object. - @rtype: list + @rtype: L{CListValue} of L{KX_GameObject} @return: a list of all this objects children. """ def getChildrenRecursive(): """ Return a list of children of this object, including all their childrens children. - @rtype: list + @rtype: L{CListValue} of L{KX_GameObject} @return: a list of all this objects children recursivly. """ def getMesh(mesh): diff --git a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py new file mode 100644 index 00000000000..2171cf4c7b6 --- /dev/null +++ b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py @@ -0,0 +1,47 @@ +class KX_PhysicsObjectWrapper: # (PyObjectPlus) + """ + KX_PhysicsObjectWrapper + + All placeholders have a __ prefix + """ + def __setActive(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __setAngularVelocity(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setLinearVelocity(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setPosition(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py index a9fd44ffc9a..5dcd560ee96 100644 --- a/source/gameengine/PyDoc/KX_Scene.py +++ b/source/gameengine/PyDoc/KX_Scene.py @@ -16,14 +16,14 @@ class KX_Scene: scene = GameLogic.getCurrentScene() # print all the objects in the scene - for obj in scene.getObjectList(): - print obj.getName() + for obj in scene.objects: + print obj.name # get an object named 'Cube' - obj = scene.getObjectList()["OBCube"] + obj = scene.objects["OBCube"] # get the first object in the scene. - obj = scene.getObjectList()[0] + obj = scene.objects[0] Example:: # Get the depth of an object in the camera view. @@ -40,7 +40,7 @@ class KX_Scene: @ivar name: The scene's name @type name: string @ivar objects: A list of objects in the scene. - @type objects: list [L{KX_GameObject}] + @type objects: L{CListValue} of L{KX_GameObject} @ivar active_camera: The current active camera @type active_camera: L{KX_Camera} @ivar suspended: True if the scene is suspended. diff --git a/source/gameengine/PyDoc/KX_TouchSensor.py b/source/gameengine/PyDoc/KX_TouchSensor.py index d7277be4c2a..f4fcbeefc62 100644 --- a/source/gameengine/PyDoc/KX_TouchSensor.py +++ b/source/gameengine/PyDoc/KX_TouchSensor.py @@ -17,7 +17,7 @@ class KX_TouchSensor(SCA_ISensor): @ivar objectHit: The last collided object. (Read Only) @type objectHit: L{KX_GameObject} or None @ivar objectHitList: A list of colliding objects. (Read Only) - @type objectHitList: list + @type objectHitList: L{CListValue} of L{KX_GameObject} """ #--The following methods are deprecated, please use properties instead. @@ -53,7 +53,7 @@ class KX_TouchSensor(SCA_ISensor): Only objects that have the requisite material/property are listed. - @rtype: list [L{KX_GameObject}] + @rtype: L{CListValue} of L{KX_GameObject} """ def getTouchMaterial(): """ diff --git a/source/gameengine/PyDoc/KX_VehicleWrapper.py b/source/gameengine/PyDoc/KX_VehicleWrapper.py new file mode 100644 index 00000000000..68240e15622 --- /dev/null +++ b/source/gameengine/PyDoc/KX_VehicleWrapper.py @@ -0,0 +1,158 @@ +class KX_VehicleWrapper: # (PyObjectPlus) + """ + KX_VehicleWrapper + + All placeholders have a __ prefix + """ + + def __addWheel(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __applyBraking(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __applyEngineForce(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getConstraintId(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getConstraintType(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getNumWheels(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getWheelOrientationQuaternion(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getWheelPosition(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getWheelRotation(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setRollInfluence(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setSteeringValue(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setSuspensionCompression(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setSuspensionDamping(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setSuspensionStiffness(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __setTyreFriction(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt index 58dfbadba15..0920e5d3c7d 100644 --- a/source/gameengine/PyDoc/bge_api_validate_py.txt +++ b/source/gameengine/PyDoc/bge_api_validate_py.txt @@ -85,7 +85,7 @@ for type_name in sorted(type_members.keys()): if PRINT_OK: print "type: %s" % type_name except: - print "missing: %s - %s" % (type_name, str(members)) + print "missing: %s - %s" % (type_name, str(sorted(members))) continue reload(mod) # incase were editing it @@ -93,7 +93,7 @@ for type_name in sorted(type_members.keys()): try: type_class = getattr(mod, type_name) except: - print "missing class: %s.%s - %s" % (type_name, type_name, str(members)) + print "missing class: %s.%s - %s" % (type_name, type_name, str(sorted(members))) continue for member in sorted(members): -- cgit v1.2.3 From 370850146f5ab1af11ec3a28abd1bad2f60314a4 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 8 Apr 2009 16:25:00 +0000 Subject: BGE patch #18051: add localInertia attribute to GameObject. --- source/gameengine/PyDoc/KX_GameObject.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 97f6dab52bf..42656503384 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -16,8 +16,10 @@ class KX_GameObject: # (SCA_IObject) @ivar name: The object's name. (Read only) - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. @type name: string. - @ivar mass: The object's mass (provided the object has a physics controller). Read only. + @ivar mass: The object's mass (provided the object has a physics controller). @type mass: float + @ivar localInertia: the object's inertia vector in local coordinates. Read only. + @type localInertia: list [ix, iy, iz] @ivar parent: The object's parent object. (Read only) @type parent: L{KX_GameObject} or None @ivar visible: visibility flag. -- cgit v1.2.3 From db33320df7f4db6480a15502baecaafefc1be63d Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 8 Apr 2009 16:57:08 +0000 Subject: BGE patch #18350: Add sendMessage() to GameLogic. Added sendMessage to both GameLogic and KX_GameObject. --- source/gameengine/PyDoc/GameLogic.py | 13 +++++++++++++ source/gameengine/PyDoc/KX_GameObject.py | 11 +++++++++++ 2 files changed, 24 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index da394288e25..29d1b64350a 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -205,6 +205,19 @@ def addActiveActuator(actuator, activate): @type activate: boolean @param activate: whether to activate or deactivate the given actuator. """ +def sendMessage(subject, body="", to="", from=""): + """ + Sends a message. + + @param subject: The subject of the message + @type subject: string + @param body: The body of the message (optional) + @type body: string + @param to: The name of the object to send the message to (optional) + @type to: string + @param from: The name of the object that the message is coming from (optional) + @type from: string + """ def getRandomFloat(): """ Returns a random floating point value in the range [0...1) diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 42656503384..fb1e099e575 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -453,3 +453,14 @@ class KX_GameObject: # (SCA_IObject) @type margin: float @param margin: the collision margin distance in blender units. """ + def sendMessage(subject, body="", to=""): + """ + Sends a message. + + @param subject: The subject of the message + @type subject: string + @param body: The body of the message (optional) + @type body: string + @param to: The name of the object to send the message to (optional) + @type to: string + """ -- cgit v1.2.3 From 5b0d75e831d891015b82dcc3d30856125c7b913e Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 8 Apr 2009 21:40:55 +0000 Subject: BGE API cleanup: 2DFilterActuator. --- source/gameengine/PyDoc/SCA_2DFilterActuator.py | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 source/gameengine/PyDoc/SCA_2DFilterActuator.py (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/SCA_2DFilterActuator.py b/source/gameengine/PyDoc/SCA_2DFilterActuator.py new file mode 100644 index 00000000000..12baed6fa0c --- /dev/null +++ b/source/gameengine/PyDoc/SCA_2DFilterActuator.py @@ -0,0 +1,44 @@ +# $Id$ +# Documentation for SCA_2DFilterActuator +from SCA_IActuator import * +from SCA_ILogicBrick import * + +class SCA_2DFilterActuator(SCA_IActuator): + """ + Create, enable and disable 2D filters + + Properties: + + The following properties don't have an immediate effect. + You must active the actuator to get the result. + The actuator is not persistent: it automatically stops itself after setting up the filter + but the filter remains active. To stop a filter you must activate the actuator with 'type' + set to RAS_2DFILTER_DISABLED or RAS_2DFILTER_NOFILTER. + + @ivar shaderText: shader source code for custom shader + @type shaderText: string + @ivar disableMotionBlur: action on motion blur: 0=enable, 1=disable + @type disableMotionBlur: integer + @ivar type: type of 2D filter, use one of the following constants: + RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled + RAS_2DFILTER_DISABLED (-1) : disable the filter that is currently active + RAS_2DFILTER_NOFILTER (0) : disable and destroy the filter that is currently active + RAS_2DFILTER_MOTIONBLUR (1) : create and enable preset filters + RAS_2DFILTER_BLUR (2) + RAS_2DFILTER_SHARPEN (3) + RAS_2DFILTER_DILATION (4) + RAS_2DFILTER_EROSION (5) + RAS_2DFILTER_LAPLACIAN (6) + RAS_2DFILTER_SOBEL (7) + RAS_2DFILTER_PREWITT (8) + RAS_2DFILTER_GRAYSCALE (9) + RAS_2DFILTER_SEPIA (10) + RAS_2DFILTER_INVERT (11) + RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property + @type type: integer + @ivar passNb: order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb. + Only be one filter can be defined per passNb. + @type passNb: integer (0-100) + @ivar value: argument for motion blur filter + @type value: float (0.0-100.0) + """ -- cgit v1.2.3 From e14e66f041104c87033ec0b58596fb49c591908c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Apr 2009 12:53:56 +0000 Subject: BGE Py API - added keyboard senser attribute "events" to replace getEventList() - fix 2 memory leaks in the python api (was making a list but not returning it) - setting readonly attributes didnt give a good error message. --- source/gameengine/PyDoc/GameLogic.py | 8 +++---- source/gameengine/PyDoc/SCA_2DFilterActuator.py | 2 +- source/gameengine/PyDoc/SCA_KeyboardSensor.py | 32 +++++++++++++++++-------- 3 files changed, 27 insertions(+), 15 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 29d1b64350a..1996aa3f8a9 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -205,9 +205,9 @@ def addActiveActuator(actuator, activate): @type activate: boolean @param activate: whether to activate or deactivate the given actuator. """ -def sendMessage(subject, body="", to="", from=""): +def sendMessage(subject, body="", to="", message_from=""): """ - Sends a message. + Sends a message to sensors in any active scene. @param subject: The subject of the message @type subject: string @@ -215,8 +215,8 @@ def sendMessage(subject, body="", to="", from=""): @type body: string @param to: The name of the object to send the message to (optional) @type to: string - @param from: The name of the object that the message is coming from (optional) - @type from: string + @param message_from: The name of the object that the message is coming from (optional) + @type message_from: string """ def getRandomFloat(): """ diff --git a/source/gameengine/PyDoc/SCA_2DFilterActuator.py b/source/gameengine/PyDoc/SCA_2DFilterActuator.py index 12baed6fa0c..9a010e8f221 100644 --- a/source/gameengine/PyDoc/SCA_2DFilterActuator.py +++ b/source/gameengine/PyDoc/SCA_2DFilterActuator.py @@ -20,7 +20,7 @@ class SCA_2DFilterActuator(SCA_IActuator): @ivar disableMotionBlur: action on motion blur: 0=enable, 1=disable @type disableMotionBlur: integer @ivar type: type of 2D filter, use one of the following constants: - RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled + RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled RAS_2DFILTER_DISABLED (-1) : disable the filter that is currently active RAS_2DFILTER_NOFILTER (0) : disable and destroy the filter that is currently active RAS_2DFILTER_MOTIONBLUR (1) : create and enable preset filters diff --git a/source/gameengine/PyDoc/SCA_KeyboardSensor.py b/source/gameengine/PyDoc/SCA_KeyboardSensor.py index f6a7a7d8a97..93a09acafcf 100644 --- a/source/gameengine/PyDoc/SCA_KeyboardSensor.py +++ b/source/gameengine/PyDoc/SCA_KeyboardSensor.py @@ -20,11 +20,23 @@ class SCA_KeyboardSensor(SCA_ISensor): @type targetProperty: string @ivar useAllKeys: Flag to determine whether or not to accept all keys. @type useAllKeys: boolean + @ivar events: a list of pressed keys that have either been pressed, or just released, or are active this frame. (read only). + + - 'keycode' matches the values in L{GameKeys}. + - 'status' uses... + - L{GameLogic.KX_INPUT_NONE} + - L{GameLogic.KX_INPUT_JUST_ACTIVATED} + - L{GameLogic.KX_INPUT_ACTIVE} + - L{GameLogic.KX_INPUT_JUST_RELEASED} + + @type events: list [[keycode, status], ...] """ def getEventList(): """ Get a list of pressed keys that have either been pressed, or just released, or are active this frame. + B{DEPRECATED: Use the "events" property instead}. + @rtype: list of key status. [[keycode, status]] @return: A list of keyboard events """ @@ -33,18 +45,18 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get the status of a key. - @rtype: key state (KX_NO_INPUTSTATUS, KX_JUSTACTIVATED, KX_ACTIVE or KX_JUSTRELEASED) + @rtype: key state L{GameLogic} members (KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED) @return: The state of the given key @type keycode: integer @param keycode: The code that represents the key you want to get the state of """ - #--The following methods are deprecated-- + #--The following methods are DEPRECATED-- def getKey(): """ Returns the key code this sensor is looking for. - Deprecated: Use the "key" property instead. + B{DEPRECATED: Use the "key" property instead}. @rtype: keycode from L{GameKeys} module """ @@ -53,7 +65,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Set the key this sensor should listen for. - Deprecated: Use the "key" property instead. + B{DEPRECATED: Use the "key" property instead}. @type keycode: keycode from L{GameKeys} module """ @@ -62,7 +74,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code for the first modifier this sensor is looking for. - Deprecated: Use the "hold1" property instead. + B{DEPRECATED: Use the "hold1" property instead}. @rtype: keycode from L{GameKeys} module """ @@ -71,7 +83,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Sets the key code for the first modifier this sensor should look for. - Deprecated: Use the "hold1" property instead. + B{DEPRECATED: Use the "hold1" property instead}. @type keycode: keycode from L{GameKeys} module """ @@ -80,7 +92,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code for the second modifier this sensor is looking for. - Deprecated: Use the "hold2" property instead. + B{DEPRECATED: Use the "hold2" property instead}. @rtype: keycode from L{GameKeys} module """ @@ -89,7 +101,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Sets the key code for the second modifier this sensor should look for. - Deprecated: Use the "hold2" property instead. + B{DEPRECATED: Use the "hold2" property instead.} @type keycode: keycode from L{GameKeys} module """ @@ -98,7 +110,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get a list of keys that have either been pressed, or just released this frame. - Deprecated: Use getEventList() instead. + B{DEPRECATED: Use "events" instead.} @rtype: list of key status. [[keycode, status]] """ @@ -107,7 +119,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get a list of currently pressed keys that have either been pressed, or just released - Deprecated: Use getEventList() instead. + B{DEPRECATED: Use "events" instead.} @rtype: list of key status. [[keycode, status]] """ \ No newline at end of file -- cgit v1.2.3 From 4669fa48a82f5f1070cf885cd1714e0a8ff8db3a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Apr 2009 16:00:45 +0000 Subject: Added GameKeys.EventToCharacter(event, is_shift) so you can get the character that would be types when pressing a key. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last commit was made in the pydocs folder only, so this includes changes mentioned in rev 19620. --- source/gameengine/PyDoc/GameKeys.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameKeys.py b/source/gameengine/PyDoc/GameKeys.py index 1a0a737718e..310f2b0d506 100644 --- a/source/gameengine/PyDoc/GameKeys.py +++ b/source/gameengine/PyDoc/GameKeys.py @@ -134,26 +134,20 @@ Example:: co = GameLogic.getCurrentController() # 'Keyboard' is a keyboard sensor sensor = co.getSensor('Keyboard') - sensor.setKey(GameKeys.F1KEY) + sensor.key = GameKeys.F1KEY Example:: # Do the all keys thing import GameLogic import GameKeys - - # status: these should be added to a module somewhere - KX_NO_INPUTSTATUS = 0 - KX_JUSTACTIVATED = 1 - KX_ACTIVE = 2 - KX_JUSTRELEASED = 3 - + co = GameLogic.getCurrentController() # 'Keyboard' is a keyboard sensor sensor = co.getSensor('Keyboard') - keylist = sensor.getPressedKeys() + keylist = sensor.events for key in keylist: # key[0] == GameKeys.keycode, key[1] = status - if key[1] == KX_JUSTACTIVATED: + if key[1] == GameLogic.KX_INPUT_JUST_ACTIVATED: if key[0] == GameKeys.WKEY: # Activate Forward! if key[0] == GameKeys.SKEY: @@ -173,3 +167,15 @@ def EventToString(event): @param event: key event from GameKeys or the keyboard sensor. @rtype: string """ + +def EventToCharacter(event, shift): + """ + Return the string name of a key event. Returns an empty string if the event cant be represented as a character. + + @type event: int + @param event: key event from GameKeys or the keyboard sensor. + @type event: bool + @param event: set to true if shift is held. + @rtype: string + """ + -- cgit v1.2.3 From 09a5ffdf07677016b4e8eae8df02c47cd94ca6d8 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 9 Apr 2009 20:40:12 +0000 Subject: BGE API cleanup: sound actuator. --- source/gameengine/PyDoc/KX_SoundActuator.py | 53 +++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_SoundActuator.py b/source/gameengine/PyDoc/KX_SoundActuator.py index 072af5b816c..383b45e6eb9 100644 --- a/source/gameengine/PyDoc/KX_SoundActuator.py +++ b/source/gameengine/PyDoc/KX_SoundActuator.py @@ -8,17 +8,53 @@ class KX_SoundActuator(SCA_IActuator): The L{startSound()}, L{pauseSound()} and L{stopSound()} do not require the actuator to be activated - they act instantly. + + @ivar filename: Sets the filename of the sound this actuator plays. + @type filename: string + + @ivar volume: Sets the volume (gain) of the sound. + @type volume: float + + @ivar pitch: Sets the pitch of the sound. + @type pitch: float + + @ivar rollOffFactor: Sets the roll off factor. Rolloff defines the rate of attenuation as the sound gets further away. + @type rollOffFactor: float + + @ivar looping: Sets the loop mode of the actuator. + @type looping: integer + + @ivar position: Sets the position of the sound. + @type position: float array + + @ivar velocity: Sets the speed of the sound; The speed of the sound alter the pitch. + @type velocity: float array + + @ivar orientation: Sets the orientation of the sound. When setting the orientation you can + also use quaternion [float,float,float,float] or euler angles [float,float,float] + @type orientation: 3x3 matrix [[float]] + + @ivar type: Sets the operation mode of the actuator. You can use one of the following constant: + KX_SOUNDACT_PLAYSTOP (1) + KX_SOUNDACT_PLAYEND (2) + KX_SOUNDACT_LOOPSTOP (3) + KX_SOUNDACT_LOOPEND (4) + KX_SOUNDACT_LOOPBIDIRECTIONAL (5) + KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6) + @type type: integer - @group Play Methods: startSound, pauseSound, stopSound + @group Play Methods: startSound, pauseSound, stopSound. """ def setFilename(filename): """ - Sets the filename of the sound this actuator plays. + DEPRECATED: Use the filename property instead. + Sets the filename of the sound this actuator plays. @type filename: string """ def getFilename(): """ + DEPRECATED: Use the filename property instead. Returns the filename of the sound this actuator plays. @rtype: string @@ -37,6 +73,7 @@ class KX_SoundActuator(SCA_IActuator): """ def setGain(gain): """ + DEPRECATED: Use the volume property instead Sets the gain (volume) of the sound @type gain: float @@ -44,24 +81,28 @@ class KX_SoundActuator(SCA_IActuator): """ def getGain(): """ + DEPRECATED: Use the volume property instead. Gets the gain (volume) of the sound. @rtype: float """ def setPitch(pitch): """ + DEPRECATED: Use the pitch property instead. Sets the pitch of the sound. @type pitch: float """ def getPitch(): """ + DEPRECATED: Use the pitch property instead. Returns the pitch of the sound. @rtype: float """ def setRollOffFactor(rolloff): """ + DEPRECATED: Use the rollOffFactor property instead. Sets the rolloff factor for the sounds. Rolloff defines the rate of attenuation as the sound gets further away. @@ -71,12 +112,14 @@ class KX_SoundActuator(SCA_IActuator): """ def getRollOffFactor(): """ + DEPRECATED: Use the rollOffFactor property instead. Returns the rolloff factor for the sound. @rtype: float """ def setLooping(loop): """ + DEPRECATED: Use the looping property instead. Sets the loop mode of the actuator. @bug: There are no constants defined for this method! @@ -90,12 +133,14 @@ class KX_SoundActuator(SCA_IActuator): """ def getLooping(): """ + DEPRECATED: Use the looping property instead. Returns the current loop mode of the actuator. @rtype: integer """ def setPosition(x, y, z): """ + DEPRECATED: Use the position property instead. Sets the position this sound will come from. @type x: float @@ -107,6 +152,7 @@ class KX_SoundActuator(SCA_IActuator): """ def setVelocity(vx, vy, vz): """ + DEPRECATED: Use the velocity property instead. Sets the velocity this sound is moving at. The sound's pitch is determined from the velocity. @@ -120,6 +166,7 @@ class KX_SoundActuator(SCA_IActuator): """ def setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33): """ + DEPRECATED: Use the orientation property instead. Sets the orientation of the sound. The nine parameters specify a rotation matrix:: @@ -130,6 +177,7 @@ class KX_SoundActuator(SCA_IActuator): def setType(mode): """ + DEPRECATED: Use the type property instead. Sets the operation mode of the actuator. @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP @@ -138,6 +186,7 @@ class KX_SoundActuator(SCA_IActuator): def getType(): """ + DEPRECATED: Use the type property instead. Returns the operation mode of the actuator. @rtype: integer -- cgit v1.2.3 From b0cca7de267f84768ee1eba0955373a24b661aad Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 9 Apr 2009 21:15:44 +0000 Subject: BGE API cleanup: StateActuator. --- source/gameengine/PyDoc/KX_SoundActuator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_SoundActuator.py b/source/gameengine/PyDoc/KX_SoundActuator.py index 383b45e6eb9..37ae3c6640d 100644 --- a/source/gameengine/PyDoc/KX_SoundActuator.py +++ b/source/gameengine/PyDoc/KX_SoundActuator.py @@ -7,7 +7,8 @@ class KX_SoundActuator(SCA_IActuator): Sound Actuator. The L{startSound()}, L{pauseSound()} and L{stopSound()} do not require - the actuator to be activated - they act instantly. + the actuator to be activated - they act instantly provided that the actuator has + been activated once at least. @ivar filename: Sets the filename of the sound this actuator plays. @type filename: string -- cgit v1.2.3 From ac45472a1707934573a12d629a21a81c3ed409ba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Apr 2009 22:15:26 +0000 Subject: BGE Bugfix The End key didn't work work at all for the keyboard sensor. Removed getEventList() since it was added since 2.48a release. --- source/gameengine/PyDoc/SCA_KeyboardSensor.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/SCA_KeyboardSensor.py b/source/gameengine/PyDoc/SCA_KeyboardSensor.py index 93a09acafcf..8abb1fda762 100644 --- a/source/gameengine/PyDoc/SCA_KeyboardSensor.py +++ b/source/gameengine/PyDoc/SCA_KeyboardSensor.py @@ -31,15 +31,6 @@ class SCA_KeyboardSensor(SCA_ISensor): @type events: list [[keycode, status], ...] """ - def getEventList(): - """ - Get a list of pressed keys that have either been pressed, or just released, or are active this frame. - - B{DEPRECATED: Use the "events" property instead}. - - @rtype: list of key status. [[keycode, status]] - @return: A list of keyboard events - """ def getKeyStatus(keycode): """ -- cgit v1.2.3 From 5031fe982ea464ccb49ccfb4df857bf9dcb27c33 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 9 Apr 2009 23:10:12 +0000 Subject: BGE API cleanup: ConstraintActuator. --- source/gameengine/PyDoc/KX_ConstraintActuator.py | 69 ++++++++++++++++++++++++ source/gameengine/PyDoc/KX_StateActuator.py | 18 +++++++ 2 files changed, 87 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_ConstraintActuator.py b/source/gameengine/PyDoc/KX_ConstraintActuator.py index 7c7ad5aa0fa..a30b859548b 100644 --- a/source/gameengine/PyDoc/KX_ConstraintActuator.py +++ b/source/gameengine/PyDoc/KX_ConstraintActuator.py @@ -5,6 +5,75 @@ from SCA_IActuator import * class KX_ConstraintActuator(SCA_IActuator): """ A constraint actuator limits the position, rotation, distance or orientation of an object. + + Properties: + + @ivar damp: time constant of the constraint expressed in frame (not use by Force field constraint) + @type damp: integer + + @ivar rotDamp: time constant for the rotation expressed in frame (only for the distance constraint) + 0 = use damp for rotation as well + @type rotDamp: integer + + @ivar direction: the reference direction in world coordinate for the orientation constraint + @type direction: 3-tuple of float: [x,y,z] + + @ivar option: Binary combination of the following values: + Applicable to Distance constraint: + KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface + KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control + KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis + Applicable to Force field constraint: + KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well + Applicable to both: + KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property + KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target + @type option: integer + + @ivar time: activation time of the actuator. The actuator disables itself after this many frame. + If set to 0, the actuator is not limited in time. + @type time: integer + + @ivar property: the name of the property or material for the ray detection of the distance constraint. + @type property: string + + @ivar min: The lower bound of the constraint + For the rotation and orientation constraint, it represents radiant + @type min: float + + @ivar distance: the target distance of the distance constraint + @type distance: float + + @ivar max: the upper bound of the constraint. + For rotation and orientation constraints, it represents radiant. + @type max: float + + @ivar rayLength: the length of the ray of the distance constraint. + @type rayLength: float + + @ivar limit: type of constraint, use one of the following constant: + KX_ACT_CONSTRAINT_LOCX ( 1) : limit X coord + KX_ACT_CONSTRAINT_LOCY ( 2) : limit Y coord + KX_ACT_CONSTRAINT_LOCZ ( 3) : limit Z coord + KX_ACT_CONSTRAINT_ROTX ( 4) : limit X rotation + KX_ACT_CONSTRAINT_ROTY ( 5) : limit Y rotation + KX_ACT_CONSTRAINT_ROTZ ( 6) : limit Z rotation + KX_ACT_CONSTRAINT_DIRPX ( 7) : set distance along positive X axis + KX_ACT_CONSTRAINT_DIRPY ( 8) : set distance along positive Y axis + KX_ACT_CONSTRAINT_DIRPZ ( 9) : set distance along positive Z axis + KX_ACT_CONSTRAINT_DIRNX (10) : set distance along negative X axis + KX_ACT_CONSTRAINT_DIRNY (11) : set distance along negative Y axis + KX_ACT_CONSTRAINT_DIRNZ (12) : set distance along negative Z axis + KX_ACT_CONSTRAINT_ORIX (13) : set orientation of X axis + KX_ACT_CONSTRAINT_ORIY (14) : set orientation of Y axis + KX_ACT_CONSTRAINT_ORIZ (15) : set orientation of Z axis + KX_ACT_CONSTRAINT_FHPX (16) : set force field along positive X axis + KX_ACT_CONSTRAINT_FHPY (17) : set force field along positive Y axis + KX_ACT_CONSTRAINT_FHPZ (18) : set force field along positive Z axis + KX_ACT_CONSTRAINT_FHNX (19) : set force field along negative X axis + KX_ACT_CONSTRAINT_FHNY (20) : set force field along negative Y axis + KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis + @type limit: integer """ def setDamp(time): """ diff --git a/source/gameengine/PyDoc/KX_StateActuator.py b/source/gameengine/PyDoc/KX_StateActuator.py index fb6ae5a3621..fe3669d3809 100644 --- a/source/gameengine/PyDoc/KX_StateActuator.py +++ b/source/gameengine/PyDoc/KX_StateActuator.py @@ -5,9 +5,26 @@ from SCA_IActuator import * class KX_StateActuator(SCA_IActuator): """ State actuator changes the state mask of parent object. + + Property: + + @ivar operation: type of bit operation to be applied on object state mask. + You can use one of the following constant: + KX_STATE_OP_CPY (0) : Copy state mask + KX_STATE_OP_SET (1) : Add bits to state mask + KX_STATE_OP_CLR (2) : Substract bits to state mask + KX_STATE_OP_NEG (3) : Invert bits to state mask + @type operation: integer + + @ivar mask: value that defines the bits that will be modified by the operation. + The bits that are 1 in the mask will be updated in the object state, + the bits that are 0 are will be left unmodified expect for the Copy operation + which copies the mask to the object state + @type mask: integer """ def setOperation(op): """ + DEPRECATED: Use the operation property instead. Set the type of bit operation to be applied on object state mask. Use setMask() to specify the bits that will be modified. @@ -16,6 +33,7 @@ class KX_StateActuator(SCA_IActuator): """ def setMask(mask): """ + DEPRECATED: Use the mask property instead. Set the value that defines the bits that will be modified by the operation. The bits that are 1 in the value will be updated in the object state, the bits that are 0 are will be left unmodified expect for the Copy operation -- cgit v1.2.3 From 4cd088b1059afa2e7b998c184b2c9deecd4be4a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 11 Apr 2009 20:58:09 +0000 Subject: BGE Py API - setting the scene attributes would always add to the scenes custom dictionary. - new CListValue method from_id(id) so you can store a Game Objects id and use it to get the game object back. ob_id = id(gameOb) ... gameOb = scene.objects.from_id(ob_id) This is useful because names are not always unique. --- source/gameengine/PyDoc/CListValue.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/CListValue.py b/source/gameengine/PyDoc/CListValue.py index 33e77395c86..e9fc4215bb6 100644 --- a/source/gameengine/PyDoc/CListValue.py +++ b/source/gameengine/PyDoc/CListValue.py @@ -33,7 +33,27 @@ class CListValue: # (PyObjectPlus) @rtype: integer @return: The index of the value in the list. """ - def reverse(val): + def reverse(): """ Reverse the order of the list. + """ + def from_id(id): + """ + This is a funtion especially for the game engine to return a value with a spesific id. + + Since object names are not always unique, the id of an object can be used to get an object from the CValueList. + + Example. + + C{myObID = id(gameObject)} + + C{...} + + C{ob= scene.objects.from_id(myObID)} + + Where myObID is an int or long from the id function. + + This has the advantage that you can store the id in places you could not store a gameObject. + + Warning: the id is derived from a memory location and will be different each time the game engine starts. """ \ No newline at end of file -- cgit v1.2.3 From 1b73d3ce058a0edbbdfcc573d0084f655a9c8465 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Apr 2009 03:43:16 +0000 Subject: mesh proxy attributes from andrecastelo --- source/gameengine/PyDoc/KX_MeshProxy.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_MeshProxy.py b/source/gameengine/PyDoc/KX_MeshProxy.py index c6855d3b0a5..e8839ac484c 100644 --- a/source/gameengine/PyDoc/KX_MeshProxy.py +++ b/source/gameengine/PyDoc/KX_MeshProxy.py @@ -47,6 +47,12 @@ class KX_MeshProxy: @ivar materials: @type materials: list of L{KX_BlenderMaterial} or L{KX_PolygonMaterial} types + + @ivar numPolygons: + @type numPolygons: integer + + @ivar numMaterials: + @type numMaterials: integer """ def getNumMaterials(): -- cgit v1.2.3 From 6f12e584a97f664c654ddfbe5f721d2a7be3d491 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Mon, 13 Apr 2009 19:33:22 +0000 Subject: SVN maintenance. --- source/gameengine/PyDoc/GameTypes.py | 2 +- source/gameengine/PyDoc/SCA_NANDController.py | 2 +- source/gameengine/PyDoc/SCA_NORController.py | 2 +- source/gameengine/PyDoc/SCA_XNORController.py | 2 +- source/gameengine/PyDoc/SCA_XORController.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index f39e4ed064d..2b07a18247c 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -1,4 +1,4 @@ -# $Id: GameLogic.py 19483 2009-03-31 21:03:15Z ben2610 $ +# $Id$ """ GameEngine Types ================ diff --git a/source/gameengine/PyDoc/SCA_NANDController.py b/source/gameengine/PyDoc/SCA_NANDController.py index 81e1dfd6d92..a864ff2981c 100644 --- a/source/gameengine/PyDoc/SCA_NANDController.py +++ b/source/gameengine/PyDoc/SCA_NANDController.py @@ -1,4 +1,4 @@ -# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# $Id$ # Documentation for SCA_NANDController from SCA_IController import * diff --git a/source/gameengine/PyDoc/SCA_NORController.py b/source/gameengine/PyDoc/SCA_NORController.py index e3bdeefa63e..0bc0a71d7b1 100644 --- a/source/gameengine/PyDoc/SCA_NORController.py +++ b/source/gameengine/PyDoc/SCA_NORController.py @@ -1,4 +1,4 @@ -# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# $Id$ # Documentation for SCA_NORController from SCA_IController import * diff --git a/source/gameengine/PyDoc/SCA_XNORController.py b/source/gameengine/PyDoc/SCA_XNORController.py index b1d9dddd9f2..5fb2561f35a 100644 --- a/source/gameengine/PyDoc/SCA_XNORController.py +++ b/source/gameengine/PyDoc/SCA_XNORController.py @@ -1,4 +1,4 @@ -# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# $Id$ # Documentation for SCA_XNORController from SCA_IController import * diff --git a/source/gameengine/PyDoc/SCA_XORController.py b/source/gameengine/PyDoc/SCA_XORController.py index b8f2b5feef0..10e20fb0945 100644 --- a/source/gameengine/PyDoc/SCA_XORController.py +++ b/source/gameengine/PyDoc/SCA_XORController.py @@ -1,4 +1,4 @@ -# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $ +# $Id$ # Documentation for SCA_XORController from SCA_IController import * -- cgit v1.2.3 From 0b8661ab4da1a7cfbc756640649a2d07bb36cc64 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 13 Apr 2009 20:08:33 +0000 Subject: BGE: Occlusion culling and other performance improvements. Added occlusion culling capability in the BGE. More info: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine#BGE_Scenegraph_improvement MSVC, scons, cmake, Makefile updated. Other minor performance improvements: - The rasterizer was computing the openGL model matrix of the objects too many times - DBVT view frustrum culling was not properly culling behind the near plane: Large objects behind the camera were sent to the GPU - Remove all references to mesh split/join feature as it is not yet functional --- source/gameengine/PyDoc/KX_GameObject.py | 10 ++++++++++ source/gameengine/PyDoc/KX_VisibilityActuator.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index fb1e099e575..fa4641c3e2f 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -25,6 +25,8 @@ class KX_GameObject: # (SCA_IObject) @ivar visible: visibility flag. - note: Game logic will still run for invisible objects. @type visible: boolean + @ivar occlusion: occlusion capability flag. + @type occlusion: boolean @ivar position: The object's position. @type position: list [x, y, z] @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. @@ -76,6 +78,14 @@ class KX_GameObject: # (SCA_IObject) @type recursive: boolean @param recursive: optional argument to set all childrens visibility flag too. """ + def setOcclusion(occlusion, recursive): + """ + Sets the game object's occlusion capability. + + @type visible: boolean + @type recursive: boolean + @param recursive: optional argument to set all childrens occlusion flag too. + """ def getState(): """ Gets the game object's state bitmask. (B{deprecated}) diff --git a/source/gameengine/PyDoc/KX_VisibilityActuator.py b/source/gameengine/PyDoc/KX_VisibilityActuator.py index aca8d1ce243..36f25b2423c 100644 --- a/source/gameengine/PyDoc/KX_VisibilityActuator.py +++ b/source/gameengine/PyDoc/KX_VisibilityActuator.py @@ -7,7 +7,9 @@ class KX_VisibilityActuator(SCA_IActuator): Visibility Actuator. @ivar visibility: whether the actuator makes its parent object visible or invisible @type visibility: boolean - @ivar recursion: whether the visibility/invisibility should be propagated to all children of the object + @ivar occlusion: whether the actuator makes its parent object an occluder or not + @type occlusion: boolean + @ivar recursion: whether the visibility/occlusion should be propagated to all children of the object @type recursion: boolean """ def set(visible): -- cgit v1.2.3 From 3511f8ef9fe6a2a6491fbae3a44a407f280a19e0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Apr 2009 12:34:39 +0000 Subject: BGE Physics Clamp objects min/max velocity. Accessed with bullet physics from the advanced button with dynamic and rigid body objects. - useful for preventing unstable physics in cases where objects move too fast. - can add linear velocity with the motion actuator to give smooth motion transitions, without moving too fast. - minimum velocity means objects don't stop moving. - python scripts can adjust these values speedup or throttle velocity in the existing direction. Also made copy properties from an object with no properties work (in case you want to clear all props) --- source/gameengine/PyDoc/KX_GameObject.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index fa4641c3e2f..44b84d44d8d 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -16,8 +16,18 @@ class KX_GameObject: # (SCA_IObject) @ivar name: The object's name. (Read only) - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. @type name: string. - @ivar mass: The object's mass (provided the object has a physics controller). + @ivar mass: The object's mass + - note: The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0 @type mass: float + @ivar linVelocityMin: Enforces the object keeps moving at a minimum velocity. + - note: Applies to dynamic and rigid body objects only. + - note: A value of 0.0 disables this option. + - note: While objects are stationary the minimum velocity will not be applied. + @type linVelocityMin: float + @ivar linVelocityMax: Clamp the maximum linear velocity to prevent objects moving beyond a set speed. + - note: Applies to dynamic and rigid body objects only. + - note: A value of 0.0 disables this option (rather then setting it stationary). + @type linVelocityMax: float @ivar localInertia: the object's inertia vector in local coordinates. Read only. @type localInertia: list [ix, iy, iz] @ivar parent: The object's parent object. (Read only) @@ -35,7 +45,7 @@ class KX_GameObject: # (SCA_IObject) @type scaling: list [sx, sy, sz] @ivar timeOffset: adjust the slowparent delay at runtime. @type timeOffset: float - @ivar state: the game object's state bitmask. + @ivar state: the game object's state bitmask, using the first 30 bits, one bit must always be set. @type state: int @ivar meshes: a list meshes for this object. - note: Most objects use only 1 mesh. -- cgit v1.2.3 From e8f4d9322112e64677df11ba834a26159874b332 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 15 Apr 2009 10:57:28 +0000 Subject: Disable using KX_GameObjects in python that have been removed from the scene (zombie objects) by raising a RuntimeError when accessing methods, attributes or passing to a function. Common cases of this are when python references an object from the AddObject actuator that has ended, or a scene has been loaded and the old objects freed. This means some scripts will raise errors now in certain cases but better give the error early rather then failing silently with strange hard to track down behavior & crashes. Added "isValid" attribute for checking objects are in a scene. At the moment it uses the SceneGraph Node to check of the objects valid but it might be better to do this in a more generic way so scenes, meshes etc also have this check. --- source/gameengine/PyDoc/KX_GameObject.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 44b84d44d8d..4aa9de2fe86 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -12,6 +12,7 @@ class KX_GameObject: # (SCA_IObject) All game objects are derived from this class. Properties assigned to game objects are accessible as attributes of this class. + - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a RuntimeError, if an object may have been removed since last accessing it use the L{isValid} attribute to check. @ivar name: The object's name. (Read only) - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. @@ -63,6 +64,8 @@ class KX_GameObject: # (SCA_IObject) - note: This attribute is experemental and may be removed (but probably wont be). - note: Changes to this list will not update the KX_GameObject. @type actuators: list + @ivar isValid: Retuerns fails when the object has been removed from the scene and can no longer be used. + @type isValid: bool """ def endObject(visible): """ -- cgit v1.2.3 From 514c78ba39f296fcac60b33d9a040af2051d23cc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 15 Apr 2009 13:50:56 +0000 Subject: BGE MouseFocusSensor - fix for multiple viewpors broke single viewport (both work now) - python could get uninitialized values from m_prevTargetPoint and m_prevSourcePoint - getting the RayDirection for python could crash blender trying to normalize a zero length vector. - added python attributes - removed unused canvas from the MouseFocusSensor class --- source/gameengine/PyDoc/KX_MouseFocusSensor.py | 27 +++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_MouseFocusSensor.py b/source/gameengine/PyDoc/KX_MouseFocusSensor.py index ceab5b8c511..24f7716218b 100644 --- a/source/gameengine/PyDoc/KX_MouseFocusSensor.py +++ b/source/gameengine/PyDoc/KX_MouseFocusSensor.py @@ -8,46 +8,59 @@ class KX_MouseFocusSensor(SCA_MouseSensor): The mouse focus sensor works by transforming the mouse coordinates from 2d device space to 3d space then raycasting away from the camera. + + @ivar raySource: The worldspace source of the ray (the view position) + @type raySource: list (vector of 3 floats) + @ivar rayTarget: The worldspace target of the ray. + @type rayTarget: list (vector of 3 floats) + @ivar rayDirection: The L{rayTarget} - L{raySource} normalized. + @type rayDirection: list (normalized vector of 3 floats) + @ivar hitObject: the last object the mouse was over. + @type hitObject: L{KX_GameObject} or None + @ivar hitPosition: The worldspace position of the ray intersecton. + @type hitPosition: list (vector of 3 floats) + @ivar hitNormal: the worldspace normal from the face at point of intersection. + @type hitNormal: list (normalized vector of 3 floats) """ def getHitNormal(): """ - Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. - + Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) + @rtype: list [x, y, z] @return: the ray collision normal. """ def getHitObject(): """ - Returns the object that was hit by this ray or None. + Returns the object that was hit by this ray or None. (B{deprecated}) @rtype: L{KX_GameObject} or None @return: the collision object. """ def getHitPosition(): """ - Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. + Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) @rtype: list [x, y, z] @return: the ray collision position. """ def getRayDirection(): """ - Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. + Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. (B{deprecated}) @rtype: list [x, y, z] @return: the ray direction. """ def getRaySource(): """ - Returns the position (in worldcoordinates) the ray was cast from by the mouse. + Returns the position (in worldcoordinates) the ray was cast from by the mouse. (B{deprecated}) @rtype: list [x, y, z] @return: the ray source. """ def getRayTarget(): """ - Returns the target of the ray (in worldcoordinates) that seeks the focus object. + Returns the target of the ray (in worldcoordinates) that seeks the focus object. (B{deprecated}) @rtype: list [x, y, z] @return: the ray target. -- cgit v1.2.3 From bbdaa03d6598a6f09e7272ade1ef96abf3ce1d53 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 15 Apr 2009 21:17:08 +0000 Subject: BGE bug #18168: Get local orientation of object using game engine python script system. Added localOrientation and worldOrientation. orientation attribute deprecated. Same for position and scaling. World attributes are read-only except for worldPosition. Add systematic check on NULL SGNode in all python functions. This is necessary to handle zombie objects (deleted by the game but kept alive by a reference in a list). --- source/gameengine/PyDoc/KX_GameObject.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 4aa9de2fe86..21ddf439924 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -39,11 +39,26 @@ class KX_GameObject: # (SCA_IObject) @ivar occlusion: occlusion capability flag. @type occlusion: boolean @ivar position: The object's position. - @type position: list [x, y, z] + DEPRECATED: use localPosition and worldPosition + @type position: list [x, y, z] On write: local position, on read: world position @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. - @type orientation: 3x3 Matrix [[float]] + DEPRECATED: use localOrientation and worldOrientation + @type orientation: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation @ivar scaling: The object's scaling factor. list [sx, sy, sz] - @type scaling: list [sx, sy, sz] + DEPRECATED: use localScaling and worldScaling + @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling + @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. + @type localOrientation: 3x3 Matrix [[float]] + @ivar worldOrientation: The object's world orientation. Read-only. + @type worldOrientation: 3x3 Matrix [[float]] + @ivar localScaling: The object's local scaling factor. + @type localScaling: list [sx, sy, sz] + @ivar worldScaling: The object's world scaling factor. Read-only + @type worldScaling: list [sx, sy, sz] + @ivar localPosition: The object's local position. + @type localPosition: list [x, y, z] + @ivar worldPosition: The object's world position. + @type worldPosition: list [x, y, z] @ivar timeOffset: adjust the slowparent delay at runtime. @type timeOffset: float @ivar state: the game object's state bitmask, using the first 30 bits, one bit must always be set. -- cgit v1.2.3 From fcdbbee208fb64e9f0696843a69726de3c0d36b8 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 19 Apr 2009 21:26:29 +0000 Subject: SCons / epydoc support * properly detect if epydoc is installed. patch by Brandano --- source/gameengine/PyDoc/SConscript | 40 +++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/SConscript b/source/gameengine/PyDoc/SConscript index ac0b163d7bd..ab1fda8fa85 100644 --- a/source/gameengine/PyDoc/SConscript +++ b/source/gameengine/PyDoc/SConscript @@ -3,26 +3,22 @@ Import ('env') from optparse import OptionParser -try: - import epydoc -except ImportError: - print "No epydoc install detected, Python API Docs will not be generated " -if epydoc: - from epydoc.docbuilder import build_doc_index - from epydoc import cli - names = env.Glob("source/gameengine/PyDoc/*.py") - docindex = build_doc_index(names) - optvalues = cli.OPTION_DEFAULTS - optvalues["verbose"] = 1 - optvalues["target"] = env["BF_DOCDIR"]+"/BGE_API/" - optvalues["url"] = "http://www.blender.org" - optvalues["top"] = "Game Engine API" - optvalues["name"] = "Blender" - optvalues["noprivate"] = 1 - optvalues["noframes"] = 1 - optvalues["names"] = names - optparser = OptionParser() - optparser.set_defaults(**optvalues) - (options, args) = optparser.parse_args([]) - cli.write_html(docindex, options) +import epydoc +from epydoc.docbuilder import build_doc_index +from epydoc import cli +names = env.Glob("source/gameengine/PyDoc/*.py") +docindex = build_doc_index(names) +optvalues = cli.OPTION_DEFAULTS +optvalues["verbose"] = 1 +optvalues["target"] = env["BF_DOCDIR"]+"/BGE_API/" +optvalues["url"] = "http://www.blender.org" +optvalues["top"] = "Game Engine API" +optvalues["name"] = "Blender" +optvalues["noprivate"] = 1 +optvalues["noframes"] = 1 +optvalues["names"] = names +optparser = OptionParser() +optparser.set_defaults(**optvalues) +(options, args) = optparser.parse_args([]) +cli.write_html(docindex, options) -- cgit v1.2.3 From 9078ce5da209bcfd31c60b55118076359ce7244f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 19 Apr 2009 22:02:48 +0000 Subject: Scons epydos changed options - no source code since this is only useful if the epydocs contain code, ours are only docstrings. - set inheritance to included so you dont have to search up the classes to find available functions. - SConstruct, isolate the exception for importing epydoc. - Added a print to the SConscript files otherwise it looks like nothings happening. --- source/gameengine/PyDoc/SConscript | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/SConscript b/source/gameengine/PyDoc/SConscript index ab1fda8fa85..ed9712ba273 100644 --- a/source/gameengine/PyDoc/SConscript +++ b/source/gameengine/PyDoc/SConscript @@ -10,6 +10,10 @@ names = env.Glob("source/gameengine/PyDoc/*.py") docindex = build_doc_index(names) optvalues = cli.OPTION_DEFAULTS optvalues["verbose"] = 1 +optvalues["quiet"] = 0 +optvalues["include_source_code"] = 0 +optvalues["inheritance"] = "included" +optvalues["show_private"] = 0 optvalues["target"] = env["BF_DOCDIR"]+"/BGE_API/" optvalues["url"] = "http://www.blender.org" optvalues["top"] = "Game Engine API" @@ -20,5 +24,6 @@ optvalues["names"] = names optparser = OptionParser() optparser.set_defaults(**optvalues) (options, args) = optparser.parse_args([]) +print "Writing Game Engine epydocs to \"%s\"" % optvalues["target"] cli.write_html(docindex, options) -- cgit v1.2.3 From dee32d0b3f409007f5a392668068b92c3810026a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 20 Apr 2009 09:13:59 +0000 Subject: BGE Python API - initialize pythons sys.argv in the blenderplayer - ignore all arguments after a single " - " in the blenderplayer (like in blender), so args can be passed to the game. - add a utility function PyOrientationTo() - to take a Py euler, quat or 3x3 matrix and convert into a C++ MT_Matrix3x3. - add utility function ConvertPythonToMesh to get a RAS_MeshObject from a KX_MeshProxy or a name. - Added error prefix arguments to ConvertPythonToGameObject, ConvertPythonToMesh and PyOrientationTo so the error messages can include what function they came from. - deprecated brick.getOwner() for the "owner" attribute. --- source/gameengine/PyDoc/KX_VehicleWrapper.py | 20 ++++++++++++++------ source/gameengine/PyDoc/SCA_ILogicBrick.py | 6 +++++- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'source/gameengine/PyDoc') diff --git a/source/gameengine/PyDoc/KX_VehicleWrapper.py b/source/gameengine/PyDoc/KX_VehicleWrapper.py index 68240e15622..087aa167475 100644 --- a/source/gameengine/PyDoc/KX_VehicleWrapper.py +++ b/source/gameengine/PyDoc/KX_VehicleWrapper.py @@ -5,15 +5,23 @@ class KX_VehicleWrapper: # (PyObjectPlus) All placeholders have a __ prefix """ - def __addWheel(val): + def addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering): + """ TODO - Description - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param wheel: The object to use as a wheel. + @type wheel: L{KX_GameObject} or a KX_GameObject name + @param attachPos: The position that this wheel will attach to. + @type attachPos: vector of 3 floats + @param attachDir: The direction this wheel points. + @type attachDir: vector of 3 floats + @param axleDir: The direction of this wheels axle. + @type axleDir: vector of 3 floats + @param suspensionRestLength: TODO - Description + @type suspensionRestLength: float + @param wheelRadius: The size of the wheel. + @type wheelRadius: float """ def __applyBraking(val): diff --git a/source/gameengine/PyDoc/SCA_ILogicBrick.py b/source/gameengine/PyDoc/SCA_ILogicBrick.py index 18cb900f28d..4688ba12bb6 100644 --- a/source/gameengine/PyDoc/SCA_ILogicBrick.py +++ b/source/gameengine/PyDoc/SCA_ILogicBrick.py @@ -8,13 +8,17 @@ class SCA_ILogicBrick: @ivar executePriority: This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). @type executePriority: int + @ivar owner: The game object this logic brick is attached to (read only). + @type owner: L{KX_GameObject} or None in exceptional cases. """ def getOwner(): """ Gets the game object associated with this logic brick. - @rtype: L{KX_GameObject} + Deprecated: Use the "owner" property instead. + + @rtype: L{KX_GameObject} """ #--The following methods are deprecated-- -- cgit v1.2.3