Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-09-19 05:33:08 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-09-19 05:33:08 +0400
commitfd5f3e13d2f86f0f344422c773df85d0c3e6df32 (patch)
tree8f55d1124aa01fcdfb847dedd1396e941060dae5 /source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
parentd70197262b3bf22388673b5b8fc96af969875d50 (diff)
Convert and use actuators with no target object set.
Certain actuators (Add Object/Replace Mesh/Scene/Track To) used to always require a target, or they would not influence the scene. If the actuator target is always set from Python, this could be annoying.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
index f26e9873863..84e12ac86af 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
@@ -116,7 +116,7 @@ PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* self,
void* mesh = SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String(meshname));
- if (m_mesh) {
+ if (mesh) {
m_mesh= (class RAS_MeshObject*)mesh;
Py_Return;
}
@@ -129,6 +129,9 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh,
"Returns the name of the mesh to be substituted.\n"
)
{
+ if (!m_mesh)
+ Py_Return;
+
return PyString_FromString(const_cast<char *>(m_mesh->GetName().ReadPtr()));
}