[Bf-blender-cvs] [5baf0de6e74] blender2.8: Merge branch 'master' into blender2.8
Sergey Sharybin
noreply at git.blender.org
Fri Mar 16 11:25:09 CET 2018
Commit: 5baf0de6e74a4df43dea91e177aeece5468648c4
Author: Sergey Sharybin
Date: Fri Mar 16 11:17:45 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB5baf0de6e74a4df43dea91e177aeece5468648c4
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/anim_sys.c
index d1b26d9a2a0,e2c371348e5..ecdb180d2ed
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@@ -2879,9 -2920,7 +2881,7 @@@ void BKE_animsys_evaluate_all_animation
/* ************** */
/* Evaluation API */
- #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,
@@@ -2918,13 -2939,8 +2918,10 @@@ void BKE_animsys_eval_driver(const Eval
PointerRNA id_ptr;
bool ok = false;
+ fcu = find_driver_from_evaluated_id(id, fcu);
+
- DEBUG_PRINT("%s on %s (%s[%d])\n",
- __func__,
- id->name,
- fcu->rna_path,
- fcu->array_index);
+ DEG_debug_print_eval_subdata_index(
+ __func__, id->name, id, "fcu", fcu->rna_path, fcu, fcu->array_index);
RNA_id_pointer_create(id, &id_ptr);
diff --cc source/blender/blenkernel/intern/armature_update.c
index 203dcbf247c,e6bb0d6b7ce..bf065ef992c
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@@ -712,12 -710,14 +717,12 @@@ void BKE_pose_eval_flush(const struct E
/* 6. release the IK tree */
BIK_release_tree(scene, ob, ctime);
-
- ob->recalc &= ~OB_RECALC_ALL;
}
-void BKE_pose_eval_proxy_copy(EvaluationContext *UNUSED(eval_ctx), Object *ob)
+void BKE_pose_eval_proxy_copy(const struct EvaluationContext *UNUSED(eval_ctx), Object *ob)
{
BLI_assert(ID_IS_LINKED(ob) && ob->proxy_from != NULL);
- DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
+ DEG_debug_print_eval(__func__, ob->id.name, ob);
if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
printf("Proxy copy error, lib Object: %s proxy Object: %s\n",
ob->id.name + 2, ob->proxy_from->id.name + 2);
diff --cc source/blender/blenkernel/intern/curve.c
index b5ad2bcef4e,943cab0a9fc..0c4dbdf7763
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@@ -5255,12 -5252,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_EVAL) {
- printf("%s on %s\n", __func__, curve->id.name);
- }
+ DEG_debug_print_eval(__func__, curve->id.name, curve);
if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) {
BKE_curve_texspace_calc(curve);
}
diff --cc source/blender/blenkernel/intern/group.c
index c3fe586bbbb,6dc8cc5aff1..20da1e7b7ac
--- 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_EVAL) printf
-static void free_group_object(GroupObject *go)
-{
- MEM_freeN(go);
-}
++#include "DEG_depsgraph.h"
/** Free (or release) any data used by this group (does not free the group itself). */
void BKE_group_free(Group *group)
@@@ -369,45 -367,12 +369,45 @@@ void BKE_group_handle_recalc_and_update
#endif
{
/* only do existing tags, as set by regular depsgraph */
- for (go = group->gobject.first; go; go = go->next) {
- if (go->ob) {
- if (go->ob->recalc) {
- BKE_object_handle_update(eval_ctx, scene, go->ob);
- }
+ FOREACH_GROUP_OBJECT_BEGIN(group, object)
+ {
+ if (object->id.recalc & ID_RECALC_ALL) {
+ BKE_object_handle_update(eval_ctx, scene, object);
}
}
+ FOREACH_GROUP_OBJECT_END;
+ }
+}
+
+/* ******** Dependency graph evaluation ******** */
+
+static void group_eval_layer_collections(
+ const struct EvaluationContext *eval_ctx,
+ Group *group,
+ ListBase *layer_collections,
+ LayerCollection *parent_layer_collection)
+{
+ LISTBASE_FOREACH (LayerCollection *, layer_collection, layer_collections) {
+ /* Evaluate layer collection itself. */
+ BKE_layer_eval_layer_collection(eval_ctx,
+ layer_collection,
+ parent_layer_collection);
+ /* Evaluate nested collections. */
+ group_eval_layer_collections(eval_ctx,
+ group,
+ &layer_collection->layer_collections,
+ layer_collection);
}
}
+
+void BKE_group_eval_view_layers(const struct EvaluationContext *eval_ctx,
+ Group *group)
+{
- DEBUG_PRINT("%s on %s (%p)\n", __func__, group->id.name, group);
++ DEG_debug_print_eval(__func__, group->id.name, group);
+ BKE_layer_eval_layer_collection_pre(eval_ctx, &group->id, group->view_layer);
+ group_eval_layer_collections(eval_ctx,
+ group,
+ &group->view_layer->layer_collections,
+ NULL);
+ BKE_layer_eval_layer_collection_post(eval_ctx, group->view_layer);
+}
diff --cc source/blender/blenkernel/intern/layer.c
index cde256a0f14,00000000000..78af18fa362
mode 100644,000000..100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@@ -1,2363 -1,0 +1,2364 @@@
+/*
+ * ***** 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_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->
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list