Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r--source/blender/editors/object/object_relations.c231
1 files changed, 90 insertions, 141 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 867b807c908..4d6864d2023 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,14 +15,10 @@
*
* 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
- * \ingroup edobj
+/** \file
+ * \ingroup edobj
*/
@@ -39,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"
@@ -70,11 +64,10 @@
#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"
-#include "BKE_lamp.h"
+#include "BKE_light.h"
#include "BKE_lattice.h"
#include "BKE_layer.h"
#include "BKE_library.h"
@@ -152,7 +145,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);
@@ -305,9 +298,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;
}
@@ -341,9 +334,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 {
@@ -385,19 +378,20 @@ 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;
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++;
@@ -452,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 */
@@ -504,7 +498,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 */
@@ -513,14 +508,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;
}
@@ -609,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,
@@ -631,7 +628,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, NULL);
}
else {
cu->flag |= CU_FOLLOW;
@@ -915,7 +913,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);
@@ -935,26 +933,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);
}
@@ -1057,83 +1075,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 {
@@ -1144,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 */
@@ -1214,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)
@@ -1239,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;
}
@@ -1262,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;
@@ -1286,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;
@@ -1336,7 +1277,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);
@@ -1468,7 +1409,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;
@@ -1492,7 +1434,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 {
@@ -1502,9 +1444,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;
@@ -1601,11 +1543,12 @@ 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}};
+ {0, NULL, 0, NULL, NULL},
+ };
/* identifiers */
ot->name = "Link Data";
@@ -1654,7 +1597,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));
}
}
@@ -1756,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;
@@ -1773,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));
@@ -1867,7 +1810,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);
@@ -2182,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 */
@@ -2213,8 +2157,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) {
@@ -2256,7 +2201,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;
@@ -2291,9 +2236,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"));
@@ -2356,10 +2301,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->dup_group = NULL;
+ /* obcollection is no more duplicollection-ing,
+ * it merely parents whole collection of overriding instantiated objects. */
+ obcollection->instance_collection = 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);
@@ -2379,7 +2326,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);
@@ -2403,7 +2351,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)
@@ -2486,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";