diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/editarmature_sketch.c | 6 | ||||
-rw-r--r-- | source/blender/editors/armature/poselib.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 15 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_hook.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 85 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 3 |
17 files changed, 65 insertions, 76 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 10886615976..c525c9af626 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -696,7 +696,7 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformK /* Menu of All Keying Sets ----------------------------- */ /* Dynamically populate an enum of Keying Sets */ -EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), int *free) +EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Scene *scene = CTX_data_scene(C); KeyingSet *ks; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index ccb9a45af37..97f85b92b32 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -374,16 +374,16 @@ static void sk_autoname(bContext *C, ReebArc *arc) int valid = 0; int caps = 0; - if (BLI_streq(side, "")) + if (side[0] == '\0') { valid = 1; } - else if (BLI_streq(side, "R") || BLI_streq(side, "L")) + else if (strcmp(side, "R")==0 || strcmp(side, "L")==0) { valid = 1; caps = 1; } - else if (BLI_streq(side, "r") || BLI_streq(side, "l")) + else if (strcmp(side, "r")==0 || strcmp(side, "l")==0) { valid = 1; caps = 0; diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 9e0e9374d5d..5b4da1a38df 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -483,7 +483,7 @@ void POSELIB_OT_pose_add (wmOperatorType *ot) /* ----- */ /* can be called with C == NULL */ -static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *ob = get_poselib_object(C); bAction *act = (ob) ? ob->poselib : NULL; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 27f2598d515..42ffefa6bd4 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -453,7 +453,7 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect) /* for camera view set the subrect */ if (rv3d->persp == RV3D_CAMOB) { - ED_view3d_calc_camera_border(scene, ar, v3d, NULL, subrect, -1); /* negative shift */ + ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, subrect, -1); /* negative shift */ return 1; } } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 2a4b583276e..f4da734473d 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1131,7 +1131,7 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) /* for camera view set the subrect */ if (rv3d->persp == RV3D_CAMOB) { - ED_view3d_calc_camera_border(p->scene, p->ar, v3d, NULL, &p->subrect_data, -1); /* negative shift */ + ED_view3d_calc_camera_border(p->scene, p->ar, v3d, rv3d, &p->subrect_data, -1); /* negative shift */ p->subrect= &p->subrect_data; } } diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 6523a897713..294b9b8475a 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -211,7 +211,7 @@ struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const c void ANIM_keying_sets_menu_setup(struct bContext *C, const char title[], const char op_name[]); /* Dynamically populate an enum of Keying Sets */ -struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, int *free); +struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free); /* Check if KeyingSet can be used in the current context */ short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index e70b793cfb0..da479fe7ca3 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1848,29 +1848,24 @@ void uiFreeInactiveBlocks(const bContext *C, ListBase *lb) void uiBlockSetRegion(uiBlock *block, ARegion *region) { - ListBase *lb; + ListBase *lb= ®ion->uiblocks; uiBlock *oldblock= NULL; - lb= ®ion->uiblocks; - /* each listbase only has one block with this name, free block * if is already there so it can be rebuilt from scratch */ if(lb) { - for (oldblock= lb->first; oldblock; oldblock= oldblock->next) - if (BLI_streq(oldblock->name, block->name)) - break; + oldblock= BLI_findstring(lb, block->name, offsetof(uiBlock, name)); if (oldblock) { oldblock->active= 0; oldblock->panel= NULL; } + + /* at the beginning of the list! for dynamical menus/blocks */ + BLI_addhead(lb, block); } block->oldblock= oldblock; - - /* at the beginning of the list! for dynamical menus/blocks */ - if(lb) - BLI_addhead(lb, block); } uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, short dt) diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 18f3b807f86..b5da36756b5 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1250,7 +1250,7 @@ static int select_similar_exec(bContext *C, wmOperator *op) return similar_face_select_exec(C, op); } -static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *obedit= CTX_data_edit_object(C); EnumPropertyItem *item= NULL; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index dfd1ac730ac..dc744c49fae 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -762,7 +762,7 @@ static EnumPropertyItem extrude_items[] = { {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *mesh_extrude_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *mesh_extrude_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { EnumPropertyItem *item= NULL; Object *obedit= CTX_data_edit_object(C); @@ -5263,7 +5263,7 @@ static int blend_from_shape_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *obedit= CTX_data_edit_object(C); Mesh *me= (obedit) ? obedit->data : NULL; @@ -5975,7 +5975,7 @@ static EnumPropertyItem merge_type_items[]= { {5, "COLLAPSE", 0, "Collapse", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *obedit= CTX_data_edit_object(C); EnumPropertyItem *item= NULL; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 91980ddf228..527b97a6082 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1873,7 +1873,7 @@ static void rand_timeoffs(Scene *scene, View3D *v3d) } -static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { EnumPropertyItem *input = object_mode_items; EnumPropertyItem *item= NULL; @@ -2119,7 +2119,7 @@ static EnumPropertyItem game_properties_copy_operations[] ={ static EnumPropertyItem gameprops_items[]= { {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *gameprops_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *gameprops_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *ob= ED_object_active_context(C); EnumPropertyItem tmp = {0, "", 0, "", ""}; diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 78937299645..2d547da41f6 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -563,7 +563,7 @@ static int object_hook_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *ob = CTX_data_edit_object(C); EnumPropertyItem tmp = {0, "", 0, "", ""}; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index d5bf894ac8c..5996037cd2d 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -584,7 +584,7 @@ static int modifier_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *ob= ED_object_active_context(C); EnumPropertyItem *item= NULL, *md_item; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 8078bfbeb93..f7158e4b4ec 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -360,7 +360,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) } /* Generic itemf's for operators that take library args */ -static EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { EnumPropertyItem item_tmp= {0}, *item= NULL; int totitem= 0; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 53562caf1b5..43448198ae1 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1966,7 +1966,7 @@ static int set_active_group_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; EnumPropertyItem tmp = {0, "", 0, "", ""}; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 14e9626212a..0380dba7592 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -288,6 +288,43 @@ static void make_vertexcol(Object *ob) /* single ob */ } +/* mirror_vgroup is set to -1 when invalid */ +static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror) +{ + bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef - 1); + + if(defgroup) { + bDeformGroup *curdef; + int mirrdef; + char name[MAXBONENAME]; + + flip_side_name(name, defgroup->name, FALSE); + + if(strcmp(name, defgroup->name) != 0) { + for (curdef= ob->defbase.first, mirrdef; curdef; curdef=curdef->next, mirrdef++) { + if (!strcmp(curdef->name, name)) { + break; + } + } + + if(curdef==NULL) { + int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */ + curdef= ED_vgroup_add_name(ob, name); + ob->actdef= olddef; + } + + /* curdef should never be NULL unless this is + * a lamp and ED_vgroup_add_name fails */ + if(curdef) { + *vgroup_mirror= mirrdef; + return; + } + } + } + + *vgroup_mirror= -1; +} + static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot) { if(vp->vpaint_prev) { @@ -383,32 +420,11 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) } vgroup= ob->actdef-1; - - /* directly copied from weight_paint, should probaby split into a separate function */ + /* if mirror painting, find the other group */ if(me->editflag & ME_EDIT_MIRROR_X) { - bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1); - if(defgroup) { - bDeformGroup *curdef; - int actdef= 0; - char name[32]; - - flip_side_name(name, defgroup->name, FALSE); - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++) - if (!strcmp(curdef->name, name)) - break; - if(curdef==NULL) { - int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */ - curdef= ED_vgroup_add_name (ob, name); - ob->actdef= olddef; - } - - if(curdef && curdef!=defgroup) - vgroup_mirror= actdef; - } + wpaint_mirror_vgroup_ensure(ob, &vgroup_mirror); } - /* end copy from weight_paint*/ copy_wpaint_prev(wp, me->dvert, me->totvert); @@ -942,7 +958,7 @@ void PAINT_OT_weight_sample(wmOperatorType *ot) } /* samples cursor location, and gives menu with vertex groups to activate */ -static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { if (C) { wmWindow *win= CTX_wm_window(C); @@ -1351,26 +1367,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED /* if mirror painting, find the other group */ if(me->editflag & ME_EDIT_MIRROR_X) { - bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1); - if(defgroup) { - bDeformGroup *curdef; - int actdef= 0; - char name[32]; - - flip_side_name(name, defgroup->name, FALSE); - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++) - if (!strcmp(curdef->name, name)) - break; - if(curdef==NULL) { - int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */ - curdef= ED_vgroup_add_name (ob, name); - ob->actdef= olddef; - } - - if(curdef && curdef!=defgroup) - wpd->vgroup_mirror= actdef; - } + wpaint_mirror_vgroup_ensure(ob, &wpd->vgroup_mirror); } return 1; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index ec0d9806bca..18270bfaa26 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -606,7 +606,7 @@ void ED_spacetype_file(void) void ED_file_init(void) { - char *cfgdir = BLI_get_folder(BLENDER_CONFIG, NULL); + char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); fsmenu_read_system(fsmenu_get()); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 9e2783113ef..67035247038 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -876,9 +876,6 @@ void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, Region float dx= 0.0f, dy= 0.0f; view3d_viewborder_size_get(scene, ar, size); - - if (rv3d == NULL) - rv3d = ar->regiondata; size[0]= size[0]*zoomfac; size[1]= size[1]*zoomfac; |