[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31373] trunk/blender/source: Py API (GSoC ): Second merging commit

Joerg Mueller nexyon at gmail.com
Mon Aug 16 14:14:09 CEST 2010


Revision: 31373
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31373
Author:   nexyon
Date:     2010-08-16 14:14:09 +0200 (Mon, 16 Aug 2010)

Log Message:
-----------
Py API (GSoC): Second merging commit
Rough summary of fixes/changes:
- Blender Py API: GameLogic -> bge.logic
- Blender Py API: Implemented missing KX_PYATTRIBUTE_TODOs and -DUMMYs.
- Fix for [#22924] KX_PolygonMaterial.diffuse does not return expected list[r,g,b]
- Py API: Renaming _owner attribute of mathutils classes to owner.
- Fix some minor errors in mathutils and blf.
- Enabling game engine autoplay again based on a patch by Dalai:
  * The biggest 3D view in the open scene is used, if there is none, blender opens the file normally and raises an error.
  * The 3D view are is made fullscreen.
  * Quad view, header, properties and toolbox panel are all hidden to get the maximum view.
  * If the game engine full screen setting is set, the game starts in fullscreen.
- Fix for ipo conversion on file transition in the game engine.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/makesrna/intern/rna_actuator.c
    trunk/blender/source/blender/python/generic/blf_api.c
    trunk/blender/source/blender/python/generic/mathutils_color.c
    trunk/blender/source/blender/python/generic/mathutils_euler.c
    trunk/blender/source/blender/python/generic/mathutils_matrix.c
    trunk/blender/source/blender/python/generic/mathutils_quat.c
    trunk/blender/source/blender/python/generic/mathutils_vector.c
    trunk/blender/source/blender/windowmanager/WM_api.h
    trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
    trunk/blender/source/blender/windowmanager/intern/wm_window.c
    trunk/blender/source/blender/windowmanager/wm_window.h
    trunk/blender/source/creator/creator.c
    trunk/blender/source/gameengine/Expressions/PyObjectPlus.h
    trunk/blender/source/gameengine/GameLogic/SCA_ISensor.cpp
    trunk/blender/source/gameengine/GameLogic/SCA_ISensor.h
    trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
    trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp
    trunk/blender/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
    trunk/blender/source/gameengine/Ketsji/KX_BlenderMaterial.h
    trunk/blender/source/gameengine/Ketsji/KX_Camera.cpp
    trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
    trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.h
    trunk/blender/source/gameengine/Ketsji/KX_PolyProxy.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PolyProxy.h
    trunk/blender/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
    trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.cpp
    trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.h

Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -2529,7 +2529,7 @@
 			}
 
 			//str = "Scene %t|Load game%x0|Start loaded game%x1|Restart this game%x2|Quit this game %x3";
-			str = "Scene %t|Start new game%x0|Restart this game%x2|Quit this game %x3|Save GameLogic.globalDict %x4|Load GameLogic.globalDict %x5";
+			str = "Scene %t|Start new game%x0|Restart this game%x2|Quit this game %x3|Save bge.logic.globalDict %x4|Load bge.logic.globalDict %x5";
 			uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &gma->type, 0.0, 0.0, 0, 0, ""); 
 			
 			yco -= ysize; 

Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -1557,8 +1557,8 @@
 		{ACT_GAME_LOAD, "START", 0, "Start new game", ""},
 		{ACT_GAME_RESTART, "RESTART", 0, "Restart this game", ""},
 		{ACT_GAME_QUIT, "QUIT", 0, "Quit this game", ""},
-		{ACT_GAME_SAVECFG, "SAVECFG", 0, "Save GameLogic.globalDict", ""},
-		{ACT_GAME_LOADCFG, "LOADCFG", 0, "Load GameLogic.globalDict", ""},
+		{ACT_GAME_SAVECFG, "SAVECFG", 0, "Save bge.logic.globalDict", ""},
+		{ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""},
 		{0, NULL, 0, NULL, NULL}};
 	
 	srna= RNA_def_struct(brna, "GameActuator", "Actuator");

Modified: trunk/blender/source/blender/python/generic/blf_api.c
===================================================================
--- trunk/blender/source/blender/python/generic/blf_api.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/python/generic/blf_api.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -39,7 +39,7 @@
 "   :arg y: Y axis position to draw the text.\n"
 "   :type y: float\n"
 "   :arg z: Z axis position to draw the text.\n"
-"   :type x: float\n";
+"   :type z: float\n";
 
 static PyObject *py_blf_position(PyObject *self, PyObject *args)
 {
@@ -261,7 +261,7 @@
 "   :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
 "   :type fontid: int\n"
 "   :arg angle: The angle for text drawing to use.\n"
-"   :type aspect: float\n";
+"   :type angle: float\n";
 
 static PyObject *py_blf_rotation(PyObject *self, PyObject *args)
 {

Modified: trunk/blender/source/blender/python/generic/mathutils_color.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils_color.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/python/generic/mathutils_color.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -445,7 +445,7 @@
 	{"hsv", (getter)Color_getHSV, (setter)Color_setHSV, "HSV Values in [0, 1].\n\n:type: float triplet", (void *)0},
 
 	{"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, BaseMathObject_Wrapped_doc, NULL},
-	{"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
+	{"owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
 	{NULL,NULL,NULL,NULL,NULL}  /* Sentinel */
 };
 

Modified: trunk/blender/source/blender/python/generic/mathutils_euler.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils_euler.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/python/generic/mathutils_euler.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -621,7 +621,7 @@
 	{"order", (getter)Euler_getOrder, (setter)Euler_setOrder, "Euler rotation order.\n\n:type: string in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']", (void *)NULL},
 
 	{"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, BaseMathObject_Wrapped_doc, NULL},
-	{"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
+	{"owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
 	{NULL,NULL,NULL,NULL,NULL}  /* Sentinel */
 };
 

Modified: trunk/blender/source/blender/python/generic/mathutils_matrix.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils_matrix.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/python/generic/mathutils_matrix.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -1737,7 +1737,7 @@
 	{"median_scale", (getter)Matrix_getMedianScale, (setter)NULL, "The average scale applied to each axis (readonly).\n\n:type: float", NULL},
 	{"is_negative", (getter)Matrix_getIsNegative, (setter)NULL, "True if this matrix results in a negative scale, 3x3 and 4x4 only, (readonly).\n\n:type: bool", NULL},
 	{"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, BaseMathObject_Wrapped_doc, NULL},
-	{"_owner",(getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
+	{"owner",(getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
 	{NULL,NULL,NULL,NULL,NULL}  /* Sentinel */
 };
 

Modified: trunk/blender/source/blender/python/generic/mathutils_quat.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils_quat.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/python/generic/mathutils_quat.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -109,7 +109,7 @@
 }
 //----------------------------Quaternion.toMatrix()------------------
 static char Quaternion_ToMatrix_doc[] =
-".. method:: to_matrix(other)\n"
+".. method:: to_matrix()\n"
 "\n"
 "   Return a matrix representation of the quaternion.\n"
 "\n"
@@ -930,7 +930,7 @@
 	{"angle", (getter)Quaternion_getAngle, (setter)Quaternion_setAngle, "angle of the quaternion.\n\n:type: float", NULL},
 	{"axis",(getter)Quaternion_getAxisVec, (setter)Quaternion_setAxisVec, "quaternion axis as a vector.\n\n:type: :class:`Vector`", NULL},
 	{"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, BaseMathObject_Wrapped_doc, NULL},
-	{"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
+	{"owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
 	{NULL,NULL,NULL,NULL,NULL}  /* Sentinel */
 };
 

Modified: trunk/blender/source/blender/python/generic/mathutils_vector.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils_vector.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/python/generic/mathutils_vector.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -508,7 +508,8 @@
 "   :arg other: another vector to compare the angle with\n"
 "   :type other: :class:`Vector`\n"
 "   :arg fallback: return this value when the angle cant be calculated (zero length vector)\n"
-"   :return angle: angle in radians or fallback when given\n"
+"   :type fallback: any\n"
+"   :return: angle in radians or fallback when given\n"
 "   :rtype: float\n"
 "\n"
 "   .. note:: Zero length vectors raise an :exc:`AttributeError`.\n";
@@ -607,8 +608,9 @@
 "\n"
 "   Return the projection of this vector onto the *other*.\n"
 "\n"
+"   :arg other: second vector.\n"
 "   :type other: :class:`Vector`\n"
-"   :return projection: the parallel projection vector\n"
+"   :return: the parallel projection vector\n"
 "   :rtype: :class:`Vector`\n";
 
 static PyObject *Vector_Project(VectorObject *self, VectorObject *value)
@@ -1601,7 +1603,7 @@
 	{"length", (getter)Vector_getLength, (setter)Vector_setLength, "Vector Length.\n\n:type: float", NULL},
 	{"magnitude", (getter)Vector_getLength, (setter)Vector_setLength, "Vector Length.\n\n:type: float", NULL},
 	{"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, BaseMathObject_Wrapped_doc, NULL},
-	{"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
+	{"owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
 	
 	/* autogenerated swizzle attrs, see python script below */
 	{"xx",   (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 36

Modified: trunk/blender/source/blender/windowmanager/WM_api.h
===================================================================
--- trunk/blender/source/blender/windowmanager/WM_api.h	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/windowmanager/WM_api.h	2010-08-16 12:14:09 UTC (rev 31373)
@@ -57,7 +57,7 @@
 void		WM_exit				(struct bContext *C);
 void		WM_main				(struct bContext *C);
 
-void		WM_init_game		(struct bContext *C);
+int 		WM_init_game		(struct bContext *C);
 void		WM_init_splash		(struct bContext *C);
 
 

Modified: trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2010-08-16 11:41:07 UTC (rev 31372)
+++ trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2010-08-16 12:14:09 UTC (rev 31373)
@@ -49,6 +49,7 @@
 #include "BKE_font.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
+#include "BKE_main.h"
 #include "BKE_mball.h"
 #include "BKE_report.h"
 #include "BKE_utildefines.h"
@@ -94,6 +95,7 @@
 
 #include "BKE_depsgraph.h"
 #include "BKE_sound.h"
+#include "GHOST_C-api.h"
 
 static void wm_init_reports(bContext *C)
 {
@@ -186,18 +188,113 @@
 	}
 }
 
-void WM_init_game(bContext *C)
+static ScrArea *biggest_view3d(bContext *C)
 {
-	//XXX copied from WM_init_splash we may not even need those "window" related code
-	//XXX not working yet, it fails at the game_start_operator pool (it needs an area)
+	bScreen *sc= CTX_wm_screen(C);
+	ScrArea *sa, *big= NULL;
+	int size, maxsize= 0;
+
+	for(sa= sc->areabase.first; sa; sa= sa->next) {
+		if(sa->spacetype==SPACE_VIEW3D) {
+			size= sa->winx * sa->winy;
+			if(size > maxsize) {
+				maxsize= size;
+				big= sa;
+			}
+		}
+	}
+	return big;
+}
+
+int WM_init_game(bContext *C)
+{

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list