[Bf-blender-cvs] [8d3d931] master: BGE: Fix T46338 replace mesh from an other scene.

Porteries Tristan noreply at git.blender.org
Thu Oct 29 12:13:55 CET 2015


Commit: 8d3d931f6a6401b44a23357839f498fdb7f24e36
Author: Porteries Tristan
Date:   Thu Oct 29 12:05:06 2015 +0100
Branches: master
https://developer.blender.org/rB8d3d931f6a6401b44a23357839f498fdb7f24e36

BGE: Fix T46338 replace mesh from an other scene.

To make consistent with KX_GameObject.replaceMesh, we don't allow this behavior but print an error message for the replace mesh actuator.
e.g : Warning: object "Cube" from ReplaceMesh actuator "Edit Object" uses a mesh not owned by an object in scene "scene1"

Reviewers: youle.

===================================================================

M	source/gameengine/Converter/KX_ConvertActuators.cpp

===================================================================

diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index 3347255..12bfb11 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -505,6 +505,13 @@ void BL_ConvertActuators(const char* maggiename,
 					{
 						RAS_MeshObject *tmpmesh = converter->FindGameMesh(editobact->me);
 
+						if (!tmpmesh) {
+							std::cout << "Warning: object \"" << objectname <<
+							"\" from ReplaceMesh actuator \"" << uniquename <<
+							"\" uses a mesh not owned by an object in scene \"" <<
+							scene->GetName() << "\"." << std::endl;
+						}
+
 						KX_SCA_ReplaceMeshActuator* tmpreplaceact = new KX_SCA_ReplaceMeshActuator(
 						            gameobj,
 						            tmpmesh,




More information about the Bf-blender-cvs mailing list