[Bf-blender-cvs] [2e3fdeed94f] temp-sculpt-colors: Merge remote-tracking branch 'origin/master' into temp-sculpt-colors

Joseph Eagar noreply at git.blender.org
Wed Mar 30 22:03:28 CEST 2022


Commit: 2e3fdeed94f32e100921e610c7c99e5d1a5bf727
Author: Joseph Eagar
Date:   Wed Mar 30 11:32:28 2022 -0700
Branches: temp-sculpt-colors
https://developer.blender.org/rB2e3fdeed94f32e100921e610c7c99e5d1a5bf727

Merge remote-tracking branch 'origin/master' into temp-sculpt-colors

===================================================================



===================================================================

diff --cc source/blender/blenloader/intern/versioning_300.c
index 2f6bec4061a,eee0e7fbea8..c148825c32c
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@@ -2437,65 -2435,27 +2437,75 @@@ void blo_do_versions_300(FileData *fd, 
      }
    }
  
 +  /* rebuild active/render color attribute references*/
 +  if (!MAIN_VERSION_ATLEAST(bmain, 302, 6)) {
 +    LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
 +      /* buggy code in wm_toolsystem broke smear in old files,
 +         reset to defaults */
 +      if (br->sculpt_tool == SCULPT_TOOL_SMEAR) {
 +        br->alpha = 1.0f;
 +        br->spacing = 5;
 +        br->flag &= ~BRUSH_ALPHA_PRESSURE;
 +        br->flag &= ~BRUSH_SPACE_ATTEN;
 +        br->curve_preset = BRUSH_CURVE_SPHERE;
 +      }
 +    }
 +
 +    LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
 +      for (int step = 0; step < 2; step++) {
 +        CustomDataLayer *actlayer = NULL;
 +
 +        int vact1, vact2;
 +
 +        if (step) {
 +          vact1 = CustomData_get_render_layer_index(&me->vdata, CD_PROP_COLOR);
 +          vact2 = CustomData_get_render_layer_index(&me->ldata, CD_MLOOPCOL);
 +        }
 +        else {
 +          vact1 = CustomData_get_active_layer_index(&me->vdata, CD_PROP_COLOR);
 +          vact2 = CustomData_get_active_layer_index(&me->ldata, CD_MLOOPCOL);
 +        }
 +
 +        if (vact1 != -1) {
 +          actlayer = me->vdata.layers + vact1;
 +        }
 +        else if (vact2 != -1) {
 +          actlayer = me->ldata.layers + vact2;
 +        }
 +
 +        if (actlayer) {
 +          if (step) {
 +            BKE_id_attributes_render_color_set(&me->id, actlayer);
 +          }
 +          else {
 +            BKE_id_attributes_active_color_set(&me->id, actlayer);
 +          }
 +        }
 +      }
 +    }
 +  }
 +
-   /**
-    * Versioning code until next subversion bump goes here.
-    *
-    * \note Be sure to check when bumping the version:
-    * - "versioning_userdef.c", #blo_do_versions_userdef
-    * - "versioning_userdef.c", #do_versions_theme
-    *
-    * \note Keep this message at the bottom of the function.
-    */
-   {
-     /* Keep this block, even when empty. */
+   if (!MAIN_VERSION_ATLEAST(bmain, 302, 7)) {
+     /* Generate 'system' liboverrides IDs.
+      * NOTE: This is a fairly rough process, based on very basic heuristics. Should be enough for a
+      * do_version code though, this is a new optional feature, not a critical conversion. */
+     ID *id;
+     FOREACH_MAIN_ID_BEGIN (bmain, id) {
+       if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || ID_IS_LINKED(id)) {
+         /* Ignore non-real liboverrides, and linked ones. */
+         continue;
+       }
+       if (GS(id->name) == ID_OB) {
+         /* Never 'lock' an object into a system override for now. */
+         continue;
+       }
+       if (BKE_lib_override_library_is_user_edited(id)) {
+         /* Do not 'lock' an ID already edited by the user. */
+         continue;
+       }
+       id->override_library->flag |= IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED;
+     }
+     FOREACH_MAIN_ID_END;
  
      /* Initialize brush curves sculpt settings. */
      LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
diff --cc source/blender/editors/geometry/geometry_attributes.cc
index 10438ae1492,5d9d02db660..d8b05b50bf8
--- a/source/blender/editors/geometry/geometry_attributes.cc
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@@ -17,7 -15,7 +17,8 @@@
  #include "BKE_context.h"
  #include "BKE_deform.h"
  #include "BKE_geometry_set.hh"
 +#include "BKE_mesh.h"
+ #include "BKE_lib_id.h"
  #include "BKE_object_deform.h"
  #include "BKE_report.h"



More information about the Bf-blender-cvs mailing list