[Bf-blender-cvs] [d4ee0cee51e] blender2.8: Merge branch 'master' into blender2.8
Sergey Sharybin
noreply at git.blender.org
Wed Feb 21 10:52:20 CET 2018
Commit: d4ee0cee51e01cf62acc1e239844fcb6c7dbf449
Author: Sergey Sharybin
Date: Wed Feb 21 10:51:58 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBd4ee0cee51e01cf62acc1e239844fcb6c7dbf449
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_global.h
index 80a8f750d20,f3d44164b1e..78d8271458d
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@@ -122,13 -122,15 +122,16 @@@ enum
G_DEBUG_WM = (1 << 5), /* operator, undo */
G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
- G_DEBUG_DEPSGRAPH = (1 << 8), /* depsgraph messages */
- G_DEBUG_SIMDATA = (1 << 9), /* sim debug data display */
- G_DEBUG_GPU_MEM = (1 << 10), /* gpu memory in status bar */
+ G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
+ G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
+ G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 11), /* single threaded depsgraph */
- G_DEBUG_GPU = (1 << 12), /* gpu debug */
+ G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | G_DEBUG_DEPSGRAPH_TAG),
+ G_DEBUG_SIMDATA = (1 << 12), /* sim debug data display */
+ G_DEBUG_GPU_MEM = (1 << 13), /* gpu memory in status bar */
- G_DEBUG_GPU = (1 << 14), /* gpu debug */
- G_DEBUG_IO = (1 << 15), /* IO Debugging (for Collada, ...)*/
++ G_DEBUG_GPU = (1 << 14), /* gpu debug */
+ G_DEBUG_IO = (1 << 13), /* IO Debugging (for Collada, ...)*/
- G_DEBUG_GPU_SHADERS = (1 << 14), /* GLSL shaders */
++ G_DEBUG_GPU_SHADERS = (1 << 15), /* GLSL shaders */
};
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
diff --cc source/blender/blenkernel/intern/anim_sys.c
index 844a2a50bb3,95d9a769749..631d3743970
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@@ -2879,9 -2918,9 +2879,9 @@@ void BKE_animsys_evaluate_all_animation
/* ************** */
/* Evaluation API */
- #define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+ #define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
-void BKE_animsys_eval_animdata(EvaluationContext *eval_ctx, ID *id)
+void BKE_animsys_eval_animdata(const EvaluationContext *eval_ctx, ID *id)
{
AnimData *adt = BKE_animdata_from_id(id);
Scene *scene = NULL; /* XXX: this is only needed for flushing RNA updates,
diff --cc source/blender/blenkernel/intern/armature_update.c
index de0dfe2530d,2e9b2f7d20f..203dcbf247c
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@@ -50,7 -51,13 +50,7 @@@
#include "BKE_global.h"
#include "BKE_main.h"
- #define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
-#include "DEG_depsgraph.h"
-
-#ifdef WITH_LEGACY_DEPSGRAPH
-# define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
-#else
-# define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
-#endif
++#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
/* ********************** SPLINE IK SOLVER ******************* */
diff --cc source/blender/blenkernel/intern/curve.c
index 2a27bad0fb5,f0759748fee..b5ad2bcef4e
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@@ -5255,10 -5250,10 +5255,10 @@@ void BKE_curve_rect_from_textbox(const
/* **** Depsgraph evaluation **** */
-void BKE_curve_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
+void BKE_curve_eval_geometry(const EvaluationContext *UNUSED(eval_ctx),
Curve *curve)
{
- if (G.debug & G_DEBUG_DEPSGRAPH) {
+ if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s\n", __func__, curve->id.name);
}
if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) {
diff --cc source/blender/blenkernel/intern/group.c
index c615f67fe42,6dc8cc5aff1..8fa8da8b0ca
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@@ -53,9 -53,12 +53,9 @@@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
-#include "BKE_scene.h" /* BKE_scene_base_find */
+#include "BKE_scene.h"
- #define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
-static void free_group_object(GroupObject *go)
-{
- MEM_freeN(go);
-}
++#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
/** Free (or release) any data used by this group (does not free the group itself). */
void BKE_group_free(Group *group)
diff --cc source/blender/blenkernel/intern/layer.c
index 8e7b7f5456b,00000000000..82ac666c46b
mode 100644,000000..100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@@ -1,2363 -1,0 +1,2363 @@@
+/*
+ * ***** 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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): Dalai Felinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenkernel/intern/layer.c
+ * \ingroup bke
+ */
+
+#include <string.h>
+
+#include "BLI_listbase.h"
+#include "BLI_string.h"
+#include "BLI_string_utf8.h"
+#include "BLI_string_utils.h"
+#include "BLT_translation.h"
+
+#include "BKE_collection.h"
+#include "BKE_freestyle.h"
+#include "BKE_global.h"
+#include "BKE_group.h"
+#include "BKE_idprop.h"
+#include "BKE_layer.h"
+#include "BKE_main.h"
+#include "BKE_node.h"
+#include "BKE_workspace.h"
+
+#include "DEG_depsgraph.h"
+
+#include "DNA_group_types.h"
+#include "DNA_ID.h"
+#include "DNA_layer_types.h"
+#include "DNA_object_types.h"
+#include "DNA_node_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_windowmanager_types.h"
+#include "DNA_workspace_types.h"
+
+#include "DRW_engine.h"
+
+#include "MEM_guardedalloc.h"
+
- #define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
++#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
+
+/* prototype */
+struct EngineSettingsCB_Type;
+static void layer_collections_sync_flags(ListBase *layer_collections_dst, const ListBase *layer_collections_src);
+static void layer_collection_free(ViewLayer *view_layer, LayerCollection *lc);
+static void layer_collection_objects_populate(ViewLayer *view_layer, LayerCollection *lc, ListBase *objects);
+static LayerCollection *layer_collection_add(ViewLayer *view_layer, LayerCollection *parent, SceneCollection *sc);
+static LayerCollection *find_layer_collection_by_scene_collection(LayerCollection *lc, const SceneCollection *sc);
+static IDProperty *collection_engine_settings_create(struct EngineSettingsCB_Type *ces_type, const bool populate);
+static IDProperty *collection_engine_get(IDProperty *root, const int type, const char *engine_name);
+static void collection_engine_settings_init(IDProperty *root, const bool populate);
+static void layer_engine_settings_init(IDProperty *root, const bool populate);
+static void object_bases_iterator_next(BLI_Iterator *iter, const int flag);
+
+/* RenderLayer */
+
+/**
+ * Returns the ViewLayer to be used for rendering
+ * Most of the time BKE_view_layer_from_workspace_get should be used instead
+ */
+ViewLayer *BKE_view_layer_from_scene_get(const Scene *scene)
+{
+ ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer);
+ BLI_assert(view_layer);
+ return view_layer;
+}
+
+/**
+ * Returns the ViewLayer to be used for drawing, outliner, and other context related areas.
+ */
+ViewLayer *BKE_view_layer_from_workspace_get(const struct Scene *scene, const struct WorkSpace *workspace)
+{
+ if (BKE_workspace_use_scene_settings_get(workspace)) {
+ return BKE_view_layer_from_scene_get(scene);
+ }
+ else {
+ return BKE_workspace_view_layer_get(workspace, scene);
+ }
+}
+
+/**
+ * This is a placeholder to know which areas of the code need to be addressed for the Workspace changes.
+ * Never use this, you should either use BKE_view_layer_from_workspace_get or get ViewLayer explicitly.
+ */
+ViewLayer *BKE_view_layer_context_active_PLACEHOLDER(const Scene *scene)
+{
+ return BKE_view_layer_from_scene_get(scene);
+}
+
+static ViewLayer *view_layer_add(const char *name, SceneCollection *master_scene_collection)
+{
+ if (!name) {
+ name = DATA_("View Layer");
+ }
+
+ IDPropertyTemplate val = {0};
+ ViewLayer *view_layer = MEM_callocN(sizeof(ViewLayer), "View Layer");
+ view_layer->flag = VIEW_LAYER_RENDER | VIEW_LAYER_FREESTYLE;
+
+ view_layer->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP);
+ layer_engine_settings_init(view_layer->properties, false);
+ BLI_strncpy_utf8(view_layer->name, name, sizeof(view_layer->name));
+
+ /* Link the master collection by default. */
+ layer_collection_add(view_layer, NULL, master_scene_collection);
+
+ /* Pure rendering pipeline settings. */
+ view_layer->layflag = 0x7FFF; /* solid ztra halo edge strand */
+ view_layer->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
+ view_layer->pass_alpha_threshold = 0.5f;
+ BKE_freestyle_config_init(&view_layer->freestyle_config);
+
+ return view_layer;
+}
+
+/**
+ * Add a new view layer
+ * by default, a view layer has the master collection
+ */
+ViewLayer *BKE_view_layer_add(Scene *scene, const char *name)
+{
+ SceneCollection *sc = BKE_collection_master(&scene->id);
+ ViewLayer *view_layer = view_layer_add(name, sc);
+
+ BLI_addtail(&scene->view_layers, view_layer);
+
+ /* unique name */
+ BLI_uniquename(
+ &scene->view_layers, view_layer, DATA_("ViewLayer"), '.',
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list