BGE: Mouse Sensor type defaults to 1 (MOUSELEFT ) + remove camera attribute from...
authorDalai Felinto <dfelinto@gmail.com>
Sun, 17 Jan 2010 21:46:34 +0000 (21:46 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Sun, 17 Jan 2010 21:46:34 +0000 (21:46 +0000)
(if you want to mark your camera objects create a property manually ;)

That way object.getPropertyNames() works consistently across all object types.

source/blender/blenkernel/intern/sca.c
source/blender/editors/space_logic/logic_window.c
source/gameengine/Ketsji/KX_Camera.cpp

index 5cd554725ffe9dc33bab7e057bbbd0039b886fcc..1bef60f984cb2206b594cfdb4f8efd237c511012 100644 (file)
@@ -139,7 +139,7 @@ void init_sensor(bSensor *sens)
                break;
        case SENS_MOUSE:
                ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens");
-               //XXX ms->type= LEFTMOUSE;
+               ms->type= 1; // LEFTMOUSE workaround because Mouse Sensor types enum starts in 1
                break;
        case SENS_COLLISION:
                sens->data= MEM_callocN(sizeof(bCollisionSensor), "colsens");
index 3e4c76f993f53a36301487b955e1362b848c96b6..d9bfa43bd410debf0ba3ae95a14f2b48ac6548db 100644 (file)
@@ -1436,6 +1436,8 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
                        
                        /* Line 2: type selection. The number are a bit mangled to get
                        * proper compatibility with older .blend files. */
+                       /* Any sensor type default is 0 but the ms enum starts in 1.
+                        * Therefore the mosue sensor is initialized to 1 in sca.c */
                        str= "Type %t|Left button %x1|Middle button %x2|"
                                "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32"; 
                        uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19,
index 384125119a9fba1e128377623d28f619de0cdd21..ce13b9912a8f8b83a3c994f56a0f6c0517d3d188 100644 (file)
@@ -57,9 +57,6 @@ KX_Camera::KX_Camera(void* sgReplicationInfo,
        m_name = "cam";
        m_projection_matrix.setIdentity();
        m_modelview_matrix.setIdentity();
-       CValue* val = new CIntValue(1);
-       SetProperty("camera",val);
-       val->Release();
 }