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.
This commit is contained in:
Porteries Tristan 2015-10-29 12:05:06 +01:00
parent 0e80d0893f
commit 8d3d931f6a
Notes: blender-bot 2023-09-08 04:55:43 +02:00
Referenced by issue #46338, Do not work change the grid taken from another scene.
1 changed files with 7 additions and 0 deletions

View File

@ -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,