Depsgraph: Support changing scene's render engine

This commit is contained in:
Sergey Sharybin
2017-07-25 15:11:51 +02:00
parent f7636f0ef2
commit 80e03e7709
2 changed files with 8 additions and 3 deletions

View File

@@ -547,9 +547,11 @@ void update_copy_on_write_scene(const Depsgraph *depsgraph,
else {
scene_cow->obedit = NULL;
}
// TODO(sergey): Things which are still missing here:
// - Active render engine.
// - Something else?
/* Synchronize active render engine. */
BLI_strncpy_utf8(scene_cow->r.engine,
scene_orig->r.engine,
sizeof(scene_cow->r.engine));
/* TODO(sergey): What else do we need here? */
}
/* Update copy-on-write version of armature object from original scene. */

View File

@@ -1569,9 +1569,12 @@ static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
{
RenderData *rd = (RenderData *)ptr->data;
RenderEngineType *type = BLI_findlink(&R_engines, value);
Scene *scene = (Scene *)ptr->id.data;
if (type)
BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine));
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
}
static EnumPropertyItem *rna_RenderSettings_engine_itemf(