Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 30 Jan 2018 13:32:27 +0000 (14:32 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 30 Jan 2018 13:32:27 +0000 (14:32 +0100)
16 files changed:
1  2 
intern/cycles/blender/blender_mesh.cpp
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/paint.c
source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.h
source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
source/blender/editors/include/ED_view3d.h
source/blender/editors/object/object_edit.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/makesrna/intern/rna_space.c
source/creator/creator_args.c

Simple merge
index 2fc42efa440009a1409d0bc6588071d90c456e9f,29cd72c13fd71b8465b0e12a1ae6ea6cb5ef541b..8be974aae3954f16865fe33142e32e08c82f8d8b
@@@ -321,52 -257,34 +321,52 @@@ void DepsgraphNodeBuilder::build_proxy_
  {
        bArmature *arm = (bArmature *)object->data;
        OperationDepsNode *op_node;
 -
 -      build_animdata(&arm->id);
 -
 +      Object *object_cow;
 +      if (DEG_depsgraph_use_copy_on_write()) {
 +              /* NOTE: We need to expand both object and armature, so this way we can
 +               * safely create object level pose.
 +               */
 +              object_cow = expand_cow_datablock(object);
 +      }
 +      else {
 +              object_cow = object;
 +      }
 +      /* Sanity check. */
        BLI_assert(object->pose != NULL);
 -
 +      /* Animation. */
 +      build_animdata(&arm->id);
        /* speed optimization for animation lookups */
        BKE_pose_channels_hash_make(object->pose);
 -      if (object->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
 -              BKE_pose_update_constraint_flags(object->pose);
 +      if (object_cow->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
 +              BKE_pose_update_constraint_flags(object_cow->pose);
        }
 -
        op_node = add_operation_node(&object->id,
                                     DEG_NODE_TYPE_EVAL_POSE,
 -                                   function_bind(BKE_pose_eval_proxy_copy, _1, object),
 +                                   function_bind(BKE_pose_eval_proxy_copy,
 +                                                 _1,
 +                                                 object_cow),
                                     DEG_OPCODE_POSE_INIT);
        op_node->set_as_entry();
-       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) {
-               /* Local bone transform. */
 -
+       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
 -              op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name,
 -                                           NULL, DEG_OPCODE_BONE_LOCAL);
 +              op_node = add_operation_node(&object->id,
 +                                           DEG_NODE_TYPE_BONE,
 +                                           pchan->name,
 +                                           NULL,
 +                                           DEG_OPCODE_BONE_LOCAL);
                op_node->set_as_entry();
 -
 -              add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name,
 -                                 NULL, DEG_OPCODE_BONE_READY);
 -
 -              op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name,
 -                                           NULL, DEG_OPCODE_BONE_DONE);
 +              /* Bone is ready for solvers. */
 +              add_operation_node(&object->id,
 +                                 DEG_NODE_TYPE_BONE,
 +                                 pchan->name,
 +                                 NULL,
 +                                 DEG_OPCODE_BONE_READY);
 +              /* Bone is fully evaluated. */
 +              op_node = add_operation_node(&object->id,
 +                                           DEG_NODE_TYPE_BONE,
 +                                           pchan->name,
 +                                           NULL,
 +                                           DEG_OPCODE_BONE_DONE);
                op_node->set_as_exit();
  
                /* Custom properties. */
index 0c1df71b1aa2152c29f0dc8c6a0ca741ed22df9c,490343ab1f2cb9b8050db0bc2b580b0d09453bbb..b536f42a54e5a02f152d275080e33bfd1b009883
@@@ -938,11 -937,14 +938,14 @@@ static void do_weight_paint_vertex
  
  
  /* Toggle operator for turning vertex paint mode on or off (copied from sculpt.c) */
 -static void vertex_paint_init_session(Scene *scene, Object *ob)
 +static void vertex_paint_init_session(const EvaluationContext *eval_ctx, Scene *scene, Object *ob)
  {
+       /* Create persistent sculpt mode data */
+       BKE_sculpt_toolsettings_data_ensure(scene);
        if (ob->sculpt == NULL) {
                ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
 -              BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false);
 +              BKE_sculpt_update_mesh_elements(eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
        }
  }
  
index c9d550aa4bd93ece6d30f86d3a5e4271eac3b9f6,696267a0e8e2dc9bb9a3107d285b0b735aa0a1ea..2d71cc17a19bbbce72e56107ccf99555d9665daa
@@@ -5599,15 -5583,13 +5599,16 @@@ static void SCULPT_OT_symmetrize(wmOper
  
  /**** Toggle operator for turning sculpt mode on or off ****/
  
 -static void sculpt_init_session(Scene *scene, Object *ob)
 +static void sculpt_init_session(const bContext *C, Scene *scene, Object *ob)
  {
 +      EvaluationContext eval_ctx;
-       ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
 +      CTX_data_eval_ctx(C, &eval_ctx);
 +
+       /* Create persistent sculpt mode data */
+       BKE_sculpt_toolsettings_data_ensure(scene);
  
 -      BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false);
+       ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
 +      BKE_sculpt_update_mesh_elements(&eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
  }
  
  
@@@ -5668,33 -5649,8 +5668,8 @@@ static int sculpt_mode_toggle_exec(bCon
                ob->mode |= mode_flag;
  
                if (flush_recalc)
 -                      DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 +                      DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
  
-               /* Create persistent sculpt mode data */
-               if (!ts->sculpt) {
-                       ts->sculpt = MEM_callocN(sizeof(Sculpt), "sculpt mode data");
-                       /* Turn on X plane mirror symmetry by default */
-                       ts->sculpt->paint.symmetry_flags |= PAINT_SYMM_X;
-                       ts->sculpt->paint.flags |= PAINT_SHOW_BRUSH;
-                       /* Make sure at least dyntopo subdivision is enabled */
-                       ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
-               }
-               if (!ts->sculpt->detail_size)
-                       ts->sculpt->detail_size = 12;
-               if (!ts->sculpt->detail_percent)
-                       ts->sculpt->detail_percent = 25;
-               if (ts->sculpt->constant_detail == 0.0f)
-                       ts->sculpt->constant_detail = 3.0f;
-               /* Set sane default tiling offsets */
-               if (!ts->sculpt->paint.tile_offset[0]) ts->sculpt->paint.tile_offset[0] = 1.0f;
-               if (!ts->sculpt->paint.tile_offset[1]) ts->sculpt->paint.tile_offset[1] = 1.0f;
-               if (!ts->sculpt->paint.tile_offset[2]) ts->sculpt->paint.tile_offset[2] = 1.0f;
                /* Create sculpt mode session data */
                if (ob->sculpt)
                        BKE_sculptsession_free(ob);
index 4ff8444cd71b4a464f90d6f757ac27a4e820cb3c,ca24cdd27ec1b8e08f84ba13d4ddf5d81253c8da..f6019747b453c6f619fb4f76d5896bd896f18acf
@@@ -570,10 -532,10 +570,10 @@@ static int rna_SpaceView3D_active_layer
  
  static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
  {
 -      DAG_on_visible_update(bmain, false);
 +      DEG_on_visible_update(bmain, false);
  }
  
- static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+ static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
  {
        View3D *v3d = (View3D *)(ptr->data);
        ScrArea *sa = rna_area_from_space(ptr);
Simple merge