[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12932] trunk/blender/source: Reverting to 2_2x BPY

Martin Poirier theeth at yahoo.com
Mon Dec 17 21:21:06 CET 2007


Revision: 12932
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12932
Author:   theeth
Date:     2007-12-17 21:21:06 +0100 (Mon, 17 Dec 2007)

Log Message:
-----------
Reverting to 2_2x BPY

I was careful in selectively rolling back revisions, but if you've committed changes unrelated to BPY mixed with BPY changes, I might have reverted those too, so please double check.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_bad_level_calls.h
    trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
    trunk/blender/source/blender/blenkernel/intern/library.c
    trunk/blender/source/blender/python/BPY_extern.h
    trunk/blender/source/blender/python/BPY_interface.c
    trunk/blender/source/blender/python/BPY_menus.c
    trunk/blender/source/blender/python/Makefile
    trunk/blender/source/blender/python/SConscript
    trunk/blender/source/blender/python/api2_2x/0-todo.txt
    trunk/blender/source/blender/python/api2_2x/Armature.c
    trunk/blender/source/blender/python/api2_2x/Armature.h
    trunk/blender/source/blender/python/api2_2x/BGL.c
    trunk/blender/source/blender/python/api2_2x/BGL.h
    trunk/blender/source/blender/python/api2_2x/BezTriple.c
    trunk/blender/source/blender/python/api2_2x/BezTriple.h
    trunk/blender/source/blender/python/api2_2x/Blender.c
    trunk/blender/source/blender/python/api2_2x/Blender.h
    trunk/blender/source/blender/python/api2_2x/Bone.c
    trunk/blender/source/blender/python/api2_2x/Bone.h
    trunk/blender/source/blender/python/api2_2x/Camera.c
    trunk/blender/source/blender/python/api2_2x/Camera.h
    trunk/blender/source/blender/python/api2_2x/Constraint.c
    trunk/blender/source/blender/python/api2_2x/Constraint.h
    trunk/blender/source/blender/python/api2_2x/CurNurb.c
    trunk/blender/source/blender/python/api2_2x/CurNurb.h
    trunk/blender/source/blender/python/api2_2x/Curve.c
    trunk/blender/source/blender/python/api2_2x/Curve.h
    trunk/blender/source/blender/python/api2_2x/Draw.c
    trunk/blender/source/blender/python/api2_2x/Draw.h
    trunk/blender/source/blender/python/api2_2x/EXPP_interface.c
    trunk/blender/source/blender/python/api2_2x/EXPP_interface.h
    trunk/blender/source/blender/python/api2_2x/Effect.c
    trunk/blender/source/blender/python/api2_2x/Effect.h
    trunk/blender/source/blender/python/api2_2x/Font.c
    trunk/blender/source/blender/python/api2_2x/Font.h
    trunk/blender/source/blender/python/api2_2x/Geometry.c
    trunk/blender/source/blender/python/api2_2x/Geometry.h
    trunk/blender/source/blender/python/api2_2x/Group.c
    trunk/blender/source/blender/python/api2_2x/Group.h
    trunk/blender/source/blender/python/api2_2x/IDProp.c
    trunk/blender/source/blender/python/api2_2x/IDProp.h
    trunk/blender/source/blender/python/api2_2x/Image.c
    trunk/blender/source/blender/python/api2_2x/Image.h
    trunk/blender/source/blender/python/api2_2x/Ipo.c
    trunk/blender/source/blender/python/api2_2x/Ipo.h
    trunk/blender/source/blender/python/api2_2x/Ipocurve.c
    trunk/blender/source/blender/python/api2_2x/Ipocurve.h
    trunk/blender/source/blender/python/api2_2x/Key.c
    trunk/blender/source/blender/python/api2_2x/Key.h
    trunk/blender/source/blender/python/api2_2x/Lamp.c
    trunk/blender/source/blender/python/api2_2x/Lamp.h
    trunk/blender/source/blender/python/api2_2x/Lattice.c
    trunk/blender/source/blender/python/api2_2x/Lattice.h
    trunk/blender/source/blender/python/api2_2x/Library.c
    trunk/blender/source/blender/python/api2_2x/Library.h
    trunk/blender/source/blender/python/api2_2x/MTex.c
    trunk/blender/source/blender/python/api2_2x/MTex.h
    trunk/blender/source/blender/python/api2_2x/Makefile
    trunk/blender/source/blender/python/api2_2x/Material.c
    trunk/blender/source/blender/python/api2_2x/Material.h
    trunk/blender/source/blender/python/api2_2x/Mathutils.c
    trunk/blender/source/blender/python/api2_2x/Mathutils.h
    trunk/blender/source/blender/python/api2_2x/Mesh.c
    trunk/blender/source/blender/python/api2_2x/Mesh.h
    trunk/blender/source/blender/python/api2_2x/Metaball.c
    trunk/blender/source/blender/python/api2_2x/Metaball.h
    trunk/blender/source/blender/python/api2_2x/Modifier.c
    trunk/blender/source/blender/python/api2_2x/Modifier.h
    trunk/blender/source/blender/python/api2_2x/NLA.c
    trunk/blender/source/blender/python/api2_2x/NLA.h
    trunk/blender/source/blender/python/api2_2x/NMesh.c
    trunk/blender/source/blender/python/api2_2x/NMesh.h
    trunk/blender/source/blender/python/api2_2x/Node.c
    trunk/blender/source/blender/python/api2_2x/Node.h
    trunk/blender/source/blender/python/api2_2x/Noise.c
    trunk/blender/source/blender/python/api2_2x/Object.c
    trunk/blender/source/blender/python/api2_2x/Object.h
    trunk/blender/source/blender/python/api2_2x/Particle.c
    trunk/blender/source/blender/python/api2_2x/Particle.h
    trunk/blender/source/blender/python/api2_2x/Pose.c
    trunk/blender/source/blender/python/api2_2x/Pose.h
    trunk/blender/source/blender/python/api2_2x/Registry.c
    trunk/blender/source/blender/python/api2_2x/Registry.h
    trunk/blender/source/blender/python/api2_2x/Scene.c
    trunk/blender/source/blender/python/api2_2x/Scene.h
    trunk/blender/source/blender/python/api2_2x/Sound.c
    trunk/blender/source/blender/python/api2_2x/Sound.h
    trunk/blender/source/blender/python/api2_2x/SurfNurb.c
    trunk/blender/source/blender/python/api2_2x/SurfNurb.h
    trunk/blender/source/blender/python/api2_2x/Sys.c
    trunk/blender/source/blender/python/api2_2x/Sys.h
    trunk/blender/source/blender/python/api2_2x/Text.c
    trunk/blender/source/blender/python/api2_2x/Text.h
    trunk/blender/source/blender/python/api2_2x/Text3d.c
    trunk/blender/source/blender/python/api2_2x/Text3d.h
    trunk/blender/source/blender/python/api2_2x/Texture.c
    trunk/blender/source/blender/python/api2_2x/Texture.h
    trunk/blender/source/blender/python/api2_2x/Types.c
    trunk/blender/source/blender/python/api2_2x/Types.h
    trunk/blender/source/blender/python/api2_2x/Window.c
    trunk/blender/source/blender/python/api2_2x/Window.h
    trunk/blender/source/blender/python/api2_2x/World.c
    trunk/blender/source/blender/python/api2_2x/World.h
    trunk/blender/source/blender/python/api2_2x/bpy.c
    trunk/blender/source/blender/python/api2_2x/bpy.h
    trunk/blender/source/blender/python/api2_2x/bpy_config.c
    trunk/blender/source/blender/python/api2_2x/bpy_config.h
    trunk/blender/source/blender/python/api2_2x/bpy_data.c
    trunk/blender/source/blender/python/api2_2x/bpy_data.h
    trunk/blender/source/blender/python/api2_2x/bpy_types.h
    trunk/blender/source/blender/python/api2_2x/charRGBA.c
    trunk/blender/source/blender/python/api2_2x/charRGBA.h
    trunk/blender/source/blender/python/api2_2x/constant.c
    trunk/blender/source/blender/python/api2_2x/constant.h
    trunk/blender/source/blender/python/api2_2x/doc/API_intro.py
    trunk/blender/source/blender/python/api2_2x/doc/API_related.py
    trunk/blender/source/blender/python/api2_2x/doc/Armature.py
    trunk/blender/source/blender/python/api2_2x/doc/BGL.py
    trunk/blender/source/blender/python/api2_2x/doc/BezTriple.py
    trunk/blender/source/blender/python/api2_2x/doc/Blender.py
    trunk/blender/source/blender/python/api2_2x/doc/Blender_API.css
    trunk/blender/source/blender/python/api2_2x/doc/Bpy.py
    trunk/blender/source/blender/python/api2_2x/doc/Bpy_config.py
    trunk/blender/source/blender/python/api2_2x/doc/Bpy_data.py
    trunk/blender/source/blender/python/api2_2x/doc/Camera.py
    trunk/blender/source/blender/python/api2_2x/doc/Constraint.py
    trunk/blender/source/blender/python/api2_2x/doc/Curve.py
    trunk/blender/source/blender/python/api2_2x/doc/Curvedoc.txt
    trunk/blender/source/blender/python/api2_2x/doc/Draw.py
    trunk/blender/source/blender/python/api2_2x/doc/Effect.py
    trunk/blender/source/blender/python/api2_2x/doc/Effectdoc.txt
    trunk/blender/source/blender/python/api2_2x/doc/Font.py
    trunk/blender/source/blender/python/api2_2x/doc/Geometry.py
    trunk/blender/source/blender/python/api2_2x/doc/Group.py
    trunk/blender/source/blender/python/api2_2x/doc/IDProp.py
    trunk/blender/source/blender/python/api2_2x/doc/Image.py
    trunk/blender/source/blender/python/api2_2x/doc/Ipo.py
    trunk/blender/source/blender/python/api2_2x/doc/IpoCurve.py
    trunk/blender/source/blender/python/api2_2x/doc/Ipodoc.txt
    trunk/blender/source/blender/python/api2_2x/doc/Key.py
    trunk/blender/source/blender/python/api2_2x/doc/Lamp.py
    trunk/blender/source/blender/python/api2_2x/doc/Lattice.py
    trunk/blender/source/blender/python/api2_2x/doc/LibData.py
    trunk/blender/source/blender/python/api2_2x/doc/Library.py
    trunk/blender/source/blender/python/api2_2x/doc/Material.py
    trunk/blender/source/blender/python/api2_2x/doc/Mathutils.py
    trunk/blender/source/blender/python/api2_2x/doc/Mesh.py
    trunk/blender/source/blender/python/api2_2x/doc/MeshPrimitives.py
    trunk/blender/source/blender/python/api2_2x/doc/Metaball.py
    trunk/blender/source/blender/python/api2_2x/doc/Metaballdoc.txt
    trunk/blender/source/blender/python/api2_2x/doc/Modifier.py
    trunk/blender/source/blender/python/api2_2x/doc/NLA.py
    trunk/blender/source/blender/python/api2_2x/doc/NMesh.py
    trunk/blender/source/blender/python/api2_2x/doc/Noise.py
    trunk/blender/source/blender/python/api2_2x/doc/Object.py
    trunk/blender/source/blender/python/api2_2x/doc/Pose.py
    trunk/blender/source/blender/python/api2_2x/doc/Radio.py
    trunk/blender/source/blender/python/api2_2x/doc/Registry.py
    trunk/blender/source/blender/python/api2_2x/doc/Render.py
    trunk/blender/source/blender/python/api2_2x/doc/Scene.py
    trunk/blender/source/blender/python/api2_2x/doc/Sound.py
    trunk/blender/source/blender/python/api2_2x/doc/Sys.py
    trunk/blender/source/blender/python/api2_2x/doc/Text.py
    trunk/blender/source/blender/python/api2_2x/doc/Text3d.py
    trunk/blender/source/blender/python/api2_2x/doc/Texture.py
    trunk/blender/source/blender/python/api2_2x/doc/Theme.py
    trunk/blender/source/blender/python/api2_2x/doc/TimeLine.py
    trunk/blender/source/blender/python/api2_2x/doc/Types.py
    trunk/blender/source/blender/python/api2_2x/doc/Window.py
    trunk/blender/source/blender/python/api2_2x/doc/World.py
    trunk/blender/source/blender/python/api2_2x/doc/Worlddoc.txt
    trunk/blender/source/blender/python/api2_2x/doc/epy_docgen-3.sh
    trunk/blender/source/blender/python/api2_2x/doc/epy_docgen.sh
    trunk/blender/source/blender/python/api2_2x/doc/id_generics.py
    trunk/blender/source/blender/python/api2_2x/doc/pupblock.blend
    trunk/blender/source/blender/python/api2_2x/doc/testbgl.py
    trunk/blender/source/blender/python/api2_2x/doc/testcamera.py
    trunk/blender/source/blender/python/api2_2x/doc/testcurve.py
    trunk/blender/source/blender/python/api2_2x/doc/testeffect.py
    trunk/blender/source/blender/python/api2_2x/doc/testipo.py
    trunk/blender/source/blender/python/api2_2x/doc/testmball.py
    trunk/blender/source/blender/python/api2_2x/doc/testtext.py
    trunk/blender/source/blender/python/api2_2x/doc/testworld.py
    trunk/blender/source/blender/python/api2_2x/euler.c
    trunk/blender/source/blender/python/api2_2x/euler.h
    trunk/blender/source/blender/python/api2_2x/gen_library.c
    trunk/blender/source/blender/python/api2_2x/gen_library.h
    trunk/blender/source/blender/python/api2_2x/gen_utils.c
    trunk/blender/source/blender/python/api2_2x/gen_utils.h
    trunk/blender/source/blender/python/api2_2x/logic.c
    trunk/blender/source/blender/python/api2_2x/logic.h
    trunk/blender/source/blender/python/api2_2x/matrix.c
    trunk/blender/source/blender/python/api2_2x/matrix.h
    trunk/blender/source/blender/python/api2_2x/meshPrimitive.c
    trunk/blender/source/blender/python/api2_2x/meshPrimitive.h
    trunk/blender/source/blender/python/api2_2x/modules.h
    trunk/blender/source/blender/python/api2_2x/point.c
    trunk/blender/source/blender/python/api2_2x/point.h
    trunk/blender/source/blender/python/api2_2x/quat.c
    trunk/blender/source/blender/python/api2_2x/quat.h
    trunk/blender/source/blender/python/api2_2x/rgbTuple.c
    trunk/blender/source/blender/python/api2_2x/rgbTuple.h
    trunk/blender/source/blender/python/api2_2x/sceneRadio.c
    trunk/blender/source/blender/python/api2_2x/sceneRadio.h
    trunk/blender/source/blender/python/api2_2x/sceneRender.c
    trunk/blender/source/blender/python/api2_2x/sceneRender.h
    trunk/blender/source/blender/python/api2_2x/sceneSequence.c
    trunk/blender/source/blender/python/api2_2x/sceneSequence.h
    trunk/blender/source/blender/python/api2_2x/sceneTimeLine.c
    trunk/blender/source/blender/python/api2_2x/sceneTimeLine.h
    trunk/blender/source/blender/python/api2_2x/vector.c
    trunk/blender/source/blender/python/api2_2x/vector.h
    trunk/blender/source/blender/python/api2_2x/windowTheme.c
    trunk/blender/source/blender/python/api2_2x/windowTheme.h
    trunk/blender/source/nan_definitions.mk

Added Paths:
-----------
    trunk/blender/source/blender/python/api2_2x/
    trunk/blender/source/blender/python/api2_2x/doc/

Removed Paths:
-------------
    trunk/blender/source/blender/python/api2_2x/doc/
    trunk/blender/source/blender/python/api2_4x/
    trunk/blender/source/blender/python/api2_5x/

Property Changed:
----------------
    trunk/blender/source/blender/python/api2_2x/doc/pupblock.blend

Modified: trunk/blender/source/blender/blenkernel/BKE_bad_level_calls.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_bad_level_calls.h	2007-12-17 18:20:48 UTC (rev 12931)
+++ trunk/blender/source/blender/blenkernel/BKE_bad_level_calls.h	2007-12-17 20:21:06 UTC (rev 12932)
@@ -66,8 +66,6 @@
 struct bPythonConstraint;
 struct bConstraintOb;
 struct bConstraintTarget;
-
-
 void BPY_do_pyscript (struct ID *id, short int event);
 void BPY_clear_script (struct Script *script);
 void BPY_free_compiled_text (struct Text *text);
@@ -80,12 +78,8 @@
 /* pyconstraints */
 void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets);
 void BPY_pyconstraint_targets(struct bPythonConstraint *con, struct bConstraintTarget *ct);
-/* py id-hash */
-void BPY_idhash_add(void * value);
-void *BPY_idhash_get(struct ID *id);
-void BPY_idhash_remove(struct ID *id);
-void BPY_idhash_invalidate(struct ID *id);
 
+
 /* writefile.c */
 struct Oops;
 void free_oops(struct Oops *oops);

Modified: trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
===================================================================
--- trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c	2007-12-17 18:20:48 UTC (rev 12931)
+++ trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c	2007-12-17 20:21:06 UTC (rev 12932)
@@ -37,7 +37,6 @@
 #include "BKE_bad_level_calls.h"
 #include "BLI_blenlib.h"
 #include "BPI_script.h"
-#include "DNA_ID.h"
 #include "DNA_texture_types.h"
 #include "DNA_material_types.h"
 #include "DNA_node_types.h"
@@ -137,14 +136,6 @@
 void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct)
 {
 }
-/* Py ID Hash*/
-void BPY_idhash_add(void *value){}
-void *BPY_idhash_get(ID *id){}
-void BPY_idhash_remove(ID *id)
-{
-	return 0;
-}
-void BPY_idhash_invalidate(ID *id){}
 
 
 /* writefile.c */

Modified: trunk/blender/source/blender/blenkernel/intern/library.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/library.c	2007-12-17 18:20:48 UTC (rev 12931)
+++ trunk/blender/source/blender/blenkernel/intern/library.c	2007-12-17 20:21:06 UTC (rev 12932)
@@ -116,9 +116,6 @@
 
 #include "BPI_script.h"
 
-/* for maintaining the python id hash when removeing data */
-#include "BPY_extern.h"
-
 #define MAX_IDPUP		60	/* was 24 */
 
 /* ************* general ************************ */
@@ -435,9 +432,6 @@
 {
 	ID *id= idv;
 	
-	/* invalidate the data if its in the python pool */
-	BPY_idhash_invalidate(id);
-	
 	switch( GS(id->name) ) {	/* GetShort from util.h */
 		case ID_SCE:
 			free_scene((Scene *)id);

Modified: trunk/blender/source/blender/python/BPY_extern.h
===================================================================
--- trunk/blender/source/blender/python/BPY_extern.h	2007-12-17 18:20:48 UTC (rev 12931)
+++ trunk/blender/source/blender/python/BPY_extern.h	2007-12-17 20:21:06 UTC (rev 12932)
@@ -30,12 +30,9 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-
 #ifndef BPY_EXTERN_H
 #define BPY_EXTERN_H
 
-#define EXPP_BUTTON_EVENTS_OFFSET 1001
-
 extern char bprogname[];	/* holds a copy of argv[0], from creator.c */
 
 struct Text; /* defined in DNA_text_types.h */
@@ -124,17 +121,9 @@
 	void BPY_spacescript_do_pywin_draw( struct SpaceScript *sc );
 	void BPY_spacescript_do_pywin_event( struct SpaceScript *sc,
 					     unsigned short event, short val, char ascii );
-	void BPY_spacescript_do_pywin_event( struct SpaceScript *sc, 
-						 unsigned short event, short val, char ascii );
 	void BPY_clear_script( struct Script *script );
 	void BPY_free_finished_script( struct Script *script );
 
-/* tell python were removing this ID so python can NULL the pointers */
-	void BPY_idhash_add(void *value);
-	void *BPY_idhash_get(struct ID *id);
-	void BPY_idhash_remove(struct ID *id);
-	void BPY_idhash_invalidate(struct ID *id);
-
 /* void BPY_Err_Handle(struct Text *text); */
 /* void BPY_clear_bad_scriptlink(struct ID *id, struct Text *byebye); */
 /* void BPY_clear_bad_scriptlist(struct ListBase *, struct Text *byebye); */

Modified: trunk/blender/source/blender/python/BPY_interface.c
===================================================================
--- trunk/blender/source/blender/python/BPY_interface.c	2007-12-17 18:20:48 UTC (rev 12931)
+++ trunk/blender/source/blender/python/BPY_interface.c	2007-12-17 20:21:06 UTC (rev 12932)
@@ -36,7 +36,6 @@
 #include "compile.h"		/* for the PyCodeObject */
 #include "eval.h"		/* for PyEval_EvalCode */
 #include "BLI_blenlib.h"	/* for BLI_last_slash() */
-#include "BLI_ghash.h"	/* for tracking removed data */
 #include "BIF_interface.h"	/* for pupmenu() */
 #include "BIF_space.h"
 #include "BIF_screen.h"
@@ -62,31 +61,22 @@
 #include "BKE_global.h"
 #include "BKE_main.h"
 #include "BKE_armature.h"
-#include "api2_5x/EXPP_interface.h"
-#include "api2_5x/gen_utils.h"
-#include "api2_5x/gen_library.h" /* GetPyObjectFromID */
-#include "api2_5x/bpy_gl.h" 
-#include "api2_5x/bpy_state.h"
-#include "api2_5x/Camera.h"
-#include "api2_5x/Draw.h"
-#include "api2_5x/Object.h"
-#include "api2_5x/Registry.h"
-#include "api2_5x/Pose.h"
-#include "api2_5x/bpy.h" /* for the new "bpy" module */
+#include "api2_2x/EXPP_interface.h"
+#include "api2_2x/constant.h"
+#include "api2_2x/gen_utils.h"
+#include "api2_2x/gen_library.h" /* GetPyObjectFromID */
+#include "api2_2x/BGL.h" 
+#include "api2_2x/Blender.h"
+#include "api2_2x/Camera.h"
+#include "api2_2x/Draw.h"
+#include "api2_2x/Object.h"
+#include "api2_2x/Registry.h"
+#include "api2_2x/Pose.h"
+#include "api2_2x/bpy.h" /* for the new "bpy" module */
 
-/* old 2.4x api */
-#ifdef WITH_BPYAPI_V24X
-#include "api2_4x/Blender.h"
-#include "api2_4x/gen_utils.h"
-#endif
-
 /*these next two are for pyconstraints*/
-#include "api2_5x/IDProp.h"
-#include "api2_5x/matrix.h"
-#include "api2_5x/gen_utils.h"
-#include "api2_5x/gen_library.h"
-#include "blendef.h"
-#include "BKE_utildefines.h"
+#include "api2_2x/IDProp.h"
+#include "api2_2x/matrix.h"
 
 /* for scriptlinks */
 #include "DNA_lamp_types.h"
@@ -95,208 +85,27 @@
 #include "DNA_scene_types.h"
 #include "DNA_material_types.h"
 
-#include "DNA_ID.h"
-
-#include "mydevice.h"		/*@ for all the event constants, only because we have to access QKEY etc */
-
-/* bpy_registryDict is declared in api2_5x/Registry.h and defined
- * in api2_5x/Registry.c
+/* bpy_registryDict is declared in api2_2x/Registry.h and defined
+ * in api2_2x/Registry.c
  * This Python dictionary will be used to store data that scripts
  * choose to preserve after they are executed, so user changes can be
  * restored next time the script is used.  Check the Blender.Registry module. 
  */
-/*#include "api2_5x/Registry.h" */
+/*#include "api2_2x/Registry.h" */
 
 /* for pydrivers (ipo drivers defined by one-line Python expressions) */
 PyObject *bpy_pydriver_Dict = NULL;
 
-
-/*This is needed for button callbacks.  Any button that uses a callback gets added to this list.
-  On the C side of drawing begin, this list should be cleared.
-  Each entry is a tuple of the form (button, callback py object)
-*/
-PyObject *M_Button_List = NULL;
-
-void BPy_Set_DrawButtonsList(void *list)
-{
-	M_Button_List = list;
-}
-
-/*this MUST be called after doing UI stuff.*/
-void BPy_Free_DrawButtonsList(void)
-{
-	/*Clear the list.*/
-	if (M_Button_List) {
-		PyList_SetSlice(M_Button_List, 0, PyList_Size(M_Button_List), NULL);
-		Py_DECREF(M_Button_List);
-		M_Button_List = NULL;
-	}
-}
-
-void exit_pydraw( SpaceScript * sc, short err )
-{
-	Script *script = NULL;
-
-	if( !sc || !sc->script )
-		return;
-
-	script = sc->script;
-
-	if( err ) {
-		PyErr_Print(  );
-		script->flags = 0;	/* mark script struct for deletion */
-		error( "Python script error: check console" );
-		scrarea_queue_redraw( sc->area );
-	}
-
-	BPy_Set_DrawButtonsList(sc->but_refs);
-	BPy_Free_DrawButtonsList(); /*clear all temp button references*/
-	sc->but_refs = NULL;
-	
-	Py_XDECREF( ( PyObject * ) script->py_draw );
-	Py_XDECREF( ( PyObject * ) script->py_event );
-	Py_XDECREF( ( PyObject * ) script->py_button );
-
-	script->py_draw = script->py_event = script->py_button = NULL;
-}
-
-static void exec_callback( SpaceScript * sc, PyObject * callback,
-			   PyObject * args )
-{
-	PyObject *result = PyObject_CallObject( callback, args );
-
-	if( result == NULL && sc->script ) {	/* errors in the script */
-
-		if( sc->script->lastspace == SPACE_TEXT ) {	/*if it can be an ALT+P script */
-			Text *text = G.main->text.first;
-
-			while( text ) {	/* find it and free its compiled code */
-
-				if( !strcmp
-				    ( text->id.name + 2,
-				      sc->script->id.name + 2 ) ) {
-					BPY_free_compiled_text( text );
-					break;
-				}
-
-				text = text->id.next;
-			}
-		}
-		exit_pydraw( sc, 1 );
-	}
-
-	Py_XDECREF( result );
-	Py_DECREF( args );
-}
-
-/* BPY_spacescript_do_pywin_draw, the static spacescript_do_pywin_buttons and
- * BPY_spacescript_do_pywin_event are the three functions responsible for
- * calling the draw, buttons and event callbacks registered with Draw.Register
- * (see Method_Register below).  They are called (only the two BPY_ ones)
- * from blender/src/drawscript.c */
-
-void BPY_spacescript_do_pywin_draw( SpaceScript * sc )
-{
-	uiBlock *block;
-	char butblock[20];
-	Script *script = sc->script;
-
-	sprintf( butblock, "win %d", curarea->win );
-	block = uiNewBlock( &curarea->uiblocks, butblock, UI_EMBOSSX,
-			    UI_HELV, curarea->win );
-
-	if( script->py_draw ) {
-		if (sc->but_refs) {
-			BPy_Set_DrawButtonsList(sc->but_refs);
-			BPy_Free_DrawButtonsList(); /*clear all temp button references*/
-		}
-		sc->but_refs = PyList_New(0);
-		BPy_Set_DrawButtonsList(sc->but_refs);
-		
-		glPushAttrib( GL_ALL_ATTRIB_BITS );
-		exec_callback( sc, script->py_draw, Py_BuildValue( "()" ) );
-		glPopAttrib(  );
-	} else {
-		glClearColor( 0.4375, 0.4375, 0.4375, 0.0 );
-		glClear( GL_COLOR_BUFFER_BIT );
-	}
-
-	uiDrawBlock( block );
-
-	curarea->win_swap = WIN_BACK_OK;
-}
-
-void spacescript_do_pywin_buttons( SpaceScript * sc,
-					  unsigned short event )
-{
-	if( sc->script->py_button )
-		exec_callback( sc, sc->script->py_button,
-			       Py_BuildValue( "(i)", event ) );
-}
-
-void BPY_spacescript_do_pywin_event( SpaceScript * sc, unsigned short event,
-	short val, char ascii )
-{
-	if( event == QKEY && G.qual & ( LR_ALTKEY | LR_CTRLKEY ) ) {

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list