Page MenuHome

Sensor physics mode- missing UI option
Closed, ResolvedPublic

Description

The "Sensor" physics mode in BGE uses the "use_actor" property to determine whether to filter for actor collisions, or to accept any collision.
The UI option to toggle it is missing from the Physics tab > physics rollout in BGE.
Turning it on from the python console, or by adding a control for it to properties_game.py works as expected.

This option was present in Blender 2.4x but is missing in Blender 2.62, though the wikidocs still list it.
( http://wiki.blender.org/index.php/Doc:2.4/Manual/Game_Engine/Physics/Object_Type/Sensor )
( http://wiki.blender.org/index.php/Doc:2.6/Manual/Game_Engine/Physics/Object_Type/Sensor )

Details

Type
Bug

Event Timeline

What button exactly is missing? I am confused...

"Detect Actor".

In sensor objects (physics mode: sensor), the OB_ACTOR RNA property ("use_actor" in python) is overloaded to mean whether the sensor reacts to *any* collisions, or just to actor objects. ( source\gameengine\Ketsji\KX_ConvertPhysicsObjects.cpp - lines 486-488 )

So release/scripts/startup/bl_ui/properties_game.py needs to have an option for physics_type=='SENSOR' that includes col.prop(game, "use_actor", text="Detect Actor")

It needs different text since in this case, the use_actor setting is doing something different (determining whether or not the sensor is doing broadphase filtering for actors)

Like so:

--- C:/DOCUME~1/Snapai/LOCALS~1/Temp/properties_game-revBASE.svn003.tmp.py Wed Mar 14 20:27:53 2012
+++ C:/Documents and Settings/Snapai/Desktop/blender_release/scripts/startup/bl_ui/properties_game.py Wed Mar 14 20:26:40 2012
@@ -165,7 +165,12 @@
subsub.active = game.use_anisotropic_friction
subsub.prop(game, "friction_coefficients", text="", slider=True)

- elif physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
+ elif physics_type =='SENSOR':
+ col = layout.column()
+ col.prop(game, "use_actor", text="Detect Actors")
+ col.prop(ob, "hide_render", text="Invisible")
+
+ elif physics_type in {'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
layout.prop(ob, "hide_render", text="Invisible")

elif physics_type == 'NAVMESH':

Okay, attaching the diff as a file didn't work, but its entire text is in my previous comment. :P

Oh nevermind, there it is. Sorry for the extra comments. :)

Assigning to Benoit to look over the patch.

Committed in revision 45656.
Thanks for the patch.

Benoit Bolsee (ben2610) closed this task as Resolved.Apr 15 2012, 1:49 PM