diff options
author | Dalai Felinto <dalai@blender.org> | 2022-03-30 12:06:10 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2022-03-30 12:06:10 +0300 |
commit | 35f34a3cf840852b70c1be5910be5517265d96cc (patch) | |
tree | 85feca0e8d12261484df49dde2f0db621cdc5971 /source/blender/editors/object/object_relations.c | |
parent | 218bcff32db55874ccc35300ddd21baa585350dd (diff) |
Modifiers: Support applying modifiers for multi-user data
The current behaviour is to prevent multi-user data from having its
modifier applied.
Instead, with this patch, we now warn the user that if they want to
proceed the object will be made single-user.
Note that this only makes the object data single-user. Not the material
or actions.
As a future step we can apply the same behaviour for the Grease Pencil modifiers
Differential Revision: https://developer.blender.org/D14381
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 064a84cdea5..7be46bdb24b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1893,6 +1893,19 @@ static void single_obdata_users( } } +void ED_object_single_obdata_user(Main *bmain, Scene *scene, Object *ob) +{ + FOREACH_SCENE_OBJECT_BEGIN (scene, ob_iter) { + ob_iter->flag &= ~OB_DONE; + } + FOREACH_SCENE_OBJECT_END; + + /* Tag only the one object. */ + ob->flag |= OB_DONE; + + single_obdata_users(bmain, scene, NULL, NULL, OB_DONE); +} + static void single_object_action_users( Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag) { |