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:
authorHans Goudey <h.goudey@me.com>2021-08-25 01:40:18 +0300
committerHans Goudey <h.goudey@me.com>2021-08-25 01:40:18 +0300
commit137a5e162c2435662dbb299ff49771e7d2e7598f (patch)
treea40ebf526c1a320c7a9fa0c8456dfe2ffd4db6a6 /source/blender/blenkernel/intern/scene.c
parentaad18a005026cfaa19c45f2477318c6e06303eae (diff)
parent5ef3afd87c54b47614254d95c9b2e9a17c60f76e (diff)
Merge branch 'master' into refactor-idprop-ui-data
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 9dab276af95..5a668746956 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -109,6 +109,8 @@
#include "RE_engine.h"
+#include "RNA_access.h"
+
#include "SEQ_edit.h"
#include "SEQ_iterator.h"
#include "SEQ_modifier.h"
@@ -445,7 +447,8 @@ static void scene_free_data(ID *id)
* for objects directly in the master collection? then other
* collections in the scene need to do it too? */
if (scene->master_collection) {
- BKE_collection_free(scene->master_collection);
+ BKE_collection_free_data(scene->master_collection);
+ BKE_libblock_free_data_py(&scene->master_collection->id);
MEM_freeN(scene->master_collection);
scene->master_collection = NULL;
}
@@ -1173,11 +1176,6 @@ static void scene_blend_read_data(BlendDataReader *reader, ID *id)
seq->flag |= SEQ_EFFECT_NOT_LOADED;
}
- if (seq->type == SEQ_TYPE_SPEED) {
- SpeedControlVars *s = seq->effectdata;
- s->frameMap = NULL;
- }
-
if (seq->type == SEQ_TYPE_TEXT) {
TextVars *t = seq->effectdata;
t->text_blf_id = SEQ_FONT_NOT_LOADED;
@@ -1986,9 +1984,12 @@ Scene *BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type)
if (type == SCE_COPY_FULL) {
/* Scene duplication is always root of duplication currently. */
const bool is_subprocess = false;
+ const bool is_root_id = true;
if (!is_subprocess) {
BKE_main_id_newptr_and_tag_clear(bmain);
+ }
+ if (is_root_id) {
/* In case root duplicated ID is linked, assume we want to get a local copy of it and
* duplicate all expected linked data. */
if (ID_IS_LINKED(sce)) {
@@ -2937,6 +2938,22 @@ bool BKE_scene_uses_cycles(const Scene *scene)
return STREQ(scene->r.engine, RE_engine_id_CYCLES);
}
+/* This enumeration has to match the one defined in the Cycles addon. */
+typedef enum eCyclesFeatureSet {
+ CYCLES_FEATURES_SUPPORTED = 0,
+ CYCLES_FEATURES_EXPERIMENTAL = 1,
+} eCyclesFeatureSet;
+
+/* We cannot use const as RNA_id_pointer_create is not using a const ID. */
+bool BKE_scene_uses_cycles_experimental_features(Scene *scene)
+{
+ BLI_assert(BKE_scene_uses_cycles(scene));
+ PointerRNA scene_ptr;
+ RNA_id_pointer_create(&scene->id, &scene_ptr);
+ PointerRNA cycles_ptr = RNA_pointer_get(&scene_ptr, "cycles");
+ return RNA_enum_get(&cycles_ptr, "feature_set") == CYCLES_FEATURES_EXPERIMENTAL;
+}
+
void BKE_scene_base_flag_to_objects(ViewLayer *view_layer)
{
Base *base = view_layer->object_bases.first;