2.5
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:
@@ -1620,8 +1620,7 @@ static EnumPropertyItem prop_set_restrictview_types[] = {
|
|||||||
static int object_set_restrictview_exec(bContext *C, wmOperator *op)
|
static int object_set_restrictview_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene= CTX_data_scene(C);
|
Scene *scene= CTX_data_scene(C);
|
||||||
|
short changed = 0;
|
||||||
short changed = 0, changed_act = 0;
|
|
||||||
|
|
||||||
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
|
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
|
||||||
if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")){
|
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;
|
base->object->restrictflag |= OB_RESTRICT_VIEW;
|
||||||
changed = 1;
|
changed = 1;
|
||||||
if (base==BASACT) {
|
if (base==BASACT) {
|
||||||
BASACT= NULL;
|
ED_base_object_activate(C, NULL);
|
||||||
changed_act = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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));
|
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;
|
return OPERATOR_FINISHED;
|
||||||
|
@@ -5327,8 +5327,8 @@ static void do_view3d_buttons(bContext *C, void *arg, int event)
|
|||||||
Scene *scene= CTX_data_scene(C);
|
Scene *scene= CTX_data_scene(C);
|
||||||
ScrArea *sa= CTX_wm_area(C);
|
ScrArea *sa= CTX_wm_area(C);
|
||||||
View3D *v3d= sa->spacedata.first;
|
View3D *v3d= sa->spacedata.first;
|
||||||
Base *basact= scene->basact;
|
Base *basact= CTX_data_active_base(C);
|
||||||
Object *ob= basact->object;
|
Object *ob= CTX_data_active_object(C);
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
Object *obedit = CTX_data_edit_object(C);
|
||||||
EditMesh *em= NULL;
|
EditMesh *em= NULL;
|
||||||
int bit, ctrl=0, shift=0; // XXX shift arg?
|
int bit, ctrl=0, shift=0; // XXX shift arg?
|
||||||
|
Reference in New Issue
Block a user