diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-09 00:08:19 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-09 00:08:19 +0400 |
commit | c8b4cf92067ffeb625aa39003baf5d8f7c3f0025 (patch) | |
tree | c6c50dbc3d90a65fca6c1ca56a93e4a57cf7e154 /source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | |
parent | e93db433a086a3e739c0f4026cd500f0b595b0f1 (diff) | |
parent | d76a6f5231c015c35123d22e1f5c3ffcdfbf9bbd (diff) |
2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD
Notes:
* Game and sequencer RNA, and sequencer header are now out of date
a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
not needed anymore.
* Fix "duplicate strip" always increase the user count for ipo.
* IPO pinning on sequencer strips was lost during Undo.
Diffstat (limited to 'source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py')
-rw-r--r-- | source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py deleted file mode 100644 index 951c118a99a..00000000000 --- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py +++ /dev/null @@ -1,84 +0,0 @@ -# $Id$ -# Documentation for KX_SCA_ReplaceMeshActuator -from SCA_IActuator import * - -class KX_SCA_ReplaceMeshActuator(SCA_IActuator): - """ - Edit Object actuator, in Replace Mesh mode. - - Example:: - # Level-of-detail - # Switch a game object's mesh based on its depth in the camera view. - # +----------+ +-----------+ +-------------------------------------+ - # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh | - # +----------+ +-----------+ +-------------------------------------+ - import GameLogic - - # List detail meshes here - # 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) - ) - - co = GameLogic.getCurrentController() - obj = co.getOwner() - act = co.getActuator("LOD." + obj.name) - cam = GameLogic.getCurrentScene().active_camera - - def Depth(pos, plane): - return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3] - - # Depth is negative and decreasing further from the camera - depth = Depth(obj.position, cam.world_to_camera[2]) - - newmesh = None - curmesh = None - # Find the lowest detail mesh for depth - for mesh in meshes: - if depth < mesh[1] and depth > mesh[2]: - newmesh = mesh - if "ME" + obj.name + mesh[0] == act.getMesh(): - curmesh = mesh - - 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: - act.setMesh(obj.getName() + newmesh[0]) - GameLogic.addActiveActuator(act, True) - - @warning: Replace mesh actuators will be ignored if at game start, the - named mesh doesn't exist. - - This will generate a warning in the console: - - C{ERROR: GameObject I{OBName} ReplaceMeshActuator I{ActuatorName} without object} - - @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. - 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. - - @type name: string or None - """ - 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. - - @rtype: string or None - """ - def instantReplaceMesh(): - """ - Immediately replace mesh without delay. - @rtype: None - """
\ No newline at end of file |