Bugfix;
- do not set active base/object yourse, but use ED_base_object_activate
- view3d buttons was reading NULL pointer.
This commit is contained in:
Ton Roosendaal
2009-01-14 16:54:36 +00:00
parent 247f3c9e7d
commit fd37c07e28
2 changed files with 4 additions and 9 deletions

View File

@@ -1620,8 +1620,7 @@ static EnumPropertyItem prop_set_restrictview_types[] = {
static int object_set_restrictview_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
short changed = 0, changed_act = 0;
short changed = 0;
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")){
@@ -1631,8 +1630,7 @@ static int object_set_restrictview_exec(bContext *C, wmOperator *op)
base->object->restrictflag |= OB_RESTRICT_VIEW;
changed = 1;
if (base==BASACT) {
BASACT= NULL;
changed_act = 1;
ED_base_object_activate(C, NULL);
}
}
}
@@ -1652,9 +1650,6 @@ static int object_set_restrictview_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
if (changed_act) { /* these spaces depend on the active object */
WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, CTX_data_scene(C));
}
}
return OPERATOR_FINISHED;

View File

@@ -5327,8 +5327,8 @@ static void do_view3d_buttons(bContext *C, void *arg, int event)
Scene *scene= CTX_data_scene(C);
ScrArea *sa= CTX_wm_area(C);
View3D *v3d= sa->spacedata.first;
Base *basact= scene->basact;
Object *ob= basact->object;
Base *basact= CTX_data_active_base(C);
Object *ob= CTX_data_active_object(C);
Object *obedit = CTX_data_edit_object(C);
EditMesh *em= NULL;
int bit, ctrl=0, shift=0; // XXX shift arg?