- assigning vectors in the BGE wasn't updating the vector from the callback
authorCampbell Barton <ideasman42@gmail.com>
Thu, 27 Aug 2009 15:22:41 +0000 (15:22 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 27 Aug 2009 15:22:41 +0000 (15:22 +0000)
- Pkey only starts in BGE in Object Mode
- warning in readblenentry.c, is silent on 64bit too.

source/blender/blenloader/intern/readblenentry.c
source/blender/editors/space_view3d/view3d_view.c
source/gameengine/Ketsji/KX_PyMath.h

index ac561eb6186dea1ab1dc30d4d56c52065c9f6356..33641a0b0047df59891c5ceb44fe79b80fea78aa 100644 (file)
@@ -200,7 +200,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
                        buf[2]= buf[2]?buf[2]:' ';
                        buf[3]= buf[3]?buf[3]:' ';
                        
-                       fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead));
+                       fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)bhead->len+sizeof(BHead));
                }
        }
        fprintf(fp, "]\n");
index ce7b6ba454da8c8804fbc53d0dd7637e4523f6d7..771c02e95b620282314baaf3c28cfe4378d07029 100644 (file)
@@ -1444,6 +1444,11 @@ extern void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int always_
 
 #endif // GAMEBLENDER == 1
 
+int game_engine_poll(bContext *C)
+{
+       return CTX_data_mode_enum(C)==CTX_MODE_OBJECT ? 1:0;
+}
+
 static int game_engine_exec(bContext *C, wmOperator *unused)
 {
 #if GAMEBLENDER == 1
@@ -1503,7 +1508,7 @@ void VIEW3D_OT_game_start(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= game_engine_exec;
        
-       //ot->poll= ED_operator_view3d_active;
+       ot->poll= game_engine_poll;
 }
 
 /* ************************************** */
index a8488e8e60acd715b4ebdf24655f13e535b83924..17102905607e7e54d983acfd34199e45a0807a06 100644 (file)
@@ -109,6 +109,7 @@ bool PyVecTo(PyObject* pyval, T& vec)
        
        if(VectorObject_Check(pyval)) {
                VectorObject *pyvec= (VectorObject *)pyval;
+               BaseMath_ReadCallback(pyvec);
                if (pyvec->size != Size(vec)) {
                        PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", pyvec->size, Size(vec));
                        return false;
@@ -118,6 +119,7 @@ bool PyVecTo(PyObject* pyval, T& vec)
        }
        else if(QuaternionObject_Check(pyval)) {
                QuaternionObject *pyquat= (QuaternionObject *)pyval;
+               BaseMath_ReadCallback(pyquat);
                if (4 != Size(vec)) {
                        PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 4, Size(vec));
                        return false;
@@ -128,6 +130,7 @@ bool PyVecTo(PyObject* pyval, T& vec)
        }
        else if(EulerObject_Check(pyval)) {
                EulerObject *pyeul= (EulerObject *)pyval;
+               BaseMath_ReadCallback(pyeul);
                if (3 != Size(vec)) {
                        PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 3, Size(vec));
                        return false;