Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2009-01-14 00:18:05 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2009-01-14 00:18:05 +0300
commit0162ded15a7709c131095e883793d1ac932b7870 (patch)
treef983ee5680767d5c715c263ee0135a3d78b50c8c /source/blender/editors
parenta42f9163bff98018c54320086fdf695419e4336c (diff)
2.5 / Keymap definition
* For some reason builds on Windows would crash when tabbing into edit mode with default .b.blend Problem is that it is not very clear why it happens. The debug trace I managed to get pointed at SCRIPT_OT_run_pyfile being run when pressing TAB. Changing the way how this quickhack for running scripts is added made the crash go away, but this points at a potential problem in the creation of keymaps. The original form is the plenty used: RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_run_pyfile", PKEY, KM_PRESS, 0, 0)->ptr, "filename", "test.py"); But changing that to: km = WM_keymap_add_item(keymap, "SCRIPT_OT_run_pyfile", PKEY, KM_PRESS, 0, 0); RNA_string_set(km->ptr, "filename", "test.py"); Properly prevents the execution of the script operator. It looks like somewhere something goes wrong, but no idea what, yet. Probably a good thing to investigate now! Apparently this doesn't happen on Linux (and probably not on OSX either).
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index e7e987f1c18..eb0511eeea8 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -163,7 +163,8 @@ void view3d_keymap(wmWindowManager *wm)
WM_keymap_add_item(keymap, "VIEW3D_OT_wpaint_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
/* TODO - this is just while we have no way to load a text datablock */
- RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_run_pyfile", PKEY, KM_PRESS, 0, 0)->ptr, "filename", "test.py");
+ km = WM_keymap_add_item(keymap, "SCRIPT_OT_run_pyfile", PKEY, KM_PRESS, 0, 0);
+ RNA_string_set(km->ptr, "filename", "test.py");
transform_keymap_for_space(wm, keymap, SPACE_VIEW3D);