Interface:

- added submenu "Scripts" in both View3D->Object and Mesh menus.
  Put them on top (it's better to follow some guideline, so users don't have to search for "Scripts" submenu in a different position in each menu), feel free to change.
- added button 'previous win' to SpaceScript, makes accessing buttons win, for example, much faster.  Maybe all spaces could have this button.

BPython:
- added Window.EditMode(), to check, enter and leave edit mode.  Scripts that change mesh data need this to leave edit mode before making changes to the active (G.obedit) mesh, of course.
- updated script bevel_center to use the above function and also popup an error msg if the active obj is not a mesh.
- doc updates, minor fixes.

Forgot to mention in my previous commit that I also updated the "-P" command-line option (for running script files) to be able to run already loaded Blender Texts, too.  So, if you have a script called 'Text' in foo.blend, you can run it with blender foo.blend -P Text .
This commit is contained in:
2004-07-03 17:28:15 +00:00
parent 5c543698c9
commit cbe7471905
12 changed files with 126 additions and 35 deletions

View File

@@ -42,7 +42,6 @@
#include <MEM_guardedalloc.h>
#include <BLI_blenlib.h> /* for BLI_last_slash() */
#include <BDR_editobject.h> /* for exit_editmode() */
#include <BIF_interface.h> /* for pupmenu() */
#include <BIF_space.h>
#include <BIF_screen.h>
@@ -448,10 +447,6 @@ int BPY_txt_do_python_Text(struct Text* text)
* will have been deallocated already, so we need to copy its name here. */
BLI_strncpy(textname, GetName(text), strlen(GetName(text))+1);
/* if in it, leave editmode, since changes a script makes to meshdata
* can be lost otherwise. */
if (G.obedit) exit_editmode(1);
script->id.us = 1;
script->flags = SCRIPT_RUNNING;
script->py_draw = NULL;
@@ -621,10 +616,6 @@ int BPY_menu_do_python(short menutype, int event)
return 0;
}
/* if in editmode, leave it, since changes a script makes to meshdata
* can be lost otherwise. */
if (G.obedit) exit_editmode(1);
/* let's find a proper area for an eventual script gui:
* (still experimenting here, need definition on which win
* each group will be put to code this properly) */