diff options
author | HG1 <HG1_public@gmx.net> | 2014-07-12 02:18:43 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-07-12 03:00:14 +0400 |
commit | 984d6c8677a365cf47cc6ad6c89c93b04877a948 (patch) | |
tree | 0433fe2f7f5646d4afddca0c769c42c6cbfca56b /source/gameengine/Ketsji/KX_Scene.cpp | |
parent | 93278165937273fd0c14eb54deb1c4c25ebb1296 (diff) |
BGE debug API and actuator
This patch adds some new debug methods to the KX_GameObject for manually adding the debug list and bge.render for controlling the debug visualization.
It also adds a new debug actuator, which allows to control the same functions.
This patch is a updated version of T33701.
Thread on Blenderartists:
http://blenderartists.org/forum/showthread.php?264745-Debug-proerties-for-added-objects-patch&p=2256018&viewfull=1#post2256018
Reviewers: moguri
Reviewed By: moguri
Differential Revision: https://developer.blender.org/D635
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index d57c9b78587..5745e3adbc5 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -595,7 +595,9 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal void KX_Scene::ReplicateLogic(KX_GameObject* newobj) { /* add properties to debug list, for added objects and DupliGroups */ - AddObjectDebugProperties(newobj); + if (KX_GetActiveEngine()->GetAutoAddDebugProperties()) { + AddObjectDebugProperties(newobj); + } // also relink the controller to sensors/actuators SCA_ControllerList& controllers = newobj->GetControllers(); //SCA_SensorList& sensors = newobj->GetSensors(); @@ -1005,7 +1007,7 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) int ret; KX_GameObject* newobj = (KX_GameObject*) gameobj; - /* remove property to debug list */ + /* remove property from debug list */ RemoveObjectDebugProperties(newobj); /* Invalidate the python reference, since the object may exist in script lists @@ -2022,7 +2024,11 @@ bool KX_Scene::MergeScene(KX_Scene *other) { KX_GameObject* gameobj = (KX_GameObject*)other->GetObjectList()->GetValue(i); MergeScene_GameObject(gameobj, this, other); - AddObjectDebugProperties(gameobj); // add properties to debug list for LibLoad objects + + /* add properties to debug list for LibLoad objects */ + if (KX_GetActiveEngine()->GetAutoAddDebugProperties()) { + AddObjectDebugProperties(gameobj); + } gameobj->UpdateBuckets(false); /* only for active objects */ } |