[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27079] trunk/blender: game engine support for recording animation back & some other minor changes .

Campbell Barton ideasman42 at gmail.com
Mon Feb 22 13:25:58 CET 2010


Revision: 27079
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27079
Author:   campbellbarton
Date:     2010-02-22 13:25:58 +0100 (Mon, 22 Feb 2010)

Log Message:
-----------
game engine support for recording animation back & some other minor changes.

Modified Paths:
--------------
    trunk/blender/release/scripts/op/fcurve_euler_filter.py
    trunk/blender/release/scripts/ui/properties_game.py
    trunk/blender/release/scripts/ui/space_graph.py
    trunk/blender/release/scripts/ui/space_info.py
    trunk/blender/source/blender/editors/space_view3d/view3d_view.c
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/python/intern/bpy_rna.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
    trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c
    trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
    trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
    trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.h
    trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
    trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
    trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.h

Modified: trunk/blender/release/scripts/op/fcurve_euler_filter.py
===================================================================
--- trunk/blender/release/scripts/op/fcurve_euler_filter.py	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/release/scripts/op/fcurve_euler_filter.py	2010-02-22 12:25:58 UTC (rev 27079)
@@ -45,7 +45,7 @@
 
 class DiscontFilterOp(bpy.types.Operator):
     """Fixes the most common causes of gimbal lock in the fcurves of the active bone"""
-    bl_idname = "graph.discont_filter"
+    bl_idname = "graph.euler_filter"
     bl_label = "Filter out discontinuities in the active fcurves"
 
     def poll(self, context):
@@ -63,4 +63,3 @@
 
 if __name__ == "__main__":
     register()
-

Modified: trunk/blender/release/scripts/ui/properties_game.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_game.py	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/release/scripts/ui/properties_game.py	2010-02-22 12:25:58 UTC (rev 27079)
@@ -357,13 +357,13 @@
         col.prop(gs, "show_debug_properties", text="Debug Properties")
         col.prop(gs, "show_framerate_profile", text="Framerate and Profile")
         col.prop(gs, "show_physics_visualization", text="Physics Visualization")
-        col.prop(gs, "deprecation_warnings")
+        col.prop(gs, "use_deprecation_warnings")
 
         if wide_ui:
             col = split.column()
         col.label(text="Render:")
-        col.prop(gs, "all_frames")
-        col.prop(gs, "display_lists")
+        col.prop(gs, "use_frame_rate")
+        col.prop(gs, "use_display_lists")
 
 
 class RENDER_PT_game_sound(RenderButtonsPanel):

Modified: trunk/blender/release/scripts/ui/space_graph.py
===================================================================
--- trunk/blender/release/scripts/ui/space_graph.py	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/release/scripts/ui/space_graph.py	2010-02-22 12:25:58 UTC (rev 27079)
@@ -148,7 +148,7 @@
         layout.operator("anim.channels_collapse")
 
         layout.separator()
-        layout.operator("graph.discont_filter", text="Discontinuity (Euler) Filter")
+        layout.operator("graph.euler_filter", text="Discontinuity (Euler) Filter")
 
 
 class GRAPH_MT_key(bpy.types.Menu):

Modified: trunk/blender/release/scripts/ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/ui/space_info.py	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/release/scripts/ui/space_info.py	2010-02-22 12:25:58 UTC (rev 27079)
@@ -253,7 +253,8 @@
         layout.prop(gs, "show_debug_properties")
         layout.prop(gs, "show_framerate_profile")
         layout.prop(gs, "show_physics_visualization")
-        layout.prop(gs, "deprecation_warnings")
+        layout.prop(gs, "use_deprecation_warnings")
+        layout.prop(gs, "use_animation_record")
 
 
 class INFO_MT_render(bpy.types.Menu):

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_view.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_view.c	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_view.c	2010-02-22 12:25:58 UTC (rev 27079)
@@ -1690,8 +1690,8 @@
 		test= (gm->flag & GAME_ENABLE_ALL_FRAMES);
 		SYS_WriteCommandLineInt(syshandle, "fixedtime", test);
 
-//		a= (G.fileflags & G_FILE_GAME_TO_IPO);
-//		SYS_WriteCommandLineInt(syshandle, "game2ipo", a);
+		test= (gm->flag & GAME_ENABLE_ANIMATION_RECORD);
+		SYS_WriteCommandLineInt(syshandle, "animation_record", test);
 
 		test= (gm->flag & GAME_IGNORE_DEPRECATION_WARNINGS);
 		SYS_WriteCommandLineInt(syshandle, "ignore_deprecation_warnings", test);

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2010-02-22 12:25:58 UTC (rev 27079)
@@ -487,6 +487,7 @@
 #define GAME_GLSL_NO_NODES					(1 << 10)
 #define GAME_GLSL_NO_EXTRA_TEX				(1 << 11)
 #define GAME_IGNORE_DEPRECATION_WARNINGS	(1 << 12)
+#define GAME_ENABLE_ANIMATION_RECORD		(1 << 13)
 
 /* GameData.matmode */
 #define GAME_MAT_TEXFACE	0

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2010-02-22 12:25:58 UTC (rev 27079)
@@ -1501,52 +1501,47 @@
 	prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
 	RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustrum and occlusion culling");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 	
 	// not used // deprecated !!!!!!!!!!!!!
 	prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
 	RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
 	// not used // deprecated !!!!!!!!!!!!!
 	prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
 	RNA_def_property_range(prop, 0.0, 1000.0);
 	RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
 	/* booleans */
-	prop= RNA_def_property(srna, "all_frames", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
-	RNA_def_property_ui_text(prop, "All Frames", "Render as many frames as possible, rather than respecting framerate");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
-
 	prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
 	RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
 	prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
 	RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
 	prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
 	RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
-	prop= RNA_def_property(srna, "display_lists", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
+	RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather then rendering as many frames as possible");
+
+	prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
 	RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
-	prop= RNA_def_property(srna, "deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
 	RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
 
+	prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
+	RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
+
 	/* materials */
 	prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "matmode");

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2010-02-22 10:36:53 UTC (rev 27078)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2010-02-22 12:25:58 UTC (rev 27079)
@@ -1639,48 +1639,82 @@
 	return BPy_Wrap_GetValues(self->ptr.id.data, group);
 }
 
-static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args)
+/* internal use for insert and delete */
+int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, char *error_prefix,
+	char **path_full, int *index, float *cfra) /* return values */
 {
-	char *path, *path_full;
-	int index= -1; /* default to all */
-	float cfra = CTX_data_scene(BPy_GetContext())->r.cfra;
+	char *path;
 	PropertyRNA *prop;
-	PyObject *result;
 
-	if (!PyArg_ParseTuple(args, "s|if:keyframe_insert", &path, &index, &cfra))
-		return NULL;
+	if (!PyArg_ParseTuple(args, "s|if", &path, &index, &cfra)) {
+		PyErr_Format(PyExc_TypeError, "%.200s: expected a string and optionally an int and float arguments", error_prefix);
+		return -1;
+	}
 
-	if (self->ptr.data==NULL) {
-		PyErr_Format( PyExc_TypeError, "keyframe_insert, this struct has no data, cant be animated", path);
-		return NULL;
+	if (ptr->data==NULL) {
+		PyErr_Format(PyExc_TypeError, "%.200s: this struct has no data, can't be animated", error_prefix);
+		return -1;
 	}
 
-	prop = RNA_struct_find_property(&self->ptr, path);
+	prop = RNA_struct_find_property(ptr, path);
 
 	if (prop==NULL) {
-		PyErr_Format( PyExc_TypeError, "keyframe_insert, property \"%s\" not found", path);
-		return NULL;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list