From 23e6ada74f649b7ed69ad1978790d53fe09c43e0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 8 Apr 2010 11:46:52 +0000 Subject: bugfix [#21929] linking in groups into a linked in scene is possible and those groups can't be deleted - Disallow this and report a warning in the console when it happens. - File selector operators now report in the global report console. - Cleared some warnings. --- source/blender/blenkernel/intern/action.c | 2 +- source/blender/editors/space_view3d/drawobject.c | 4 ++-- source/blender/makesrna/intern/rna_animation_api.c | 4 ++-- source/blender/windowmanager/intern/wm_event_system.c | 4 ++++ source/blender/windowmanager/intern/wm_operators.c | 9 +++++++++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 365ac2371b8..fc7b22fa63e 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -396,7 +396,7 @@ bPoseChannel *get_pose_channel(const bPose *pose, const char *name) return NULL; if(pose->chanhash) - return BLI_ghash_lookup(pose->chanhash, name); + return BLI_ghash_lookup(pose->chanhash, (void *)name); return BLI_findstring(&((bPose *)pose)->chanbase, name, offsetof(bPoseChannel, name)); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 93f2f571d77..b877266aeaf 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -625,14 +625,14 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa } if(tot) { +#if 0 bglMats mats; /* ZBuffer depth vars */ double ux, uy, uz; float depth; if(v3d->zbuf) bgl_get_mats(&mats); - - +#endif if(rv3d->rflag & RV3D_CLIPPING) for(a=0; a<6; a++) glDisable(GL_CLIP_PLANE0+a); diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index 5c745eac59f..1e62e10f211 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -44,8 +44,8 @@ void RNA_api_keyingset(StructRNA *srna) { - FunctionRNA *func; - PropertyRNA *parm; +// FunctionRNA *func; +// PropertyRNA *parm; } #endif diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 5c22f664281..e292b6bf5eb 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1240,6 +1240,10 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa handler->op->reports->printlevel = RPT_WARNING; uiPupMenuReports(C, handler->op->reports); + /* XXX - copied from 'wm_operator_finished()' */ + /* add reports to the global list, otherwise they are not seen */ + addlisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list); + CTX_wm_window_set(C, win_prev); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index aa087cb0298..c94f4eb14c4 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1482,6 +1482,7 @@ static short wm_link_append_flag(wmOperator *op) if(RNA_boolean_get(op->ptr, "relative_path")) flag |= FILE_RELPATH; if(RNA_boolean_get(op->ptr, "link")) flag |= FILE_LINK; if(RNA_boolean_get(op->ptr, "instance_groups")) flag |= FILE_GROUP_INSTANCE; + return flag; } @@ -1554,6 +1555,14 @@ static int wm_link_append_exec(bContext *C, wmOperator *op) flag = wm_link_append_flag(op); + /* sanity checks for flag */ + if(scene->id.lib && (flag & FILE_GROUP_INSTANCE)) { + /* TODO, user never gets this message */ + BKE_reportf(op->reports, RPT_WARNING, "Scene '%s' is linked, group instance disabled", scene->id.name+2); + flag &= ~FILE_GROUP_INSTANCE; + } + + /* tag everything, all untagged data can be made local * its also generally useful to know what is new * -- cgit v1.2.3