[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12930] trunk/blender/source: bpy 2. 4x api added back

Campbell Barton ideasman42 at gmail.com
Mon Dec 17 17:43:21 CET 2007


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

Log Message:
-----------
bpy 2.4x api added back

Added Paths:
-----------
    trunk/blender/source/blender/
    trunk/blender/source/blender/python/
    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/BPY_menus.h
    trunk/blender/source/blender/python/CMakeLists.txt
    trunk/blender/source/blender/python/Makefile
    trunk/blender/source/blender/python/SConscript
    trunk/blender/source/blender/python/api2_2x/
    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/
    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

Removed Paths:
-------------
    trunk/blender/source/blender/

Added: trunk/blender/source/blender/python/BPY_extern.h
===================================================================
--- trunk/blender/source/blender/python/BPY_extern.h	                        (rev 0)
+++ trunk/blender/source/blender/python/BPY_extern.h	2007-12-17 16:43:21 UTC (rev 12930)
@@ -0,0 +1,136 @@
+/*
+ * $Id: BPY_extern.h 12334 2007-10-21 23:00:29Z aligorith $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code was in: source/blender/bpython/include/BPY_extern.h
+ *
+ * Contributor(s): Michel Selten, Willian P. Germano, Chris Keith
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+#ifndef BPY_EXTERN_H
+#define BPY_EXTERN_H
+
+extern char bprogname[];	/* holds a copy of argv[0], from creator.c */
+
+struct Text; /* defined in DNA_text_types.h */
+struct ID; /* DNA_ID.h */
+struct Object; /* DNA_object_types.h */
+struct IpoDriver; /* DNA_curve_types.h */
+struct ScriptLink; /* DNA_scriptlink_types.h */
+struct ListBase; /* DNA_listBase.h */
+struct SpaceText; /* DNA_space_types.h */
+struct SpaceScript; /* DNA_space_types.h */
+struct Script; /* BPI_script.h */
+struct ScrArea; /* DNA_screen_types.h */
+struct bScreen; /* DNA_screen_types.h */
+struct bConstraint; /* DNA_constraint_types.h */
+struct bPythonConstraint; /* DNA_constraint_types.h */
+struct bConstraintOb; /* DNA_constraint_types.h */
+struct bConstraintTarget; /* DNA_constraint_types.h*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	/*These two next functions are important for making sure the Draw module
+	  works correctly.  Before calling any gui callback using the Draw module,
+	  the following code must be executed:
+	  
+		if (some_drawspace_pylist) {
+			BPy_Set_DrawButtonsList(some_drawspace_pylist->but_refs);
+			BPy_Free_DrawButtonsList();
+		}
+		some_drawspace_pylist = PyList_New(0);
+		BPy_Set_DrawButtonsList(some_drawspace_pylist);
+
+      Also, BPy_Free_DrawButtonsList() must be called as necassary when a drawspace
+      with python callbacks is destroyed.
+      
+      This is necassary to avoid blender buttons storing invalid pointers to freed
+      python data.*/
+	void BPy_Set_DrawButtonsList(void *list);
+	void BPy_Free_DrawButtonsList(void);
+	
+	void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets);
+	void BPY_pyconstraint_settings(void *arg1, void *arg2);
+	void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct);
+	void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
+	int BPY_is_pyconstraint(struct Text *text);
+	
+	void BPY_start_python( int argc, char **argv );
+	void BPY_end_python( void );
+	void BPY_post_start_python( void );
+	void init_syspath( int first_time );
+	void syspath_append( char *dir );
+
+	int BPY_Err_getLinenumber( void );
+	const char *BPY_Err_getFilename( void );
+
+	int BPY_txt_do_python_Text( struct Text *text );
+	int BPY_menu_do_python( short menutype, int event );
+	void BPY_run_python_script( char *filename );
+	void BPY_free_compiled_text( struct Text *text );
+
+	void BPY_clear_bad_scriptlinks( struct Text *byebye );
+	int BPY_has_onload_script( void );
+	void BPY_do_all_scripts( short event );
+	int BPY_check_all_scriptlinks( struct Text *text );
+	void BPY_do_pyscript( struct ID *id, short event );
+	void BPY_free_scriptlink( struct ScriptLink *slink );
+	void BPY_copy_scriptlink( struct ScriptLink *scriptlink );
+
+	int BPY_is_spacehandler(struct Text *text, char spacetype);
+	int BPY_del_spacehandler(struct Text *text, struct ScrArea *sa);
+	int BPY_add_spacehandler(struct Text *txt, struct ScrArea *sa,char spacetype);
+	int BPY_has_spacehandler(struct Text *text, struct ScrArea *sa);
+	void BPY_screen_free_spacehandlers(struct bScreen *sc);
+	int BPY_do_spacehandlers(struct ScrArea *sa, unsigned short event,
+		unsigned short space_event);
+
+	void BPY_pydriver_update(void);
+	float BPY_pydriver_eval(struct IpoDriver *driver);
+	struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver);
+
+	int BPY_button_eval(char *expr, double *value);
+
+/* format importer hook */
+	int BPY_call_importloader( char *name );
+
+	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_clear_script( struct Script *script );
+	void BPY_free_finished_script( struct Script *script );
+
+/* 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); */
+/* int BPY_spacetext_is_pywin(struct SpaceText *st); */
+
+#ifdef __cplusplus
+}				/* extern "C" */
+#endif
+
+#endif  /* BPY_EXTERN_H */

Added: trunk/blender/source/blender/python/BPY_interface.c
===================================================================
--- trunk/blender/source/blender/python/BPY_interface.c	                        (rev 0)
+++ trunk/blender/source/blender/python/BPY_interface.c	2007-12-17 16:43:21 UTC (rev 12930)
@@ -0,0 +1,2659 @@
+/* 
+ * $Id: BPY_interface.c 12813 2007-12-07 09:51:02Z campbellbarton $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA	02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * This is a new part of Blender.
+ *
+ * Contributor(s): Michel Selten, Willian P. Germano, Stephen Swaney,
+ * Chris Keith, Chris Want, Ken Hughes
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+*/
+
+#include <Python.h>
+
+#include "compile.h"		/* for the PyCodeObject */
+#include "eval.h"		/* for PyEval_EvalCode */
+#include "BLI_blenlib.h"	/* for BLI_last_slash() */
+#include "BIF_interface.h"	/* for pupmenu() */
+#include "BIF_space.h"
+#include "BIF_screen.h"
+#include "BIF_toolbox.h"
+#include "BKE_action.h" 	/* for get_pose_channel() */
+#include "BKE_library.h"
+#include "BKE_object.h"		/* during_scriptlink() */
+#include "BKE_text.h"
+#include "BKE_constraint.h" /* for bConstraintOb */
+#include "BKE_idprop.h"
+
+#include "DNA_curve_types.h" /* for struct IpoDriver */
+#include "DNA_ID.h" /* ipo driver */
+#include "DNA_object_types.h" /* ipo driver */
+#include "DNA_constraint_types.h" /* for pyconstraint */
+
+#include "DNA_screen_types.h"
+#include "DNA_userdef_types.h"	/* for U.pythondir */
+#include "MEM_guardedalloc.h"
+#include "BPY_extern.h"
+#include "BPY_menus.h"
+#include "BPI_script.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_armature.h"
+#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 */
+
+/*these next two are for pyconstraints*/
+#include "api2_2x/IDProp.h"
+#include "api2_2x/matrix.h"
+
+/* for scriptlinks */
+#include "DNA_lamp_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_world_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_material_types.h"
+
+/* 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_2x/Registry.h" */
+
+/* for pydrivers (ipo drivers defined by one-line Python expressions) */
+PyObject *bpy_pydriver_Dict = NULL;
+
+/*
+ * set up a weakref list for Armatures
+ *    creates list in __main__ module dict 
+ */
+  
+int setup_armature_weakrefs()
+{
+	PyObject *maindict;
+	PyObject *main_module;
+	char *list_name = ARM_WEAKREF_LIST_NAME;
+
+	main_module = PyImport_AddModule( "__main__");
+	if(main_module){
+		PyObject *weakreflink;
+		maindict= PyModule_GetDict(main_module);
+
+		/* check if there is already a dict entry for the armature weakrefs,
+		 * and delete if so before making another one */
+
+		weakreflink= PyDict_GetItemString(maindict,list_name);
+		if( weakreflink != NULL ) {
+			PyDict_DelItemString(maindict,list_name);
+			Py_XDECREF( weakreflink );
+		}
+
+		if (PyDict_SetItemString(maindict, 
+								 list_name, 
+								 PyList_New(0)) == -1){
+			printf("Oops - setup_armature_weakrefs()\n");
+			
+			return 0;
+		}
+	}
+	return 1;
+}
+

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list