[Bf-blender-cvs] [5162135e147] master: Curves: add second experimental option for new curves tools

Jacques Lucke noreply at git.blender.org
Wed May 4 14:21:42 CEST 2022


Commit: 5162135e147074e034449c484eac59e568ef8051
Author: Jacques Lucke
Date:   Wed May 4 14:17:13 2022 +0200
Branches: master
https://developer.blender.org/rB5162135e147074e034449c484eac59e568ef8051

Curves: add second experimental option for new curves tools

Now there are two experimental feature options:
* "New Curves Type": Enables the new data type and a couple of tools
  that are meant to be in the first release that comes with the new curves object.
* "New Curves Tools": This is only available when the new curve type is available
  as well. It mainly exists to keep some tools experimental even after the initial
  curves object is release officially.
  * For now this only includes the curves edit mode which is not usable yet and
    probably won't be for the initial release.

Differential Revision: https://developer.blender.org/D14840

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/object/object_modes.c
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index e0abb3a8d89..6654053bef4 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2274,6 +2274,7 @@ class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
         self._draw_items(
             context, (
                 ({"property": "use_new_curves_type"}, "T68981"),
+                ({"property": "use_new_curves_tools"}, "T68981"),
                 ({"property": "use_new_point_cloud_type"}, "T75717"),
                 ({"property": "use_full_frame_compositor"}, "T88150"),
                 ({"property": "enable_eevee_next"}, "T93220"),
diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c
index cc6aa34d39d..fdf2cae026d 100644
--- a/source/blender/editors/object/object_modes.c
+++ b/source/blender/editors/object/object_modes.c
@@ -143,7 +143,12 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
       }
       break;
     case OB_CURVES:
-      if (mode & (OB_MODE_EDIT | OB_MODE_SCULPT_CURVES)) {
+      if (U.experimental.use_new_curves_tools) {
+        if (mode & OB_MODE_EDIT) {
+          return true;
+        }
+      }
+      if (mode & OB_MODE_SCULPT_CURVES) {
         return true;
       }
       break;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 9ea1e3a9e8d..f257833efe8 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -535,7 +535,8 @@ enum {
 
 /** Matches #OB_TYPE_SUPPORT_EDITMODE. */
 #define OB_DATA_SUPPORT_EDITMODE(_type) \
-  (ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR, ID_CV))
+  (ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR) || \
+   (U.experimental.use_new_curves_tools && (_type) == ID_CV))
 
 /* is this ID type used as object data */
 #define OB_DATA_SUPPORT_ID(_id_type) \
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 3de6453bbaa..4d6e0eba915 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -643,6 +643,8 @@ typedef struct UserDef_Experimental {
   /* The following options are automatically sanitized (set to 0)
    * when the release cycle is not alpha. */
   char use_new_curves_type;
+  /** Only available when #use_new_curves_type is enabled. */
+  char use_new_curves_tools;
   char use_new_point_cloud_type;
   char use_full_frame_compositor;
   char use_sculpt_tools_tilt;
@@ -650,7 +652,7 @@ typedef struct UserDef_Experimental {
   char use_override_templates;
   char enable_eevee_next;
   char use_sculpt_texture_paint;
-  char _pad0[2];
+  char _pad0[1];
   /** `makesdna` does not allow empty structs. */
 } UserDef_Experimental;
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1a2017f2dbb..75489ed1477 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1101,6 +1101,16 @@ int rna_show_statusbar_vram_editable(struct PointerRNA *UNUSED(ptr), const char
   return GPU_mem_stats_supported() ? PROP_EDITABLE : 0;
 }
 
+static int rna_userdef_experimental_use_new_curve_tools_editable(struct PointerRNA *ptr,
+                                                                 const char **r_info)
+{
+  if (U.experimental.use_new_curves_type) {
+    return PROP_EDITABLE;
+  }
+  *r_info = "Only available when new curves type is enabled";
+  return 0;
+}
+
 #else
 
 #  define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \
@@ -6394,6 +6404,12 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
   RNA_def_property_boolean_sdna(prop, NULL, "use_new_curves_type", 1);
   RNA_def_property_ui_text(prop, "New Curves Type", "Enable the new curves data type in the UI");
 
+  prop = RNA_def_property(srna, "use_new_curves_tools", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_new_curves_tools", 1);
+  RNA_def_property_editable_func(prop, "rna_userdef_experimental_use_new_curve_tools_editable");
+  RNA_def_property_ui_text(
+      prop, "New Curves Tools", "Enable additional features for the new curves data block");
+
   prop = RNA_def_property(srna, "use_cycles_debug", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "use_cycles_debug", 1);
   RNA_def_property_ui_text(prop, "Cycles Debug", "Enable Cycles debugging options for developers");



More information about the Bf-blender-cvs mailing list