Page Menu
Home
Search
Configure Global Search
Log In
Files
F1959
Script_link_editMode.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Campbell Barton (campbellbarton)
Nov 13 2013, 1:01 PM
Size
6 KB
Subscribers
None
Script_link_editMode.txt
View Options
Index: source/blender/blenkernel/BKE_global.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/BKE_global.h,v
retrieving revision 1.21
diff -u -p -r1.21 BKE_global.h
--- source/blender/blenkernel/BKE_global.h 5 May 2005 17:19:19 -0000 1.21
+++ source/blender/blenkernel/BKE_global.h 6 May 2005 14:30:22 -0000
@@ -165,7 +165,7 @@ typedef struct Global {
#define G_ALLEDGES 2048
#define G_DEBUG 4096
#define G_SCENESCRIPT 8192
-/* #define G_PROPORTIONAL 16384 removed! so can be used later for other stuff */
#define G_WEIGHTPAINT 32768
+/* #define G_EDITMODESCRIPT 16384 removed! so can be used later for other stuff */
#define G_TEXTUREPAINT 65536
/* #define G_NOFROZEN (1 << 17) also removed */
Index: source/blender/makesdna/DNA_scriptlink_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_scriptlink_types.h,v
retrieving revision 1.6
diff -u -p -r1.6 DNA_scriptlink_types.h
--- source/blender/makesdna/DNA_scriptlink_types.h 17 Aug 2004 04:25:58 -0000 1.6
+++ source/blender/makesdna/DNA_scriptlink_types.h 6 May 2005 14:30:22 -0000
@@ -56,6 +56,7 @@ typedef struct ScriptLink {
#define SCRIPT_ONLOAD 2
#define SCRIPT_REDRAW 4
#define SCRIPT_ONSAVE 8
+#define SCRIPT_EDITMODE 16
#ifdef __cplusplus
}
Index: source/blender/python/api2_2x/Scene.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Scene.c,v
retrieving revision 1.29
diff -u -p -r1.29 Scene.c
--- source/blender/python/api2_2x/Scene.c 21 Apr 2005 19:44:52 -0000 1.29
+++ source/blender/python/api2_2x/Scene.c 6 May 2005 14:30:24 -0000
@@ -146,17 +147,19 @@ static PyMethodDef BPy_Scene_methods[] =
"(obj) - Unlink Object obj from this scene"},
{"getChildren", ( PyCFunction ) Scene_getChildren, METH_NOARGS,
"() - Return list of all objects linked to scene self"},
+ {"getActive", ( PyCFunction ) Scene_getActive, METH_NOARGS,
+ "() - Return the active objects linked to scene self"},
{"getCurrentCamera", ( PyCFunction ) Scene_getCurrentCamera,
METH_NOARGS,
"() - Return current active Camera"},
{"getScriptLinks", ( PyCFunction ) Scene_getScriptLinks, METH_VARARGS,
"(eventname) - Get a list of this scene's scriptlinks (Text names) "
"of the given type\n"
- "(eventname) - string: FrameChanged, OnLoad or Redraw."},
+ "(eventname) - string: FrameChanged, OnLoad, Redraw or EditMode."},
{"addScriptLink", ( PyCFunction ) Scene_addScriptLink, METH_VARARGS,
"(text, evt) - Add a new scene scriptlink.\n"
"(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, OnLoad or Redraw."},
+ "(evt) string: FrameChanged, OnLoad, Redraw or EditMode."},
{"clearScriptLinks", ( PyCFunction ) Scene_clearScriptLinks,
METH_VARARGS,
"() - Delete all scriptlinks from this scene.\n"
Index: source/blender/python/api2_2x/gen_utils.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/gen_utils.c,v
retrieving revision 1.26
diff -u -p -r1.26 gen_utils.c
--- source/blender/python/api2_2x/gen_utils.c 24 Apr 2005 19:32:04 -0000 1.26
+++ source/blender/python/api2_2x/gen_utils.c 6 May 2005 14:30:25 -0000
@@ -155,6 +155,8 @@ char *event_to_name( short event )
return "OnSave";
case SCRIPT_REDRAW:
return "Redraw";
+ case SCRIPT_EDITMODE:
+ return "EditMode";
default:
return "Unknown";
}
@@ -318,6 +320,8 @@ PyObject *EXPP_getScriptLinks( ScriptLin
event = SCRIPT_ONLOAD;
else if( is_scene && !strcmp( eventname, "OnSave" ) )
event = SCRIPT_ONSAVE;
+ else if( is_scene && !strcmp( eventname, "EditMode" ) )
+ event = SCRIPT_EDITMODE;
else
return EXPP_ReturnPyObjError( PyExc_AttributeError,
"invalid event name" );
@@ -469,6 +473,8 @@ PyObject *EXPP_addScriptLink(ScriptLink
event = SCRIPT_ONLOAD;
else if( is_scene && !strcmp( eventname, "OnSave" ) )
event = SCRIPT_ONSAVE;
+ else if( is_scene && !strcmp( eventname, "EditMode" ) )
+ event = SCRIPT_EDITMODE;
else
return EXPP_ReturnPyObjError( PyExc_AttributeError,
"invalid event name" );
Index: source/blender/python/api2_2x/doc/Scene.py
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Scene.py,v
retrieving revision 1.12
diff -u -p -r1.12 Scene.py
--- source/blender/python/api2_2x/doc/Scene.py 21 Apr 2005 19:44:52 -0000 1.12
+++ source/blender/python/api2_2x/doc/Scene.py 6 May 2005 14:30:26 -0000
@@ -221,7 +229,7 @@ class Scene:
"""
Get a list with this Scene's script links of type 'event'.
@type event: string
- @param event: "FrameChanged", "OnLoad", "OnSave" or "Redraw".
+ @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "EditMode".
@rtype: list
@return: a list with Blender L{Text} names (the script links of the given
'event' type) or None if there are no script links at all.
Index: source/blender/src/buttons_script.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_script.c,v
retrieving revision 1.9
diff -u -p -r1.9 buttons_script.c
--- source/blender/src/buttons_script.c 19 Mar 2005 21:08:11 -0000 1.9
+++ source/blender/src/buttons_script.c 6 May 2005 14:30:26 -0000
@@ -235,9 +235,11 @@ void draw_scriptlink(uiBlock *block, Scr
if (script->totscript) {
strcpy(str, "FrameChanged%x 1|");
strcat(str, "Redraw%x 4|");
+
if (scene) {
strcat(str, "OnLoad%x 2|");
- strcat(str, "OnSave%x 8");
+ strcat(str, "OnSave%x 8|");
+ strcat(str, "EditMode%x 16");
}
uiDefButS(block, MENU, 1, str, (short)sx, (short)sy, 140, 19, &script->flag[script->actscript-1], 0, 0, 0, 0, "Script links for this event");
Index: source/blender/src/editobject.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editobject.c,v
retrieving revision 1.184
diff -u -p -r1.184 editobject.c
--- source/blender/src/editobject.c 4 May 2005 12:53:35 -0000 1.184
+++ source/blender/src/editobject.c 6 May 2005 14:30:28 -0000
@@ -1451,6 +1451,10 @@ void enter_editmode(void)
if (G.obpose)
exit_posemode (1);
scrarea_queue_headredraw(curarea);
+
+ if(G.scene->scriptlink.totscript && !during_script()) {
+ BPY_do_pyscript((ID *)G.scene, SCRIPT_EDITMODE);
+ }
}
void make_displists_by_parent(Object *ob) {
@@ -1559,6 +1563,11 @@ void exit_editmode(int freedata) /* free
if(G.obedit==NULL && freedata==2)
BIF_undo_push("Editmode");
+
+ if(G.scene->scriptlink.totscript && !during_script()) {
+ BPY_do_pyscript((ID *)G.scene, SCRIPT_EDITMODE);
+ }
+
}
void check_editmode(int type)
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1d/04/862290f18660a7a38f389cdabaf3
Event Timeline
Log In to Comment