Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2019-11-21 00:12:32 +0300
committerHans Goudey <h.goudey@me.com>2019-11-21 00:25:28 +0300
commitba1e9ae4733ae956331c7e8899f6939997205298 (patch)
tree007362ed2c9ee4564b67404f552906d6e66848db /source/blender/makesrna/intern
parent8c6ce742391b2b8798143a4a2c2224ebbeb7f1ec (diff)
Bevel: Custom Profile and CurveProfile Widget
Custom profiles in bevel allows the profile curve to be controlled by manually placed control points. Orientation is regularized along groups of edges, and the 'pipe case' is updated. This commit includes many updates to comments and changed variable names as well. A 'cutoff' vertex mesh method is added to bevel in addition to the existing grid fill option for replacing vertices. The UI of the bevel modifier and tool are updated and unified. Also, a 'CurveProfile' widget is added to BKE for defining the profile in the interface, which may be useful in other situations. Many thanks to Howard, my mentor for this GSoC project. Reviewers: howardt, campbellbarton Differential Revision: https://developer.blender.org/D5516
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesrna/intern/makesrna.c1
-rw-r--r--source/blender/makesrna/intern/rna_curveprofile.c322
-rw-r--r--source/blender/makesrna/intern/rna_internal.h1
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c65
-rw-r--r--source/blender/makesrna/intern/rna_scene.c6
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c4
7 files changed, 391 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 4bb53404724..7c06582dd6a 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -68,6 +68,7 @@ set(DEFSRC
rna_palette.c
rna_particle.c
rna_pose.c
+ rna_curveprofile.c
rna_render.c
rna_rigidbody.c
rna_rna.c
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 2d4da942610..009a723551e 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -4255,6 +4255,7 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_palette.c", NULL, RNA_def_palette},
{"rna_particle.c", NULL, RNA_def_particle},
{"rna_pose.c", "rna_pose_api.c", RNA_def_pose},
+ {"rna_curveprofile.c", NULL, RNA_def_profile},
{"rna_lightprobe.c", NULL, RNA_def_lightprobe},
{"rna_render.c", NULL, RNA_def_render},
{"rna_rigidbody.c", NULL, RNA_def_rigidbody},
diff --git a/source/blender/makesrna/intern/rna_curveprofile.c b/source/blender/makesrna/intern/rna_curveprofile.c
new file mode 100644
index 00000000000..71e1aac5aba
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_curveprofile.c
@@ -0,0 +1,322 @@
+/*
+ * 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.
+ */
+
+/** \file
+ * \ingroup RNA
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "DNA_curveprofile_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_texture_types.h"
+
+#include "BLI_utildefines.h"
+
+#include "RNA_define.h"
+#include "rna_internal.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#ifdef RNA_RUNTIME
+
+# include "RNA_access.h"
+
+# include "DNA_image_types.h"
+# include "DNA_material_types.h"
+# include "DNA_movieclip_types.h"
+# include "DNA_node_types.h"
+# include "DNA_object_types.h"
+# include "DNA_particle_types.h"
+# include "DNA_sequence_types.h"
+
+# include "MEM_guardedalloc.h"
+
+# include "BKE_colorband.h"
+# include "BKE_curveprofile.h"
+# include "BKE_image.h"
+# include "BKE_movieclip.h"
+# include "BKE_node.h"
+# include "BKE_sequencer.h"
+# include "BKE_linestyle.h"
+
+# include "DEG_depsgraph.h"
+
+# include "ED_node.h"
+
+# include "IMB_colormanagement.h"
+# include "IMB_imbuf.h"
+
+static void rna_CurveProfile_clip_set(PointerRNA *ptr, bool value)
+{
+ CurveProfile *profile = (CurveProfile *)ptr->data;
+
+ if (value) {
+ profile->flag |= PROF_USE_CLIP;
+ }
+ else {
+ profile->flag &= ~PROF_USE_CLIP;
+ }
+
+ BKE_curveprofile_update(profile, false);
+}
+
+static void rna_CurveProfile_sample_straight_set(PointerRNA *ptr, bool value)
+{
+ CurveProfile *profile = (CurveProfile *)ptr->data;
+
+ if (value) {
+ profile->flag |= PROF_SAMPLE_STRAIGHT_EDGES;
+ }
+ else {
+ profile->flag &= ~PROF_SAMPLE_STRAIGHT_EDGES;
+ }
+
+ BKE_curveprofile_update(profile, false);
+}
+
+static void rna_CurveProfile_sample_even_set(PointerRNA *ptr, bool value)
+{
+ CurveProfile *profile = (CurveProfile *)ptr->data;
+
+ if (value) {
+ profile->flag |= PROF_SAMPLE_EVEN_LENGTHS;
+ }
+ else {
+ profile->flag &= ~PROF_SAMPLE_EVEN_LENGTHS;
+ }
+
+ BKE_curveprofile_update(profile, false);
+}
+
+static void rna_CurveProfile_remove_point(CurveProfile *profile,
+ ReportList *reports,
+ PointerRNA *point_ptr)
+{
+ CurveProfilePoint *point = point_ptr->data;
+ if (BKE_curveprofile_remove_point(profile, point) == false) {
+ BKE_report(reports, RPT_ERROR, "Unable to remove path point");
+ return;
+ }
+
+ RNA_POINTER_INVALIDATE(point_ptr);
+}
+
+static void rna_CurveProfile_evaluate(struct CurveProfile *profile,
+ ReportList *reports,
+ float length_portion,
+ float *location)
+{
+ if (!profile->table) {
+ BKE_report(reports, RPT_ERROR, "CurveProfile table not initialized, call initialize()");
+ }
+ BKE_curveprofile_evaluate_length_portion(profile, length_portion, &location[0], &location[1]);
+}
+
+static void rna_CurveProfile_initialize(struct CurveProfile *profile, int segments_len)
+{
+ BKE_curveprofile_initialize(profile, (short)segments_len);
+}
+
+static void rna_CurveProfile_update(struct CurveProfile *profile)
+{
+ BKE_curveprofile_update(profile, false);
+}
+
+#else
+
+static const EnumPropertyItem prop_handle_type_items[] = {
+ {HD_AUTO, "AUTO", 0, "Auto Handle", ""},
+ {HD_VECT, "VECTOR", 0, "Vector Handle", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
+static void rna_def_curveprofilepoint(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "CurveProfilePoint", NULL);
+ RNA_def_struct_ui_text(srna, "CurveProfilePoint", "Point of a path used to define a profile");
+
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Location", "X/Y coordinates of the path point");
+
+ prop = RNA_def_property(srna, "handle_type_1", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "h1");
+ RNA_def_property_enum_items(prop, prop_handle_type_items);
+ RNA_def_property_ui_text(
+ prop, "First Handle Type", "Path interpolation at this point: Bezier or vector");
+
+ prop = RNA_def_property(srna, "handle_type_2", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "h2");
+ RNA_def_property_enum_items(prop, prop_handle_type_items);
+ RNA_def_property_ui_text(
+ prop, "Second Handle Type", "Path interpolation at this point: Bezier or vector");
+
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PROF_SELECT);
+ RNA_def_property_ui_text(prop, "Select", "Selection state of the path point");
+}
+
+static void rna_def_curveprofile_points_api(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *parm;
+ FunctionRNA *func;
+
+ RNA_def_property_srna(cprop, "CurveProfilePoints");
+ srna = RNA_def_struct(brna, "CurveProfilePoints", NULL);
+ RNA_def_struct_sdna(srna, "CurveProfile");
+ RNA_def_struct_ui_text(srna, "Profile Point", "Collection of Profile Points");
+
+ func = RNA_def_function(srna, "add", "BKE_curveprofile_insert");
+ RNA_def_function_ui_description(func, "Add point to the profile");
+ parm = RNA_def_float(func,
+ "x",
+ 0.0f,
+ -FLT_MAX,
+ FLT_MAX,
+ "X Position",
+ "X Position for new point",
+ -FLT_MAX,
+ FLT_MAX);
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ parm = RNA_def_float(func,
+ "y",
+ 0.0f,
+ -FLT_MAX,
+ FLT_MAX,
+ "Y Position",
+ "Y Position for new point",
+ -FLT_MAX,
+ FLT_MAX);
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ parm = RNA_def_pointer(func, "point", "CurveProfilePoint", "", "New point");
+ RNA_def_function_return(func, parm);
+
+ func = RNA_def_function(srna, "remove", "rna_CurveProfile_remove_point");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Delete point from the profile");
+ parm = RNA_def_pointer(func, "point", "CurveProfilePoint", "", "Point to remove");
+ RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
+ RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
+}
+
+static void rna_def_curveprofile(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ PropertyRNA *parm;
+ FunctionRNA *func;
+
+ static const EnumPropertyItem rna_enum_curveprofile_preset_items[] = {
+ {PROF_PRESET_LINE, "LINE", 0, "Line", "Default"},
+ {PROF_PRESET_SUPPORTS, "SUPPORTS", 0, "Support Loops", "Loops on each side of the profile"},
+ {PROF_PRESET_CORNICE, "CORNICE", 0, "Cornice Moulding", ""},
+ {PROF_PRESET_CROWN, "CROWN", 0, "Crown Moulding", ""},
+ {PROF_PRESET_STEPS, "STEPS", 0, "Steps", "A number of steps defined by the segments"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ srna = RNA_def_struct(brna, "CurveProfile", NULL);
+ RNA_def_struct_ui_text(srna, "CurveProfile", "Profile Path editor used to build a profile path");
+
+ prop = RNA_def_property(srna, "preset", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "preset");
+ RNA_def_property_enum_items(prop, rna_enum_curveprofile_preset_items);
+ RNA_def_property_ui_text(prop, "Preset", "");
+
+ prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PROF_USE_CLIP);
+ RNA_def_property_ui_text(prop, "Clip", "Force the path view to fit a defined boundary");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveProfile_clip_set");
+
+ prop = RNA_def_property(srna, "use_sample_straight_edges", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PROF_SAMPLE_STRAIGHT_EDGES);
+ RNA_def_property_ui_text(prop, "Sample Straight Edges", "Sample edges with vector handles");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveProfile_sample_straight_set");
+
+ prop = RNA_def_property(srna, "use_sample_even_lengths", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PROF_SAMPLE_EVEN_LENGTHS);
+ RNA_def_property_ui_text(prop, "Sample Even Lengths", "Sample edges with even lengths");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveProfile_sample_even_set");
+
+ func = RNA_def_function(srna, "update", "rna_CurveProfile_update");
+ RNA_def_function_ui_description(func, "Update the profile");
+
+ func = RNA_def_function(srna, "initialize", "rna_CurveProfile_initialize");
+ parm = RNA_def_int(func,
+ "totsegments",
+ 1,
+ 1,
+ 1000,
+ "",
+ "The number of segment values to"
+ " initialize the segments table with",
+ 1,
+ 100);
+ RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
+ RNA_def_function_ui_description(func, "Set the number of display segments and fill tables");
+
+ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "path", "path_len");
+ RNA_def_property_struct_type(prop, "CurveProfilePoint");
+ RNA_def_property_ui_text(prop, "Points", "Profile control points");
+ rna_def_curveprofile_points_api(brna, prop);
+
+ prop = RNA_def_property(srna, "segments", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "segments", "segments_len");
+ RNA_def_property_struct_type(prop, "CurveProfilePoint");
+ RNA_def_property_ui_text(prop, "Segments", "Segments sampled from control points");
+
+ func = RNA_def_function(srna, "evaluate", "rna_CurveProfile_evaluate");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Evaluate the at the given portion of the path length");
+ parm = RNA_def_float(func,
+ "length_portion",
+ 0.0f,
+ 0.0f,
+ 1.0f,
+ "Length Portion",
+ "Portion of the path length to travel before evaluation",
+ 0.0f,
+ 1.0f);
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ parm = RNA_def_float_vector(func,
+ "location",
+ 2,
+ NULL,
+ -100.0f,
+ 100.0f,
+ "Location",
+ "The location at the given portion of the profile",
+ -100.0f,
+ 100.0f);
+ RNA_def_function_output(func, parm);
+}
+
+void RNA_def_profile(BlenderRNA *brna)
+{
+ rna_def_curveprofilepoint(brna);
+ rna_def_curveprofile(brna);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 04a59a48b63..94394a4826b 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -178,6 +178,7 @@ void RNA_def_packedfile(struct BlenderRNA *brna);
void RNA_def_palette(struct BlenderRNA *brna);
void RNA_def_particle(struct BlenderRNA *brna);
void RNA_def_pose(struct BlenderRNA *brna);
+void RNA_def_profile(struct BlenderRNA *brna);
void RNA_def_lightprobe(struct BlenderRNA *brna);
void RNA_def_render(struct BlenderRNA *brna);
void RNA_def_rigidbody(struct BlenderRNA *brna);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 6e81b1343f5..789946d3268 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -37,6 +37,7 @@
#include "BLT_translation.h"
#include "BKE_animsys.h"
+#include "BKE_curveprofile.h"
#include "BKE_data_transfer.h"
#include "BKE_dynamicpaint.h"
#include "BKE_effect.h"
@@ -433,7 +434,6 @@ const EnumPropertyItem rna_enum_axis_flag_xyz_items[] = {
};
#ifdef RNA_RUNTIME
-
# include "DNA_particle_types.h"
# include "DNA_curve_types.h"
# include "DNA_smoke_types.h"
@@ -998,6 +998,18 @@ static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
}
+/* Special update function for setting the number of segments of the modifier that also resamples
+ * the segments in the custom profile. */
+static void rna_BevelModifier_update_segments(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ BevelModifierData *bmd = (BevelModifierData *)ptr->data;
+ if (RNA_boolean_get(ptr, "use_custom_profile")) {
+ short segments = (short)RNA_int_get(ptr, "segments");
+ BKE_curveprofile_initialize(bmd->custom_profile, segments);
+ }
+ rna_Modifier_update(bmain, scene, ptr);
+}
+
static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
{
UVProjectModifierData *md = (UVProjectModifierData *)ptr->data;
@@ -3583,10 +3595,26 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
- static EnumPropertyItem prop_miter_items[] = {
- {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Default sharp miter"},
- {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Miter with extra corner"},
- {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Miter with curved arc"},
+ static const EnumPropertyItem prop_miter_outer_items[] = {
+ {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Outside of miter is sharp"},
+ {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Outside of miter is squared-off patch"},
+ {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Outside of miter is arc"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ static const EnumPropertyItem prop_miter_inner_items[] = {
+ {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Inside of miter is sharp"},
+ {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Inside of miter is arc"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ static EnumPropertyItem prop_vmesh_method_items[] = {
+ {MOD_BEVEL_VMESH_ADJ, "ADJ", 0, "Grid Fill", "Default patterned fill"},
+ {MOD_BEVEL_VMESH_CUTOFF,
+ "CUTOFF",
+ 0,
+ "Cutoff",
+ "A cut-off at the end of each profile before the intersection"},
{0, NULL, 0, NULL, NULL},
};
@@ -3614,7 +3642,7 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "res");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Segments", "Number of segments for round edges/verts");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ RNA_def_property_update(prop, 0, "rna_BevelModifier_update_segments");
prop = RNA_def_property(srna, "use_only_vertices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_VERT);
@@ -3648,7 +3676,7 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
prop = RNA_def_property(srna, "offset_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "val_flags");
RNA_def_property_enum_items(prop, prop_val_type_items);
- RNA_def_property_ui_text(prop, "Amount Type", "What distance Width measures");
+ RNA_def_property_ui_text(prop, "Width Type", "What distance Width measures");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR);
@@ -3693,13 +3721,13 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
prop = RNA_def_property(srna, "miter_outer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "miter_outer");
- RNA_def_property_enum_items(prop, prop_miter_items);
+ RNA_def_property_enum_items(prop, prop_miter_outer_items);
RNA_def_property_ui_text(prop, "Outer Miter", "Pattern to use for outside of miters");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "miter_inner", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "miter_inner");
- RNA_def_property_enum_items(prop, prop_miter_items);
+ RNA_def_property_enum_items(prop, prop_miter_inner_items);
RNA_def_property_ui_text(prop, "Inner Miter", "Pattern to use for inside of miters");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -3709,6 +3737,25 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4);
RNA_def_property_ui_text(prop, "Spread", "Spread distance for inner miter arcs");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "use_custom_profile", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_CUSTOM_PROFILE);
+ RNA_def_property_ui_text(
+ prop, "Custom Profile", "Whether to use a user inputed curve for the bevel's profile");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "custom_profile", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "CurveProfile");
+ RNA_def_property_pointer_sdna(prop, NULL, "custom_profile");
+ RNA_def_property_ui_text(prop, "Custom Profile Path", "The path for the custom profile");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "vmesh_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "vmesh_method");
+ RNA_def_property_enum_items(prop, prop_vmesh_method_items);
+ RNA_def_property_ui_text(
+ prop, "Vertex Mesh Method", "The method to use to create the mesh at intersections");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index b9bc7b2bbf5..4d3de4ed6e6 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3307,6 +3307,12 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MeshStatVis");
RNA_def_property_ui_text(prop, "Mesh Statistics Visualization", NULL);
+
+ /* CurveProfile */
+ prop = RNA_def_property(srna, "custom_bevel_profile_preset", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "custom_bevel_profile_preset");
+ RNA_def_property_struct_type(prop, "CurveProfile");
+ RNA_def_property_ui_text(prop, "Curve Profile Widget", "Used for defining a profile's path");
}
static void rna_def_unified_paint_settings(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 94fe43a0a77..c734720fdcd 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -1220,6 +1220,10 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "use_negative_slope", false, "", "Use a negative slope by default");
RNA_def_boolean(func, "show_tone", false, "", "Show tone options");
+ func = RNA_def_function(srna, "template_curveprofile", "uiTemplateCurveProfile");
+ RNA_def_function_ui_description(func, "A profile path editor used for custom profiles");
+ api_ui_item_rna_common(func);
+
func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
RNA_def_function_ui_description(func, "Item. A color ramp widget");
api_ui_item_rna_common(func);