From bcf0c7143371deba9050eedd0f3474ae4fd91cc9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Dec 2018 00:57:47 +1100 Subject: Cleanup: remove non-existing function declarations --- source/blender/editors/object/object_intern.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index c750a3fb2bd..e4953202ee4 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -99,7 +99,6 @@ void OBJECT_OT_link_to_collection(struct wmOperatorType *ot); void OBJECT_OT_select_all(struct wmOperatorType *ot); void OBJECT_OT_select_random(struct wmOperatorType *ot); void OBJECT_OT_select_by_type(struct wmOperatorType *ot); -void OBJECT_OT_select_by_layer(struct wmOperatorType *ot); void OBJECT_OT_select_linked(struct wmOperatorType *ot); void OBJECT_OT_select_grouped(struct wmOperatorType *ot); void OBJECT_OT_select_mirror(struct wmOperatorType *ot); -- cgit v1.2.3 From 1a208f03260b8b11977b1b2d41ca550711c57257 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Jan 2019 17:03:45 +1100 Subject: Cleanup: indentation, naming Use rna naming conventions for unit-settings callbacks. --- source/blender/editors/object/object_relations.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 867b807c908..3dec9d945a1 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -385,8 +385,9 @@ static int make_proxy_exec(bContext *C, wmOperator *op) } /* Generic itemf's for operators that take library args */ -static const EnumPropertyItem *proxy_collection_object_itemf(bContext *C, PointerRNA *UNUSED(ptr), - PropertyRNA *UNUSED(prop), bool *r_free) +static const EnumPropertyItem *proxy_collection_object_itemf( + bContext *C, PointerRNA *UNUSED(ptr), + PropertyRNA *UNUSED(prop), bool *r_free) { EnumPropertyItem item_tmp = {0}, *item = NULL; int totitem = 0; -- cgit v1.2.3 From f15205b93f56e454b76d5a222fdb9a9665b99907 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 2 Jan 2019 11:26:31 +0100 Subject: Fix T60060: Corrective Smooth Modifier binding process is broken. Same as with the other modifiers' binding ops, those need to be performed outside of regular depsgraph eval. --- source/blender/editors/object/object_modifier.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 2be86773057..15aca6a3253 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1880,6 +1880,7 @@ static bool correctivesmooth_poll(bContext *C) static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) { + Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); Object *ob = ED_object_active_context(C); CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)edit_modifier_property_get(op, ob, eModifierType_CorrectiveSmooth); @@ -1906,9 +1907,16 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) else { /* signal to modifier to recalculate */ csmd->bind_coords_num = (unsigned int)-1; + + /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */ + const int mode = csmd->modifier.mode; + csmd->modifier.mode |= eModifierMode_Realtime; + object_force_modifier_update_for_bind(depsgraph, scene, ob); + csmd->modifier.mode = mode; } - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + /* We need ID_RECALC_COPY_ON_WRITE to ensure (un)binding is flushed to CoW copies of the object... */ + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; -- cgit v1.2.3 From 65b4ebbbd5c497f732fab94bc4389533be22d4e3 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 2 Jan 2019 15:37:15 +0100 Subject: Fix T60056: Make Duplicates Real with Keep Hierarchy does nothing Caused by rB36ca072375deea4803df4681716c1d3224095e07 [one instance of `DEG_get_original_object` was neccesary, the other one breaks getting the parent in `BLI_ghash_lookup`] Reviewed by: brecht Differential Revision: https://developer.blender.org/D4154 --- source/blender/editors/object/object_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index c481a62acb7..316d581870d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1609,7 +1609,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, } for (dob = lb_duplis->first; dob; dob = dob->next) { - Object *ob_src = DEG_get_original_object(dob->ob); + Object *ob_src = dob->ob; Object *ob_dst = BLI_ghash_lookup(dupli_gh, dob); /* Remap new object to itself, and clear again newid pointer of orig object. */ -- cgit v1.2.3 From a30bdcc142f1241a302107c637fd47be06073d76 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Thu, 3 Jan 2019 18:10:39 +0100 Subject: Fix T60022: Crash when adding grease pencil object to a collection disabled in viewport. See D4163 Thanks to Habib Gahbiche (@zazizizou) for the fix. --- source/blender/editors/object/object_add.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 316d581870d..6be1afdcb2a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1030,7 +1030,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) mul_v3_fl(mat[1], radius); mul_v3_fl(mat[2], radius); - ED_gpencil_create_stroke(C, mat); + ED_gpencil_create_stroke(C, ob, mat); break; } case GP_MONKEY: @@ -1043,7 +1043,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) mul_v3_fl(mat[1], radius); mul_v3_fl(mat[2], radius); - ED_gpencil_create_monkey(C, mat); + ED_gpencil_create_monkey(C, ob, mat); break; } case GP_EMPTY: @@ -1057,7 +1057,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) /* if this is a new object, initialise default stuff (colors, etc.) */ if (newob) { - ED_gpencil_add_defaults(C); + ED_gpencil_add_defaults(C, ob); } return OPERATOR_FINISHED; -- cgit v1.2.3 From 2c21e3e35f304afdc1a320fb8ccef91e0119dfc8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 4 Jan 2019 14:28:47 +0100 Subject: Fix T60132: Convert hair particles to mesh Needed to port operator to use evaluated particle system. But also changed interface to always show Convert button when draw type is set to Path (Hair particle system is forced to be draws as path). This avoid rather expensive lookup on every redraw, but will show Convert button for un-baked particle emitter. Probably, an acceptable compromise. --- source/blender/editors/object/object_modifier.c | 32 +++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 15aca6a3253..79dffa17c7a 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -432,10 +432,12 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData * return 1; } -int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *scene, ViewLayer *view_layer, Object *ob, ModifierData *md) +int ED_object_modifier_convert(ReportList *UNUSED(reports), + Main *bmain, Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, + Object *ob, ModifierData *md) { Object *obn; - ParticleSystem *psys; + ParticleSystem *psys_orig, *psys_eval; ParticleCacheKey *key, **cache; ParticleSettings *part; Mesh *me; @@ -448,20 +450,25 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * if (md->type != eModifierType_ParticleSystem) return 0; if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) return 0; - psys = ((ParticleSystemModifierData *)md)->psys; - part = psys->part; + psys_orig = ((ParticleSystemModifierData *)md)->psys; + part = psys_orig->part; - if (part->ren_as != PART_DRAW_PATH || psys->pathcache == NULL) + if (part->ren_as != PART_DRAW_PATH) { return 0; + } + psys_eval = psys_eval_get(depsgraph, ob, psys_orig); + if (psys_eval->pathcache == NULL) { + return 0; + } - totpart = psys->totcached; - totchild = psys->totchildcache; + totpart = psys_eval->totcached; + totchild = psys_eval->totchildcache; if (totchild && (part->draw & PART_DRAW_PARENT) == 0) totpart = 0; /* count */ - cache = psys->pathcache; + cache = psys_eval->pathcache; for (a = 0; a < totpart; a++) { key = cache[a]; @@ -471,7 +478,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * } } - cache = psys->childcache; + cache = psys_eval->childcache; for (a = 0; a < totchild; a++) { key = cache[a]; @@ -498,7 +505,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * medge = me->medge; /* copy coordinates */ - cache = psys->pathcache; + cache = psys_eval->pathcache; for (a = 0; a < totpart; a++) { key = cache[a]; kmax = key->segments; @@ -517,7 +524,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * } } - cache = psys->childcache; + cache = psys_eval->childcache; for (a = 0; a < totchild; a++) { key = cache[a]; kmax = key->segments; @@ -1086,12 +1093,13 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot) static int modifier_convert_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob = ED_object_active_context(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); - if (!md || !ED_object_modifier_convert(op->reports, bmain, scene, view_layer, ob, md)) + if (!md || !ED_object_modifier_convert(op->reports, bmain, depsgraph, scene, view_layer, ob, md)) return OPERATOR_CANCELLED; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); -- cgit v1.2.3 From ae2af4692009fe2c3fc97783f6d69aaa7cac5123 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 8 Jan 2019 18:19:12 +0100 Subject: Fix inconsistent naming and behavior for base visible/selected/editable. Fixes T60251. --- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/object/object_relations.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 59ce42c50a5..0da8d6804e5 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -920,7 +920,7 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D * for (base = FIRSTBASE(view_layer); base; base = base->next) { if (base != BASACT(view_layer)) { - if (TESTBASELIB(v3d, base)) { + if (BASE_SELECTED_EDITABLE(v3d, base)) { DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY); if (event == 1) { /* loc */ diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 3dec9d945a1..4a306a6c4e3 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1337,7 +1337,7 @@ static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr)) if (sce->id.lib) return; for (base = FIRSTBASE; base; base = base->next) { - if (TESTBASE(v3d, base)) { + if (BASE_SELECTED(v3d, base)) { nbase = MEM_mallocN(sizeof(Base), "newbase"); *nbase = *base; BLI_addhead(&(sce->base), nbase); -- cgit v1.2.3 From 002d0bd344739f6beb76b5f3073def0866d5ad56 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 10 Jan 2019 12:52:20 +1100 Subject: Cleanup: remove unused copy menu code Unused since 2.4x. --- source/blender/editors/object/object_edit.c | 326 ---------------------------- 1 file changed, 326 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 0da8d6804e5..25e3fa848d6 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -125,7 +125,6 @@ static void move_to_collection_menus_items(struct uiLayout *layout, struct MoveT /* ************* XXX **************** */ static void error(const char *UNUSED(arg)) {} static void waitcursor(int UNUSED(val)) {} -static int pupmenu(const char *UNUSED(msg)) { return 0; } /* port over here */ static void error_libdata(void) {} @@ -845,331 +844,6 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* both pointers should exist */ -static void copy_texture_space(Object *to, Object *ob) -{ - float *poin1 = NULL, *poin2 = NULL; - short texflag = 0; - - if (ob->type == OB_MESH) { - texflag = ((Mesh *)ob->data)->texflag; - poin2 = ((Mesh *)ob->data)->loc; - } - else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - texflag = ((Curve *)ob->data)->texflag; - poin2 = ((Curve *)ob->data)->loc; - } - else if (ob->type == OB_MBALL) { - texflag = ((MetaBall *)ob->data)->texflag; - poin2 = ((MetaBall *)ob->data)->loc; - } - else - return; - - if (to->type == OB_MESH) { - ((Mesh *)to->data)->texflag = texflag; - poin1 = ((Mesh *)to->data)->loc; - } - else if (ELEM(to->type, OB_CURVE, OB_SURF, OB_FONT)) { - ((Curve *)to->data)->texflag = texflag; - poin1 = ((Curve *)to->data)->loc; - } - else if (to->type == OB_MBALL) { - ((MetaBall *)to->data)->texflag = texflag; - poin1 = ((MetaBall *)to->data)->loc; - } - else - return; - - memcpy(poin1, poin2, 9 * sizeof(float)); /* this was noted in DNA_mesh, curve, mball */ - - if (to->type == OB_MESH) { - /* pass */ - } - else if (to->type == OB_MBALL) { - BKE_mball_texspace_calc(to); - } - else { - BKE_curve_texspace_calc(to->data); - } - -} - -/* UNUSED, keep in case we want to copy functionality for use elsewhere */ -static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, short event) -{ - Object *ob; - Base *base; - Curve *cu, *cu1; - Nurb *nu; - - if (ID_IS_LINKED(scene)) return; - - if (!(ob = OBACT(view_layer))) return; - - if (BKE_object_is_in_editmode(ob)) { - /* obedit_copymenu(); */ - return; - } - - if (event == 24) { - /* moved to BKE_object_link_modifiers */ - /* copymenu_modifiers(bmain, scene, v3d, ob); */ - return; - } - - for (base = FIRSTBASE(view_layer); base; base = base->next) { - if (base != BASACT(view_layer)) { - if (BASE_SELECTED_EDITABLE(v3d, base)) { - DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY); - - if (event == 1) { /* loc */ - copy_v3_v3(base->object->loc, ob->loc); - copy_v3_v3(base->object->dloc, ob->dloc); - } - else if (event == 2) { /* rot */ - copy_v3_v3(base->object->rot, ob->rot); - copy_v3_v3(base->object->drot, ob->drot); - - copy_qt_qt(base->object->quat, ob->quat); - copy_qt_qt(base->object->dquat, ob->dquat); - } - else if (event == 3) { /* size */ - copy_v3_v3(base->object->size, ob->size); - copy_v3_v3(base->object->dscale, ob->dscale); - } - else if (event == 4) { /* drawtype */ - base->object->dt = ob->dt; - base->object->dtx = ob->dtx; - base->object->empty_drawtype = ob->empty_drawtype; - base->object->empty_drawsize = ob->empty_drawsize; - } - else if (event == 5) { /* time offs */ - base->object->sf = ob->sf; - } - else if (event == 6) { /* dupli */ - base->object->dupon = ob->dupon; - base->object->dupoff = ob->dupoff; - base->object->dupsta = ob->dupsta; - base->object->dupend = ob->dupend; - - base->object->transflag &= ~OB_DUPLI; - base->object->transflag |= (ob->transflag & OB_DUPLI); - - base->object->dup_group = ob->dup_group; - if (ob->dup_group) - id_us_plus(&ob->dup_group->id); - } - else if (event == 17) { /* tex space */ - copy_texture_space(base->object, ob); - } - else if (event == 18) { /* font settings */ - - if (base->object->type == ob->type) { - cu = ob->data; - cu1 = base->object->data; - - cu1->spacemode = cu->spacemode; - cu1->align_y = cu->align_y; - cu1->spacing = cu->spacing; - cu1->linedist = cu->linedist; - cu1->shear = cu->shear; - cu1->fsize = cu->fsize; - cu1->xof = cu->xof; - cu1->yof = cu->yof; - cu1->textoncurve = cu->textoncurve; - cu1->wordspace = cu->wordspace; - cu1->ulpos = cu->ulpos; - cu1->ulheight = cu->ulheight; - if (cu1->vfont) - id_us_min(&cu1->vfont->id); - cu1->vfont = cu->vfont; - id_us_plus((ID *)cu1->vfont); - if (cu1->vfontb) - id_us_min(&cu1->vfontb->id); - cu1->vfontb = cu->vfontb; - id_us_plus((ID *)cu1->vfontb); - if (cu1->vfonti) - id_us_min(&cu1->vfonti->id); - cu1->vfonti = cu->vfonti; - id_us_plus((ID *)cu1->vfonti); - if (cu1->vfontbi) - id_us_min(&cu1->vfontbi->id); - cu1->vfontbi = cu->vfontbi; - id_us_plus((ID *)cu1->vfontbi); - - BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family)); - - DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY); - } - } - else if (event == 19) { /* bevel settings */ - - if (ELEM(base->object->type, OB_CURVE, OB_FONT)) { - cu = ob->data; - cu1 = base->object->data; - - cu1->bevobj = cu->bevobj; - cu1->taperobj = cu->taperobj; - cu1->width = cu->width; - cu1->bevresol = cu->bevresol; - cu1->ext1 = cu->ext1; - cu1->ext2 = cu->ext2; - - DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY); - } - } - else if (event == 25) { /* curve resolution */ - - if (ELEM(base->object->type, OB_CURVE, OB_FONT)) { - cu = ob->data; - cu1 = base->object->data; - - cu1->resolu = cu->resolu; - cu1->resolu_ren = cu->resolu_ren; - - nu = cu1->nurb.first; - - while (nu) { - nu->resolu = cu1->resolu; - nu = nu->next; - } - - DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY); - } - } - else if (event == 21) { - if (base->object->type == OB_MESH) { - ModifierData *md = modifiers_findByType(ob, eModifierType_Subsurf); - - if (md) { - ModifierData *tmd = modifiers_findByType(base->object, eModifierType_Subsurf); - - if (!tmd) { - tmd = modifier_new(eModifierType_Subsurf); - BLI_addtail(&base->object->modifiers, tmd); - } - - modifier_copyData(md, tmd); - DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY); - } - } - } - else if (event == 22) { - /* Copy the constraint channels over */ - BKE_constraints_copy(&base->object->constraints, &ob->constraints, true); - DEG_id_tag_update(&base->object->id, ID_RECALC_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); - } - else if (event == 23) { - sbFree(base->object); - BKE_object_copy_softbody(base->object, ob, 0); - - if (!modifiers_findByType(base->object, eModifierType_Softbody)) { - BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody)); - } - - DEG_id_tag_update(&base->object->id, ID_RECALC_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); - } - else if (event == 26) { -#if 0 // XXX old animation system - BKE_nlastrip_copy(s(&base->object->nlastrips, &ob->nlastrips); -#endif // XXX old animation system - } - else if (event == 27) { /* autosmooth */ - if (base->object->type == OB_MESH) { - Mesh *me = ob->data; - Mesh *cme = base->object->data; - cme->smoothresh = me->smoothresh; - if (me->flag & ME_AUTOSMOOTH) - cme->flag |= ME_AUTOSMOOTH; - else - cme->flag &= ~ME_AUTOSMOOTH; - } - } - else if (event == 28) { /* UV orco */ - if (ELEM(base->object->type, OB_CURVE, OB_SURF)) { - cu = ob->data; - cu1 = base->object->data; - - if (cu->flag & CU_UV_ORCO) - cu1->flag |= CU_UV_ORCO; - else - cu1->flag &= ~CU_UV_ORCO; - } - } - else if (event == 29) { /* protected bits */ - base->object->protectflag = ob->protectflag; - } - else if (event == 30) { /* index object */ - base->object->index = ob->index; - } - else if (event == 31) { /* object color */ - copy_v4_v4(base->object->col, ob->col); - } - } - } - } -} - -static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *obedit) -{ - Object *ob; - short event; - char str[512]; - - if (!(ob = OBACT(view_layer))) return; - - if (obedit) { -/* if (ob->type == OB_MESH) */ -/* XXX mesh_copy_menu(); */ - return; - } - - /* Object Mode */ - - /* If you change this menu, don't forget to update the menu in header_view3d.c - * view3d_edit_object_copyattrmenu() and in toolbox.c - */ - - strcpy(str, - "Copy Attributes %t|Location %x1|Rotation %x2|Size %x3|Draw Options %x4|" - "Time Offset %x5|Dupli %x6|Object Color %x31|%l|Mass %x7|Damping %x8|All Physical Attributes %x11|Properties %x9|" - "Logic Bricks %x10|Protected Transform %x29|%l"); - - strcat(str, "|Object Constraints %x22"); - strcat(str, "|NLA Strips %x26"); - -/* XXX if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) { */ -/* strcat(str, "|Texture Space %x17"); */ -/* } */ - - if (ob->type == OB_FONT) strcat(str, "|Font Settings %x18|Bevel Settings %x19"); - if (ob->type == OB_CURVE) strcat(str, "|Bevel Settings %x19|UV Orco %x28"); - - if ((ob->type == OB_FONT) || (ob->type == OB_CURVE)) { - strcat(str, "|Curve Resolution %x25"); - } - - if (ob->type == OB_MESH) { - strcat(str, "|Subsurf Settings %x21|AutoSmooth %x27"); - } - - if (ob->soft) strcat(str, "|Soft Body Settings %x23"); - - strcat(str, "|Pass Index %x30"); - - if (ob->type == OB_MESH || ob->type == OB_CURVE || ob->type == OB_LATTICE || ob->type == OB_SURF) { - strcat(str, "|Modifiers ... %x24"); - } - - event = pupmenu(str); - if (event <= 0) return; - - copy_attr(bmain, scene, view_layer, v3d, event); -} - /* ******************* force field toggle operator ***************** */ void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object) -- cgit v1.2.3 From 11f9938eedc9efc42a6319fbc0f8583aac23d469 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 10 Jan 2019 13:02:07 +1100 Subject: Clenaup: remove unused EM_WAITCURSOR --- source/blender/editors/object/object_add.c | 4 ++-- source/blender/editors/object/object_edit.c | 18 ++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 6be1afdcb2a..f58fc013ea2 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -396,7 +396,7 @@ Object *ED_object_add_type( /* for as long scene has editmode... */ if (CTX_data_edit_object(C)) { - ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR); + ED_object_editmode_exit(C, EM_FREEDATA); } /* deselects all, sets active object */ @@ -2143,7 +2143,7 @@ static int convert_exec(bContext *C, wmOperator *op) } // XXX ED_object_editmode_enter(C, 0); -// XXX exit_editmode(C, EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */ +// XXX exit_editmode(C, EM_FREEDATA|); /* freedata, but no undo */ if (basact) { /* active base was changed */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 25e3fa848d6..09ea2188de7 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -124,7 +124,6 @@ static void move_to_collection_menus_items(struct uiLayout *layout, struct MoveT /* ************* XXX **************** */ static void error(const char *UNUSED(arg)) {} -static void waitcursor(int UNUSED(val)) {} /* port over here */ static void error_libdata(void) {} @@ -517,15 +516,12 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f { const bool freedata = (flag & EM_FREEDATA) != 0; - if (flag & EM_WAITCURSOR) waitcursor(1); - if (ED_object_editmode_load_ex(bmain, obedit, freedata) == false) { /* in rare cases (background mode) its possible active object * is flagged for editmode, without 'obedit' being set [#35489] */ if (UNLIKELY(obedit && obedit->mode & OB_MODE_EDIT)) { obedit->mode &= ~OB_MODE_EDIT; } - if (flag & EM_WAITCURSOR) waitcursor(0); return true; } @@ -552,8 +548,6 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f obedit->mode &= ~OB_MODE_EDIT; } - if (flag & EM_WAITCURSOR) waitcursor(0); - return (obedit->mode & OB_MODE_EDIT) == 0; } @@ -583,8 +577,6 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag return false; } - if (flag & EM_WAITCURSOR) waitcursor(1); - ob->restore_mode = ob->mode; ob->mode = OB_MODE_EDIT; @@ -649,8 +641,6 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag WM_main_add_notifier(NC_SCENE | ND_MODE | NS_MODE_OBJECT, scene); } - if (flag & EM_WAITCURSOR) waitcursor(0); - return (ob->mode & OB_MODE_EDIT) != 0; } @@ -691,24 +681,24 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op) } if (!is_mode_set) { - ED_object_editmode_enter(C, EM_WAITCURSOR); + ED_object_editmode_enter(C, 0); if (obact->mode & mode_flag) { FOREACH_SELECTED_OBJECT_BEGIN(view_layer, v3d, ob) { if ((ob != obact) && (ob->type == obact->type)) { - ED_object_editmode_enter_ex(bmain, scene, ob, EM_WAITCURSOR | EM_NO_CONTEXT); + ED_object_editmode_enter_ex(bmain, scene, ob, EM_NO_CONTEXT); } } FOREACH_SELECTED_OBJECT_END; } } else { - ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR); + ED_object_editmode_exit(C, EM_FREEDATA); if ((obact->mode & mode_flag) == 0) { FOREACH_OBJECT_BEGIN(view_layer, ob) { if ((ob != obact) && (ob->type == obact->type)) { - ED_object_editmode_exit_ex(bmain, scene, ob, EM_FREEDATA | EM_WAITCURSOR); + ED_object_editmode_exit_ex(bmain, scene, ob, EM_FREEDATA); } } FOREACH_OBJECT_END; -- cgit v1.2.3 From 6af97b84dfa286fc5c8efb2b0536ed1b87f591b0 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 14 Jan 2019 15:47:11 +0100 Subject: Cleanup: replace usages of deprecated BKE_libblock_free by BKE_id_free. --- source/blender/editors/object/object_bake_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 90b6be215d4..9239e1d1a6f 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -961,7 +961,7 @@ static int bake( RE_bake_pixels_populate(me_nores, pixel_array_low, num_pixels, &bake_images, uv_layer); RE_bake_normal_world_to_tangent(pixel_array_low, num_pixels, depth, result, me_nores, normal_swizzle, ob_low->obmat); - BKE_libblock_free(bmain, me_nores); + BKE_id_free(bmain, me_nores); if (md) md->mode = mode; @@ -1070,7 +1070,7 @@ cleanup: int i; for (i = 0; i < tot_highpoly; i++) { if (highpoly[i].me) - BKE_libblock_free(bmain, highpoly[i].me); + BKE_id_free(bmain, highpoly[i].me); } MEM_freeN(highpoly); } @@ -1094,10 +1094,10 @@ cleanup: MEM_freeN(result); if (me_low) - BKE_libblock_free(bmain, me_low); + BKE_id_free(bmain, me_low); if (me_cage) - BKE_libblock_free(bmain, me_cage); + BKE_id_free(bmain, me_cage); DEG_graph_free(depsgraph); -- cgit v1.2.3 From 01029c68d293593ccf5019793a5b577b3b522338 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 14 Jan 2019 21:24:25 +0100 Subject: Cleanup: rename BKE_libblock_delete to BKE_id_delete. --- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_collection.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index f58fc013ea2..7a2b1d8ada2 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1361,7 +1361,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) */ if (use_global && ob->id.lib == NULL) { /* We want to nuke the object, let's nuke it the easy way (not for linked data though)... */ - BKE_libblock_delete(bmain, &ob->id); + BKE_id_delete(bmain, &ob->id); changed_count += 1; continue; } diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 5e1773bf3c2..1a9b69b38ad 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -538,7 +538,7 @@ static int collection_unlink_exec(bContext *C, wmOperator *UNUSED(op)) if (!collection) return OPERATOR_CANCELLED; - BKE_libblock_delete(bmain, collection); + BKE_id_delete(bmain, collection); DEG_relations_tag_update(bmain); -- cgit v1.2.3 From b8e8c0e325d213f2dcf4adad5506989fa224716e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2019 23:24:20 +1100 Subject: Cleanup: comment line length (editors) Prevents clang-format wrapping text before comments. --- source/blender/editors/object/object_add.c | 8 ++++-- source/blender/editors/object/object_bake.c | 24 ++++++++++------ source/blender/editors/object/object_bake_api.c | 3 +- source/blender/editors/object/object_collection.c | 3 +- source/blender/editors/object/object_constraint.c | 9 ++++-- .../blender/editors/object/object_data_transfer.c | 3 +- source/blender/editors/object/object_edit.c | 8 ++++-- source/blender/editors/object/object_modifier.c | 9 ++++-- source/blender/editors/object/object_relations.c | 32 ++++++++++++++-------- source/blender/editors/object/object_select.c | 3 +- source/blender/editors/object/object_transform.c | 12 +++++--- source/blender/editors/object/object_vgroup.c | 16 +++++++---- 12 files changed, 86 insertions(+), 44 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 7a2b1d8ada2..918b3500a08 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1600,8 +1600,9 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, BLI_ghash_insert(dupli_gh, dob, ob_dst); if (parent_gh) { void **val; - /* Due to nature of hash/comparison of this ghash, a lot of duplis may be considered as 'the same', - * this avoids trying to insert same key several time and raise asserts in debug builds... */ + /* Due to nature of hash/comparison of this ghash, a lot of duplis may be considered as + * 'the same', this avoids trying to insert same key several time and + * raise asserts in debug builds... */ if (!BLI_ghash_ensure_p(parent_gh, dob, &val)) { *val = ob_dst; } @@ -1981,7 +1982,8 @@ static int convert_exec(bContext *C, wmOperator *op) * datablock, but for until we've got granular update * lets take care by selves. */ - /* XXX This may fail/crash, since BKE_vfont_to_curve() accesses evaluated data in some cases (bastien). */ + /* XXX This may fail/crash, since BKE_vfont_to_curve() + * accesses evaluated data in some cases (bastien). */ BKE_vfont_to_curve(newob, FO_EDIT); newob->type = OB_CURVE; diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 5a650d9dc05..b760514ef32 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -120,14 +120,22 @@ typedef struct MultiresBakerJobData { typedef struct { Scene *scene; ListBase data; - bool bake_clear; /* Clear the images before baking */ - int bake_filter; /* Bake-filter, aka margin */ - short mode; /* mode of baking (displacement, normals, AO) */ - bool use_lores_mesh; /* Use low-resolution mesh when baking displacement maps */ - int number_of_rays; /* Number of rays to be cast when doing AO baking */ - float bias; /* Bias between object and start ray point when doing AO baking */ - int threads; /* Number of threads to be used for baking */ - float user_scale; /* User scale used to scale displacement when baking derivative map. */ + /** Clear the images before baking */ + bool bake_clear; + /** Bake-filter, aka margin */ + int bake_filter; + /** mode of baking (displacement, normals, AO) */ + short mode; + /** Use low-resolution mesh when baking displacement maps */ + bool use_lores_mesh; + /** Number of rays to be cast when doing AO baking */ + int number_of_rays; + /** Bias between object and start ray point when doing AO baking */ + float bias; + /** Number of threads to be used for baking */ + int threads; + /** User scale used to scale displacement when baking derivative map. */ + float user_scale; } MultiresBakeJob; static bool multiresbake_check(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 9239e1d1a6f..fca3cc3e9f6 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -655,7 +655,8 @@ static int bake( const char *custom_cage, const char *filepath, const int width, const int height, const char *identifier, ScrArea *sa, const char *uv_layer) { - /* We build a depsgraph for the baking, so we don't need to change the original data to adjust visibility and modifiers. */ + /* We build a depsgraph for the baking, + * so we don't need to change the original data to adjust visibility and modifiers. */ Depsgraph *depsgraph = DEG_graph_new(scene, view_layer, DAG_EVAL_RENDER); DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer); diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 1a9b69b38ad..c9cdb77ca65 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -562,7 +562,8 @@ void OBJECT_OT_collection_unlink(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */ +/* Select objects in the same collection as the active */ +static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 93ff94edc75..5416079ddf7 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -105,7 +105,8 @@ ListBase *get_active_constraints(Object *ob) return NULL; } -/* Find the list that a given constraint belongs to, and/or also get the posechannel this is from (if applicable) */ +/* Find the list that a given constraint belongs to, + * and/or also get the posechannel this is from (if applicable) */ ListBase *get_constraint_lb(Object *ob, bConstraint *con, bPoseChannel **r_pchan) { if (r_pchan) @@ -1306,7 +1307,8 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_constraint_remove_ex(lb, ob, con, true)) { /* there's no active constraint now, so make sure this is the case */ BKE_constraints_active_set(&ob->constraints, NULL); - ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */ + /* needed to set the flags on posebones correctly */ + ED_object_constraint_update(bmain, ob); /* relatiols */ DEG_relations_tag_update(CTX_data_main(C)); @@ -1637,7 +1639,8 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob return false; /* restricted target-type constraints -------------- */ - /* NOTE: for these, we cannot try to add a target object if no valid ones are found, since that doesn't work */ + /* NOTE: for these, we cannot try to add a target object if no valid ones are found, + * since that doesn't work */ /* curve-based constraints - set the only_curve and only_ob flags */ case CONSTRAINT_TYPE_CLAMPTO: case CONSTRAINT_TYPE_FOLLOWPATH: diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index ad47e07b2e9..26ba9c31c22 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -71,7 +71,8 @@ static const EnumPropertyItem DT_layer_items[] = { #if 0 /* XXX For now, would like to finish/merge work from 2014 gsoc first. */ {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"}, #endif -#if 0 /* XXX When SkinModifier is enabled, it seems to erase its own CD_MVERT_SKIN layer from final DM :( */ +#if 0 /* XXX When SkinModifier is enabled, + * it seems to erase its own CD_MVERT_SKIN layer from final DM :( */ {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"}, #endif {DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"}, diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 09ea2188de7..b3d6b7acaa2 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -533,8 +533,10 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f /* flag object caches as outdated */ BKE_ptcache_ids_from_object(&pidlist, obedit, scene, 0); for (pid = pidlist.first; pid; pid = pid->next) { - if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */ + /* particles don't need reset on geometry change */ + if (pid->type != PTCACHE_TYPE_PARTICLES) { pid->cache->flag |= PTCACHE_OUTDATED; + } } BLI_freelistN(&pidlist); @@ -602,7 +604,9 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag ok = 1; ED_armature_to_edit(ob->data); /* to ensure all goes in restposition and without striding */ - DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); /* XXX: should this be ID_RECALC_GEOMETRY? */ + + /* XXX: should this be ID_RECALC_GEOMETRY? */ + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_ARMATURE, scene); } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 79dffa17c7a..02ee1f9c360 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1916,7 +1916,8 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) /* signal to modifier to recalculate */ csmd->bind_coords_num = (unsigned int)-1; - /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */ + /* Force modifier to run, it will call binding routine + * (this has to happen outside of depsgraph evaluation). */ const int mode = csmd->modifier.mode; csmd->modifier.mode |= eModifierMode_Realtime; object_force_modifier_update_for_bind(depsgraph, scene, ob); @@ -2303,7 +2304,8 @@ static int laplaciandeform_bind_exec(bContext *C, wmOperator *op) lmd->flag |= MOD_LAPLACIANDEFORM_BIND; } - /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */ + /* Force modifier to run, it will call binding routine + * (this has to happen outside of depsgraph evaluation). */ const int mode = lmd->modifier.mode; lmd->modifier.mode |= eModifierMode_Realtime; object_force_modifier_update_for_bind(depsgraph, scene, ob); @@ -2365,7 +2367,8 @@ static int surfacedeform_bind_exec(bContext *C, wmOperator *op) smd->flags |= MOD_SDEF_BIND; } - /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */ + /* Force modifier to run, it will call binding routine + * (this has to happen outside of depsgraph evaluation). */ const int mode = smd->modifier.mode; smd->modifier.mode |= eModifierMode_Realtime; object_force_modifier_update_for_bind(depsgraph, scene, ob); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 4a306a6c4e3..05d968660f2 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -505,7 +505,8 @@ void ED_object_parent_clear(Object *ob, const int type) switch (type) { case CLEAR_PARENT_ALL: { - /* for deformers, remove corresponding modifiers to prevent a large number of modifiers building up */ + /* for deformers, remove corresponding modifiers to prevent + * a large number of modifiers building up */ object_remove_parent_deform_modifiers(ob, ob->parent); /* clear parenting relationship completely */ @@ -514,14 +515,16 @@ void ED_object_parent_clear(Object *ob, const int type) } case CLEAR_PARENT_KEEP_TRANSFORM: { - /* remove parent, and apply the parented transform result as object's local transforms */ + /* remove parent, and apply the parented transform + * result as object's local transforms */ ob->parent = NULL; BKE_object_apply_mat4(ob, ob->obmat, true, false); break; } case CLEAR_PARENT_INVERSE: { - /* object stays parented, but the parent inverse (i.e. offset from parent to retain binding state) + /* object stays parented, but the parent inverse + * (i.e. offset from parent to retain binding state) * is cleared. In other words: nothing to do here! */ break; } @@ -632,7 +635,8 @@ bool ED_object_parent_set(ReportList *reports, const bContext *C, Scene *scene, if ((cu->flag & CU_PATH) == 0) { cu->flag |= CU_PATH | CU_FOLLOW; - BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); /* force creation of path data */ + /* force creation of path data */ + BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); } else { cu->flag |= CU_FOLLOW; @@ -1469,7 +1473,8 @@ static int make_links_data_exec(bContext *C, wmOperator *op) /* new approach, using functions from kernel */ for (a = 0; a < ob_src->totcol; a++) { Material *ma = give_current_material(ob_src, a + 1); - assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */ + /* also works with `ma == NULL` */ + assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); } DEG_id_tag_update(&ob_dst->id, ID_RECALC_GEOMETRY); break; @@ -1868,7 +1873,8 @@ static void single_mat_users(Main *bmain, Scene *scene, ViewLayer *view_layer, V for (a = 1; a <= ob->totcol; a++) { ma = give_current_material(ob, a); if (ma) { - /* do not test for LIB_TAG_NEW or use newid: this functions guaranteed delivers single_users! */ + /* do not test for LIB_TAG_NEW or use newid: + * this functions guaranteed delivers single_users! */ if (ma->id.us > 1) { man = BKE_material_copy(bmain, ma); @@ -2214,8 +2220,9 @@ static void make_override_static_tag_object(Object *obact, Object *ob) return; } - /* Note: all this is very case-by-case bad handling, ultimately we'll want a real full 'automatic', generic - * handling of all this, will probably require adding some override-aware stuff to library_query code... */ + /* Note: all this is very case-by-case bad handling, ultimately we'll want a real full + * 'automatic', generic handling of all this, + * will probably require adding some override-aware stuff to library_query code... */ if (obact->type == OB_ARMATURE && ob->modifiers.first != NULL) { for (ModifierData *md = ob->modifiers.first; md != NULL; md = md->next) { @@ -2357,10 +2364,12 @@ static int make_override_static_exec(bContext *C, wmOperator *op) } FOREACH_COLLECTION_OBJECT_RECURSIVE_END; - /* obcollection is no more duplicollection-ing, it merely parents whole collection of overriding instantiated objects. */ + /* obcollection is no more duplicollection-ing, + * it merely parents whole collection of overriding instantiated objects. */ obcollection->dup_group = NULL; - /* Also, we'd likely want to lock by default things like transformations of implicitly overridden objects? */ + /* Also, we'd likely want to lock by default things like + * transformations of implicitly overridden objects? */ DEG_id_tag_update(&scene->id, 0); @@ -2380,7 +2389,8 @@ static int make_override_static_exec(bContext *C, wmOperator *op) success = BKE_override_static_create_from_tag(bmain); - /* Also, we'd likely want to lock by default things like transformations of implicitly overridden objects? */ + /* Also, we'd likely want to lock by default things like + * transformations of implicitly overridden objects? */ /* Cleanup. */ BKE_main_id_clear_newpoins(bmain); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 0b032a3111a..48b13698fa7 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -781,7 +781,8 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel #define COLLECTION_MENU_MAX 24 -static bool select_grouped_collection(bContext *C, Object *ob) /* Select objects in the same group as the active */ +/* Select objects in the same group as the active */ +static bool select_grouped_collection(bContext *C, Object *ob) { bool changed = false; Collection *collection, *ob_collections[COLLECTION_MENU_MAX]; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 1620d1f82f9..373b7a4a0aa 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -491,7 +491,8 @@ static int apply_objects_internal( bool has_unparented_layers = false; for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { - /* Parented layers aren't supported as we can't easily re-evaluate the scene to sample parent movement */ + /* Parented layers aren't supported as we can't easily re-evaluate + * the scene to sample parent movement */ if (gpl->parent == NULL) { has_unparented_layers = true; break; @@ -1122,7 +1123,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) float diff_mat[4][4]; float inverse_diff_mat[4][4]; - /* recalculate all strokes (all layers are considered without evaluating lock attributtes) */ + /* recalculate all strokes + * (all layers are considered without evaluating lock attributtes) */ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* calculate difference matrix */ ED_gpencil_parent_location(depsgraph, obact, gpd, gpl, diff_mat); @@ -1203,7 +1205,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) BKE_object_where_is_calc(depsgraph, scene, ob_other); if (ob_other->type == OB_ARMATURE) { - BKE_pose_where_is(depsgraph, scene, ob_other); /* needed for bone parents */ + /* needed for bone parents */ + BKE_pose_where_is(depsgraph, scene, ob_other); } ignore_parent_tx(C, bmain, scene, ob_other); } @@ -1651,7 +1654,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const copy_v3_v3(loc, location_world); madd_v3_v3fl(loc, target_normal, item->xform_dist); object_apply_location(item->ob, loc); - copy_v3_v3(item->ob->obmat[3], loc); /* so orient behaves as expected */ + /* so orient behaves as expected */ + copy_v3_v3(item->ob->obmat[3], loc); } object_orient_to_location(item->ob, item->rot_mat, item->rot_mat[2], location_world); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 036689509e9..31faa00db43 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -960,7 +960,9 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum) } void ED_vgroup_select_by_name(Object *ob, const char *name) -{ /* note: ob->actdef==0 signals on painting to create a new one, if a bone in posemode is selected */ +{ + /* note: ob->actdef==0 signals on painting to create a new one, + * if a bone in posemode is selected */ ob->actdef = defgroup_name_index(ob, name) + 1; } @@ -1946,20 +1948,22 @@ static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2) { /* qsort sorts in ascending order. We want descending order to save a memcopy * so this compare function is inverted from the standard greater than comparison qsort needs. - * A normal compare function is called with two pointer arguments and should return an integer less than, equal to, - * or greater than zero corresponding to whether its first argument is considered less than, equal to, - * or greater than its second argument. This does the opposite. */ + * A normal compare function is called with two pointer arguments and should return an integer + * less than, equal to, or greater than zero corresponding to whether its first argument is + * considered less than, equal to, or greater than its second argument. + * This does the opposite. */ const struct MDeformWeight *dw1 = a1, *dw2 = a2; if (dw1->weight < dw2->weight) return 1; else if (dw1->weight > dw2->weight) return -1; - else if (&dw1 < &dw2) return 1; /* compare addresses so we have a stable sort algorithm */ + else if (&dw1 < &dw2) return 1; /* compare address for stable sort algorithm */ else return -1; } /* Used for limiting the number of influencing bones per vertex when exporting * skinned meshes. if all_deform_weights is True, limit all deform modifiers - * to max_weights regardless of type, otherwise, only limit the number of influencing bones per vertex*/ + * to max_weights regardless of type, otherwise, + * only limit the number of influencing bones per vertex. */ static int vgroup_limit_total_subset( Object *ob, const bool *vgroup_validmap, -- cgit v1.2.3 From 88a80fcec8672b5bb67041456dc7f7101aae3d55 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2019 23:57:49 +1100 Subject: Cleanup: commas at the end of enums Without this clang-format may wrap them onto a single line. --- source/blender/editors/object/object_bake.c | 2 +- source/blender/editors/object/object_vgroup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index b760514ef32..a9efef2ab53 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -285,7 +285,7 @@ static DerivedMesh *multiresbake_create_hiresdm(Scene *scene, Object *ob, int *l typedef enum ClearFlag { CLEAR_TANGENT_NORMAL = 1, - CLEAR_DISPLACEMENT = 2 + CLEAR_DISPLACEMENT = 2, } ClearFlag; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 31faa00db43..1e0fe094e2e 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -3630,7 +3630,7 @@ static void vgroup_sort_bone_hierarchy(Object *ob, ListBase *bonebase) enum { SORT_TYPE_NAME = 0, - SORT_TYPE_BONEHIERARCHY = 1 + SORT_TYPE_BONEHIERARCHY = 1, }; static int vertex_group_sort_exec(bContext *C, wmOperator *op) -- cgit v1.2.3 From e4c78436c6a3bef0d30ff656a4758295f58b5ae4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 15 Jan 2019 16:53:35 +0100 Subject: Fix T60246: crash with Cycles baking while in edit mode. --- source/blender/editors/object/object_bake_api.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index fca3cc3e9f6..81715890f0a 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -635,9 +635,15 @@ static size_t initialize_internal_images(BakeImages *bake_images, ReportList *re /* create new mesh with edit mode changes and modifiers applied */ static Mesh *bake_mesh_new_from_object(Depsgraph *depsgraph, Main *bmain, Scene *scene, Object *ob) { - ED_object_editmode_load(bmain, ob); + bool apply_modifiers = false; - Mesh *me = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob, 1, 0); + /* Mesh is already updated and has modifiers applied. */ + if (ob->type != OB_MESH) { + ED_object_editmode_load(bmain, ob); + apply_modifiers = true; + } + + Mesh *me = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob, apply_modifiers, 0); if (me->flag & ME_AUTOSMOOTH) { BKE_mesh_split_faces(me, true); } -- cgit v1.2.3 From 735653cda86c88c4768bf0456afd8112044704fd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 16 Jan 2019 18:32:09 +1100 Subject: Fix T52354: Origin to Geometry uses Bounds w/ Median Center is set --- source/blender/editors/object/object_transform.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 373b7a4a0aa..57a04cbd0f3 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -813,7 +813,6 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Object *tob; float cursor[3], cent[3], cent_neg[3], centn[3]; int centermode = RNA_enum_get(op->ptr, "type"); - int around = RNA_enum_get(op->ptr, "center"); /* initialized from v3d->around */ ListBase ctx_data_list; CollectionPointerLink *ctx_ob; @@ -826,12 +825,22 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in edit mode"); return OPERATOR_CANCELLED; } - else { - /* get the view settings if 'around' isn't set and the view is available */ - View3D *v3d = CTX_wm_view3d(C); - copy_v3_v3(cursor, scene->cursor.location); - if (v3d && !RNA_struct_property_is_set(op->ptr, "center")) - around = scene->toolsettings->transform_pivot_point; + + int around; + { + PropertyRNA *prop_center = RNA_struct_find_property(op->ptr, "center"); + if (RNA_property_is_set(op->ptr, prop_center)) { + around = RNA_property_enum_get(op->ptr, prop_center); + } + else { + if (scene->toolsettings->transform_pivot_point == V3D_AROUND_CENTER_BOUNDS) { + around = V3D_AROUND_CENTER_BOUNDS; + } + else { + around = V3D_AROUND_CENTER_MEDIAN; + } + RNA_property_enum_set(op->ptr, prop_center, around); + } } zero_v3(cent); -- cgit v1.2.3 From 45042f6a035dd8f2c21512af567a10db0b052a3c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 16 Jan 2019 19:57:58 +1100 Subject: Fix uninitialized cursor w/ setting object origin --- source/blender/editors/object/object_transform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 57a04cbd0f3..a30bc60eba6 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -811,7 +811,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); Depsgraph *depsgraph = CTX_data_depsgraph(C); Object *tob; - float cursor[3], cent[3], cent_neg[3], centn[3]; + float cent[3], cent_neg[3], centn[3]; + const float *cursor = scene->cursor.location; int centermode = RNA_enum_get(op->ptr, "type"); ListBase ctx_data_list; -- cgit v1.2.3 From c9938ebb0064675a17c92e8112fc4d416bba5f7c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 15 Jan 2019 13:03:09 +0100 Subject: Fix T60615: Cycles baking not working with some modifiers. Refactors Cycles mesh export a bit to avoid unnecessary copies and to be in sync with the Blender baker. --- source/blender/editors/object/object_bake_api.c | 41 ++++++++++++------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 81715890f0a..5f403dad54a 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -635,15 +635,9 @@ static size_t initialize_internal_images(BakeImages *bake_images, ReportList *re /* create new mesh with edit mode changes and modifiers applied */ static Mesh *bake_mesh_new_from_object(Depsgraph *depsgraph, Main *bmain, Scene *scene, Object *ob) { - bool apply_modifiers = false; + bool apply_modifiers = (ob->type != OB_MESH); + Mesh *me = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob, apply_modifiers, false); - /* Mesh is already updated and has modifiers applied. */ - if (ob->type != OB_MESH) { - ED_object_editmode_load(bmain, ob); - apply_modifiers = true; - } - - Mesh *me = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob, apply_modifiers, 0); if (me->flag & ME_AUTOSMOOTH) { BKE_mesh_split_faces(me, true); } @@ -812,7 +806,7 @@ static int bake( ob_low_eval = DEG_get_evaluated_object(depsgraph, ob_low); /* get the mesh as it arrives in the renderer */ - me_low = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_low); + me_low = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_low_eval); /* populate the pixel array with the face data */ if ((is_selected_to_active && (ob_cage == NULL) && is_cage) == false) @@ -825,7 +819,7 @@ static int bake( /* prepare cage mesh */ if (ob_cage) { - me_cage = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_cage); + me_cage = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_cage_eval); if ((me_low->totpoly != me_cage->totpoly) || (me_low->totloop != me_cage->totloop)) { BKE_report(reports, RPT_ERROR, "Invalid cage object, the cage mesh must have the same number " @@ -834,6 +828,8 @@ static int bake( } } else if (is_cage) { + BKE_object_eval_reset(ob_low_eval); + ModifierData *md = ob_low_eval->modifiers.first; while (md) { ModifierData *md_next = md->next; @@ -851,7 +847,6 @@ static int bake( md = md_next; } - BKE_object_eval_reset(ob_low_eval); me_cage = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_low_eval); RE_bake_pixels_populate(me_cage, pixel_array_low, num_pixels, &bake_images, uv_layer); } @@ -867,10 +862,10 @@ static int bake( /* initialize highpoly_data */ highpoly[i].ob = ob_iter; - highpoly[i].me = bake_mesh_new_from_object(depsgraph, bmain, scene, highpoly[i].ob); highpoly[i].ob_eval = DEG_get_evaluated_object(depsgraph, ob_iter); highpoly[i].ob_eval->restrictflag &= ~OB_RESTRICT_RENDER; highpoly[i].ob_eval->base_flag |= (BASE_VISIBLE | BASE_ENABLED_RENDER); + highpoly[i].me = bake_mesh_new_from_object(depsgraph, bmain, scene, highpoly[i].ob_eval); /* lowpoly to highpoly transformation matrix */ copy_m4_m4(highpoly[i].obmat, highpoly[i].ob->obmat); @@ -894,7 +889,7 @@ static int bake( /* populate the pixel arrays with the corresponding face data for each high poly object */ if (!RE_bake_pixels_populate_from_objects( me_low, pixel_array_low, pixel_array_high, highpoly, tot_highpoly, num_pixels, ob_cage != NULL, - cage_extrusion, ob_low->obmat, (ob_cage ? ob_cage->obmat : ob_low->obmat), me_cage)) + cage_extrusion, ob_low_eval->obmat, (ob_cage ? ob_cage->obmat : ob_low_eval->obmat), me_cage)) { BKE_report(reports, RPT_ERROR, "Error handling selected objects"); goto cleanup; @@ -912,10 +907,10 @@ static int bake( } else { /* If low poly is not renderable it should have failed long ago. */ - BLI_assert((ob_low->restrictflag & OB_RESTRICT_RENDER) == 0); + BLI_assert((ob_low_eval->restrictflag & OB_RESTRICT_RENDER) == 0); if (RE_bake_has_engine(re)) { - ok = RE_bake_engine(re, depsgraph, ob_low, 0, pixel_array_low, num_pixels, depth, pass_type, pass_filter, result); + ok = RE_bake_engine(re, depsgraph, ob_low_eval, 0, pixel_array_low, num_pixels, depth, pass_type, pass_filter, result); } else { BKE_report(reports, RPT_ERROR, "Current render engine does not support baking"); @@ -943,13 +938,13 @@ static int bake( } case R_BAKE_SPACE_OBJECT: { - RE_bake_normal_world_to_object(pixel_array_low, num_pixels, depth, result, ob_low, normal_swizzle); + RE_bake_normal_world_to_object(pixel_array_low, num_pixels, depth, result, ob_low_eval, normal_swizzle); break; } case R_BAKE_SPACE_TANGENT: { if (is_selected_to_active) { - RE_bake_normal_world_to_tangent(pixel_array_low, num_pixels, depth, result, me_low, normal_swizzle, ob_low->obmat); + RE_bake_normal_world_to_tangent(pixel_array_low, num_pixels, depth, result, me_low, normal_swizzle, ob_low_eval->obmat); } else { /* from multiresolution */ @@ -957,17 +952,19 @@ static int bake( ModifierData *md = NULL; int mode; - md = modifiers_findByType(ob_low, eModifierType_Multires); + BKE_object_eval_reset(ob_low_eval); + md = modifiers_findByType(ob_low_eval, eModifierType_Multires); if (md) { mode = md->mode; md->mode &= ~eModifierMode_Render; } - me_nores = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_low); + /* Evaluate modifiers again. */ + me_nores = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob_low_eval, true, false); RE_bake_pixels_populate(me_nores, pixel_array_low, num_pixels, &bake_images, uv_layer); - RE_bake_normal_world_to_tangent(pixel_array_low, num_pixels, depth, result, me_nores, normal_swizzle, ob_low->obmat); + RE_bake_normal_world_to_tangent(pixel_array_low, num_pixels, depth, result, me_nores, normal_swizzle, ob_low_eval->obmat); BKE_id_free(bmain, me_nores); if (md) @@ -1029,8 +1026,8 @@ static int bake( BLI_path_suffix(name, FILE_MAX, bk_image->image->id.name + 2, "_"); } else { - if (ob_low->mat[i]) { - BLI_path_suffix(name, FILE_MAX, ob_low->mat[i]->id.name + 2, "_"); + if (ob_low_eval->mat[i]) { + BLI_path_suffix(name, FILE_MAX, ob_low_eval->mat[i]->id.name + 2, "_"); } else if (me_low->mat[i]) { BLI_path_suffix(name, FILE_MAX, me_low->mat[i]->id.name + 2, "_"); -- cgit v1.2.3 From 42ba2942355c9320d3173f4ea3e374a63f0f8e3a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 21 Jan 2019 10:35:55 +0100 Subject: Fix T55461: [Vertex Group] "Delete all unlocked groups" not working. --- source/blender/editors/object/object_vgroup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 1e0fe094e2e..9108de3612a 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2683,8 +2683,10 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) ot->flag = /*OPTYPE_REGISTER|*/ OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 0, "All", "Remove all vertex groups"); - RNA_def_boolean(ot->srna, "all_unlocked", 0, "All Unlocked", "Remove all unlocked vertex groups"); + PropertyRNA *prop = RNA_def_boolean(ot->srna, "all", 0, "All", "Remove all vertex groups"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); + prop = RNA_def_boolean(ot->srna, "all_unlocked", 0, "All Unlocked", "Remove all unlocked vertex groups"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); } static int vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op)) -- cgit v1.2.3 From 0c829e8240eebd7ce4ed9d61f8682c0d6bf534f4 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 21 Jan 2019 13:43:16 +0100 Subject: Fix T60709: Apply Object Transform does nothing by default --- source/blender/editors/object/object_transform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index a30bc60eba6..2c85963ff17 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -786,9 +786,9 @@ void OBJECT_OT_transform_apply(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "location", 0, "Location", ""); - RNA_def_boolean(ot->srna, "rotation", 0, "Rotation", ""); - RNA_def_boolean(ot->srna, "scale", 0, "Scale", ""); + RNA_def_boolean(ot->srna, "location", true, "Location", ""); + RNA_def_boolean(ot->srna, "rotation", true, "Rotation", ""); + RNA_def_boolean(ot->srna, "scale", true, "Scale", ""); RNA_def_boolean(ot->srna, "properties", true, "Apply Properties", "Modify properties such as curve vertex radius, font size and bone envelope"); } -- cgit v1.2.3 From 48149459e46fb45b51680e937962b28045623932 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Mon, 21 Jan 2019 18:29:02 +0100 Subject: Fix T60714: Avoid creation of nested objects In grease pencil is not logic add an object inside other object in edit mode. The object must be created only in Object mode. --- source/blender/editors/object/object_add.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 918b3500a08..56697f41ec0 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -967,6 +967,23 @@ void OBJECT_OT_drop_named_image(wmOperatorType *ot) } /********************* Add Gpencil Operator ********************/ +bool object_gpencil_add_poll(bContext *C) +{ + Scene *scene = CTX_data_scene(C); + Object *obact = CTX_data_active_object(C); + + if ((scene == NULL) || (ID_IS_LINKED(scene))) { + return false; + } + + if (obact && obact->type == OB_GPENCIL) { + if (obact->mode != OB_MODE_OBJECT) { + return false; + } + } + + return true; +} static int object_gpencil_add_exec(bContext *C, wmOperator *op) { @@ -1073,7 +1090,7 @@ void OBJECT_OT_gpencil_add(wmOperatorType *ot) /* api callbacks */ ot->invoke = WM_menu_invoke; ot->exec = object_gpencil_add_exec; - ot->poll = ED_operator_scene_editable; + ot->poll = object_gpencil_add_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -- cgit v1.2.3 From a712fbda6a174a955f32999e28346abb122e3de7 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Mon, 21 Jan 2019 18:30:15 +0100 Subject: GP: Cleanup previous commit --- source/blender/editors/object/object_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 56697f41ec0..da911687f3e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -967,7 +967,7 @@ void OBJECT_OT_drop_named_image(wmOperatorType *ot) } /********************* Add Gpencil Operator ********************/ -bool object_gpencil_add_poll(bContext *C) +static bool object_gpencil_add_poll(bContext *C) { Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); -- cgit v1.2.3 From ac5278b682cfb090aafe93082e95349cb7d993d3 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 23 Jan 2019 15:20:35 +0100 Subject: Fix T60791: Don't show automatic weights option when not supported There are probably many more cases in which the menu looks a little different. However, I don't know them all and it's too easy to break something accidentally here. Maybe a user could try the different combinations of object types and check if there are entries that should not be there. Reviewers: brecht Differential Revision: https://developer.blender.org/D4240 --- source/blender/editors/object/object_relations.c | 34 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 05d968660f2..80ae81ba737 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -920,7 +920,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { - Object *ob = ED_object_active_context(C); + Object *parent = ED_object_active_context(C); uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Set Parent To"), ICON_NONE); uiLayout *layout = UI_popup_menu_layout(pup); @@ -940,26 +940,46 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent RNA_enum_set(&opptr, "type", PAR_OBJECT); RNA_boolean_set(&opptr, "keep_transform", true); #endif - /* ob becomes parent, make the associated menus */ - if (ob->type == OB_ARMATURE) { + + struct { + bool mesh, gpencil; + } has_children_of_type = { 0 }; + + CTX_DATA_BEGIN (C, Object *, child, selected_editable_objects) + { + if (child == parent) { + continue; + } + if (child->type == OB_MESH) { + has_children_of_type.mesh = true; + } + if (child->type == OB_GPENCIL) { + has_children_of_type.gpencil = true; + } + } + CTX_DATA_END; + + if (parent->type == OB_ARMATURE) { uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE); uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_NAME); uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_ENVELOPE); - uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_AUTO); + if (has_children_of_type.mesh || has_children_of_type.gpencil) { + uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_AUTO); + } uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE); uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE_RELATIVE); } - else if (ob->type == OB_CURVE) { + else if (parent->type == OB_CURVE) { uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_CURVE); uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_FOLLOW); uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_PATH_CONST); } - else if (ob->type == OB_LATTICE) { + else if (parent->type == OB_LATTICE) { uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_LATTICE); } /* vertex parenting */ - if (OB_TYPE_SUPPORT_PARVERT(ob->type)) { + if (OB_TYPE_SUPPORT_PARVERT(parent->type)) { uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_VERTEX); uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_VERTEX_TRI); } -- cgit v1.2.3 From 2218bf02dd4f4f83a5eabbc34103a1c301bcbe7b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 Jan 2019 08:30:33 +1100 Subject: Cleanup: sort cmake file lists --- source/blender/editors/object/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index db8997c5e0a..f379417c5c7 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -50,23 +50,23 @@ set(SRC object_bake_api.c object_collection.c object_constraint.c + object_data_transfer.c object_edit.c object_facemap_ops.c + object_gpencil_modifier.c object_hook.c object_modes.c object_modifier.c - object_gpencil_modifier.c - object_shader_fx.c object_ops.c object_random.c object_relations.c object_select.c + object_shader_fx.c object_shapekey.c - object_data_transfer.c object_transform.c object_utils.c - object_warp.c object_vgroup.c + object_warp.c object_intern.h ) -- cgit v1.2.3 From 1e4aab36c237b751c23be161217d989472bfaf20 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 Jan 2019 20:41:52 +1100 Subject: Cleanup: remove redundant BKE/BLI/BIF headers --- source/blender/editors/object/object_add.c | 1 - source/blender/editors/object/object_bake.c | 3 --- source/blender/editors/object/object_bake_api.c | 2 -- source/blender/editors/object/object_collection.c | 1 - source/blender/editors/object/object_constraint.c | 1 - source/blender/editors/object/object_edit.c | 3 --- source/blender/editors/object/object_facemap_ops.c | 2 -- source/blender/editors/object/object_gpencil_modifier.c | 2 -- source/blender/editors/object/object_relations.c | 1 - source/blender/editors/object/object_shader_fx.c | 2 -- source/blender/editors/object/object_vgroup.c | 1 - 11 files changed, 19 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index da911687f3e..462059262dd 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -90,7 +90,6 @@ #include "BKE_particle.h" #include "BKE_report.h" #include "BKE_scene.h" -#include "BKE_screen.h" #include "BKE_speaker.h" #include "DEG_depsgraph.h" diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index a9efef2ab53..940c558c4d5 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -43,15 +43,12 @@ #include "DNA_meshdata_types.h" #include "BLI_blenlib.h" -#include "BLI_threads.h" #include "BLI_utildefines.h" #include "BKE_blender.h" -#include "BKE_screen.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_image.h" -#include "BKE_main.h" #include "BKE_material.h" #include "BKE_multires.h" #include "BKE_report.h" diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 5f403dad54a..da2c25db385 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -41,9 +41,7 @@ #include "RNA_enum_types.h" #include "BLI_listbase.h" -#include "BLI_string.h" #include "BLI_fileops.h" -#include "BLI_math_geom.h" #include "BLI_path_util.h" #include "BKE_context.h" diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index c9cdb77ca65..0761b7e4f4c 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -42,7 +42,6 @@ #include "BKE_collection.h" #include "BKE_context.h" #include "BKE_library.h" -#include "BKE_library_remap.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_report.h" diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 5416079ddf7..e362eb535b8 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -54,7 +54,6 @@ #include "BKE_constraint.h" #include "BKE_context.h" #include "BKE_fcurve.h" -#include "BKE_global.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_report.h" diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index b3d6b7acaa2..f55bccdeb25 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -38,10 +38,8 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" -#include "BLI_math.h" #include "BLI_utildefines.h" #include "BLI_ghash.h" -#include "BLI_string_utils.h" #include "BLT_translation.h" @@ -73,7 +71,6 @@ #include "BKE_image.h" #include "BKE_lattice.h" #include "BKE_layer.h" -#include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_mball.h" diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index a111a73a42c..545082f82f0 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -33,8 +33,6 @@ #include "MEM_guardedalloc.h" #include "BLI_utildefines.h" -#include "BLI_path_util.h" -#include "BLI_string.h" #include "BLI_listbase.h" #include "DNA_object_types.h" diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index 1523cafa928..e5f118bfba5 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -39,9 +39,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "BLI_math.h" #include "BLI_listbase.h" -#include "BLI_string.h" #include "BLI_string_utf8.h" #include "BLI_utildefines.h" diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 80ae81ba737..c3d194e176f 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -70,7 +70,6 @@ #include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_editmesh.h" -#include "BKE_global.h" #include "BKE_gpencil.h" #include "BKE_fcurve.h" #include "BKE_idprop.h" diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index a7505c4b2cc..f8a33577f5d 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -39,9 +39,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "BLI_math.h" #include "BLI_listbase.h" -#include "BLI_string.h" #include "BLI_string_utf8.h" #include "BLI_utildefines.h" diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 9108de3612a..624788c8123 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -50,7 +50,6 @@ #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_utildefines.h" -#include "BLI_linklist_stack.h" #include "BLI_utildefines_stack.h" -- cgit v1.2.3 From f20dbc293fc9041a487544652f2d3baf1a4452c8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 Jan 2019 21:43:24 +1100 Subject: Cleanup: blank lines over doxy headers --- source/blender/editors/object/object_transform.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 2c85963ff17..17011c6f28f 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1291,7 +1291,6 @@ void OBJECT_OT_origin_set(wmOperatorType *ot) } /* -------------------------------------------------------------------- */ - /** \name Transform Axis Target * * Note this is an experemental operator to point lamps/cameras at objects. -- cgit v1.2.3 From 25772c9e1d2d5239e1f7f83f6ea0c4d7d1f1df4a Mon Sep 17 00:00:00 2001 From: Antonioya Date: Sat, 26 Jan 2019 16:19:03 +0100 Subject: Fix T59921: RuntimeError:bpy.ops.object.gpencil_modifier_apply() Thanks to Brecht for his help --- source/blender/editors/object/object_gpencil_modifier.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index e5f118bfba5..a4e2011097e 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -376,11 +376,6 @@ static int gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type); Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C); - if (!ptr.data) { - CTX_wm_operator_poll_msg_set(C, "Context missing 'modifier'"); - return 0; - } - if (!ob || ID_IS_LINKED(ob)) return 0; if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) return 0; if (ptr.id.data && ID_IS_LINKED(ptr.id.data)) return 0; -- cgit v1.2.3 From c0f88ed8a860026e32ec6a06287fcf9394b4cf0a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Jan 2019 21:08:24 +1100 Subject: Cleanup: sort forward declarations of enum & struct Done using: source/tools/utils_maintenance/c_sort_blocks.py --- source/blender/editors/object/object_intern.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index e4953202ee4..1ef0b0f268c 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -31,11 +31,11 @@ #ifndef __OBJECT_INTERN_H__ #define __OBJECT_INTERN_H__ -struct wmOperatorType; struct Object; -struct bContext; struct StructRNA; +struct bContext; struct wmOperator; +struct wmOperatorType; struct ModifierData; -- cgit v1.2.3 From 68cab3aff63aea95830aa082a160200768d0e826 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Jan 2019 07:46:25 +1100 Subject: Cleanup: replace attrib w/ attr Also rename GPUVertexAttribs to GPUVertAttrLayers, avoids confusion with GPUVertAttr which isn't closely related. --- source/blender/editors/object/object_transform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 17011c6f28f..7967e94963a 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1134,7 +1134,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) float inverse_diff_mat[4][4]; /* recalculate all strokes - * (all layers are considered without evaluating lock attributtes) */ + * (all layers are considered without evaluating lock attributes) */ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* calculate difference matrix */ ED_gpencil_parent_location(depsgraph, obact, gpd, gpl, diff_mat); -- cgit v1.2.3 From 93dc2d373fdd34ca64dff53b9d830052fb2aa749 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 30 Jan 2019 12:00:58 +0100 Subject: Fix (unreported) memleak when copying object and its material with GP settings. Like... seriously? --- source/blender/editors/object/object_add.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 462059262dd..25391251948 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2266,10 +2266,6 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer ID_NEW_REMAP_US(obn->mat[a]) else { obn->mat[a] = ID_NEW_SET(obn->mat[a], BKE_material_copy(bmain, obn->mat[a])); - /* duplicate grease pencil settings */ - if (ob->mat[a]->gp_style) { - obn->mat[a]->gp_style = MEM_dupallocN(ob->mat[a]->gp_style); - } } id_us_min(id); -- cgit v1.2.3 From 9407456e3f6991f5d703bd6b4e25b18b048d95a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Jan 2019 15:36:24 +1100 Subject: Cleanup: remove EM_IGNORE_LAYER Call ED_object_editmode_enter_ex instead. --- source/blender/editors/object/object_add.c | 5 +++-- source/blender/editors/object/object_edit.c | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 25391251948..fdbe324ab3d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -416,8 +416,9 @@ Object *ED_object_add_type( DEG_id_tag_update_ex(bmain, (ID *)ob->data, ID_RECALC_EDITORS); } - if (enter_editmode) - ED_object_editmode_enter(C, EM_IGNORE_LAYER); + if (enter_editmode) { + ED_object_editmode_enter_ex(bmain, scene, ob, 0); + } WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f55bccdeb25..b5d88b846de 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -652,12 +652,9 @@ bool ED_object_editmode_enter(bContext *C, int flag) ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob; - if ((flag & EM_IGNORE_LAYER) == 0) { - ob = CTX_data_active_object(C); /* active layer checked here for view3d */ - } - else { - ob = view_layer->basact->object; - } + /* Active layer checked here for view3d, + * callers that don't want view context can call the extended version. */ + ob = CTX_data_active_object(C); if ((ob == NULL) || ID_IS_LINKED(ob)) { return false; } -- cgit v1.2.3 From 293f4d88dac4919371e3e9c375f7c4cde803b078 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Jan 2019 15:54:37 +1100 Subject: Cleanup: style, unused variable --- source/blender/editors/object/object_edit.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index b5d88b846de..dff78d15692 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -649,7 +649,6 @@ bool ED_object_editmode_enter(bContext *C, int flag) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob; /* Active layer checked here for view3d, -- cgit v1.2.3 From 3e072da45bee1ac5368b83c84839d2ccdde6e514 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 31 Jan 2019 11:02:51 +0100 Subject: Fix T60432: Blender crashes when dragging objects from other scene from outliner. --- source/blender/editors/object/object_add.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index fdbe324ab3d..7f71596b3c4 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2240,8 +2240,11 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer LayerCollection *layer_collection = BKE_layer_collection_get_active(view_layer); BKE_collection_object_add(bmain, layer_collection->collection, obn); } + basen = BKE_view_layer_base_find(view_layer, obn); - basen->local_view_bits = base->local_view_bits; + if (base != NULL) { + basen->local_view_bits = base->local_view_bits; + } /* 1) duplis should end up in same collection as the original * 2) Rigid Body sim participants MUST always be part of a collection... -- cgit v1.2.3 From 7400aa7e595063510ce9f29fa1b02ebd3f9296e2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 28 Jan 2019 17:52:46 +0100 Subject: Depsgraph: remove features incompatible with new system. Some features are incompatible with multithreading and reliable evaluation of dependencies. We are now removing them as part of a bigger cleanup to fix bugs in keyframing and invalid animation evaluations. * Dupliframes have been removed. This was a hack added before there were more powerful features like the array modifier. * Slow parent has been removed, never worked in 2.8. It was always unreliable for use in production due to depending on whatever frame was previously evaluated, which was not always the previous frame. * Particle instanced objects used to have their transform evaluated at the particle time. Now it always gets the current time transform. * Boids can no longer do predictive avoidance of force field objects, but still for other particles. Differential Revision: https://developer.blender.org/D4274 --- source/blender/editors/object/object_intern.h | 2 - source/blender/editors/object/object_ops.c | 2 - source/blender/editors/object/object_relations.c | 77 ------------------------ 3 files changed, 81 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 1ef0b0f268c..3db9b748def 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -65,8 +65,6 @@ void OBJECT_OT_parent_clear(struct wmOperatorType *ot); void OBJECT_OT_vertex_parent_set(struct wmOperatorType *ot); void OBJECT_OT_track_set(struct wmOperatorType *ot); void OBJECT_OT_track_clear(struct wmOperatorType *ot); -void OBJECT_OT_slow_parent_set(struct wmOperatorType *ot); -void OBJECT_OT_slow_parent_clear(struct wmOperatorType *ot); void OBJECT_OT_make_local(struct wmOperatorType *ot); void OBJECT_OT_make_override_static(struct wmOperatorType *ot); void OBJECT_OT_make_single_user(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index eb9dd0bbe28..05bb6e06a85 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -87,8 +87,6 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_vertex_parent_set); WM_operatortype_append(OBJECT_OT_track_set); WM_operatortype_append(OBJECT_OT_track_clear); - WM_operatortype_append(OBJECT_OT_slow_parent_set); - WM_operatortype_append(OBJECT_OT_slow_parent_clear); WM_operatortype_append(OBJECT_OT_make_local); WM_operatortype_append(OBJECT_OT_make_override_static); WM_operatortype_append(OBJECT_OT_make_single_user); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index c3d194e176f..33d698757b8 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1081,83 +1081,6 @@ void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ Clear Slow Parent Operator *********************/ - -static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Depsgraph *depsgraph = CTX_data_depsgraph(C); - Scene *scene = CTX_data_scene(C); - - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) - { - if (ob->parent) { - if (ob->partype & PARSLOW) { - ob->partype -= PARSLOW; - BKE_object_where_is_calc(depsgraph, scene, ob); - ob->partype |= PARSLOW; - DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); - } - } - } - CTX_DATA_END; - - WM_event_add_notifier(C, NC_SCENE, scene); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_slow_parent_clear(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Clear Slow Parent"; - ot->description = "Clear the object's slow parent"; - ot->idname = "OBJECT_OT_slow_parent_clear"; - - /* api callbacks */ - ot->invoke = WM_operator_confirm; - ot->exec = object_slow_parent_clear_exec; - ot->poll = ED_operator_view3d_active; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -/********************** Make Slow Parent Operator *********************/ - -static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Scene *scene = CTX_data_scene(C); - - CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) - { - if (ob->parent) - ob->partype |= PARSLOW; - - DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); - } - CTX_DATA_END; - - WM_event_add_notifier(C, NC_SCENE, scene); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_slow_parent_set(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Set Slow Parent"; - ot->description = "Set the object's slow parent"; - ot->idname = "OBJECT_OT_slow_parent_set"; - - /* api callbacks */ - ot->invoke = WM_operator_confirm; - ot->exec = object_slow_parent_set_exec; - ot->poll = ED_operator_view3d_active; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - /* ******************** Clear Track Operator ******************* */ enum { -- cgit v1.2.3 From 83f8f44791374dd051728e44d89fbdeee15c60aa Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 29 Jan 2019 11:59:17 +0100 Subject: Fix T59495, T59992, T59904, T59178, T60598: broken keyframed value editing. This removes a bunch of animation/driver evaluations and recalc flags that should be redundant in the new depsgraph, and were incorrectly affecting the evaluated scene in a permanent way. Still two cases that could be removed if the depsgraph is improved, in BKE_object_handle_data_update and BKE_cachefile_update_frame. For physics subframe interpolation there are also still calls to BKE_object_where_is_calc that should ideally be removed as well, though they are not known to cause keyframing bugs. Differential Revision: https://developer.blender.org/D4274 --- source/blender/editors/object/object_constraint.c | 4 ++-- source/blender/editors/object/object_modifier.c | 19 ++----------------- 2 files changed, 4 insertions(+), 19 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index e362eb535b8..3fdd770b008 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1242,7 +1242,7 @@ static void object_pose_tag_update(Main *bmain, Object *ob) * Note that this is a bit wide here, since we cannot be sure whether there are some locked proxy bones * or not... * XXX Temp hack until new depsgraph hopefully solves this. */ - ob->adt->recalc |= ADT_RECALC_ANIM; + DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION); } } @@ -1856,7 +1856,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded * after calling `BKE_pose_rebuild()`, which causes T43872. * XXX Temp hack until new depsgraph hopefully solves this. */ - ob->adt->recalc |= ADT_RECALC_ANIM; + DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION); } DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_TRANSFORM); } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 02ee1f9c360..23a7064b994 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -2190,23 +2190,8 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) /* precalculate time variable before baking */ for (f = omd->bakestart; f <= omd->bakeend; f++) { - /* from physics_fluid.c: - * - * XXX: This can't be used due to an anim sys optimization that ignores recalc object animation, - * leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ ) - * --> BKE_animsys_evaluate_all_animation(bmain, eval_time); - * This doesn't work with drivers: - * --> BKE_animsys_evaluate_animdata(&fsDomain->id, fsDomain->adt, eval_time, ADT_RECALC_ALL); - */ - - /* Modifying the global scene isn't nice, but we can do it in - * this part of the process before a threaded job is created */ - - //scene->r.cfra = f; - //ED_update_for_newframe(bmain, scene); - - /* ok, this doesn't work with drivers, but is way faster. - * let's use this for now and hope nobody wants to drive the time value... */ + /* For now only simple animation of time value is supported, nothing else. + * No drivers or other modifier parameters. */ BKE_animsys_evaluate_animdata(CTX_data_depsgraph(C), scene, (ID *)ob, ob->adt, f, ADT_RECALC_ANIM); och->time[i] = omd->time; -- cgit v1.2.3 From d2f3378249902cdc093c54c41afb1b48ae8357c3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 31 Jan 2019 16:53:19 +0100 Subject: Fix T59339: Particle render without baking issues The issue was caused by dependency graph resetting particles when evaluating copy-on-write version of object. Solved by only doing reset from dependency graph on user edits. Other issue was caused by modifier itself trying to compare topology and reset particles when number of vertices or faces changed. This isn't reliable, since topology might change even with same number of elements. But also, since copy-on-written object initially always have those fields zero-ed the reset was happening on every F12. The latter issue is solved by moving reset from modifier stack to places where we exit edit/paint modes which might be changing topology. There is still weird issue of particles generated at some weird location after tapping tab twice, but this is not a new issue in 2.8 branch and is to be looked separately. --- source/blender/editors/object/object_edit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index dff78d15692..958d9c08814 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -78,6 +78,7 @@ #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_paint.h" +#include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_softbody.h" #include "BKE_editmesh.h" @@ -537,6 +538,7 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f } BLI_freelistN(&pidlist); + BKE_particlesystem_reset_all(obedit); BKE_ptcache_object_reset(scene, obedit, PTCACHE_RESET_OUTDATED); /* also flush ob recalc, doesn't take much overhead, but used for particles */ -- cgit v1.2.3 From 7f0e773dcdeecf14daa005dddd9a7cfe6b932131 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 1 Feb 2019 10:44:41 +0100 Subject: 'make links': rename group -> collection in enum in UI also rename dupli -> instance Fixes T61086 Reviewers: billreynish Maniphest Tasks: T61086 Differential Revision: https://developer.blender.org/D4294 --- source/blender/editors/object/object_relations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 33d698757b8..8e354c5f4e7 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1549,8 +1549,8 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot) {MAKE_LINKS_OBDATA, "OBDATA", 0, "Object Data", ""}, {MAKE_LINKS_MATERIALS, "MATERIAL", 0, "Materials", ""}, {MAKE_LINKS_ANIMDATA, "ANIMATION", 0, "Animation Data", ""}, - {MAKE_LINKS_GROUP, "GROUPS", 0, "Group", ""}, - {MAKE_LINKS_DUPLICOLLECTION, "DUPLICOLLECTION", 0, "DupliGroup", ""}, + {MAKE_LINKS_GROUP, "GROUPS", 0, "Collection", ""}, + {MAKE_LINKS_DUPLICOLLECTION, "DUPLICOLLECTION", 0, "Instance Collection", ""}, {MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, "Modifiers", ""}, {MAKE_LINKS_FONTS, "FONTS", 0, "Fonts", ""}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From 65ec7ec524e667ec95ce947a95f6273088dffee6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 Feb 2019 01:36:28 +1100 Subject: Cleanup: remove redundant, invalid info from headers BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits. --- source/blender/editors/object/object_add.c | 6 ------ source/blender/editors/object/object_bake.c | 9 --------- source/blender/editors/object/object_bake_api.c | 8 -------- source/blender/editors/object/object_collection.c | 8 -------- source/blender/editors/object/object_constraint.c | 8 -------- source/blender/editors/object/object_data_transfer.c | 8 -------- source/blender/editors/object/object_edit.c | 6 ------ source/blender/editors/object/object_facemap_ops.c | 7 ------- source/blender/editors/object/object_gpencil_modifier.c | 6 ------ source/blender/editors/object/object_hook.c | 6 ------ source/blender/editors/object/object_intern.h | 7 ------- source/blender/editors/object/object_modes.c | 6 ------ source/blender/editors/object/object_modifier.c | 6 ------ source/blender/editors/object/object_ops.c | 7 ------- source/blender/editors/object/object_random.c | 4 ---- source/blender/editors/object/object_relations.c | 6 ------ source/blender/editors/object/object_select.c | 6 ------ source/blender/editors/object/object_shader_fx.c | 6 ------ source/blender/editors/object/object_shapekey.c | 6 ------ source/blender/editors/object/object_transform.c | 6 ------ source/blender/editors/object/object_utils.c | 4 ---- source/blender/editors/object/object_vgroup.c | 8 -------- source/blender/editors/object/object_warp.c | 4 ---- 23 files changed, 148 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 7f71596b3c4..a0576989ead 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_add.c diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 940c558c4d5..64881bb7980 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,13 +15,6 @@ * * The Original Code is Copyright (C) 2004 by Blender Foundation * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Morten Mikkelsen, - * Sergey Sharybin - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_bake.c diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index da2c25db385..ee3fdee8f15 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,12 +15,6 @@ * * The Original Code is Copyright (C) 2004 by Blender Foundation * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_bake_api.c diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 0761b7e4f4c..47bcfc2d7c4 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,12 +15,6 @@ * * The Original Code is Copyright (C) Blender Foundation * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_collection.c diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 3fdd770b008..f53ea967430 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,12 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Joshua Leung, Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_constraint.c diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 26ba9c31c22..70001073842 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,12 +15,6 @@ * * The Original Code is Copyright (C) 2014 by Blender Foundation. * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Bastien Montagne. - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_data_transfer.c diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 958d9c08814..49358679dc6 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_edit.c diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index 545082f82f0..70a1eab7525 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,11 +15,6 @@ * * The Original Code is Copyright (C) 2008 Blender Foundation. * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_facemap_ops.c diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index a4e2011097e..1a25c630657 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2018 Blender Foundation. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2018 - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_gpencil_modifier.c diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 995f62f3cd8..8fc136d6507 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_hook.c diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 3db9b748def..941d320eaba 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,11 +15,6 @@ * * The Original Code is Copyright (C) 2008 Blender Foundation. * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_intern.h diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 771bbc5c18c..898a36bc911 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -14,10 +12,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_modes.c diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 23a7064b994..f8873648d9c 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2009 - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_modifier.c diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 05bb6e06a85..4bb0aceb5c1 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,11 +15,6 @@ * * The Original Code is Copyright (C) 2008 Blender Foundation. * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_ops.c diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c index 8291b68f15f..375df1d1663 100644 --- a/source/blender/editors/object/object_random.c +++ b/source/blender/editors/object/object_random.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,8 +15,6 @@ * * The Original Code is Copyright (C) 2014 by Blender Foundation * All rights reserved. - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_random.c diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 8e354c5f4e7..cd74339d418 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_relations.c diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 48b13698fa7..dfa29815c8d 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_select.c diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index f8a33577f5d..95788d27d7a 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2018 Blender Foundation. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2018 - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_shader_fx.c diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index cafb3a50202..8b1b82842fc 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, shapekey support - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_shapekey.c diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 7967e94963a..3b9d5a3d974 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,10 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * Contributor(s): Blender Foundation, 2002-2008 full recode - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_transform.c diff --git a/source/blender/editors/object/object_utils.c b/source/blender/editors/object/object_utils.c index 780942f04d2..7ce65fb4120 100644 --- a/source/blender/editors/object/object_utils.c +++ b/source/blender/editors/object/object_utils.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -14,8 +12,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_utils.c diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 624788c8123..7533a05bb79 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,12 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Ove M Henriksen. - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_vgroup.c diff --git a/source/blender/editors/object/object_warp.c b/source/blender/editors/object/object_warp.c index d28ed71c382..2aadf3ec996 100644 --- a/source/blender/editors/object/object_warp.c +++ b/source/blender/editors/object/object_warp.c @@ -1,6 +1,4 @@ /* - * ***** BEGIN GPL LICENSE BLOCK ***** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -17,8 +15,6 @@ * * The Original Code is Copyright (C) 2013 by Blender Foundation * All rights reserved. - * - * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/editors/object/object_warp.c -- cgit v1.2.3 From 744f6339865fa8ed00b2e98aa5812b94d67a8604 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 Feb 2019 14:01:45 +1100 Subject: Cleanup: trailing commas Needed for clan-format not to wrap onto one line. --- source/blender/editors/object/object_add.c | 8 ++++---- source/blender/editors/object/object_constraint.c | 3 ++- source/blender/editors/object/object_data_transfer.c | 2 +- source/blender/editors/object/object_facemap_ops.c | 2 +- source/blender/editors/object/object_gpencil_modifier.c | 2 +- source/blender/editors/object/object_intern.h | 2 +- source/blender/editors/object/object_modifier.c | 4 ++-- source/blender/editors/object/object_relations.c | 16 +++++++++------- source/blender/editors/object/object_select.c | 6 +++--- source/blender/editors/object/object_transform.c | 4 ++-- source/blender/editors/object/object_vgroup.c | 10 +++++----- 11 files changed, 31 insertions(+), 28 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index a0576989ead..f7e12d280cf 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -122,7 +122,7 @@ const EnumPropertyItem rna_enum_light_type_items[] = { {LA_SUN, "SUN", ICON_LIGHT_SUN, "Sun", "Constant direction parallel ray light source"}, {LA_SPOT, "SPOT", ICON_LIGHT_SPOT, "Spot", "Directional cone light source"}, {LA_AREA, "AREA", ICON_LIGHT_AREA, "Area", "Directional area light source"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* copy from rna_object_force.c */ @@ -140,7 +140,7 @@ static const EnumPropertyItem field_type_items[] = { {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""}, {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""}, {PFIELD_SMOKEFLOW, "SMOKE", ICON_FORCE_SMOKEFLOW, "Smoke Flow", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static EnumPropertyItem lightprobe_type_items[] = { @@ -150,7 +150,7 @@ static EnumPropertyItem lightprobe_type_items[] = { "Planar reflection probe"}, {LIGHTPROBE_TYPE_GRID, "GRID", ICON_LIGHTPROBE_GRID, "Irradiance Volume", "Irradiance probe to capture diffuse indirect lighting"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /************************** Exported *****************************/ @@ -1758,7 +1758,7 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) static const EnumPropertyItem convert_target_items[] = { {OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve from Mesh/Text", ""}, {OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, "Mesh from Curve/Meta/Surf/Text", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static void convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *scene, Object *ob) diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index f53ea967430..950cab4f608 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -584,7 +584,8 @@ static void object_test_constraint(Main *bmain, Object *owner, bConstraint *con) static const EnumPropertyItem constraint_owner_items[] = { {EDIT_CONSTRAINT_OWNER_OBJECT, "OBJECT", 0, "Object", "Edit a constraint on the active object"}, {EDIT_CONSTRAINT_OWNER_BONE, "BONE", 0, "Bone", "Edit a constraint on the active bone"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL}, +}; static bool edit_constraint_poll_generic(bContext *C, StructRNA *rna_type) diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 70001073842..3d53cb5e290 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -81,7 +81,7 @@ static const EnumPropertyItem DT_layer_items[] = { {0, "", 0, "Face Data", ""}, {DT_TYPE_SHARP_FACE, "SMOOTH", 0, "Smooth", "Transfer flat/smooth mark"}, {DT_TYPE_FREESTYLE_FACE, "FREESTYLE_FACE", 0, "Freestyle Mark", "Transfer Freestyle face mark"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* Note: rna_enum_dt_layers_select_src_items enum is from rna_modifier.c */ diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index 70a1eab7525..dcdb83b22f4 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -473,7 +473,7 @@ void OBJECT_OT_face_map_move(wmOperatorType *ot) static EnumPropertyItem fmap_slot_move[] = { {1, "UP", 0, "Up", ""}, {-1, "DOWN", 0, "Down", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* identifiers */ diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index 1a25c630657..d4aa879b85b 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -574,7 +574,7 @@ static int gpencil_modifier_apply_invoke(bContext *C, wmOperator *op, const wmEv static const EnumPropertyItem gpencil_modifier_apply_as_items[] = { {MODIFIER_APPLY_DATA, "DATA", 0, "Object Data", "Apply modifier to the object's data"}, {MODIFIER_APPLY_SHAPE, "SHAPE", 0, "New Shape", "Apply deform-only modifier to a new shape on this object"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; void OBJECT_OT_gpencil_modifier_apply(wmOperatorType *ot) diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 941d320eaba..d676bf1695a 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -36,7 +36,7 @@ struct ModifierData; enum eObject_Hook_Add_Mode { OBJECT_ADDHOOK_NEWOB = 1, OBJECT_ADDHOOK_SELOB, - OBJECT_ADDHOOK_SELOB_BONE + OBJECT_ADDHOOK_SELOB_BONE, }; /* internal exports only */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index f8873648d9c..f463b701d64 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1062,7 +1062,7 @@ static int modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *UNU static const EnumPropertyItem modifier_apply_as_items[] = { {MODIFIER_APPLY_DATA, "DATA", 0, "Object Data", "Apply modifier to the object's data"}, {MODIFIER_APPLY_SHAPE, "SHAPE", 0, "New Shape", "Apply deform-only modifier to a new shape on this object"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; void OBJECT_OT_modifier_apply(wmOperatorType *ot) @@ -1622,7 +1622,7 @@ void OBJECT_OT_skin_loose_mark_clear(wmOperatorType *ot) static const EnumPropertyItem action_items[] = { {SKIN_LOOSE_MARK, "MARK", 0, "Mark", "Mark selected vertices as loose"}, {SKIN_LOOSE_CLEAR, "CLEAR", 0, "Clear", "Set selected vertices as not loose"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; ot->name = "Skin Mark/Clear Loose"; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index cd74339d418..b38da1e124b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -446,7 +446,7 @@ EnumPropertyItem prop_clear_parent_types[] = { "As 'Clear Parent', but keep the current visual transformations of the object"}, {CLEAR_PARENT_INVERSE, "CLEAR_INVERSE", 0, "Clear Parent Inverse", "Reset the transform corrections applied to the parenting relationship, does not remove parenting itself"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* Helper for ED_object_parent_clear() - Remove deform-modifiers associated with parent */ @@ -606,7 +606,7 @@ EnumPropertyItem prop_make_parent_types[] = { {PAR_LATTICE, "LATTICE", 0, "Lattice Deform", ""}, {PAR_VERTEX, "VERTEX", 0, "Vertex", ""}, {PAR_VERTEX_TRI, "VERTEX_TRI", 0, "Vertex (Triangle)", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; bool ED_object_parent_set(ReportList *reports, const bContext *C, Scene *scene, Object *ob, Object *par, @@ -1085,7 +1085,7 @@ enum { static const EnumPropertyItem prop_clear_track_types[] = { {CLEAR_TRACK, "CLEAR", 0, "Clear Track", ""}, {CLEAR_TRACK_KEEP_TRANSFORM, "CLEAR_KEEP_TRANSFORM", 0, "Clear and Keep Transformation (Clear Track)", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* note, poll should check for editable scene */ @@ -1155,7 +1155,7 @@ static const EnumPropertyItem prop_make_track_types[] = { {CREATE_TRACK_DAMPTRACK, "DAMPTRACK", 0, "Damped Track Constraint", ""}, {CREATE_TRACK_TRACKTO, "TRACKTO", 0, "Track To Constraint", ""}, {CREATE_TRACK_LOCKTRACK, "LOCKTRACK", 0, "Lock Track Constraint", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static int track_set_exec(bContext *C, wmOperator *op) @@ -1547,7 +1547,8 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot) {MAKE_LINKS_DUPLICOLLECTION, "DUPLICOLLECTION", 0, "Instance Collection", ""}, {MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, "Modifiers", ""}, {MAKE_LINKS_FONTS, "FONTS", 0, "Fonts", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL}, + }; /* identifiers */ ot->name = "Link Data"; @@ -2125,7 +2126,7 @@ void OBJECT_OT_make_local(wmOperatorType *ot) {MAKE_LOCAL_SELECT_OBDATA, "SELECT_OBDATA", 0, "Selected Objects and Data", ""}, {MAKE_LOCAL_SELECT_OBDATA_MATERIAL, "SELECT_OBDATA_MATERIAL", 0, "Selected Objects, Data and Materials", ""}, {MAKE_LOCAL_ALL, "ALL", 0, "All", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* identifiers */ @@ -2433,7 +2434,8 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot) static const EnumPropertyItem type_items[] = { {MAKE_SINGLE_USER_SELECTED, "SELECTED_OBJECTS", 0, "Selected Objects", ""}, {MAKE_SINGLE_USER_ALL, "ALL", 0, "All", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL}, + }; /* identifiers */ ot->name = "Make Single User"; diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index dfa29815c8d..93ef596cd90 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -439,7 +439,7 @@ enum { OBJECT_SELECT_LINKED_DUPGROUP, OBJECT_SELECT_LINKED_PARTICLE, OBJECT_SELECT_LINKED_LIBRARY, - OBJECT_SELECT_LINKED_LIBRARY_OBDATA + OBJECT_SELECT_LINKED_LIBRARY_OBDATA, }; static const EnumPropertyItem prop_select_linked_types[] = { @@ -450,7 +450,7 @@ static const EnumPropertyItem prop_select_linked_types[] = { {OBJECT_SELECT_LINKED_PARTICLE, "PARTICLE", 0, "Particle System", ""}, {OBJECT_SELECT_LINKED_LIBRARY, "LIBRARY", 0, "Library", ""}, {OBJECT_SELECT_LINKED_LIBRARY_OBDATA, "LIBRARY_OBDATA", 0, "Library (Object Data)", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static bool object_select_all_by_obdata(bContext *C, void *obdata) @@ -727,7 +727,7 @@ static const EnumPropertyItem prop_select_grouped_types[] = { {OBJECT_GRPSEL_COLOR, "COLOR", 0, "Color", "Object Color"}, {OBJECT_GRPSEL_KEYINGSET, "KEYINGSET", 0, "Keying Set", "Objects included in active Keying Set"}, {OBJECT_GRPSEL_LIGHT_TYPE, "LIGHT_TYPE", 0, "Light Type", "Matching light types"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static bool select_grouped_children(bContext *C, Object *ob, const bool recursive) diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 3b9d5a3d974..70ef9b85358 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1257,13 +1257,13 @@ void OBJECT_OT_origin_set(wmOperatorType *ot) "Calculate the center of mass from the surface area"}, {ORIGIN_TO_CENTER_OF_MASS_VOLUME, "ORIGIN_CENTER_OF_VOLUME", 0, "Origin to Center of Mass (Volume)", "Calculate the center of mass from the volume (must be manifold geometry with consistent normals)"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static const EnumPropertyItem prop_set_bounds_types[] = { {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", 0, "Median Center", ""}, {V3D_AROUND_CENTER_BOUNDS, "BOUNDS", 0, "Bounds Center", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* identifiers */ diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 7533a05bb79..51ed9da2c93 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -674,7 +674,7 @@ static const EnumPropertyItem WT_vertex_group_select_item[] = { "BONE_DEFORM", 0, "Deform Pose Bones", "All Vertex Groups assigned to Deform Bones"}, {WT_VGROUP_ALL, "ALL", 0, "All Groups", "All Vertex Groups"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper( @@ -1616,7 +1616,7 @@ enum { VGROUP_TOGGLE, VGROUP_LOCK, VGROUP_UNLOCK, - VGROUP_INVERT + VGROUP_INVERT, }; static const EnumPropertyItem vgroup_lock_actions[] = { @@ -1624,7 +1624,7 @@ static const EnumPropertyItem vgroup_lock_actions[] = { {VGROUP_LOCK, "LOCK", 0, "Lock", "Lock all vertex groups"}, {VGROUP_UNLOCK, "UNLOCK", 0, "Unlock", "Unlock all vertex groups"}, {VGROUP_INVERT, "INVERT", 0, "Invert", "Invert the lock state of all vertex groups"}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; static void vgroup_lock_all(Object *ob, int action) @@ -3664,7 +3664,7 @@ void OBJECT_OT_vertex_group_sort(wmOperatorType *ot) static const EnumPropertyItem vgroup_sort_type[] = { {SORT_TYPE_NAME, "NAME", 0, "Name", ""}, {SORT_TYPE_BONEHIERARCHY, "BONE_HIERARCHY", 0, "Bone Hierarchy", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; ot->name = "Sort Vertex Groups"; @@ -3715,7 +3715,7 @@ void OBJECT_OT_vertex_group_move(wmOperatorType *ot) static const EnumPropertyItem vgroup_slot_move[] = { {-1, "UP", 0, "Up", ""}, {1, "DOWN", 0, "Down", ""}, - {0, NULL, 0, NULL, NULL} + {0, NULL, 0, NULL, NULL}, }; /* identifiers */ -- cgit v1.2.3 From ab5e69e6609d3724423021b011bc711d7dbf8a5d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Feb 2019 09:10:32 +1100 Subject: Cleanup: remove contributors for CMake files Following removal from C source code. See: 8c68ed6df16d8893 --- source/blender/editors/object/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index f379417c5c7..f15427e61ac 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -13,9 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Contributor(s): Jacques Beaurain. -# # ***** END GPL LICENSE BLOCK ***** set(INC -- cgit v1.2.3 From 3d984aa15038f7a7bdf4ffacb93da83713353613 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 28 Nov 2018 00:49:36 -0200 Subject: Per view-layer collection visibility [re-committing] We still control this in the viewport collections visibility menu. But now we are actually changing the visibility of the collections, not of the objects. If a collection is indirectly invisible (because one of its parents are invisible) we gray it out. Also if you click directly in the collection names, it "isolates" the collection by hiding all collections, and showing the direct parents and all the children of the selected collection. Development Note: Right now I'm excluding the hidden collections from the depsgraph. Thus the need for tagging relations to update. If this proves to be too slow, we can change. --- source/blender/editors/object/object_edit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 49358679dc6..686c03b3e16 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -285,6 +285,7 @@ static int object_hide_collection_exec(bContext *C, wmOperator *op) BKE_layer_collection_set_visible(scene, view_layer, lc, extend); + DEG_relations_tag_update(CTX_data_main(C)); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -358,7 +359,7 @@ static int object_hide_collection_invoke(bContext *C, wmOperator *op, const wmEv void OBJECT_OT_hide_collection(wmOperatorType *ot) { /* identifiers */ - ot->name = "Hide Objects By Collection"; + ot->name = "Hide Collection"; ot->description = "Show only objects in collection (Shift to extend)"; ot->idname = "OBJECT_OT_hide_collection"; -- cgit v1.2.3 From 897e047374fa3d3ceef35aa2cdb3372b6a7cc64a Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 30 Nov 2018 02:24:06 -0200 Subject: Outliner visibility unification: Implement 3 levels of viewport visibility Now collection and objects can be either: * Disabled for all the view layers. * Hidden for a view layer but not necessarily for all others. * Visible for a view layer but not necessarily for all others. Regarding icons: Whatever we decide to use for the "Hidden for all view layers" needs to be a toggle-like icon. Because when viewing "Scenes" instead of "View Layer" in the outliner we should be able to edit the collection "Hidden for all the view layers" as an on/off option. The operators are accessible via a Visibility context menu or shortcuts: * Ctrl + Click: Isolate collection (use shift to extend). * Alt + Click: Disable collection. * Shift + Click: Hide/Show collection and its children (objects and collections) Things yet to be tackled: * Object outliner context menu can also get a Visibility sub-menu. * Get better icons for viewport enable/disable. Note: * When using emulate 3 button mouse alt+click is used for 2d panning. In this case users have to use the operator from the menu. See T57857 for discussion. Patch: https://developer.blender.org/D4011 Reviewers: brecht and sergey Thanks to the reviewers and William Reynish and Julien Kasper in particular for the feedback. --- source/blender/editors/object/object_edit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 686c03b3e16..9bd0de83ca5 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -283,10 +283,12 @@ static int object_hide_collection_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - BKE_layer_collection_set_visible(scene, view_layer, lc, extend); - - DEG_relations_tag_update(CTX_data_main(C)); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); + + if (BKE_layer_collection_isolate(scene, view_layer, lc, extend)) { + DEG_relations_tag_update(CTX_data_main(C)); + } + WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); return OPERATOR_FINISHED; -- cgit v1.2.3 From eef4077f18495d88a2426cfda3ec9a4dc461f798 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Feb 2019 15:42:22 +1100 Subject: Cleanup: remove redundant doxygen \file argument Move \ingroup onto same line to be more compact and make it clear the file is in the group. --- source/blender/editors/object/object_add.c | 3 +-- source/blender/editors/object/object_bake.c | 3 +-- source/blender/editors/object/object_bake_api.c | 3 +-- source/blender/editors/object/object_collection.c | 3 +-- source/blender/editors/object/object_constraint.c | 3 +-- source/blender/editors/object/object_data_transfer.c | 3 +-- source/blender/editors/object/object_edit.c | 3 +-- source/blender/editors/object/object_facemap_ops.c | 3 +-- source/blender/editors/object/object_gpencil_modifier.c | 3 +-- source/blender/editors/object/object_hook.c | 3 +-- source/blender/editors/object/object_intern.h | 3 +-- source/blender/editors/object/object_modes.c | 3 +-- source/blender/editors/object/object_modifier.c | 3 +-- source/blender/editors/object/object_ops.c | 3 +-- source/blender/editors/object/object_random.c | 3 +-- source/blender/editors/object/object_relations.c | 3 +-- source/blender/editors/object/object_select.c | 3 +-- source/blender/editors/object/object_shader_fx.c | 3 +-- source/blender/editors/object/object_shapekey.c | 3 +-- source/blender/editors/object/object_transform.c | 3 +-- source/blender/editors/object/object_utils.c | 3 +-- source/blender/editors/object/object_vgroup.c | 3 +-- source/blender/editors/object/object_warp.c | 3 +-- 23 files changed, 23 insertions(+), 46 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index f7e12d280cf..3d05f69192d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_add.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 64881bb7980..baa0f6f9220 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_bake.c - * \ingroup edobj +/** \file \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index ee3fdee8f15..17e7b6c23db 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_bake_api.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 47bcfc2d7c4..924e8fe74a1 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_collection.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 950cab4f608..13c3ee9a1a1 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_constraint.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 3d53cb5e290..1398d8fa4a0 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_data_transfer.c - * \ingroup edobj +/** \file \ingroup edobj */ #include "DNA_mesh_types.h" diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 9bd0de83ca5..89f043966db 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_edit.c - * \ingroup edobj +/** \file \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index dcdb83b22f4..a3c0892d1b1 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_facemap_ops.c - * \ingroup edobj +/** \file \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index d4aa879b85b..39def80e134 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_gpencil_modifier.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 8fc136d6507..0fb354554c3 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_hook.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index d676bf1695a..ff153488042 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_intern.h - * \ingroup edobj +/** \file \ingroup edobj */ #ifndef __OBJECT_INTERN_H__ diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 898a36bc911..f8eda3ce1d5 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -14,8 +14,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/** \file blender/editors/object/object_modes.c - * \ingroup edobj +/** \file \ingroup edobj * * General utils to handle mode switching, * actual mode switching logic is per-object type. diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index f463b701d64..964a0efb3ee 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_modifier.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 4bb0aceb5c1..5d9aeab7eb8 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_ops.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c index 375df1d1663..05f47363ce3 100644 --- a/source/blender/editors/object/object_random.c +++ b/source/blender/editors/object/object_random.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_random.c - * \ingroup edobj +/** \file \ingroup edobj */ #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index b38da1e124b..6ce3eab5758 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_relations.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 93ef596cd90..1eccdfbd519 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_select.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 95788d27d7a..7a70e9136f9 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_shader_fx.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 8b1b82842fc..335213efe6d 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_shapekey.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 70ef9b85358..24abafe7d0f 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_transform.c - * \ingroup edobj +/** \file \ingroup edobj */ diff --git a/source/blender/editors/object/object_utils.c b/source/blender/editors/object/object_utils.c index 7ce65fb4120..93b8fe55b77 100644 --- a/source/blender/editors/object/object_utils.c +++ b/source/blender/editors/object/object_utils.c @@ -14,8 +14,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/** \file blender/editors/object/object_utils.c - * \ingroup edobj +/** \file \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 51ed9da2c93..e1c18106e0f 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_vgroup.c - * \ingroup edobj +/** \file \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_warp.c b/source/blender/editors/object/object_warp.c index 2aadf3ec996..d185026c6c2 100644 --- a/source/blender/editors/object/object_warp.c +++ b/source/blender/editors/object/object_warp.c @@ -17,8 +17,7 @@ * All rights reserved. */ -/** \file blender/editors/object/object_warp.c - * \ingroup edobj +/** \file \ingroup edobj */ #include "DNA_object_types.h" -- cgit v1.2.3 From af0eb938b8884da3b5fcca4e32b47034eb33e9c6 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 9 Feb 2019 13:20:59 +0100 Subject: Fix T61276: Make Single User unlinks original object. In that case, we have to consider number of scenes using an object, not number of collections. --- source/blender/editors/object/object_relations.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 6ce3eab5758..970a64d5e78 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1596,7 +1596,7 @@ static void single_object_users_collection( Object *ob = cob->ob; /* an object may be in more than one collection */ if ((ob->id.newid == NULL) && ((ob->flag & flag) == flag)) { - if (!ID_IS_LINKED(ob) && ob->id.us > 1) { + if (!ID_IS_LINKED(ob) && BKE_object_scenes_users_get(bmain, ob) > 1) { ID_NEW_SET(ob, BKE_object_copy(bmain, ob)); } } -- cgit v1.2.3 From ffd0fee97c364866d387718a9ee172466054133b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Feb 2019 10:51:25 +1100 Subject: Cleanup: comment indentation & spelling --- source/blender/editors/object/object_modifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 964a0efb3ee..d6aa74da273 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -260,8 +260,8 @@ static bool object_has_modifier_cb(Object *ob, void *data) } /* Use with ED_object_iter_other(). Sets the total number of levels -* for any multires modifiers on the object to the int pointed to by -* callback_data. */ + * for any multires modifiers on the object to the int pointed to by + * callback_data. */ bool ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v) { ModifierData *md; -- cgit v1.2.3 From 62f8c55a75489634a20962302ef155b0d4d3def6 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 12 Feb 2019 21:51:51 +0100 Subject: Cleanup: rename `BLT_I18NCONTEXT_ID_LAMP` -> `BLT_I18NCONTEXT_ID_LIGHT`. --- source/blender/editors/object/object_add.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 3d05f69192d..71575c31937 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -475,11 +475,11 @@ void OBJECT_OT_add(wmOperatorType *ot) static const char *get_lightprobe_defname(int type) { switch (type) { - case LIGHTPROBE_TYPE_GRID: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "IrradianceVolume"); - case LIGHTPROBE_TYPE_PLANAR: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "ReflectionPlane"); - case LIGHTPROBE_TYPE_CUBE: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "ReflectionCubemap"); + case LIGHTPROBE_TYPE_GRID: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "IrradianceVolume"); + case LIGHTPROBE_TYPE_PLANAR: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "ReflectionPlane"); + case LIGHTPROBE_TYPE_CUBE: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "ReflectionCubemap"); default: - return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "LightProbe"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "LightProbe"); } } @@ -1100,12 +1100,12 @@ void OBJECT_OT_gpencil_add(wmOperatorType *ot) static const char *get_light_defname(int type) { switch (type) { - case LA_LOCAL: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Point"); - case LA_SUN: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Sun"); - case LA_SPOT: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Spot"); - case LA_AREA: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Area"); + case LA_LOCAL: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Point"); + case LA_SUN: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Sun"); + case LA_SPOT: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Spot"); + case LA_AREA: return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Area"); default: - return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Light"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Light"); } } @@ -1167,7 +1167,7 @@ void OBJECT_OT_light_add(wmOperatorType *ot) /* properties */ ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_light_type_items, 0, "Type", ""); - RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_LAMP); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_LIGHT); ED_object_add_unit_props_radius(ot); ED_object_add_generic_props(ot, false); -- cgit v1.2.3 From 61e2e609a168cf12f107dbf9a24d94cca17d4c58 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 12 Feb 2019 22:13:42 +0100 Subject: I18N Messages: fix confusion with Light meanings. Using ID_LIGHT or ID_ID for "Lamp" meaning, "Light" without context being for 'not heavy'. That rename of data-block was not really nice on that side of things :/ Related to T43295. --- source/blender/editors/object/object_add.c | 3 ++- source/blender/editors/object/object_select.c | 1 + source/blender/editors/object/object_shader_fx.c | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 71575c31937..2931fb89d7e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -464,7 +464,8 @@ void OBJECT_OT_add(wmOperatorType *ot) /* properties */ ED_object_add_unit_props_radius(ot); - RNA_def_enum(ot->srna, "type", rna_enum_object_type_items, 0, "Type", ""); + PropertyRNA *prop = RNA_def_enum(ot->srna, "type", rna_enum_object_type_items, 0, "Type", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); ED_object_add_generic_props(ot, true); } diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 1eccdfbd519..aed074907b7 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -427,6 +427,7 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend selection instead of deselecting everything first"); ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_object_type_items, 1, "Type", ""); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ID); } /*********************** Selection by Links *********************/ diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 7a70e9136f9..a19c79d2829 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -36,6 +36,8 @@ #include "BLI_string_utf8.h" #include "BLI_utildefines.h" +#include "BLT_translation.h" + #include "BKE_context.h" #include "BKE_main.h" #include "BKE_shader_fx.h" @@ -254,8 +256,6 @@ static const EnumPropertyItem *shaderfx_add_itemf( void OBJECT_OT_shaderfx_add(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name = "Add Effect"; ot->description = "Add a visual effect to the active object"; @@ -270,9 +270,9 @@ void OBJECT_OT_shaderfx_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum(ot->srna, "type", rna_enum_object_shaderfx_type_items, eShaderFxType_Blur, "Type", ""); - RNA_def_enum_funcs(prop, shaderfx_add_itemf); - ot->prop = prop; + ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_object_shaderfx_type_items, eShaderFxType_Blur, "Type", ""); + RNA_def_enum_funcs(ot->prop, shaderfx_add_itemf); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ID); /* Abused, for "Light"... */ } /************************ generic functions for operators using names and data context *********************/ -- cgit v1.2.3 From a8134647c9a99252b123c16f3eeb8b3cef62e646 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Feb 2019 11:47:23 +1100 Subject: Fix T61360: Weight paint tools ignore face select Face selection was added in weight paint mode since 2.7x, however tools hadn't been updated. --- source/blender/editors/object/object_vgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index e1c18106e0f..e3bfd025e48 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -80,7 +80,9 @@ static bool vertex_group_use_vert_sel(Object *ob) if (ob->mode == OB_MODE_EDIT) { return true; } - else if (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_VERT_SEL) { + else if ((ob->type == OB_MESH) && + ((Mesh *)ob->data)->editflag & (ME_EDIT_PAINT_VERT_SEL | ME_EDIT_PAINT_FACE_SEL)) + { return true; } else { -- cgit v1.2.3 From 6074f62d1a099fc378aa25506a93321dba2d956b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Feb 2019 17:21:55 +1100 Subject: Fix T61353: Crash converting a curve to a mesh This was caused by curves pointing to each other creating a cyclic dependency. While the dependency graph detects this, generating a mesh for render recursively generates data which cashes in this case. Add in a check to detect cyclic links. Note, this bug exists in 2.7x too - but only crashes on render since 2.7x didn't use 'for_render' when converting data. --- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_modifier.c | 2 +- source/blender/editors/object/object_relations.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 2931fb89d7e..a6360ac2e38 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1771,7 +1771,7 @@ static void convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *scene, Objec if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) { /* We need 'for render' ON here, to enable computing bevel dipslist if needed. * Also makes sense anyway, we would not want e.g. to loose hidden parts etc. */ - BKE_displist_make_curveTypes(depsgraph, scene, ob, true, false); + BKE_displist_make_curveTypes(depsgraph, scene, ob, true, false, NULL); } else if (ob->type == OB_MBALL) { BKE_displist_make_mball(depsgraph, scene, ob); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index d6aa74da273..c91173d95ca 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -105,7 +105,7 @@ static void object_force_modifier_update_for_bind(Depsgraph *depsgraph, Scene *s BKE_displist_make_mball(depsgraph, scene, ob); } else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - BKE_displist_make_curveTypes(depsgraph, scene, ob, false, false); + BKE_displist_make_curveTypes(depsgraph, scene, ob, false, false, NULL); } } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 970a64d5e78..e5a5c045f9d 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -628,7 +628,7 @@ bool ED_object_parent_set(ReportList *reports, const bContext *C, Scene *scene, if ((cu->flag & CU_PATH) == 0) { cu->flag |= CU_PATH | CU_FOLLOW; /* force creation of path data */ - BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); + BKE_displist_make_curveTypes(depsgraph, scene, par, false, false, NULL); } else { cu->flag |= CU_FOLLOW; -- cgit v1.2.3 From c6cbcf83d0153922ac32452c198252f44867a6cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Feb 2019 17:50:41 +1100 Subject: Fix T61472: Hide Unselected fails w/ no selection Also skip mesh recalculation when no hide/reveal is performed. --- source/blender/editors/object/object_edit.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 89f043966db..0115682c2c0 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -200,21 +200,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); const bool unselected = RNA_boolean_get(op->ptr, "unselected"); - - /* Do nothing if no objects was selected. */ - bool have_selected = false; - for (Base *base = view_layer->object_bases.first; base; base = base->next) { - if (base->flag & BASE_VISIBLE) { - if (base->flag & BASE_SELECTED) { - have_selected = true; - break; - } - } - } - - if (!have_selected) { - return OPERATOR_CANCELLED; - } + bool changed = false; /* Hide selected or unselected objects. */ for (Base *base = view_layer->object_bases.first; base; base = base->next) { @@ -226,15 +212,20 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) if (base->flag & BASE_SELECTED) { ED_object_base_select(base, BA_DESELECT); base->flag |= BASE_HIDDEN; + changed = true; } } else { if (!(base->flag & BASE_SELECTED)) { ED_object_base_select(base, BA_DESELECT); base->flag |= BASE_HIDDEN; + changed = true; } } } + if (!changed) { + return OPERATOR_CANCELLED; + } BKE_layer_collection_sync(scene, view_layer); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); -- cgit v1.2.3 From 8d421f3d9b3f1f5b6822f6519927f800fc4bfbe2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Feb 2019 23:32:53 +1100 Subject: Fix T56665: Assert when selecting object Selecting object w/ a different mode missed refreshing the screen areas current tool. --- source/blender/editors/object/object_select.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index aed074907b7..0ae04ab9b33 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -65,6 +65,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "WM_message.h" #include "ED_armature.h" #include "ED_object.h" @@ -119,11 +120,13 @@ void ED_object_base_select(Base *base, eObjectSelect_Mode mode) */ void ED_object_base_activate(bContext *C, Base *base) { + struct wmMsgBus *mbus = CTX_wm_message_bus(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); view_layer->basact = base; WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene); + WM_msg_publish_rna_prop(mbus, &scene->id, view_layer, LayerObjects, active); DEG_id_tag_update(&CTX_data_scene(C)->id, ID_RECALC_SELECT); } -- cgit v1.2.3 From ae2b677dcb5a70f5f58e1da56b4fcf15b12ef851 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Feb 2019 12:24:08 +1100 Subject: Cleanup: move object bounding-box into runtime struct --- source/blender/editors/object/object_transform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 24abafe7d0f..201e8a8ea16 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1011,7 +1011,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Curve *cu = ob->data; - if (ob->bb == NULL && (centermode != ORIGIN_TO_CURSOR)) { + if (ob->runtime.bb == NULL && (centermode != ORIGIN_TO_CURSOR)) { /* do nothing*/ } else { @@ -1020,8 +1020,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) } else { /* extra 0.5 is the height o above line */ - cent[0] = 0.5f * (ob->bb->vec[4][0] + ob->bb->vec[0][0]); - cent[1] = 0.5f * (ob->bb->vec[0][1] + ob->bb->vec[2][1]); + cent[0] = 0.5f * (ob->runtime.bb->vec[4][0] + ob->runtime.bb->vec[0][0]); + cent[1] = 0.5f * (ob->runtime.bb->vec[0][1] + ob->runtime.bb->vec[2][1]); } cent[2] = 0.0f; -- cgit v1.2.3 From e0e6229176573484431d2bbf3ba0c2f849522789 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Feb 2019 18:05:18 +1100 Subject: Cleanup: rename Mesh.edit_btmesh -> edit_mesh When bmesh was in a branch we had both edit_mesh and edit_btmesh, now there is no reason to use this odd name. --- source/blender/editors/object/object_edit.c | 10 ++++---- source/blender/editors/object/object_facemap_ops.c | 10 ++++---- source/blender/editors/object/object_hook.c | 4 ++-- source/blender/editors/object/object_modifier.c | 2 +- source/blender/editors/object/object_relations.c | 2 +- source/blender/editors/object/object_transform.c | 2 +- source/blender/editors/object/object_vgroup.c | 28 +++++++++++----------- 7 files changed, 29 insertions(+), 29 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 0115682c2c0..00d33ca46df 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -407,11 +407,11 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f if (obedit->type == OB_MESH) { Mesh *me = obedit->data; - if (me->edit_btmesh == NULL) { + if (me->edit_mesh == NULL) { return false; } - if (me->edit_btmesh->bm->totvert > MESH_MAX_VERTS) { + if (me->edit_mesh->bm->totvert > MESH_MAX_VERTS) { error("Too many vertices"); return false; } @@ -419,9 +419,9 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f EDBM_mesh_load(bmain, obedit); if (freedata) { - EDBM_mesh_free(me->edit_btmesh); - MEM_freeN(me->edit_btmesh); - me->edit_btmesh = NULL; + EDBM_mesh_free(me->edit_mesh); + MEM_freeN(me->edit_mesh); + me->edit_mesh = NULL; } /* will be recalculated as needed. */ { diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index a3c0892d1b1..45e2c0dd692 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -99,8 +99,8 @@ static void object_fmap_swap_edit_mode(Object *ob, int num1, int num2) if (ob->type == OB_MESH) { Mesh *me = ob->data; - if (me->edit_btmesh) { - BMEditMesh *em = me->edit_btmesh; + if (me->edit_mesh) { + BMEditMesh *em = me->edit_mesh; const int cd_fmap_offset = CustomData_get_offset(&em->bm->pdata, CD_FACEMAP); if (cd_fmap_offset != -1) { @@ -238,7 +238,7 @@ static int face_map_assign_exec(bContext *C, wmOperator *UNUSED(op)) if (fmap) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMFace *efa; BMIter iter; int *map; @@ -286,7 +286,7 @@ static int face_map_remove_from_exec(bContext *C, wmOperator *UNUSED(op)) if (fmap) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMFace *efa; BMIter iter; int *map; @@ -331,7 +331,7 @@ void OBJECT_OT_face_map_remove_from(struct wmOperatorType *ot) static void fmap_select(Object *ob, bool select) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMFace *efa; BMIter iter; int *map; diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 0fb354554c3..b6ec7123d53 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -136,7 +136,7 @@ static bool return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *r_name, static void select_editbmesh_hook(Object *ob, HookModifierData *hmd) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMVert *eve; BMIter iter; int index = 0, nr = 0; @@ -316,7 +316,7 @@ static bool object_hook_index_array(Main *bmain, Scene *scene, Object *obedit, DEG_id_tag_update(obedit->data, 0); - em = me->edit_btmesh; + em = me->edit_mesh; EDBM_mesh_normals_update(em); BKE_editmesh_tessface_calc(em); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index c91173d95ca..e4c84d26f7b 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1485,7 +1485,7 @@ void OBJECT_OT_multires_base_apply(wmOperatorType *ot) static void modifier_skin_customdata_delete(Object *ob) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; if (em) BM_data_layer_free(em->bm, &em->bm->vdata, CD_MVERT_SKIN); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index e5a5c045f9d..00b32f6130d 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -144,7 +144,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) DEG_id_tag_update(obedit->data, 0); - em = me->edit_btmesh; + em = me->edit_mesh; EDBM_mesh_normals_update(em); BKE_editmesh_tessface_calc(em); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 201e8a8ea16..4fd03d213bc 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -842,7 +842,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (obedit) { if (obedit->type == OB_MESH) { Mesh *me = obedit->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMVert *eve; BMIter iter; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index e3bfd025e48..4e0d83f6e8a 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -147,8 +147,8 @@ bool ED_vgroup_parray_alloc(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, co { Mesh *me = (Mesh *)id; - if (me->edit_btmesh) { - BMEditMesh *em = me->edit_btmesh; + if (me->edit_mesh) { + BMEditMesh *em = me->edit_mesh; BMesh *bm = em->bm; const int cd_dvert_offset = CustomData_get_offset(&bm->vdata, CD_MDEFORMVERT); BMIter iter; @@ -506,7 +506,7 @@ static void ED_mesh_defvert_mirror_update_em( const int cd_dvert_offset) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMVert *eve_mirr; bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0; @@ -543,7 +543,7 @@ static void ED_mesh_defvert_mirror_update_ob(Object *ob, int def_nr, int vidx) void ED_vgroup_vert_active_mirror(Object *ob, int def_nr) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; MDeformVert *dvert_act; if (me->editflag & ME_EDIT_MIRROR_X) { @@ -580,7 +580,7 @@ static void vgroup_remove_weight(Object *ob, const int def_nr) static bool vgroup_normalize_active_vertex(Object *ob, eVGroupSelect subset_type) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; BMVert *eve_act; int v_act; MDeformVert *dvert_act; @@ -619,7 +619,7 @@ static bool vgroup_normalize_active_vertex(Object *ob, eVGroupSelect subset_type static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; MDeformVert *dvert_act; int i, vgroup_tot, subset_count; const bool *vgroup_validmap = BKE_object_defgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count); @@ -895,8 +895,8 @@ static float get_vert_def_nr(Object *ob, const int def_nr, const int vertnum) if (ob->type == OB_MESH) { Mesh *me = ob->data; - if (me->edit_btmesh) { - BMEditMesh *em = me->edit_btmesh; + if (me->edit_mesh) { + BMEditMesh *em = me->edit_mesh; const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT); /* warning, this lookup is _not_ fast */ @@ -972,8 +972,8 @@ static void vgroup_select_verts(Object *ob, int select) if (ob->type == OB_MESH) { Mesh *me = ob->data; - if (me->edit_btmesh) { - BMEditMesh *em = me->edit_btmesh; + if (me->edit_mesh) { + BMEditMesh *em = me->edit_mesh; const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT); if (cd_dvert_offset != -1) { @@ -2210,7 +2210,7 @@ void ED_vgroup_mirror( /* only the active group */ if (ob->type == OB_MESH) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; if (em) { const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT); @@ -2387,8 +2387,8 @@ static void vgroup_assign_verts(Object *ob, const float weight) if (ob->type == OB_MESH) { Mesh *me = ob->data; - if (me->edit_btmesh) { - BMEditMesh *em = me->edit_btmesh; + if (me->edit_mesh) { + BMEditMesh *em = me->edit_mesh; int cd_dvert_offset; BMIter iter; @@ -3740,7 +3740,7 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr) MDeformVert *dvert_act; Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; float weight_act; int i; -- cgit v1.2.3 From 319b9d6501f2170dcf06b10de0add340d0be83a3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Feb 2019 19:00:54 +1100 Subject: DNA: rename dup_* struct members to instance_* --- source/blender/editors/object/object_add.c | 4 +-- source/blender/editors/object/object_relations.c | 32 ++++++++++++------------ source/blender/editors/object/object_select.c | 12 ++++----- source/blender/editors/object/object_transform.c | 14 +++++------ 4 files changed, 31 insertions(+), 31 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index a6360ac2e38..baa94806082 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1216,7 +1216,7 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) } Object *ob = ED_object_add_type(C, OB_EMPTY, collection->id.name + 2, loc, rot, false, local_view_bits); - ob->dup_group = collection; + ob->instance_collection = collection; ob->transflag |= OB_DUPLICOLLECTION; id_us_plus(&collection->id); @@ -1685,7 +1685,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, } } - if (base->object->transflag & OB_DUPLICOLLECTION && base->object->dup_group) { + if (base->object->transflag & OB_DUPLICOLLECTION && base->object->instance_collection) { for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->proxy_group == base->object) { ob->proxy = NULL; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 00b32f6130d..ff3fda90495 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -297,9 +297,9 @@ static int make_proxy_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_CANCELLED; /* Get object to work on - use a menu if we need to... */ - if (ob->dup_group && ID_IS_LINKED(ob->dup_group)) { + if (ob->instance_collection && ID_IS_LINKED(ob->instance_collection)) { /* gives menu with list of objects in group */ - /* proxy_group_objects_menu(C, op, ob, ob->dup_group); */ + /* proxy_group_objects_menu(C, op, ob, ob->instance_collection); */ WM_enum_search_invoke(C, op, event); return OPERATOR_CANCELLED; } @@ -333,9 +333,9 @@ static int make_proxy_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - if (gob->dup_group != NULL) { - const ListBase dup_group_objects = BKE_collection_object_cache_get(gob->dup_group); - Base *base = BLI_findlink(&dup_group_objects, RNA_enum_get(op->ptr, "object")); + if (gob->instance_collection != NULL) { + const ListBase instance_collection_objects = BKE_collection_object_cache_get(gob->instance_collection); + Base *base = BLI_findlink(&instance_collection_objects, RNA_enum_get(op->ptr, "object")); ob = base->object; } else { @@ -386,11 +386,11 @@ static const EnumPropertyItem *proxy_collection_object_itemf( int i = 0; Object *ob = ED_object_active_context(C); - if (!ob || !ob->dup_group) + if (!ob || !ob->instance_collection) return DummyRNA_DEFAULT_items; /* find the object to affect */ - FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(ob->dup_group, object) + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(ob->instance_collection, object) { item_tmp.identifier = item_tmp.name = object->id.name + 2; item_tmp.value = i++; @@ -1433,7 +1433,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) /* now add in the collections from the link nodes */ for (collection_node = ob_collections; collection_node; collection_node = collection_node->next) { - if (ob_dst->dup_group != collection_node->link) { + if (ob_dst->instance_collection != collection_node->link) { BKE_collection_object_add(bmain, collection_node->link, ob_dst); } else { @@ -1443,9 +1443,9 @@ static int make_links_data_exec(bContext *C, wmOperator *op) break; } case MAKE_LINKS_DUPLICOLLECTION: - ob_dst->dup_group = ob_src->dup_group; - if (ob_dst->dup_group) { - id_us_plus(&ob_dst->dup_group->id); + ob_dst->instance_collection = ob_src->instance_collection; + if (ob_dst->instance_collection) { + id_us_plus(&ob_dst->instance_collection->id); ob_dst->transflag |= OB_DUPLICOLLECTION; } break; @@ -2200,7 +2200,7 @@ static int make_override_static_invoke(bContext *C, wmOperator *op, const wmEven } /* Get object to work on - use a menu if we need to... */ - if (!ID_IS_LINKED(obact) && obact->dup_group != NULL && ID_IS_LINKED(obact->dup_group)) { + if (!ID_IS_LINKED(obact) && obact->instance_collection != NULL && ID_IS_LINKED(obact->instance_collection)) { /* Gives menu with list of objects in group. */ WM_enum_search_invoke(C, op, event); return OPERATOR_CANCELLED; @@ -2235,9 +2235,9 @@ static int make_override_static_exec(bContext *C, wmOperator *op) bool success = false; - if (!ID_IS_LINKED(obact) && obact->dup_group != NULL && ID_IS_LINKED(obact->dup_group)) { + if (!ID_IS_LINKED(obact) && obact->instance_collection != NULL && ID_IS_LINKED(obact->instance_collection)) { Object *obcollection = obact; - Collection *collection = obcollection->dup_group; + Collection *collection = obcollection->instance_collection; const ListBase dup_collection_objects = BKE_collection_object_cache_get(collection); Base *base = BLI_findlink(&dup_collection_objects, RNA_enum_get(op->ptr, "object")); @@ -2302,7 +2302,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op) /* obcollection is no more duplicollection-ing, * it merely parents whole collection of overriding instantiated objects. */ - obcollection->dup_group = NULL; + obcollection->instance_collection = NULL; /* Also, we'd likely want to lock by default things like * transformations of implicitly overridden objects? */ @@ -2350,7 +2350,7 @@ static bool make_override_static_poll(bContext *C) return (BKE_override_static_is_enabled() && ED_operator_objectmode(C) && obact != NULL && ((ID_IS_LINKED(obact) && obact->id.tag & LIB_TAG_EXTERN) || - (!ID_IS_LINKED(obact) && obact->dup_group != NULL && ID_IS_LINKED(obact->dup_group)))); + (!ID_IS_LINKED(obact) && obact->instance_collection != NULL && ID_IS_LINKED(obact->instance_collection)))); } void OBJECT_OT_make_override_static(wmOperatorType *ot) diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 0ae04ab9b33..24660896fae 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -500,16 +500,16 @@ static bool object_select_all_by_material(bContext *C, Material *mat) return changed; } -static bool object_select_all_by_dup_group(bContext *C, Object *ob) +static bool object_select_all_by_instance_collection(bContext *C, Object *ob) { bool changed = false; - Collection *dup_group = (ob->transflag & OB_DUPLICOLLECTION) ? ob->dup_group : NULL; + Collection *instance_collection = (ob->transflag & OB_DUPLICOLLECTION) ? ob->instance_collection : NULL; CTX_DATA_BEGIN (C, Base *, base, visible_bases) { if (((base->flag & BASE_SELECTED) == 0) && ((base->flag & BASE_SELECTABLE) != 0)) { - Collection *dup_group_other = (base->object->transflag & OB_DUPLICOLLECTION) ? base->object->dup_group : NULL; - if (dup_group == dup_group_other) { + Collection *instance_collection_other = (base->object->transflag & OB_DUPLICOLLECTION) ? base->object->instance_collection : NULL; + if (instance_collection == instance_collection_other) { ED_object_base_select(base, BA_SELECT); changed = true; } @@ -649,10 +649,10 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) changed = object_select_all_by_material(C, mat); } else if (nr == OBJECT_SELECT_LINKED_DUPGROUP) { - if (ob->dup_group == NULL) + if (ob->instance_collection == NULL) return OPERATOR_CANCELLED; - changed = object_select_all_by_dup_group(C, ob); + changed = object_select_all_by_instance_collection(C, ob); } else if (nr == OBJECT_SELECT_LINKED_PARTICLE) { if (BLI_listbase_is_empty(&ob->particlesystem)) diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 4fd03d213bc..a9157cfca2b 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -903,8 +903,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) for (tob = bmain->object.first; tob; tob = tob->id.next) { if (tob->data) ((ID *)tob->data)->tag &= ~LIB_TAG_DOIT; - if (tob->dup_group) - ((ID *)tob->dup_group)->tag &= ~LIB_TAG_DOIT; + if (tob->instance_collection) + ((ID *)tob->instance_collection)->tag &= ~LIB_TAG_DOIT; } for (ctx_ob = ctx_data_list.first; @@ -925,8 +925,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (ob->data == NULL) { /* special support for dupligroups */ - if ((ob->transflag & OB_DUPLICOLLECTION) && ob->dup_group && (ob->dup_group->id.tag & LIB_TAG_DOIT) == 0) { - if (ID_IS_LINKED(ob->dup_group)) { + if ((ob->transflag & OB_DUPLICOLLECTION) && ob->instance_collection && (ob->instance_collection->id.tag & LIB_TAG_DOIT) == 0) { + if (ID_IS_LINKED(ob->instance_collection)) { tot_lib_error++; } else { @@ -943,10 +943,10 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) mul_m4_v3(ob->imat, cent); } - add_v3_v3(ob->dup_group->dupli_ofs, cent); + add_v3_v3(ob->instance_collection->dupli_ofs, cent); tot_change++; - ob->dup_group->id.tag |= LIB_TAG_DOIT; + ob->instance_collection->id.tag |= LIB_TAG_DOIT; do_inverse_offset = true; } } @@ -1197,7 +1197,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if ((ob_other->flag & OB_DONE) == 0 && ((ob->data && (ob->data == ob_other->data)) || - (ob->dup_group == ob_other->dup_group && + (ob->instance_collection == ob_other->instance_collection && (ob->transflag | ob_other->transflag) & OB_DUPLICOLLECTION))) { ob_other->flag |= OB_DONE; -- cgit v1.2.3 From de13d0a80c3cb6a7445245b2999a29fe70e49953 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Feb 2019 08:08:12 +1100 Subject: doxygen: add newline after \file While \file doesn't need an argument, it can't have another doxy command after it. --- source/blender/editors/object/object_add.c | 3 ++- source/blender/editors/object/object_bake.c | 3 ++- source/blender/editors/object/object_bake_api.c | 3 ++- source/blender/editors/object/object_collection.c | 3 ++- source/blender/editors/object/object_constraint.c | 3 ++- source/blender/editors/object/object_data_transfer.c | 3 ++- source/blender/editors/object/object_edit.c | 3 ++- source/blender/editors/object/object_facemap_ops.c | 3 ++- source/blender/editors/object/object_gpencil_modifier.c | 3 ++- source/blender/editors/object/object_hook.c | 3 ++- source/blender/editors/object/object_intern.h | 3 ++- source/blender/editors/object/object_modes.c | 3 ++- source/blender/editors/object/object_modifier.c | 3 ++- source/blender/editors/object/object_ops.c | 3 ++- source/blender/editors/object/object_random.c | 3 ++- source/blender/editors/object/object_relations.c | 3 ++- source/blender/editors/object/object_select.c | 3 ++- source/blender/editors/object/object_shader_fx.c | 3 ++- source/blender/editors/object/object_shapekey.c | 3 ++- source/blender/editors/object/object_transform.c | 3 ++- source/blender/editors/object/object_utils.c | 3 ++- source/blender/editors/object/object_vgroup.c | 3 ++- source/blender/editors/object/object_warp.c | 3 ++- 23 files changed, 46 insertions(+), 23 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index baa94806082..2f1ae2a1c39 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index baa0f6f9220..9835d09ec3a 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 17e7b6c23db..1dda976c8a8 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 924e8fe74a1..61a450205be 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 13c3ee9a1a1..0e7e0d5b8ec 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 1398d8fa4a0..8c03d43c313 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include "DNA_mesh_types.h" diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 00d33ca46df..4ade69f7c26 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index 45e2c0dd692..c46310c8c9d 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index 39def80e134..a1f529b3bde 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index b6ec7123d53..f65abb2f269 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index ff153488042..33f821126a2 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #ifndef __OBJECT_INTERN_H__ diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index f8eda3ce1d5..dd0a37b4498 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -14,7 +14,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj * * General utils to handle mode switching, * actual mode switching logic is per-object type. diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index e4c84d26f7b..c7291076234 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 5d9aeab7eb8..024fa24480a 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c index 05f47363ce3..73067be55c7 100644 --- a/source/blender/editors/object/object_random.c +++ b/source/blender/editors/object/object_random.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index ff3fda90495..7cb83834b94 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 24660896fae..3f8936400a2 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index a19c79d2829..8580ea10d35 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 335213efe6d..d445177f236 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index a9157cfca2b..c35df60a82a 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ diff --git a/source/blender/editors/object/object_utils.c b/source/blender/editors/object/object_utils.c index 93b8fe55b77..39f5dad7698 100644 --- a/source/blender/editors/object/object_utils.c +++ b/source/blender/editors/object/object_utils.c @@ -14,7 +14,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 4e0d83f6e8a..f3181f227b2 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include diff --git a/source/blender/editors/object/object_warp.c b/source/blender/editors/object/object_warp.c index d185026c6c2..753e29ca9a7 100644 --- a/source/blender/editors/object/object_warp.c +++ b/source/blender/editors/object/object_warp.c @@ -17,7 +17,8 @@ * All rights reserved. */ -/** \file \ingroup edobj +/** \file + * \ingroup edobj */ #include "DNA_object_types.h" -- cgit v1.2.3 From 022f3392714bc146f43f4000930939f524b82235 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Feb 2019 10:38:34 +1100 Subject: DNA: rename Collection.dupli_ofs -> instance_collection --- source/blender/editors/object/object_transform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index c35df60a82a..31c9a428f3c 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -944,7 +944,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) mul_m4_v3(ob->imat, cent); } - add_v3_v3(ob->instance_collection->dupli_ofs, cent); + add_v3_v3(ob->instance_collection->instance_offset, cent); tot_change++; ob->instance_collection->id.tag |= LIB_TAG_DOIT; -- cgit v1.2.3 From cc10d8653575e0d299b330521c98027f1dc8da36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Feb 2019 15:43:06 +1100 Subject: DNA: rename Object.size -> scale Resolves a common cause of confusion. --- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_transform.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 2f1ae2a1c39..e9aaaccb3d2 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -440,7 +440,7 @@ static int object_add_exec(bContext *C, wmOperator *op) if (ob->type == OB_LATTICE) { /* lattice is a special case! * we never want to scale the obdata since that is the rest-state */ - copy_v3_fl(ob->size, radius); + copy_v3_fl(ob->scale, radius); } else { BKE_object_obdata_size_init(ob, radius); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 31c9a428f3c..00374c12473 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -222,15 +222,15 @@ static void object_clear_scale(Object *ob, const bool clear_delta) { /* clear scale factors which are not locked */ if ((ob->protectflag & OB_LOCK_SCALEX) == 0) { - ob->size[0] = 1.0f; + ob->scale[0] = 1.0f; if (clear_delta) ob->dscale[0] = 1.0f; } if ((ob->protectflag & OB_LOCK_SCALEY) == 0) { - ob->size[1] = 1.0f; + ob->scale[1] = 1.0f; if (clear_delta) ob->dscale[1] = 1.0f; } if ((ob->protectflag & OB_LOCK_SCALEZ) == 0) { - ob->size[2] = 1.0f; + ob->scale[2] = 1.0f; if (clear_delta) ob->dscale[2] = 1.0f; } } @@ -630,7 +630,7 @@ static int apply_objects_internal( continue; if (apply_scale) - BKE_tracking_reconstruction_scale(&clip->tracking, ob->size); + BKE_tracking_reconstruction_scale(&clip->tracking, ob->scale); } else if (ob->type == OB_EMPTY) { /* It's possible for empties too, even though they don't @@ -649,7 +649,7 @@ static int apply_objects_internal( (apply_rot == false) && (apply_scale == true)) { - float max_scale = max_fff(fabsf(ob->size[0]), fabsf(ob->size[1]), fabsf(ob->size[2])); + float max_scale = max_fff(fabsf(ob->scale[0]), fabsf(ob->scale[1]), fabsf(ob->scale[2])); ob->empty_drawsize *= max_scale; } } @@ -680,7 +680,7 @@ static int apply_objects_internal( if (apply_loc) zero_v3(ob->loc); if (apply_scale) - ob->size[0] = ob->size[1] = ob->size[2] = 1.0f; + ob->scale[0] = ob->scale[1] = ob->scale[2] = 1.0f; if (apply_rot) { zero_v3(ob->rot); unit_qt(ob->quat); @@ -1402,10 +1402,10 @@ static void object_apply_rotation(Object *ob, const float rmat[3][3]) float rmat4[4][4]; copy_m4_m3(rmat4, rmat); - copy_v3_v3(size, ob->size); + copy_v3_v3(size, ob->scale); copy_v3_v3(loc, ob->loc); BKE_object_apply_mat4(ob, rmat4, true, true); - copy_v3_v3(ob->size, size); + copy_v3_v3(ob->scale, size); copy_v3_v3(ob->loc, loc); } /* We may want to extract this to: BKE_object_apply_location */ -- cgit v1.2.3 From fc10e89918cbd42a9d787801a896695c78ed7b34 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Feb 2019 08:44:53 +1100 Subject: DNA: rename Object.col -> color Was confusing, unrelated to: colbits, col_mask, col_group, actcol & totcol. --- source/blender/editors/object/object_select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 3f8936400a2..6cc9a495597 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -921,7 +921,7 @@ static bool select_grouped_color(bContext *C, Object *ob) CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { - if (((base->flag & BASE_SELECTED) == 0) && (compare_v3v3(base->object->col, ob->col, 0.005f))) { + if (((base->flag & BASE_SELECTED) == 0) && (compare_v3v3(base->object->color, ob->color, 0.005f))) { ED_object_base_select(base, BA_SELECT); changed = true; } -- cgit v1.2.3 From 1af810b4ff171caa5342aedd6e019b53408b5a9b Mon Sep 17 00:00:00 2001 From: William Reynish Date: Wed, 20 Feb 2019 21:10:32 +0100 Subject: Units: Use correct units for transform operators -Use distance for Shrink/Fatten Distance -Use factor for Smooth Factor -Use Factor for Randomize Uniform and Normal values -Use Distance for Randomize distance amount -Randomize Transform Scale was wrongly using distance --- source/blender/editors/object/object_random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c index 73067be55c7..7c176318c57 100644 --- a/source/blender/editors/object/object_random.c +++ b/source/blender/editors/object/object_random.c @@ -158,12 +158,12 @@ void TRANSFORM_OT_vertex_random(struct wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* props */ - ot->prop = RNA_def_float( + ot->prop = RNA_def_float_distance( ot->srna, "offset", 0.1f, -FLT_MAX, FLT_MAX, "Amount", "Distance to offset", -10.0f, 10.0f); - RNA_def_float(ot->srna, "uniform", 0.0f, 0.0f, 1.0f, "Uniform", + RNA_def_float_factor(ot->srna, "uniform", 0.0f, 0.0f, 1.0f, "Uniform", "Increase for uniform offset distance", 0.0f, 1.0f); - RNA_def_float(ot->srna, "normal", 0.0f, 0.0f, 1.0f, "Normal", + RNA_def_float_factor(ot->srna, "normal", 0.0f, 0.0f, 1.0f, "Normal", "Align offset direction to normals", 0.0f, 1.0f); RNA_def_int(ot->srna, "seed", 0, 0, 10000, "Random Seed", "Seed for the random number generator", 0, 50); } -- cgit v1.2.3 From e9f738754d19a1c578a2d5139a79904873b58204 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 22 Feb 2019 16:40:57 -0300 Subject: Cleanup: Remove redudant function call BKE_main_id_clear_newpoints is already called from copy_object_set_idnew(). --- source/blender/editors/object/object_add.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index e9aaaccb3d2..febd8005e4a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2527,8 +2527,6 @@ static int duplicate_exec(bContext *C, wmOperator *op) copy_object_set_idnew(C); - BKE_main_id_clear_newpoins(bmain); - DEG_relations_tag_update(bmain); DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE | ID_RECALC_SELECT); @@ -2607,8 +2605,6 @@ static int add_named_exec(bContext *C, wmOperator *op) copy_object_set_idnew(C); - BKE_main_id_clear_newpoins(bmain); - /* TODO(sergey): Only update relations for the current scene. */ DEG_relations_tag_update(bmain); -- cgit v1.2.3 From f1317140561bc5f3af81296b081c1922d62ce67f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 25 Feb 2019 16:53:11 +0100 Subject: Fix (unreported) broken code in RNA's datatransfer source layer enum function. Same issue as in own previous commit actually. --- source/blender/editors/object/object_data_transfer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 8c03d43c313..34f758900e9 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -135,7 +135,7 @@ static const EnumPropertyItem *dt_layers_select_src_itemf( Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src); - me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_src_eval, CD_MASK_BAREMESH | CD_MLOOPUV); + me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_src_eval, CD_MASK_BAREMESH | CD_MASK_MLOOPUV); num_data = CustomData_number_of_layers(&me_eval->ldata, CD_MLOOPUV); RNA_enum_item_add_separator(&item, &totitem); @@ -157,7 +157,7 @@ static const EnumPropertyItem *dt_layers_select_src_itemf( Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src); - me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_src_eval, CD_MASK_BAREMESH | CD_MLOOPCOL); + me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_src_eval, CD_MASK_BAREMESH | CD_MASK_MLOOPCOL); num_data = CustomData_number_of_layers(&me_eval->ldata, CD_MLOOPCOL); RNA_enum_item_add_separator(&item, &totitem); -- cgit v1.2.3 From 3051e2f4ae8fd3e72a43dd1e5d40893d0efec500 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Feb 2019 10:46:48 +1100 Subject: DNA: rename Lamp -> Light - BKE_lamp -> BKE_light - Main.lamp -> light --- source/blender/editors/object/object_add.c | 6 +++--- source/blender/editors/object/object_relations.c | 10 +++++----- source/blender/editors/object/object_select.c | 4 ++-- source/blender/editors/object/object_transform.c | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index febd8005e4a..61853f05f46 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1115,7 +1115,7 @@ static int object_light_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob; - Lamp *la; + Light *la; int type = RNA_enum_get(op->ptr, "type"); ushort local_view_bits; float loc[3], rot[3]; @@ -1141,7 +1141,7 @@ static int object_light_add_exec(bContext *C, wmOperator *op) } BKE_object_obdata_size_init(ob, size); - la = (Lamp *)ob->data; + la = (Light *)ob->data; la->type = type; if (BKE_scene_uses_cycles(scene)) { @@ -2351,7 +2351,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer if (dupflag & USER_DUP_LAMP) { ID_NEW_REMAP_US2(obn->data) else { - obn->data = ID_NEW_SET(obn->data, BKE_lamp_copy(bmain, obn->data)); + obn->data = ID_NEW_SET(obn->data, BKE_light_copy(bmain, obn->data)); didit = 1; } id_us_min(id); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 7cb83834b94..de17b3ca281 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1180,7 +1180,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data->tar = obact; DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); - /* Lamp, Camera and Speaker track differently by default */ + /* Light, Camera and Speaker track differently by default */ if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { data->trackflag = TRACK_nZ; } @@ -1203,7 +1203,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data->tar = obact; DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); - /* Lamp, Camera and Speaker track differently by default */ + /* Light, Camera and Speaker track differently by default */ if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { data->reserved1 = TRACK_nZ; data->reserved2 = UP_Y; @@ -1227,7 +1227,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data->tar = obact; DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); - /* Lamp, Camera and Speaker track differently by default */ + /* Light, Camera and Speaker track differently by default */ if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { data->trackflag = TRACK_nZ; data->lockflag = LOCK_Y; @@ -1699,7 +1699,7 @@ static void new_id_matar(Main *bmain, Material **matar, const int totcol) static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag) { - Lamp *la; + Light *la; Curve *cu; /* Camera *cam; */ Mesh *me; @@ -1716,7 +1716,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer switch (ob->type) { case OB_LAMP: - ob->data = la = ID_NEW_SET(ob->data, BKE_lamp_copy(bmain, ob->data)); + ob->data = la = ID_NEW_SET(ob->data, BKE_light_copy(bmain, ob->data)); break; case OB_CAMERA: ob->data = ID_NEW_SET(ob->data, BKE_camera_copy(bmain, ob->data)); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 6cc9a495597..88713b36094 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -868,14 +868,14 @@ static bool select_grouped_siblings(bContext *C, Object *ob) } static bool select_grouped_lamptype(bContext *C, Object *ob) { - Lamp *la = ob->data; + Light *la = ob->data; bool changed = false; CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { if (base->object->type == OB_LAMP) { - Lamp *la_test = base->object->data; + Light *la_test = base->object->data; if ((la->type == la_test->type) && ((base->flag & BASE_SELECTED) == 0)) { ED_object_base_select(base, BA_SELECT); changed = true; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 00374c12473..ee9df67a830 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -510,7 +510,7 @@ static int apply_objects_internal( } if (ob->type == OB_LAMP) { - Lamp *la = ob->data; + Light *la = ob->data; if (la->type == LA_AREA) { if (apply_rot || apply_loc) { BKE_reportf(reports, RPT_ERROR, @@ -654,7 +654,7 @@ static int apply_objects_internal( } } else if (ob->type == OB_LAMP) { - Lamp *la = ob->data; + Light *la = ob->data; if (la->type != LA_AREA) { continue; } @@ -1361,7 +1361,7 @@ static void object_transform_axis_target_calc_depth_init(struct XFormAxisData *x static bool object_is_target_compat(const Object *ob) { if (ob->type == OB_LAMP) { - const Lamp *la = ob->data; + const Light *la = ob->data; if (ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA)) { return true; } -- cgit v1.2.3 From 1079742db92576d79ec89a28d95336aff847a82a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Feb 2019 12:02:02 +1100 Subject: Cleanup: rename lamp -> light --- source/blender/editors/object/object_select.c | 4 ++-- source/blender/editors/object/object_transform.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 88713b36094..f06343abcae 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -866,7 +866,7 @@ static bool select_grouped_siblings(bContext *C, Object *ob) CTX_DATA_END; return changed; } -static bool select_grouped_lamptype(bContext *C, Object *ob) +static bool select_grouped_lighttype(bContext *C, Object *ob) { Light *la = ob->data; @@ -1038,7 +1038,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Active object must be a light"); break; } - changed |= select_grouped_lamptype(C, ob); + changed |= select_grouped_lighttype(C, ob); break; default: break; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index ee9df67a830..ebc6f35e43e 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1287,14 +1287,14 @@ void OBJECT_OT_origin_set(wmOperatorType *ot) /* -------------------------------------------------------------------- */ /** \name Transform Axis Target * - * Note this is an experemental operator to point lamps/cameras at objects. + * Note this is an experemental operator to point lights/cameras at objects. * We may re-work how this behaves based on user feedback. * - campbell. * \{ */ /* When using multiple objects, apply their relative rotational offset to the active object. */ #define USE_RELATIVE_ROTATION -/* Disable overlays, ignoring user setting (lamp wire gets in the way). */ +/* Disable overlays, ignoring user setting (light wire gets in the way). */ #define USE_RENDER_OVERRIDE /* Calculate a depth if the cursor isn't already over a depth (not essential but feels buggy without). */ #define USE_FAKE_DEPTH_INIT @@ -1366,7 +1366,7 @@ static bool object_is_target_compat(const Object *ob) return true; } } - /* We might want to enable this later, for now just lamps */ + /* We might want to enable this later, for now just lights. */ #if 0 else if (ob->type == OB_CAMERA) { return true; -- cgit v1.2.3 From 168d3fd528c419b1f877362ef9ffecfc8c790a8a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Feb 2019 12:34:56 +1100 Subject: Cleanup: file rename lamp -> light --- source/blender/editors/object/object_add.c | 6 +++--- source/blender/editors/object/object_relations.c | 4 ++-- source/blender/editors/object/object_select.c | 2 +- source/blender/editors/object/object_transform.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 61853f05f46..b95aa6c787a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -32,7 +32,7 @@ #include "DNA_camera_types.h" #include "DNA_collection_types.h" #include "DNA_curve_types.h" -#include "DNA_lamp_types.h" +#include "DNA_light_types.h" #include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" @@ -67,7 +67,7 @@ #include "BKE_font.h" #include "BKE_gpencil.h" #include "BKE_key.h" -#include "BKE_lamp.h" +#include "BKE_light.h" #include "BKE_lattice.h" #include "BKE_layer.h" #include "BKE_library.h" @@ -114,7 +114,7 @@ #include "object_intern.h" -/* this is an exact copy of the define in rna_lamp.c +/* this is an exact copy of the define in rna_light.c * kept here because of linking order. * Icons are only defined here */ const EnumPropertyItem rna_enum_light_type_items[] = { diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index de17b3ca281..4d6864d2023 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -33,7 +33,7 @@ #include "DNA_mesh_types.h" #include "DNA_collection_types.h" #include "DNA_constraint_types.h" -#include "DNA_lamp_types.h" +#include "DNA_light_types.h" #include "DNA_lattice_types.h" #include "DNA_material_types.h" #include "DNA_meta_types.h" @@ -67,7 +67,7 @@ #include "BKE_gpencil.h" #include "BKE_fcurve.h" #include "BKE_idprop.h" -#include "BKE_lamp.h" +#include "BKE_light.h" #include "BKE_lattice.h" #include "BKE_layer.h" #include "BKE_library.h" diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index f06343abcae..96dc18b41f0 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -33,7 +33,7 @@ #include "DNA_modifier_types.h" #include "DNA_scene_types.h" #include "DNA_armature_types.h" -#include "DNA_lamp_types.h" +#include "DNA_light_types.h" #include "DNA_workspace_types.h" #include "DNA_gpencil_types.h" diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index ebc6f35e43e..ea51fdb5c86 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -29,7 +29,7 @@ #include "DNA_armature_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" -#include "DNA_lamp_types.h" +#include "DNA_light_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_gpencil_types.h" -- cgit v1.2.3 From 846d265a06e39c86574cba6722495b6373596c7a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 27 Feb 2019 17:09:30 +0100 Subject: Split base flags on own and collection-defined This allows to update base flags to a proper state then object's restriction flags are changed, without requiring to re-evaluate an entire tree of flags. Some old unused flags are were removed by this change, and also disabling menu items might not work the same as before. This is something we can bring back if it's really needed (the way how flags are handled did change since that interface code was done anyway, so code was looking weird anyway). Reviewers: brecht Differential Revision: https://developer.blender.org/D4420 --- source/blender/editors/object/object_edit.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 4ade69f7c26..cd8eeba73d4 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -306,12 +306,6 @@ void ED_collection_hide_menu_draw(const bContext *C, uiLayout *layout) continue; } - if ((view_layer->runtime_flag & VIEW_LAYER_HAS_HIDE) && - !(lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS)) - { - uiLayoutSetActive(row, false); - } - int icon = ICON_NONE; if (BKE_layer_collection_has_selected_objects(view_layer, lc)) { icon = ICON_LAYER_ACTIVE; -- cgit v1.2.3 From 9ddc2064a4c7b0a40882be943f76b2e26f2334d3 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Wed, 27 Feb 2019 20:46:04 +0100 Subject: GPencil: Remove dummy marker for Grease Pencil objects After adding selecction using strokes, the dummy is not required because it was added as a provisional solution while we implement stroke selection. --- source/blender/editors/object/object_add.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index b95aa6c787a..425035d41cc 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1018,12 +1018,9 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) } } - float radius = RNA_float_get(op->ptr, "radius"); ob = ED_object_add_type(C, OB_GPENCIL, ob_name, loc, rot, true, local_view_bits); gpd = ob->data; newob = true; - - BKE_object_obdata_size_init(ob, GP_OBGPENCIL_DEFAULT_SIZE * radius); } else { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); -- cgit v1.2.3 From e7ea99af1b0d933b9323be39d8b1c6f683bfba52 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 26 Feb 2019 16:15:30 -0300 Subject: Outliner: Collection - Duplicate Hierarchy, and Duplicate Linked Hierarchy As per the suggestion on T57064, this introduces two new options to duplicate collections. We then have: * Duplicate > Collection (New collection with linked content). * Duplicate > Hierachy (Duplicate entire hierarchy and make all contents single user). * Duplicate > Linked Hierarchy (Duplicate entire hierarchy keeping content linked with original). Development TODO: `single_object_users` can/should use the new functions. Reviewers: brecht, mont29 Subscribers: pablovazquez, billreynish, JulienKaspar Differential Revision: https://developer.blender.org/D4394 --- source/blender/editors/object/object_add.c | 214 +---------------------------- 1 file changed, 1 insertion(+), 213 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 425035d41cc..b69c88ecb7f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2208,20 +2208,14 @@ void OBJECT_OT_convert(wmOperatorType *ot) /* Does set ID->newid pointers. */ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer *view_layer, Object *ob, int dupflag) { -#define ID_NEW_REMAP_US(a) if ( (a)->id.newid) { (a) = (void *)(a)->id.newid; (a)->id.us++; } -#define ID_NEW_REMAP_US2(a) if (((ID *)a)->newid) { (a) = ((ID *)a)->newid; ((ID *)a)->us++; } - Base *base, *basen = NULL; - Material ***matarar; Object *obn; - ID *id; - int a, didit; if (ob->mode & OB_MODE_POSE) { ; /* nothing? */ } else { - obn = ID_NEW_SET(ob, BKE_object_copy(bmain, ob)); + obn = ID_NEW_SET(ob, BKE_object_duplicate(bmain, ob, dupflag)); DEG_id_tag_update(&obn->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); base = BKE_view_layer_base_find(view_layer, ob); @@ -2249,214 +2243,8 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer BKE_collection_object_add(bmain, collection, obn); } } - - /* duplicates using userflags */ - if (dupflag & USER_DUP_ACT) { - BKE_animdata_copy_id_action(bmain, &obn->id, true); - } - - if (dupflag & USER_DUP_MAT) { - for (a = 0; a < obn->totcol; a++) { - id = (ID *)obn->mat[a]; - if (id) { - ID_NEW_REMAP_US(obn->mat[a]) - else { - obn->mat[a] = ID_NEW_SET(obn->mat[a], BKE_material_copy(bmain, obn->mat[a])); - } - id_us_min(id); - - if (dupflag & USER_DUP_ACT) { - BKE_animdata_copy_id_action(bmain, &obn->mat[a]->id, true); - } - } - } - } - if (dupflag & USER_DUP_PSYS) { - ParticleSystem *psys; - for (psys = obn->particlesystem.first; psys; psys = psys->next) { - id = (ID *) psys->part; - if (id) { - ID_NEW_REMAP_US(psys->part) - else { - psys->part = ID_NEW_SET(psys->part, BKE_particlesettings_copy(bmain, psys->part)); - } - - if (dupflag & USER_DUP_ACT) { - BKE_animdata_copy_id_action(bmain, &psys->part->id, true); - } - - id_us_min(id); - } - } - } - - id = obn->data; - didit = 0; - - switch (obn->type) { - case OB_MESH: - if (dupflag & USER_DUP_MESH) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_mesh_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_CURVE: - if (dupflag & USER_DUP_CURVE) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_curve_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_SURF: - if (dupflag & USER_DUP_SURF) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_curve_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_FONT: - if (dupflag & USER_DUP_FONT) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_curve_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_MBALL: - if (dupflag & USER_DUP_MBALL) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_mball_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_LAMP: - if (dupflag & USER_DUP_LAMP) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_light_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_ARMATURE: - DEG_id_tag_update(&obn->id, ID_RECALC_GEOMETRY); - if (obn->pose) - BKE_pose_tag_recalc(bmain, obn->pose); - if (dupflag & USER_DUP_ARM) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_armature_copy(bmain, obn->data)); - BKE_pose_rebuild(bmain, obn, obn->data, true); - didit = 1; - } - id_us_min(id); - } - break; - case OB_LATTICE: - if (dupflag != 0) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_lattice_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_CAMERA: - if (dupflag != 0) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_camera_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_LIGHTPROBE: - if (dupflag != 0) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_lightprobe_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_SPEAKER: - if (dupflag != 0) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_speaker_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - case OB_GPENCIL: - if (dupflag != 0) { - ID_NEW_REMAP_US2(obn->data) - else { - obn->data = ID_NEW_SET(obn->data, BKE_gpencil_copy(bmain, obn->data)); - didit = 1; - } - id_us_min(id); - } - break; - } - - /* check if obdata is copied */ - if (didit) { - Key *key = BKE_key_from_object(obn); - - Key *oldkey = BKE_key_from_object(ob); - if (oldkey != NULL) { - ID_NEW_SET(oldkey, key); - } - - if (dupflag & USER_DUP_ACT) { - BKE_animdata_copy_id_action(bmain, (ID *)obn->data, true); - if (key) { - BKE_animdata_copy_id_action(bmain, (ID *)key, true); - } - } - - if (dupflag & USER_DUP_MAT) { - matarar = give_matarar(obn); - if (matarar) { - for (a = 0; a < obn->totcol; a++) { - id = (ID *)(*matarar)[a]; - if (id) { - ID_NEW_REMAP_US((*matarar)[a]) - else { - (*matarar)[a] = ID_NEW_SET((*matarar)[a], BKE_material_copy(bmain, (*matarar)[a])); - } - id_us_min(id); - } - } - } - } - } } return basen; - -#undef ID_NEW_REMAP_US -#undef ID_NEW_REMAP_US2 } /* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */ -- cgit v1.2.3