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:
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h3
-rw-r--r--source/blender/makesrna/intern/rna_ID.c4
-rw-r--r--source/blender/makesrna/intern/rna_access.c2
-rw-r--r--source/blender/makesrna/intern/rna_action.c2
-rw-r--r--source/blender/makesrna/intern/rna_brush.c37
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c54
-rw-r--r--source/blender/makesrna/intern/rna_curve.c24
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c14
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_key.c2
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c5
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c893
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c16
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c106
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c5
-rw-r--r--source/blender/makesrna/intern/rna_scene.c45
-rw-r--r--source/blender/makesrna/intern/rna_screen.c2
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c16
-rw-r--r--source/blender/makesrna/intern/rna_shader_fx.c68
-rw-r--r--source/blender/makesrna/intern/rna_space.c51
-rw-r--r--source/blender/makesrna/intern/rna_ui.c4
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c9
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c48
-rw-r--r--source/blender/makesrna/intern/rna_workspace.c2
26 files changed, 431 insertions, 987 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index ccce54227fe..c1eed8093c8 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -390,7 +390,7 @@ extern StructRNA RNA_MeshLoopColorLayer;
extern StructRNA RNA_MeshDeformModifier;
extern StructRNA RNA_MeshEdge;
extern StructRNA RNA_MeshPolygon;
-extern StructRNA RNA_MeshTessFace;
+extern StructRNA RNA_MeshLoopTriangle;
extern StructRNA RNA_MeshLoop;
extern StructRNA RNA_MeshFloatProperty;
extern StructRNA RNA_MeshFloatPropertyLayer;
@@ -619,6 +619,7 @@ extern StructRNA RNA_ShaderFx;
extern StructRNA RNA_ShaderFxBlur;
extern StructRNA RNA_ShaderFxColorize;
extern StructRNA RNA_ShaderFxFlip;
+extern StructRNA RNA_ShaderFxGlow;
extern StructRNA RNA_ShaderFxLight;
extern StructRNA RNA_ShaderFxPixel;
extern StructRNA RNA_ShaderFxRim;
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index cc1c1bffff2..921a7e3561a 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -83,7 +83,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
{ID_WM, "WINDOWMANAGER", ICON_FULLSCREEN, "Window Manager", ""},
{ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""},
- {ID_WS, "WORKSPACE", ICON_SPLITSCREEN, "Workspace", ""},
+ {ID_WS, "WORKSPACE", ICON_WORKSPACE, "Workspace", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -433,7 +433,7 @@ static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, bool clear_pro
}
-static AnimData * rna_ID_animation_data_create(ID *id, Main *bmain)
+static AnimData *rna_ID_animation_data_create(ID *id, Main *bmain)
{
AnimData *adt = BKE_animdata_add_id(id);
DEG_relations_tag_update(bmain);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index bd0b3e9d760..cb1453fd0bf 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -7075,7 +7075,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
case PROP_COLLECTION:
{
StructRNA *srna = va_arg(args, StructRNA *);
- ListBase **arg = va_arg(args, ListBase * *);
+ ListBase **arg = va_arg(args, ListBase **);
err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata,
srna, tid, fid, pid);
break;
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 12e28d457fb..fe4c92b9163 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -322,7 +322,7 @@ static void rna_def_dopesheet(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_only_errors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLY_ERRORS);
RNA_def_property_ui_text(prop, "Show Errors", "Only include F-Curves and drivers that are disabled or have errors");
- RNA_def_property_ui_icon(prop, ICON_HELP, 0); /* XXX: this doesn't quite fit */
+ RNA_def_property_ui_icon(prop, ICON_ERROR, 0);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
/* Object Collection Filtering Settings */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 5d66742e8a3..665a694653c 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -46,8 +46,8 @@
#include "WM_types.h"
static const EnumPropertyItem prop_direction_items[] = {
- {0, "ADD", ICON_ZOOMIN, "Add", "Add effect of brush"},
- {BRUSH_DIR_IN, "SUBTRACT", ICON_ZOOMOUT, "Subtract", "Subtract effect of brush"},
+ {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
+ {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}
};
@@ -589,39 +589,39 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA
/* sculpt mode */
static const EnumPropertyItem prop_flatten_contrast_items[] = {
- {BRUSH_DIR_IN, "CONTRAST", ICON_ZOOMIN, "Contrast", "Subtract effect of brush"},
- {0, "FLATTEN", ICON_ZOOMOUT, "Flatten", "Add effect of brush"},
+ {BRUSH_DIR_IN, "CONTRAST", ICON_ADD, "Contrast", "Subtract effect of brush"},
+ {0, "FLATTEN", ICON_REMOVE, "Flatten", "Add effect of brush"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_fill_deepen_items[] = {
- {0, "FILL", ICON_ZOOMIN, "Fill", "Add effect of brush"},
- {BRUSH_DIR_IN, "DEEPEN", ICON_ZOOMOUT, "Deepen", "Subtract effect of brush"},
+ {0, "FILL", ICON_ADD, "Fill", "Add effect of brush"},
+ {BRUSH_DIR_IN, "DEEPEN", ICON_REMOVE, "Deepen", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_scrape_peaks_items[] = {
- {0, "SCRAPE", ICON_ZOOMIN, "Scrape", "Add effect of brush"},
- {BRUSH_DIR_IN, "PEAKS", ICON_ZOOMOUT, "Peaks", "Subtract effect of brush"},
+ {0, "SCRAPE", ICON_ADD, "Scrape", "Add effect of brush"},
+ {BRUSH_DIR_IN, "PEAKS", ICON_REMOVE, "Peaks", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_pinch_magnify_items[] = {
- {BRUSH_DIR_IN, "MAGNIFY", ICON_ZOOMIN, "Magnify", "Subtract effect of brush"},
- {0, "PINCH", ICON_ZOOMOUT, "Pinch", "Add effect of brush"},
+ {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"},
+ {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_inflate_deflate_items[] = {
- {0, "INFLATE", ICON_ZOOMIN, "Inflate", "Add effect of brush"},
- {BRUSH_DIR_IN, "DEFLATE", ICON_ZOOMOUT, "Deflate", "Subtract effect of brush"},
+ {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"},
+ {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}
};
/* texture paint mode */
static const EnumPropertyItem prop_soften_sharpen_items[] = {
- {BRUSH_DIR_IN, "SHARPEN", ICON_ZOOMIN, "Sharpen", "Sharpen effect of brush"},
- {0, "SOFTEN", ICON_ZOOMOUT, "Soften", "Blur effect of brush"},
+ {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"},
+ {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"},
{0, NULL, 0, NULL, NULL}
};
@@ -710,6 +710,11 @@ static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C, PointerRNA *U
}
/* Grease Pencil Drawing Brushes Settings */
+static char *rna_BrushGpencilSettings_path(PointerRNA *UNUSED(ptr))
+{
+ return BLI_strdup("tool_settings.gpencil_paint.brush.gpencil_settings");
+}
+
static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
{
ToolSettings *ts = scene->toolsettings;
@@ -967,6 +972,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL);
RNA_def_struct_sdna(srna, "BrushGpencilSettings");
+ RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush");
/* grease pencil drawing brushes */
@@ -988,9 +994,10 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
/* Strength factor for new strokes */
- prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "draw_strength");
RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
RNA_def_property_ui_text(prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 4cbe365167c..3cf959eaee1 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -1005,7 +1005,7 @@ static void rna_def_histogram(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_line", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", HISTO_FLAG_LINE);
RNA_def_property_ui_text(prop, "Show Line", "Display lines rather than filled shapes");
- RNA_def_property_ui_icon(prop, ICON_IPO, 0);
+ RNA_def_property_ui_icon(prop, ICON_GRAPH, 0);
}
static void rna_def_scopes(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index ba87d08fdac..1e7ed90a4a5 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -48,63 +48,63 @@
/* please keep the names in sync with constraint.c */
const EnumPropertyItem rna_enum_constraint_type_items[] = {
{0, "", 0, N_("Motion Tracking"), ""},
- {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""},
- {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""},
- {CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CONSTRAINT_DATA, "Object Solver", ""},
+ {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT, "Camera Solver", ""},
+ {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT, "Follow Track", ""},
+ {CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CONSTRAINT, "Object Solver", ""},
{0, "", 0, N_("Transform"), ""},
- {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location",
+ {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT, "Copy Location",
"Copy the location of a target (with an optional offset), so that they move together"},
- {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation",
+ {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT, "Copy Rotation",
"Copy the rotation of a target (with an optional offset), so that they rotate together"},
- {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", ICON_CONSTRAINT_DATA, "Copy Scale",
+ {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", ICON_CONSTRAINT, "Copy Scale",
"Copy the scale factors of a target (with an optional offset), so that they are scaled by the same amount"},
- {CONSTRAINT_TYPE_TRANSLIKE, "COPY_TRANSFORMS", ICON_CONSTRAINT_DATA, "Copy Transforms",
+ {CONSTRAINT_TYPE_TRANSLIKE, "COPY_TRANSFORMS", ICON_CONSTRAINT, "Copy Transforms",
"Copy all the transformations of a target, so that they move together"},
- {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", ICON_CONSTRAINT_DATA, "Limit Distance",
+ {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", ICON_CONSTRAINT, "Limit Distance",
"Restrict movements to within a certain distance of a target (at the time of constraint evaluation only)"},
- {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT_DATA, "Limit Location",
+ {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT, "Limit Location",
"Restrict movement along each axis within given ranges"},
- {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT_DATA, "Limit Rotation",
+ {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT, "Limit Rotation",
"Restrict rotation along each axis within given ranges"},
- {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", ICON_CONSTRAINT_DATA, "Limit Scale",
+ {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", ICON_CONSTRAINT, "Limit Scale",
"Restrict scaling along each axis with given ranges"},
- {CONSTRAINT_TYPE_SAMEVOL, "MAINTAIN_VOLUME", ICON_CONSTRAINT_DATA, "Maintain Volume",
+ {CONSTRAINT_TYPE_SAMEVOL, "MAINTAIN_VOLUME", ICON_CONSTRAINT, "Maintain Volume",
"Compensate for scaling one axis by applying suitable scaling to the other two axes"},
- {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT_DATA, "Transformation",
+ {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT, "Transformation",
"Use one transform property from target to control another (or same) property on owner"},
- {CONSTRAINT_TYPE_TRANSFORM_CACHE, "TRANSFORM_CACHE", ICON_CONSTRAINT_DATA, "Transform Cache",
+ {CONSTRAINT_TYPE_TRANSFORM_CACHE, "TRANSFORM_CACHE", ICON_CONSTRAINT, "Transform Cache",
"Look up the transformation matrix from an external file"},
{0, "", 0, N_("Tracking"), ""},
- {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT_DATA, "Clamp To",
+ {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT, "Clamp To",
"Restrict movements to lie along a curve by remapping location along curve's longest axis"},
- {CONSTRAINT_TYPE_DAMPTRACK, "DAMPED_TRACK", ICON_CONSTRAINT_DATA, "Damped Track",
+ {CONSTRAINT_TYPE_DAMPTRACK, "DAMPED_TRACK", ICON_CONSTRAINT, "Damped Track",
"Point towards a target by performing the smallest rotation necessary"},
- {CONSTRAINT_TYPE_KINEMATIC, "IK", ICON_CONSTRAINT_DATA, "Inverse Kinematics",
+ {CONSTRAINT_TYPE_KINEMATIC, "IK", ICON_CONSTRAINT, "Inverse Kinematics",
"Control a chain of bones by specifying the endpoint target (Bones only)"},
- {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT_DATA, "Locked Track",
+ {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT, "Locked Track",
"Rotate around the specified ('locked') axis to point towards a target"},
- {CONSTRAINT_TYPE_SPLINEIK, "SPLINE_IK", ICON_CONSTRAINT_DATA, "Spline IK",
+ {CONSTRAINT_TYPE_SPLINEIK, "SPLINE_IK", ICON_CONSTRAINT, "Spline IK",
"Align chain of bones along a curve (Bones only)"},
- {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", ICON_CONSTRAINT_DATA, "Stretch To",
+ {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", ICON_CONSTRAINT, "Stretch To",
"Stretch along Y-Axis to point towards a target"},
- {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To",
+ {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT, "Track To",
"Legacy tracking constraint prone to twisting artifacts"},
{0, "", 0, N_("Relationship"), ""},
- {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action",
+ {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT, "Action",
"Use transform property of target to look up pose for owner from an Action"},
- {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of",
+ {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT, "Child Of",
"Make target the 'detachable' parent of owner"},
- {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor",
+ {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT, "Floor",
"Use position (and optionally rotation) of target to define a 'wall' or 'floor' that the owner can not cross"},
- {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path",
+ {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT, "Follow Path",
"Use to animate an object/bone following a path"},
- {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot",
+ {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT, "Pivot",
"Change pivot point for transforms (buggy)"},
/* {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint",
"Use to define a Rigid Body Constraint (for Game Engine use only)"}, */
/* {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script",
"Custom constraint(s) written in Python (Not yet implemented)"}, */
- {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap",
+ {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT, "Shrinkwrap",
"Restrict movements to surface of target mesh"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index cc1dc5e17b9..f576ad4866c 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -956,20 +956,20 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
PropertyRNA *prop;
static const EnumPropertyItem prop_align_items[] = {
- {CU_ALIGN_X_LEFT, "LEFT", 0, "Left", "Align text to the left"},
- {CU_ALIGN_X_MIDDLE, "CENTER", 0, "Center", "Center text"},
- {CU_ALIGN_X_RIGHT, "RIGHT", 0, "Right", "Align text to the right"},
- {CU_ALIGN_X_JUSTIFY, "JUSTIFY", 0, "Justify", "Align to the left and the right"},
- {CU_ALIGN_X_FLUSH, "FLUSH", 0, "Flush", "Align to the left and the right, with equal character spacing"},
+ {CU_ALIGN_X_LEFT, "LEFT", ICON_ALIGN_LEFT, "Left", "Align text to the left"},
+ {CU_ALIGN_X_MIDDLE, "CENTER", ICON_ALIGN_CENTER, "Center", "Center text"},
+ {CU_ALIGN_X_RIGHT, "RIGHT", ICON_ALIGN_RIGHT, "Right", "Align text to the right"},
+ {CU_ALIGN_X_JUSTIFY, "JUSTIFY", ICON_ALIGN_JUSTIFY, "Justify", "Align to the left and the right"},
+ {CU_ALIGN_X_FLUSH, "FLUSH", ICON_ALIGN_FLUSH, "Flush", "Align to the left and the right, with equal character spacing"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_align_y_items[] = {
- {CU_ALIGN_Y_TOP_BASELINE, "TOP_BASELINE", 0, "Top Base-Line", "Align to top but use the base-line of the text"},
- {CU_ALIGN_Y_TOP, "TOP", 0, "Top", "Align text to the top"},
- {CU_ALIGN_Y_CENTER, "CENTER", 0, "Center", "Align text to the middle"},
- {CU_ALIGN_Y_BOTTOM, "BOTTOM", 0, "Bottom", "Align text to the bottom"},
- {CU_ALIGN_Y_BOTTOM_BASELINE, "BOTTOM_BASELINE", 0, "Bottom Base-Line",
+ {CU_ALIGN_Y_TOP_BASELINE, "TOP_BASELINE", ICON_ALIGN_TOP, "Top Base-Line", "Align to top but use the base-line of the text"},
+ {CU_ALIGN_Y_TOP, "TOP", ICON_ALIGN_TOP, "Top", "Align text to the top"},
+ {CU_ALIGN_Y_CENTER, "CENTER", ICON_ALIGN_MIDDLE, "Center", "Align text to the middle"},
+ {CU_ALIGN_Y_BOTTOM, "BOTTOM", ICON_ALIGN_BOTTOM, "Bottom", "Align text to the bottom"},
+ {CU_ALIGN_Y_BOTTOM_BASELINE, "BOTTOM_BASELINE", ICON_ALIGN_BOTTOM, "Bottom Base-Line",
"Align text to the bottom but use the base-line of the text"},
{0, NULL, 0, NULL, NULL}
};
@@ -1179,16 +1179,19 @@ static void rna_def_charinfo(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_BOLD);
RNA_def_property_ui_text(prop, "Bold", "");
+ RNA_def_property_ui_icon(prop, ICON_BOLD, 0);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_ITALIC);
RNA_def_property_ui_text(prop, "Italic", "");
+ RNA_def_property_ui_icon(prop, ICON_ITALIC, 0);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "use_underline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_UNDERLINE);
RNA_def_property_ui_text(prop, "Underline", "");
+ RNA_def_property_ui_icon(prop, ICON_UNDERLINE, 0);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* probably there is no reason to expose this */
@@ -1202,6 +1205,7 @@ static void rna_def_charinfo(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_SMALLCAPS);
RNA_def_property_ui_text(prop, "Small Caps", "");
+ RNA_def_property_ui_icon(prop, ICON_SMALL_CAPS, 0);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 36330f1e17a..a02868622e4 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1097,7 +1097,7 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
- RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 1);
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
@@ -1279,6 +1279,13 @@ static void rna_def_gpencil_grid(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions in each side of symmetry line");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "offset");
+ RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Offset", "Offset of the canvas");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axis");
RNA_def_property_enum_items(prop, rna_enum_gpencil_grid_axis_items);
@@ -1383,6 +1390,11 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Force Fill Update", "Force recalc of fill data after use deformation modifiers (reduce FPS)");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ prop = RNA_def_property(srna, "use_adaptative_uv", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_UV_ADAPTATIVE);
+ RNA_def_property_ui_text(prop, "Adaptative UV", "Automatic UVs are calculated depending of the stroke size");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
prop = RNA_def_property(srna, "edit_line_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "line_color");
RNA_def_property_array(prop, 4);
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 2578f88a520..155c030587d 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -490,7 +490,7 @@ int rna_parameter_size(struct PropertyRNA *parm);
struct Mesh *rna_Main_meshes_new_from_object(
struct Main *bmain, struct ReportList *reports, struct Depsgraph *depsgraph,
- struct Object *ob, bool apply_modifiers, bool calc_tessface, bool calc_undeformed);
+ struct Object *ob, bool apply_modifiers, bool calc_undeformed);
/* XXX, these should not need to be defined here~! */
struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports);
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 05efe350a2f..11fb5f7f94b 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -722,7 +722,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE);
RNA_def_property_ui_text(prop, "Mute", "Mute this shape key");
- RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 1);
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop = RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 70dcf20dcc6..59c9e523914 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -310,7 +310,7 @@ static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
/* copied from Mesh_getFromObject and adapted to RNA interface */
Mesh *rna_Main_meshes_new_from_object(
Main *bmain, ReportList *reports, Depsgraph *depsgraph,
- Object *ob, bool apply_modifiers, bool calc_tessface, bool calc_undeformed)
+ Object *ob, bool apply_modifiers, bool calc_undeformed)
{
Scene *sce = DEG_get_evaluated_scene(depsgraph);
@@ -326,7 +326,7 @@ Mesh *rna_Main_meshes_new_from_object(
return NULL;
}
- return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_tessface, calc_undeformed);
+ return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_undeformed);
}
static Lamp *rna_Main_lights_new(Main *bmain, const char *name, int type)
@@ -893,7 +893,6 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
- RNA_def_boolean(func, "calc_tessface", true, "Calculate Tessellation", "Calculate tessellation faces");
RNA_def_boolean(func, "calc_undeformed", false, "Calculate Undeformed", "Calculate undeformed vertex coordinates");
parm = RNA_def_pointer(func, "mesh", "Mesh", "",
"Mesh created from object, remove it if it is only used for export");
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index ee0c9e392c4..ac65c25f1da 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -555,7 +555,7 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_COLOR_HIDE);
- RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 1);
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_ui_text(prop, "Hide", "Set color Visibility");
RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_nopreview_update");
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 24896570fb5..a5bae7115f9 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -70,6 +70,7 @@ const EnumPropertyItem rna_enum_mesh_delimit_mode_items[] = {
#include "BKE_customdata.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
@@ -139,12 +140,6 @@ static CustomData *rna_mesh_ldata(PointerRNA *ptr)
return rna_mesh_ldata_helper(me);
}
-static CustomData *rna_mesh_fdata(PointerRNA *ptr)
-{
- Mesh *me = rna_mesh(ptr);
- return rna_mesh_fdata_helper(me);
-}
-
/* -------------------------------------------------------------------- */
/* Generic CustomData Layer Functions */
@@ -195,12 +190,6 @@ static void rna_MeshLoopLayer_name_set(PointerRNA *ptr, const char *value)
{
rna_cd_layer_name_set(rna_mesh_ldata(ptr), (CustomDataLayer *)ptr->data, value);
}
-#if 0
-static void rna_MeshTessfaceLayer_name_set(PointerRNA *ptr, const char *value)
-{
- rna_cd_layer_name_set(rna_mesh_fdata(ptr), (CustomDataLayer *)ptr->data, value);
-}
-#endif
/* only for layers shared between types */
static void rna_MeshAnyLayer_name_set(PointerRNA *ptr, const char *value)
{
@@ -435,232 +424,57 @@ static void rna_MeshPolygon_flip(ID *id, MPoly *mp)
BKE_mesh_polygon_flip(mp, me->mloop, &me->ldata);
BKE_mesh_tessface_clear(me);
+ BKE_mesh_runtime_clear_geometry(me);
}
-static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values)
+static void rna_MeshLoopTriangle_verts_get(PointerRNA *ptr, int *values)
{
Mesh *me = rna_mesh(ptr);
- MFace *mface = (MFace *)ptr->data;
-
- if (mface->v4)
- normal_quad_v3(values, me->mvert[mface->v1].co, me->mvert[mface->v2].co,
- me->mvert[mface->v3].co, me->mvert[mface->v4].co);
- else
- normal_tri_v3(values, me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
+ MLoopTri *lt = (MLoopTri *)ptr->data;
+ values[0] = me->mloop[lt->tri[0]].v;
+ values[1] = me->mloop[lt->tri[1]].v;
+ values[2] = me->mloop[lt->tri[2]].v;
}
-static void rna_MeshTessFace_split_normals_get(PointerRNA *ptr, float *values)
-{
- Mesh *me = rna_mesh(ptr);
- MFace *mface = (MFace *)ptr->data;
- const short (*vec)[4][3] = CustomData_get(&me->fdata, (int)(mface - me->mface), CD_TESSLOOPNORMAL);
- int i = 4;
-
- if (!vec) {
- while (i--) zero_v3(&values[i * 3]);
- }
- else {
- while (i--) normal_short_to_float_v3(&values[i * 3], (const short *)(*vec)[i]);
- }
-}
-static float rna_MeshTessFace_area_get(PointerRNA *ptr)
+static void rna_MeshLoopTriangle_normal_get(PointerRNA *ptr, float *values)
{
Mesh *me = rna_mesh(ptr);
- MFace *mface = (MFace *)ptr->data;
-
- if (mface->v4)
- return area_quad_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co,
- me->mvert[mface->v4].co);
- else
- return area_tri_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
-}
-
-static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- values[0] = mtface->uv[0][0];
- values[1] = mtface->uv[0][1];
-}
-
-static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- mtface->uv[0][0] = values[0];
- mtface->uv[0][1] = values[1];
-}
-
-static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- values[0] = mtface->uv[1][0];
- values[1] = mtface->uv[1][1];
-}
-
-static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- mtface->uv[1][0] = values[0];
- mtface->uv[1][1] = values[1];
-}
-
-static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- values[0] = mtface->uv[2][0];
- values[1] = mtface->uv[2][1];
-}
-
-static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- mtface->uv[2][0] = values[0];
- mtface->uv[2][1] = values[1];
-}
-
-static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- values[0] = mtface->uv[3][0];
- values[1] = mtface->uv[3][1];
-}
+ MLoopTri *lt = (MLoopTri *)ptr->data;
+ unsigned int v1 = me->mloop[lt->tri[0]].v;
+ unsigned int v2 = me->mloop[lt->tri[1]].v;
+ unsigned int v3 = me->mloop[lt->tri[2]].v;
-static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
-
- mtface->uv[3][0] = values[0];
- mtface->uv[3][1] = values[1];
+ normal_tri_v3(values, me->mvert[v1].co, me->mvert[v2].co, me->mvert[v3].co);
}
-static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
+static void rna_MeshLoopTriangle_split_normals_get(PointerRNA *ptr, float *values)
{
Mesh *me = rna_mesh(ptr);
- CustomData *fdata = rna_mesh_fdata(ptr);
- CustomDataLayer *cdl;
- int a, b;
+ const float (*lnors)[3] = CustomData_get_layer(&me->ldata, CD_NORMAL);
- for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) {
- if (cdl->type == type) {
- b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type);
- if (b >= 0 && b < me->totface) {
- return (me->mface[b].v4 ? 4 : 3);
- }
- }
+ if (!lnors) {
+ zero_v3(values + 0);
+ zero_v3(values + 3);
+ zero_v3(values + 6);
+ }
+ else {
+ MLoopTri *lt = (MLoopTri *)ptr->data;
+ copy_v3_v3(values + 0, lnors[lt->tri[0]]);
+ copy_v3_v3(values + 3, lnors[lt->tri[1]]);
+ copy_v3_v3(values + 6, lnors[lt->tri[2]]);
}
-
- return 0;
-}
-
-static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
-{
- length[0] = rna_CustomDataData_numverts(ptr, CD_MTFACE);
- length[1] = 2;
- return length[0] * length[1];
-}
-
-static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
- int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE);
-
- memcpy(values, mtface->uv, totvert * 2 * sizeof(float));
-}
-
-static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
-{
- MTFace *mtface = (MTFace *)ptr->data;
- int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE);
-
- memcpy(mtface->uv, values, totvert * 2 * sizeof(float));
-}
-
-/* notice red and blue are swapped */
-static void rna_MeshColor_color1_get(PointerRNA *ptr, float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- values[3] = mcol[0].a / 255.0f;
- values[2] = mcol[0].r / 255.0f;
- values[1] = mcol[0].g / 255.0f;
- values[0] = mcol[0].b / 255.0f;
-}
-
-static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- mcol[0].a = round_fl_to_uchar_clamp(values[3] * 255.0f);
- mcol[0].r = round_fl_to_uchar_clamp(values[2] * 255.0f);
- mcol[0].g = round_fl_to_uchar_clamp(values[1] * 255.0f);
- mcol[0].b = round_fl_to_uchar_clamp(values[0] * 255.0f);
-}
-
-static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- values[3] = mcol[1].a / 255.0f;
- values[2] = mcol[1].r / 255.0f;
- values[1] = mcol[1].g / 255.0f;
- values[0] = mcol[1].b / 255.0f;
-}
-
-static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- mcol[1].a = round_fl_to_uchar_clamp(values[3] * 255.0f);
- mcol[1].r = round_fl_to_uchar_clamp(values[2] * 255.0f);
- mcol[1].g = round_fl_to_uchar_clamp(values[1] * 255.0f);
- mcol[1].b = round_fl_to_uchar_clamp(values[0] * 255.0f);
-}
-
-static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- values[3] = mcol[2].a / 255.0f;
- values[2] = mcol[2].r / 255.0f;
- values[1] = mcol[2].g / 255.0f;
- values[0] = mcol[2].b / 255.0f;
-}
-
-static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- mcol[2].a = round_fl_to_uchar_clamp(values[3] * 255.0f);
- mcol[2].r = round_fl_to_uchar_clamp(values[2] * 255.0f);
- mcol[2].g = round_fl_to_uchar_clamp(values[1] * 255.0f);
- mcol[2].b = round_fl_to_uchar_clamp(values[0] * 255.0f);
-}
-
-static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values)
-{
- MCol *mcol = (MCol *)ptr->data;
-
- values[3] = mcol[3].a / 255.0f;
- values[2] = mcol[3].r / 255.0f;
- values[1] = mcol[3].g / 255.0f;
- values[0] = mcol[3].b / 255.0f;
}
-static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values)
+static float rna_MeshLoopTriangle_area_get(PointerRNA *ptr)
{
- MCol *mcol = (MCol *)ptr->data;
+ Mesh *me = rna_mesh(ptr);
+ MLoopTri *lt = (MLoopTri *)ptr->data;
+ unsigned int v1 = me->mloop[lt->tri[0]].v;
+ unsigned int v2 = me->mloop[lt->tri[1]].v;
+ unsigned int v3 = me->mloop[lt->tri[2]].v;
- mcol[3].a = round_fl_to_uchar_clamp(values[3] * 255.0f);
- mcol[3].r = round_fl_to_uchar_clamp(values[2] * 255.0f);
- mcol[3].g = round_fl_to_uchar_clamp(values[1] * 255.0f);
- mcol[3].b = round_fl_to_uchar_clamp(values[0] * 255.0f);
+ return area_tri_v3(me->mvert[v1].co, me->mvert[v2].co, me->mvert[v3].co);
}
static void rna_MeshLoopColor_color_get(PointerRNA *ptr, float *values)
@@ -902,93 +716,8 @@ static void rna_MeshUVLoopLayer_clone_set(PointerRNA *ptr, bool value)
rna_CustomDataLayer_clone_set(ptr, rna_mesh_ldata(ptr), value, CD_MLOOPUV);
}
-/* face uv_textures */
-
-DEFINE_CUSTOMDATA_LAYER_COLLECTION(tessface_uv_texture, fdata, CD_MTFACE)
-DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_uv_texture, fdata, CD_MTFACE, active, MeshTextureFaceLayer)
-
-static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
-{
- Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
- rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_btmesh) ? 0 : me->totface, 0, NULL);
-}
-
-static int rna_MeshTextureFaceLayer_data_length(PointerRNA *ptr)
-{
- Mesh *me = rna_mesh(ptr);
- return (me->edit_btmesh) ? 0 : me->totface;
-}
-
-static bool rna_MeshTextureFaceLayer_active_render_get(PointerRNA *ptr)
-{
- return rna_CustomDataLayer_active_get(ptr, rna_mesh_fdata(ptr), CD_MTFACE, 1);
-}
-
-static bool rna_MeshTextureFaceLayer_active_get(PointerRNA *ptr)
-{
- return rna_CustomDataLayer_active_get(ptr, rna_mesh_fdata(ptr), CD_MTFACE, 0);
-}
-
-static bool rna_MeshTextureFaceLayer_clone_get(PointerRNA *ptr)
-{
- return rna_CustomDataLayer_clone_get(ptr, rna_mesh_fdata(ptr), CD_MTFACE);
-}
-
-static void rna_MeshTextureFaceLayer_active_render_set(PointerRNA *ptr, bool value)
-{
- rna_CustomDataLayer_active_set(ptr, rna_mesh_fdata(ptr), value, CD_MTFACE, 1);
-}
-
-static void rna_MeshTextureFaceLayer_active_set(PointerRNA *ptr, int value)
-{
- rna_CustomDataLayer_active_set(ptr, rna_mesh_fdata(ptr), value, CD_MTFACE, 0);
-}
-
-static void rna_MeshTextureFaceLayer_clone_set(PointerRNA *ptr, int value)
-{
- rna_CustomDataLayer_clone_set(ptr, rna_mesh_fdata(ptr), value, CD_MTFACE);
-}
-
/* vertex_color_layers */
-DEFINE_CUSTOMDATA_LAYER_COLLECTION(tessface_vertex_color, fdata, CD_MCOL)
-DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_vertex_color, fdata, CD_MCOL, active, MeshColorLayer)
-DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_vertex_color, fdata, CD_MCOL, render, MeshColorLayer)
-
-static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
-{
- Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
- rna_iterator_array_begin(iter, layer->data, sizeof(MCol) * 4, me->totface, 0, NULL);
-}
-
-static int rna_MeshColorLayer_data_length(PointerRNA *ptr)
-{
- Mesh *me = rna_mesh(ptr);
- return me->totface;
-}
-
-static bool rna_MeshColorLayer_active_render_get(PointerRNA *ptr)
-{
- return rna_CustomDataLayer_active_get(ptr, rna_mesh_fdata(ptr), CD_MCOL, 1);
-}
-
-static bool rna_MeshColorLayer_active_get(PointerRNA *ptr)
-{
- return rna_CustomDataLayer_active_get(ptr, rna_mesh_fdata(ptr), CD_MCOL, 0);
-}
-
-static void rna_MeshColorLayer_active_render_set(PointerRNA *ptr, bool value)
-{
- rna_CustomDataLayer_active_set(ptr, rna_mesh_fdata(ptr), value, CD_MCOL, 1);
-}
-
-static void rna_MeshColorLayer_active_set(PointerRNA *ptr, int value)
-{
- rna_CustomDataLayer_active_set(ptr, rna_mesh_fdata(ptr), value, CD_MCOL, 0);
-}
-
DEFINE_CUSTOMDATA_LAYER_COLLECTION(vertex_color, ldata, CD_MLOOPCOL)
DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(vertex_color, ldata, CD_MLOOPCOL, active, MeshLoopColorLayer)
DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(vertex_color, ldata, CD_MLOOPCOL, render, MeshLoopColorLayer)
@@ -1242,30 +971,6 @@ static void rna_Mesh_face_map_remove(struct Mesh *me, ReportList *reports, struc
/* End face maps */
-static int rna_MeshTessFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
-{
- MFace *face = (MFace *)ptr->data;
-
- if (face)
- length[0] = (face->v4) ? 4 : 3;
- else
- length[0] = 4; /* XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell */
-
- return length[0];
-}
-
-static void rna_MeshTessFace_verts_get(PointerRNA *ptr, int *values)
-{
- MFace *face = (MFace *)ptr->data;
- memcpy(values, &face->v1, (face->v4 ? 4 : 3) * sizeof(int));
-}
-
-static void rna_MeshTessFace_verts_set(PointerRNA *ptr, const int *values)
-{
- MFace *face = (MFace *)ptr->data;
- memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int));
-}
-
/* poly.vertices - this is faked loop access for convenience */
static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
@@ -1320,11 +1025,25 @@ static int rna_MeshEdge_index_get(PointerRNA *ptr)
return (int)(edge - me->medge);
}
-static int rna_MeshTessFace_index_get(PointerRNA *ptr)
+static int rna_MeshLoopTriangle_index_get(PointerRNA *ptr)
+{
+ Mesh *me = rna_mesh(ptr);
+ MLoopTri *ltri = (MLoopTri *)ptr->data;
+ return (int)(ltri - me->runtime.looptris.array);
+}
+
+static int rna_MeshLoopTriangle_material_index_get(PointerRNA *ptr)
+{
+ Mesh *me = rna_mesh(ptr);
+ MLoopTri *ltri = (MLoopTri *)ptr->data;
+ return me->mpoly[ltri->poly].mat_nr;
+}
+
+static bool rna_MeshLoopTriangle_use_smooth_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MFace *face = (MFace *)ptr->data;
- return (int)(face - me->mface);
+ MLoopTri *ltri = (MLoopTri *)ptr->data;
+ return me->mpoly[ltri->poly].flag & ME_SMOOTH;
}
static int rna_MeshPolygon_index_get(PointerRNA *ptr)
@@ -1363,9 +1082,9 @@ static char *rna_MeshPolygon_path(PointerRNA *ptr)
return BLI_sprintfN("polygons[%d]", (int)((MPoly *)ptr->data - rna_mesh(ptr)->mpoly));
}
-static char *rna_MeshTessFace_path(PointerRNA *ptr)
+static char *rna_MeshLoopTriangle_path(PointerRNA *ptr)
{
- return BLI_sprintfN("tessfaces[%d]", (int)((MFace *)ptr->data - rna_mesh(ptr)->mface));
+ return BLI_sprintfN("loop_triangles[%d]", (int)((MLoopTri *)ptr->data - rna_mesh(ptr)->runtime.looptris.array));
}
static char *rna_MeshEdge_path(PointerRNA *ptr)
@@ -1384,14 +1103,6 @@ static char *rna_MeshVertex_path(PointerRNA *ptr)
return BLI_sprintfN("vertices[%d]", (int)((MVert *)ptr->data - rna_mesh(ptr)->mvert));
}
-static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr)
-{
- CustomDataLayer *cdl = ptr->data;
- char name_esc[sizeof(cdl->name) * 2];
- BLI_strescape(name_esc, cdl->name, sizeof(name_esc));
- return BLI_sprintfN("tessface_uv_textures[\"%s\"]", name_esc);
-}
-
static char *rna_VertCustomData_data_path(PointerRNA *ptr, const char *collection, int type)
{
CustomDataLayer *cdl;
@@ -1455,46 +1166,11 @@ static char *rna_LoopCustomData_data_path(PointerRNA *ptr, const char *collectio
return NULL;
}
-static char *rna_FaceCustomData_data_path(PointerRNA *ptr, const char *collection, int type)
-{
- CustomDataLayer *cdl;
- Mesh *me = rna_mesh(ptr);
- CustomData *fdata = rna_mesh_fdata(ptr);
- int a, b, totloop = (me->edit_btmesh) ? 0 : me->totloop;
-
- for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) {
- if (cdl->type == type) {
- b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type);
- if (b >= 0 && b < totloop) {
- char name_esc[sizeof(cdl->name) * 2];
- BLI_strescape(name_esc, cdl->name, sizeof(name_esc));
- return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, name_esc, b);
- }
- }
- }
-
- return NULL;
-}
-
-
static char *rna_MeshUVLoop_path(PointerRNA *ptr)
{
return rna_LoopCustomData_data_path(ptr, "uv_layers", CD_MLOOPUV);
}
-static char *rna_MeshTextureFace_path(PointerRNA *ptr)
-{
- return rna_FaceCustomData_data_path(ptr, "tessface_uv_textures", CD_MTFACE);
-}
-
-static char *rna_MeshColorLayer_path(PointerRNA *ptr)
-{
- CustomDataLayer *cdl = ptr->data;
- char name_esc[sizeof(cdl->name) * 2];
- BLI_strescape(name_esc, cdl->name, sizeof(name_esc));
- return BLI_sprintfN("tessface_vertex_colors[\"%s\"]", name_esc);
-}
-
static char *rna_MeshLoopColorLayer_path(PointerRNA *ptr)
{
CustomDataLayer *cdl = ptr->data;
@@ -1721,34 +1397,6 @@ static void rna_Mesh_vertex_color_remove(struct Mesh *me, ReportList *reports, C
}
}
-static PointerRNA rna_Mesh_tessface_vertex_color_new(struct Mesh *me, ReportList *reports, const char *name)
-{
- PointerRNA ptr;
- CustomData *fdata;
- CustomDataLayer *cdl = NULL;
- int index;
-
- if (me->edit_btmesh) {
- BKE_report(reports, RPT_ERROR, "Cannot add tessface colors in edit mode");
- return PointerRNA_NULL;
- }
-
- if (me->mpoly) {
- BKE_report(reports, RPT_ERROR, "Cannot add tessface colors when MPoly's exist");
- return PointerRNA_NULL;
- }
-
- index = ED_mesh_color_add(me, name, false);
-
- if (index != -1) {
- fdata = rna_mesh_fdata_helper(me);
- cdl = &fdata->layers[CustomData_get_layer_index_n(fdata, CD_MCOL, index)];
- }
-
- RNA_pointer_create(&me->id, &RNA_MeshColorLayer, cdl, &ptr);
- return ptr;
-}
-
#define DEFINE_CUSTOMDATA_PROPERTY_API(elemname, datatype, cd_prop_type, cdata, countvar, layertype) \
static PointerRNA rna_Mesh_##elemname##_##datatype##_property_new(struct Mesh *me, const char *name) \
{ \
@@ -1796,38 +1444,6 @@ static void rna_Mesh_uv_layers_remove(struct Mesh *me, ReportList *reports, Cust
}
}
-/* while this is supposed to be readonly,
- * keep it to support importers that only make tessfaces */
-
-static PointerRNA rna_Mesh_tessface_uv_texture_new(struct Mesh *me, ReportList *reports, const char *name)
-{
- PointerRNA ptr;
- CustomData *fdata;
- CustomDataLayer *cdl = NULL;
- int index;
-
- if (me->edit_btmesh) {
- BKE_report(reports, RPT_ERROR, "Cannot add tessface uv's in edit mode");
- return PointerRNA_NULL;
- }
-
- if (me->mpoly) {
- BKE_report(reports, RPT_ERROR, "Cannot add tessface uv's when MPoly's exist");
- return PointerRNA_NULL;
- }
-
- index = ED_mesh_uv_texture_add(me, name, false);
-
- if (index != -1) {
- fdata = rna_mesh_fdata_helper(me);
- cdl = &fdata->layers[CustomData_get_layer_index_n(fdata, CD_MTFACE, index)];
- }
-
- RNA_pointer_create(&me->id, &RNA_MeshTextureFaceLayer, cdl, &ptr);
- return ptr;
-}
-
-
static bool rna_Mesh_is_editmode_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
@@ -1840,14 +1456,6 @@ static void UNUSED_FUNCTION(rna_mesh_unused)(void)
/* unused functions made by macros */
(void)rna_Mesh_skin_vertice_index_range;
(void)rna_Mesh_vertex_paint_mask_index_range;
- (void)rna_Mesh_tessface_uv_texture_active_set;
- (void)rna_Mesh_tessface_uv_texture_index_range;
- (void)rna_Mesh_tessface_vertex_color_active_set;
- (void)rna_Mesh_tessface_vertex_color_index_range;
- (void)rna_Mesh_tessface_vertex_color_render_get;
- (void)rna_Mesh_tessface_vertex_color_render_index_get;
- (void)rna_Mesh_tessface_vertex_color_render_index_set;
- (void)rna_Mesh_tessface_vertex_color_render_set;
(void)rna_Mesh_uv_layer_render_get;
(void)rna_Mesh_uv_layer_render_index_get;
(void)rna_Mesh_uv_layer_render_index_set;
@@ -2009,83 +1617,70 @@ static void rna_def_medge(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Index", "Index of this edge");
}
-static void rna_def_mface(BlenderRNA *brna)
+static void rna_def_mlooptri(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- const int splitnor_dim[] = {4, 3};
+ const int splitnor_dim[] = {3, 3};
- srna = RNA_def_struct(brna, "MeshTessFace", NULL);
- RNA_def_struct_sdna(srna, "MFace");
- RNA_def_struct_ui_text(srna, "Mesh TessFace", "TessFace in a Mesh data-block");
- RNA_def_struct_path_func(srna, "rna_MeshTessFace_path");
+ srna = RNA_def_struct(brna, "MeshLoopTriangle", NULL);
+ RNA_def_struct_sdna(srna, "MLoopTri");
+ RNA_def_struct_ui_text(srna, "Mesh Loop Triangle", "Tessellated triangle in a Mesh data-block");
+ RNA_def_struct_path_func(srna, "rna_MeshLoopTriangle_path");
RNA_def_struct_ui_icon(srna, ICON_FACESEL);
- /* XXX allows creating invalid meshes */
prop = RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_array(prop, 4);
- RNA_def_property_flag(prop, PROP_DYNAMIC);
- RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTessFace_verts_get_length");
- RNA_def_property_int_funcs(prop, "rna_MeshTessFace_verts_get", "rna_MeshTessFace_verts_set", NULL);
- RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
-
- /* leaving this fixed size array for foreach_set used in import scripts */
- prop = RNA_def_property(srna, "vertices_raw", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "v1");
- RNA_def_property_array(prop, 4);
- RNA_def_property_ui_text(prop, "Vertices", "Fixed size vertex indices array");
-
- prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "mat_nr");
- RNA_def_property_ui_text(prop, "Material Index", "");
-#if 0
- RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshPoly_material_index_range"); /* reuse for tessface is ok */
-#endif
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
- RNA_def_property_ui_text(prop, "Select", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_int_funcs(prop, "rna_MeshLoopTriangle_verts_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Vertices", "Indices of triangle vertices");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
- RNA_def_property_ui_text(prop, "Hide", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
+ prop = RNA_def_property(srna, "loops", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "tri");
+ RNA_def_property_ui_text(prop, "Loops", "Indices of mesh loops that make up the triangle");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
- RNA_def_property_ui_text(prop, "Smooth", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+ prop = RNA_def_property(srna, "polygon_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "poly");
+ RNA_def_property_ui_text(prop, "Polygon", "Index of mesh polygon that the triangle is a part of");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_float_funcs(prop, "rna_MeshTessFace_normal_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Face Normal", "Local space unit length normal vector for this face");
+ RNA_def_property_float_funcs(prop, "rna_MeshLoopTriangle_normal_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Triangle Normal", "Local space unit length normal vector for this triangle");
prop = RNA_def_property(srna, "split_normals", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_multi_array(prop, 2, splitnor_dim);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_float_funcs(prop, "rna_MeshTessFace_split_normals_get", NULL, NULL);
+ RNA_def_property_float_funcs(prop, "rna_MeshLoopTriangle_split_normals_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Split Normals",
- "Local space unit length split normals vectors of the vertices of this face "
- "(must be computed beforehand using calc_normals_split or calc_tangents, "
- "and then calc_tessface)");
+ "Local space unit length split normals vectors of the vertices of this triangle "
+ "(must be computed beforehand using calc_normals_split or calc_tangents)");
prop = RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_float_funcs(prop, "rna_MeshTessFace_area_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Face Area", "Read only area of this face");
+ RNA_def_property_float_funcs(prop, "rna_MeshLoopTriangle_area_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Triangle Area", "Area of this triangle");
prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_int_funcs(prop, "rna_MeshTessFace_index_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Index", "Index of this face");
-}
+ RNA_def_property_int_funcs(prop, "rna_MeshLoopTriangle_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Index", "Index of this loop triangle");
+ prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_MeshLoopTriangle_material_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Material Index", "");
+
+ prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_MeshLoopTriangle_use_smooth_get", NULL);
+ RNA_def_property_ui_text(prop, "Smooth", "");
+}
static void rna_def_mloop(BlenderRNA *brna)
{
@@ -2295,179 +1890,6 @@ static void rna_def_mloopuv(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "UV Edge Select", "");
}
-static void rna_def_mtface(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
- const int uv_dim[] = {4, 2};
-
- srna = RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
- RNA_def_struct_ui_text(srna, "Mesh UV Map", "UV map with assigned image textures in a Mesh data-block");
- RNA_def_struct_sdna(srna, "CustomDataLayer");
- RNA_def_struct_path_func(srna, "rna_MeshTextureFaceLayer_path");
- RNA_def_struct_ui_icon(srna, ICON_GROUP_UVS);
-
- prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_struct_name_property(srna, prop);
- RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshUVLayer_name_set");
- RNA_def_property_ui_text(prop, "Name", "Name of UV map");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set");
- RNA_def_property_ui_text(prop, "Active", "Set the map as active for display and editing");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get",
- "rna_MeshTextureFaceLayer_active_render_set");
- RNA_def_property_ui_text(prop, "Active Render", "Set the map as active for rendering");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "active_clone", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_clone_get", "rna_MeshTextureFaceLayer_clone_set");
- RNA_def_property_ui_text(prop, "Active Clone", "Set the map as active for cloning");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "MeshTextureFace");
- RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next",
- "rna_iterator_array_end", "rna_iterator_array_get",
- "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
-
- srna = RNA_def_struct(brna, "MeshTextureFace", NULL);
- RNA_def_struct_sdna(srna, "MTFace");
- RNA_def_struct_ui_text(srna, "Mesh UV Map Face", "UV map and image texture for a face");
- RNA_def_struct_path_func(srna, "rna_MeshTextureFace_path");
- RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT);
-
- /* these are for editing only, access at loops now */
-#if 0
- prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
- RNA_def_property_array(prop, 4);
- RNA_def_property_ui_text(prop, "UV Selected", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
-
- prop = RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
- RNA_def_property_array(prop, 4);
- RNA_def_property_ui_text(prop, "UV Pinned", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
-#endif
-
- prop = RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ);
- RNA_def_property_array(prop, 2);
- RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv1_get", "rna_MeshTextureFace_uv1_set", NULL);
- RNA_def_property_ui_text(prop, "UV 1", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_XYZ);
- RNA_def_property_array(prop, 2);
- RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv2_get", "rna_MeshTextureFace_uv2_set", NULL);
- RNA_def_property_ui_text(prop, "UV 2", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_XYZ);
- RNA_def_property_array(prop, 2);
- RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv3_get", "rna_MeshTextureFace_uv3_set", NULL);
- RNA_def_property_ui_text(prop, "UV 3", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_XYZ);
- RNA_def_property_array(prop, 2);
- RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv4_get", "rna_MeshTextureFace_uv4_set", NULL);
- RNA_def_property_ui_text(prop, "UV 4", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
- RNA_def_property_multi_array(prop, 2, uv_dim);
- RNA_def_property_flag(prop, PROP_DYNAMIC);
- RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length");
- RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv_get", "rna_MeshTextureFace_uv_set", NULL);
- RNA_def_property_ui_text(prop, "UV", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "uv_raw", PROP_FLOAT, PROP_NONE);
- RNA_def_property_multi_array(prop, 2, uv_dim);
- RNA_def_property_float_sdna(prop, NULL, "uv");
- RNA_def_property_ui_text(prop, "UV Raw", "Fixed size UV coordinates array");
-
-}
-
-static void rna_def_mcol(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- srna = RNA_def_struct(brna, "MeshColorLayer", NULL);
- RNA_def_struct_ui_text(srna, "Mesh Vertex Color Layer", "Layer of vertex colors in a Mesh data-block");
- RNA_def_struct_sdna(srna, "CustomDataLayer");
- RNA_def_struct_path_func(srna, "rna_MeshColorLayer_path");
- RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL);
-
- prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_struct_name_property(srna, prop);
- RNA_def_property_string_funcs(prop, NULL, NULL, NULL);
- RNA_def_property_ui_text(prop, "Name", "Name of Vertex color layer");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_get", "rna_MeshColorLayer_active_set");
- RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_render_get",
- "rna_MeshColorLayer_active_render_set");
- RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "MeshColor");
- RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next",
- "rna_iterator_array_end", "rna_iterator_array_get",
- "rna_MeshColorLayer_data_length", NULL, NULL, NULL);
-
- srna = RNA_def_struct(brna, "MeshColor", NULL);
- RNA_def_struct_sdna(srna, "MCol");
- RNA_def_struct_ui_text(srna, "Mesh Vertex Color", "Vertex colors for a face in a Mesh");
- RNA_def_struct_path_func(srna, "rna_MeshColor_path");
-
- prop = RNA_def_property(srna, "color1", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_array(prop, 4);
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_float_funcs(prop, "rna_MeshColor_color1_get", "rna_MeshColor_color1_set", NULL);
- RNA_def_property_ui_text(prop, "Color 1", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_array(prop, 4);
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_float_funcs(prop, "rna_MeshColor_color2_get", "rna_MeshColor_color2_set", NULL);
- RNA_def_property_ui_text(prop, "Color 2", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_array(prop, 4);
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_float_funcs(prop, "rna_MeshColor_color3_get", "rna_MeshColor_color3_set", NULL);
- RNA_def_property_ui_text(prop, "Color 3", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_array(prop, 4);
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_float_funcs(prop, "rna_MeshColor_color4_get", "rna_MeshColor_color4_set", NULL);
- RNA_def_property_ui_text(prop, "Color 4", "");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-}
-
static void rna_def_mloopcol(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2723,33 +2145,15 @@ static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop)
#endif
}
-/* mesh.faces */
-static void rna_def_mesh_tessfaces(BlenderRNA *brna, PropertyRNA *cprop)
+/* mesh.loop_triangles */
+static void rna_def_mesh_looptris(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
- PropertyRNA *prop;
- FunctionRNA *func;
- PropertyRNA *parm;
-
- RNA_def_property_srna(cprop, "MeshTessFaces");
- srna = RNA_def_struct(brna, "MeshTessFaces", NULL);
+ RNA_def_property_srna(cprop, "MeshLoopTriangle");
+ srna = RNA_def_struct(brna, "MeshLoopTriangles", NULL);
RNA_def_struct_sdna(srna, "Mesh");
- RNA_def_struct_ui_text(srna, "Mesh Faces", "Collection of mesh faces");
-
- prop = RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "act_face");
- RNA_def_property_ui_text(prop, "Active Face", "The active face for this mesh");
-
- func = RNA_def_function(srna, "add", "ED_mesh_tessfaces_add");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of faces to add", 0, INT_MAX);
- RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
-#if 0 /* BMESH_TODO Remove until BMesh merge */
- func = RNA_def_function(srna, "remove", "ED_mesh_faces_remove");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of faces to remove", 0, INT_MAX);
-#endif
+ RNA_def_struct_ui_text(srna, "Mesh Loop Triangles", "Tessellation of mesh polygons into triangles");
}
/* mesh.loops */
@@ -2799,43 +2203,6 @@ static void rna_def_mesh_polygons(BlenderRNA *brna, PropertyRNA *cprop)
}
-/* mesh.vertex_colors */
-static void rna_def_tessface_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- FunctionRNA *func;
- PropertyRNA *parm;
-
- RNA_def_property_srna(cprop, "VertexColors");
- srna = RNA_def_struct(brna, "VertexColors", NULL);
- RNA_def_struct_sdna(srna, "Mesh");
- RNA_def_struct_ui_text(srna, "Vertex Colors", "Collection of vertex colors");
-
- /* eventually deprecate this */
- func = RNA_def_function(srna, "new", "rna_Mesh_tessface_vertex_color_new");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh");
- RNA_def_string(func, "name", "Col", 0, "", "Vertex color name");
- parm = RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer");
- RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
- RNA_def_function_return(func, parm);
-
- prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "MeshColorLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_tessface_vertex_color_active_get",
- "rna_Mesh_tessface_vertex_color_active_set", NULL, NULL);
- RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_tessface_vertex_color_active_index_get",
- "rna_Mesh_tessface_vertex_color_active_index_set", "rna_Mesh_vertex_color_index_range");
- RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-}
-
static void rna_def_loop_colors(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
@@ -3045,43 +2412,6 @@ static void rna_def_polygon_string_layers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_return(func, parm);
}
-/* mesh.tessface_uv_layers */
-static void rna_def_tessface_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- FunctionRNA *func;
- PropertyRNA *parm;
-
- RNA_def_property_srna(cprop, "TessfaceUVTextures");
- srna = RNA_def_struct(brna, "TessfaceUVTextures", NULL);
- RNA_def_struct_sdna(srna, "Mesh");
- RNA_def_struct_ui_text(srna, "UV Maps", "Collection of UV maps for tessellated faces");
-
- /* eventually deprecate this */
- func = RNA_def_function(srna, "new", "rna_Mesh_tessface_uv_texture_new");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Add a UV tessface-texture layer to Mesh (only for meshes with no polygons)");
- RNA_def_string(func, "name", "UVMap", 0, "", "UV map name");
- parm = RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer");
- RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
- RNA_def_function_return(func, parm);
-
- prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_tessface_uv_texture_active_get",
- "rna_Mesh_tessface_uv_texture_active_set", NULL, NULL);
- RNA_def_property_ui_text(prop, "Active UV Map", "Active UV Map");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_tessface_uv_texture_active_index_get",
- "rna_Mesh_tessface_uv_texture_active_index_set", "rna_Mesh_uv_layer_index_range");
- RNA_def_property_ui_text(prop, "Active UV Map Index", "Active UV Map index");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-}
-
static void rna_def_skin_vertices(BlenderRNA *brna, PropertyRNA *UNUSED(cprop))
{
StructRNA *srna;
@@ -3256,12 +2586,6 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh");
rna_def_mesh_edges(brna, prop);
- prop = RNA_def_property(srna, "tessfaces", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "mface", "totface");
- RNA_def_property_struct_type(prop, "MeshTessFace");
- RNA_def_property_ui_text(prop, "TessFaces", "Tessellated faces of the mesh (derived from polygons)");
- rna_def_mesh_tessfaces(brna, prop);
-
prop = RNA_def_property(srna, "loops", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mloop", "totloop");
RNA_def_property_struct_type(prop, "MeshLoop");
@@ -3274,6 +2598,12 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Polygons", "Polygons of the mesh");
rna_def_mesh_polygons(brna, prop);
+ prop = RNA_def_property(srna, "loop_triangles", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "runtime.looptris.array", "runtime.looptris.len");
+ RNA_def_property_struct_type(prop, "MeshLoopTriangle");
+ RNA_def_property_ui_text(prop, "Loop Triangles", "Tessellation of mesh polygons into triangles");
+ rna_def_mesh_looptris(brna, prop);
+
/* TODO, should this be allowed to be its self? */
prop = RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
@@ -3314,27 +2644,6 @@ static void rna_def_mesh(BlenderRNA *brna)
"rna_Mesh_uv_layer_stencil_index_set", "rna_Mesh_uv_layer_index_range");
RNA_def_property_ui_text(prop, "Mask UV loop layer Index", "Mask UV loop layer index");
- /* Tessellated face UV maps - used by renderers */
- prop = RNA_def_property(srna, "tessface_uv_textures", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_tessface_uv_textures_begin", NULL, NULL, NULL,
- "rna_Mesh_tessface_uv_textures_length", NULL, NULL, NULL);
- RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_ui_text(prop, "Tessellated Face UV Maps",
- "All UV maps for tessellated faces (read-only, for use by renderers)");
- rna_def_tessface_uv_textures(brna, prop);
-
- /* Tessellated face colors - used by renderers */
-
- prop = RNA_def_property(srna, "tessface_vertex_colors", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_tessface_vertex_colors_begin", NULL, NULL, NULL,
- "rna_Mesh_tessface_vertex_colors_length", NULL, NULL, NULL);
- RNA_def_property_struct_type(prop, "MeshColorLayer");
- RNA_def_property_ui_text(prop, "Tessellated Face Colors",
- "All tessellated face colors (read-only, for use by renderers)");
- rna_def_tessface_vertex_colors(brna, prop);
-
/* Vertex colors */
prop = RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
@@ -3570,12 +2879,10 @@ void RNA_def_mesh(BlenderRNA *brna)
rna_def_mvert(brna);
rna_def_mvert_group(brna);
rna_def_medge(brna);
- rna_def_mface(brna);
+ rna_def_mlooptri(brna);
rna_def_mloop(brna);
rna_def_mpolygon(brna);
rna_def_mloopuv(brna);
- rna_def_mtface(brna);
- rna_def_mcol(brna);
rna_def_mloopcol(brna);
rna_def_mproperties(brna);
rna_def_face_map(brna);
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 7328686af7f..b1556edd4b7 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -50,6 +50,7 @@
#include "BKE_mesh.h"
#include "BKE_mesh_tangent.h"
#include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
#include "ED_mesh.h"
static const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, struct Mesh *mesh2)
@@ -101,9 +102,9 @@ static void rna_Mesh_free_tangents(Mesh *mesh)
CustomData_free_layers(&mesh->ldata, CD_MLOOPTANGENT, mesh->totloop);
}
-static void rna_Mesh_calc_tessface(Mesh *mesh, bool free_mpoly)
+static void rna_Mesh_calc_looptri(Mesh *mesh)
{
- ED_mesh_calc_tessface(mesh, free_mpoly != 0);
+ BKE_mesh_runtime_looptri_ensure(mesh);
}
static void rna_Mesh_calc_smooth_groups(Mesh *mesh, bool use_bitflags, int *r_poly_group_len,
@@ -206,6 +207,7 @@ static void rna_Mesh_flip_normals(Mesh *mesh)
BKE_mesh_polygons_flip(mesh->mpoly, mesh->mloop, &mesh->ldata, mesh->totpoly);
BKE_mesh_tessface_clear(mesh);
BKE_mesh_calc_normals(mesh);
+ BKE_mesh_runtime_clear_geometry(mesh);
DEG_id_tag_update(&mesh->id, 0);
}
@@ -269,12 +271,8 @@ void RNA_api_mesh(StructRNA *srna)
func = RNA_def_function(srna, "free_tangents", "rna_Mesh_free_tangents");
RNA_def_function_ui_description(func, "Free tangents");
- func = RNA_def_function(srna, "calc_tessface", "rna_Mesh_calc_tessface");
- RNA_def_function_ui_description(func, "Calculate face tessellation (supports editmode too)");
- RNA_def_boolean(func, "free_mpoly", 0, "Free MPoly", "Free data used by polygons and loops. "
- "WARNING: This destructive operation removes regular faces, "
- "only used on temporary mesh data-blocks to reduce memory footprint of render "
- "engines and export scripts");
+ func = RNA_def_function(srna, "calc_loop_triangles", "rna_Mesh_calc_looptri");
+ RNA_def_function_ui_description(func, "Calculate loop triangle tessellation (supports editmode too)");
func = RNA_def_function(srna, "calc_smooth_groups", "rna_Mesh_calc_smooth_groups");
RNA_def_function_ui_description(func, "Calculate smooth groups from sharp edges");
@@ -308,7 +306,7 @@ void RNA_api_mesh(StructRNA *srna)
func = RNA_def_function(srna, "update", "ED_mesh_update");
RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges");
- RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces");
+ RNA_def_boolean(func, "calc_loop_triangles", 0, "Calculate Triangules", "Force recalculation of triangle tessellation");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function(srna, "update_gpu_tag", "rna_Mesh_update_gpu_tag");
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index bbb6eae8945..4f366fa36c4 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -64,63 +64,63 @@
const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
{0, "", 0, N_("Modify"), ""},
- {eModifierType_DataTransfer, "DATA_TRANSFER", ICON_MOD_DATA_TRANSFER, "Data Transfer", ""},
- {eModifierType_MeshCache, "MESH_CACHE", ICON_MOD_MESHDEFORM, "Mesh Cache", ""},
- {eModifierType_MeshSequenceCache, "MESH_SEQUENCE_CACHE", ICON_MOD_MESHDEFORM, "Mesh Sequence Cache", ""},
- {eModifierType_NormalEdit, "NORMAL_EDIT", ICON_MOD_NORMALEDIT, "Normal Edit", ""},
- {eModifierType_WeightedNormal, "WEIGHTED_NORMAL", ICON_MOD_NORMALEDIT, "Weighted Normal", ""},
- {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
- {eModifierType_UVWarp, "UV_WARP", ICON_MOD_UVPROJECT, "UV Warp", ""},
- {eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Edit", ""},
- {eModifierType_WeightVGMix, "VERTEX_WEIGHT_MIX", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Mix", ""},
- {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MOD_VERTEX_WEIGHT,
+ {eModifierType_DataTransfer, "DATA_TRANSFER", ICON_MODIFIER, "Data Transfer", ""},
+ {eModifierType_MeshCache, "MESH_CACHE", ICON_MODIFIER, "Mesh Cache", ""},
+ {eModifierType_MeshSequenceCache, "MESH_SEQUENCE_CACHE", ICON_MODIFIER, "Mesh Sequence Cache", ""},
+ {eModifierType_NormalEdit, "NORMAL_EDIT", ICON_MODIFIER, "Normal Edit", ""},
+ {eModifierType_WeightedNormal, "WEIGHTED_NORMAL", ICON_MODIFIER, "Weighted Normal", ""},
+ {eModifierType_UVProject, "UV_PROJECT", ICON_MODIFIER, "UV Project", ""},
+ {eModifierType_UVWarp, "UV_WARP", ICON_MODIFIER, "UV Warp", ""},
+ {eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MODIFIER, "Vertex Weight Edit", ""},
+ {eModifierType_WeightVGMix, "VERTEX_WEIGHT_MIX", ICON_MODIFIER, "Vertex Weight Mix", ""},
+ {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MODIFIER,
"Vertex Weight Proximity", ""},
{0, "", 0, N_("Generate"), ""},
- {eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""},
- {eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""},
- {eModifierType_Boolean, "BOOLEAN", ICON_MOD_BOOLEAN, "Boolean", ""},
- {eModifierType_Build, "BUILD", ICON_MOD_BUILD, "Build", ""},
- {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""},
- {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
- {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
- {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
- {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
- {eModifierType_Remesh, "REMESH", ICON_MOD_REMESH, "Remesh", ""},
- {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
- {eModifierType_Skin, "SKIN", ICON_MOD_SKIN, "Skin", ""},
- {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
- {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
- {eModifierType_Triangulate, "TRIANGULATE", ICON_MOD_TRIANGULATE, "Triangulate", ""},
- {eModifierType_Wireframe, "WIREFRAME", ICON_MOD_WIREFRAME, "Wireframe", "Generate a wireframe on the edges of a mesh"},
+ {eModifierType_Array, "ARRAY", ICON_MODIFIER, "Array", ""},
+ {eModifierType_Bevel, "BEVEL", ICON_MODIFIER, "Bevel", ""},
+ {eModifierType_Boolean, "BOOLEAN", ICON_MODIFIER, "Boolean", ""},
+ {eModifierType_Build, "BUILD", ICON_MODIFIER, "Build", ""},
+ {eModifierType_Decimate, "DECIMATE", ICON_MODIFIER, "Decimate", ""},
+ {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MODIFIER, "Edge Split", ""},
+ {eModifierType_Mask, "MASK", ICON_MODIFIER, "Mask", ""},
+ {eModifierType_Mirror, "MIRROR", ICON_MODIFIER, "Mirror", ""},
+ {eModifierType_Multires, "MULTIRES", ICON_MODIFIER, "Multiresolution", ""},
+ {eModifierType_Remesh, "REMESH", ICON_MODIFIER, "Remesh", ""},
+ {eModifierType_Screw, "SCREW", ICON_MODIFIER, "Screw", ""},
+ {eModifierType_Skin, "SKIN", ICON_MODIFIER, "Skin", ""},
+ {eModifierType_Solidify, "SOLIDIFY", ICON_MODIFIER, "Solidify", ""},
+ {eModifierType_Subsurf, "SUBSURF", ICON_MODIFIER, "Subdivision Surface", ""},
+ {eModifierType_Triangulate, "TRIANGULATE", ICON_MODIFIER, "Triangulate", ""},
+ {eModifierType_Wireframe, "WIREFRAME", ICON_MODIFIER, "Wireframe", "Generate a wireframe on the edges of a mesh"},
{0, "", 0, N_("Deform"), ""},
- {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
- {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
- {eModifierType_CorrectiveSmooth, "CORRECTIVE_SMOOTH", ICON_MOD_SMOOTH, "Corrective Smooth", ""},
- {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""},
- {eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""},
- {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""},
- {eModifierType_LaplacianSmooth, "LAPLACIANSMOOTH", ICON_MOD_SMOOTH, "Laplacian Smooth", ""},
- {eModifierType_LaplacianDeform, "LAPLACIANDEFORM", ICON_MOD_MESHDEFORM, "Laplacian Deform", ""},
- {eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""},
- {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""},
- {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""},
- {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""},
- {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""},
- {eModifierType_SurfaceDeform, "SURFACE_DEFORM", ICON_MOD_MESHDEFORM, "Surface Deform", ""},
- {eModifierType_Warp, "WARP", ICON_MOD_WARP, "Warp", ""},
- {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""},
+ {eModifierType_Armature, "ARMATURE", ICON_MODIFIER, "Armature", ""},
+ {eModifierType_Cast, "CAST", ICON_MODIFIER, "Cast", ""},
+ {eModifierType_Curve, "CURVE", ICON_MODIFIER, "Curve", ""},
+ {eModifierType_Displace, "DISPLACE", ICON_MODIFIER, "Displace", ""},
+ {eModifierType_Hook, "HOOK", ICON_MODIFIER, "Hook", ""},
+ {eModifierType_LaplacianDeform, "LAPLACIANDEFORM", ICON_MODIFIER, "Laplacian Deform", ""},
+ {eModifierType_Lattice, "LATTICE", ICON_MODIFIER, "Lattice", ""},
+ {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MODIFIER, "Mesh Deform", ""},
+ {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MODIFIER, "Shrinkwrap", ""},
+ {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MODIFIER, "Simple Deform", ""},
+ {eModifierType_Smooth, "SMOOTH", ICON_MODIFIER, "Smooth", ""},
+ {eModifierType_CorrectiveSmooth, "CORRECTIVE_SMOOTH", ICON_MODIFIER, "Smooth Corrective", ""},
+ {eModifierType_LaplacianSmooth, "LAPLACIANSMOOTH", ICON_MODIFIER, "Smooth Laplacian", ""},
+ {eModifierType_SurfaceDeform, "SURFACE_DEFORM", ICON_MODIFIER, "Surface Deform", ""},
+ {eModifierType_Warp, "WARP", ICON_MODIFIER, "Warp", ""},
+ {eModifierType_Wave, "WAVE", ICON_MODIFIER, "Wave", ""},
{0, "", 0, N_("Simulate"), ""},
- {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
- {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
- {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""},
- {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
- {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
- {eModifierType_Ocean, "OCEAN", ICON_MOD_OCEAN, "Ocean", ""},
- {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
- {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
- {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""},
- {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
- {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
+ {eModifierType_Cloth, "CLOTH", ICON_MODIFIER, "Cloth", ""},
+ {eModifierType_Collision, "COLLISION", ICON_MODIFIER, "Collision", ""},
+ {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MODIFIER, "Dynamic Paint", ""},
+ {eModifierType_Explode, "EXPLODE", ICON_MODIFIER, "Explode", ""},
+ {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MODIFIER, "Fluid Simulation", ""},
+ {eModifierType_Ocean, "OCEAN", ICON_MODIFIER, "Ocean", ""},
+ {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MODIFIER, "Particle Instance", ""},
+ {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MODIFIER, "Particle System", ""},
+ {eModifierType_Smoke, "SMOKE", ICON_MODIFIER, "Smoke", ""},
+ {eModifierType_Softbody, "SOFT_BODY", ICON_MODIFIER, "Soft Body", ""},
+ {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index b5e3ce4fd28..458c26f7026 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -224,11 +224,11 @@ static void rna_Object_camera_fit_coords(
/* settings: 0 - preview, 1 - render */
static Mesh *rna_Object_to_mesh(
Object *ob, bContext *C, ReportList *reports, Depsgraph *depsgraph,
- bool apply_modifiers, bool calc_tessface, bool calc_undeformed)
+ bool apply_modifiers, bool calc_undeformed)
{
Main *bmain = CTX_data_main(C);
- return rna_Main_meshes_new_from_object(bmain, reports, depsgraph, ob, apply_modifiers, calc_tessface, calc_undeformed);
+ return rna_Main_meshes_new_from_object(bmain, reports, depsgraph, ob, apply_modifiers, calc_undeformed);
}
static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports,
@@ -594,7 +594,6 @@ void RNA_api_object(StructRNA *srna)
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
- RNA_def_boolean(func, "calc_tessface", true, "Calculate Tessellation", "Calculate tessellation faces");
RNA_def_boolean(func, "calc_undeformed", false, "Calculate Undeformed", "Calculate undeformed vertex coordinates");
parm = RNA_def_pointer(func, "mesh", "Mesh", "",
"Mesh created from object, remove it if it is only used for export");
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 08da013754b..199f74c709d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -185,9 +185,9 @@ const EnumPropertyItem rna_enum_snap_element_items[] = {
const EnumPropertyItem rna_enum_snap_node_element_items[] = {
{SCE_SNAP_MODE_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
- {SCE_SNAP_MODE_NODE_X, "NODE_X", ICON_SNAP_EDGE, "Node X", "Snap to left/right node border"},
- {SCE_SNAP_MODE_NODE_Y, "NODE_Y", ICON_SNAP_EDGE, "Node Y", "Snap to top/bottom node border"},
- {SCE_SNAP_MODE_NODE_X | SCE_SNAP_MODE_NODE_Y, "NODE_XY", ICON_SNAP_EDGE, "Node X / Y", "Snap to any node border"},
+ {SCE_SNAP_MODE_NODE_X, "NODE_X", ICON_NODE_SIDE, "Node X", "Snap to left/right node border"},
+ {SCE_SNAP_MODE_NODE_Y, "NODE_Y", ICON_NODE_TOP, "Node Y", "Snap to top/bottom node border"},
+ {SCE_SNAP_MODE_NODE_X | SCE_SNAP_MODE_NODE_Y, "NODE_XY", ICON_NODE_CORNER, "Node X / Y", "Snap to any node border"},
{0, NULL, 0, NULL, NULL}
};
@@ -457,27 +457,27 @@ static const EnumPropertyItem rna_enum_gpencil_interpolation_mode_items[] = {
#endif
const EnumPropertyItem rna_enum_transform_pivot_items_full[] = {
- {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
+ {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center",
"Pivot around bounding box center of selected object(s)"},
- {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
- {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
+ {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
+ {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_PIVOT_INDIVIDUAL,
"Individual Origins", "Pivot around each object's own origin"},
- {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
+ {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_PIVOT_MEDIAN, "Median Point",
"Pivot around the median point of selected objects"},
- {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
+ {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_PIVOT_ACTIVE, "Active Element", "Pivot around active object"},
{0, NULL, 0, NULL, NULL}
};
/* Icons could be made a consistent set of images. */
const EnumPropertyItem rna_enum_transform_orientation_items[] = {
- {V3D_MANIP_GLOBAL, "GLOBAL", ICON_SCENE_DATA, "Global", "Align the transformation axes to world space"},
- {V3D_MANIP_LOCAL, "LOCAL", ICON_MANIPUL, "Local", "Align the transformation axes to the selected objects' local space"},
- {V3D_MANIP_NORMAL, "NORMAL", ICON_SNAP_NORMAL, "Normal",
+ {V3D_MANIP_GLOBAL, "GLOBAL", ICON_ORIENTATION_GLOBAL, "Global", "Align the transformation axes to world space"},
+ {V3D_MANIP_LOCAL, "LOCAL", ICON_ORIENTATION_LOCAL, "Local", "Align the transformation axes to the selected objects' local space"},
+ {V3D_MANIP_NORMAL, "NORMAL", ICON_ORIENTATION_NORMAL, "Normal",
"Align the transformation axes to average normal of selected elements "
"(bone Y axis for pose mode)"},
- {V3D_MANIP_GIMBAL, "GIMBAL", ICON_NDOF_DOM, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
- {V3D_MANIP_VIEW, "VIEW", ICON_VISIBLE_IPO_ON, "View", "Align the transformation axes to the window"},
- {V3D_MANIP_CURSOR, "CURSOR", ICON_CURSOR, "Cursor", "Align the transformation axes to the 3D cursor"},
+ {V3D_MANIP_GIMBAL, "GIMBAL", ICON_ORIENTATION_GIMBAL, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
+ {V3D_MANIP_VIEW, "VIEW", ICON_ORIENTATION_VIEW, "View", "Align the transformation axes to the window"},
+ {V3D_MANIP_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "Cursor", "Align the transformation axes to the 3D cursor"},
// {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
{0, NULL, 0, NULL, NULL}
};
@@ -532,6 +532,14 @@ const EnumPropertyItem rna_enum_transform_orientation_items[] = {
#include "FRS_freestyle.h"
#endif
+static void rna_ToolSettings_snap_mode_set(struct PointerRNA *ptr, int value)
+{
+ ToolSettings *ts = (ToolSettings *)ptr->data;
+ if (value != 0) {
+ ts->snap_mode = value;
+ }
+}
+
/* Grease Pencil update cache */
static void rna_GPencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
@@ -2214,7 +2222,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
static const EnumPropertyItem gpencil_stroke_placement_items[] = {
{GP_PROJECT_VIEWSPACE, "ORIGIN", ICON_OBJECT_ORIGIN, "Origin", "Draw stroke at Object origin"},
- {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Draw stroke at 3D cursor location" },
+ {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Draw stroke at 3D cursor location" },
{GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_VIEW, "SURFACE", ICON_FACESEL, "Surface", "Stick stroke to surfaces"},
{0, NULL, 0, NULL, NULL}
};
@@ -2226,7 +2234,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
};
static const EnumPropertyItem annotation_stroke_placement_items[] = {
- {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Draw stroke at 3D cursor location" },
+ {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Draw stroke at 3D cursor location" },
{0, "VIEW", ICON_VISIBLE_IPO_ON, "View", "Stick stroke to the view "}, /* weird, GP_PROJECT_VIEWALIGN is inverted */
{GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_VIEW, "SURFACE", ICON_FACESEL, "Surface", "Stick stroke to surfaces"},
/* Stroke option is disabled because is not working as expected and maybe is not
@@ -2390,7 +2398,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transform_flag", SCE_XFORM_AXIS_ALIGN);
RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object, pose and weight paint mode only)");
- RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
+ RNA_def_property_ui_icon(prop, ICON_CENTER_ONLY, 0);
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
@@ -2420,6 +2428,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_mode");
RNA_def_property_enum_items(prop, rna_enum_snap_element_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_ToolSettings_snap_mode_set", NULL);
RNA_def_property_flag(prop, PROP_ENUM_FLAG);
RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
@@ -2460,7 +2469,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
- RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
+ RNA_def_property_ui_icon(prop, ICON_XRAY, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
prop = RNA_def_property(srna, "use_gizmo_mode", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index f9dedc73280..05e5587c9c4 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -519,7 +519,7 @@ static void rna_def_screen(BlenderRNA *brna)
srna = RNA_def_struct(brna, "Screen", "ID");
RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */
RNA_def_struct_ui_text(srna, "Screen", "Screen data-block, defining the layout of areas in a window");
- RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
+ RNA_def_struct_ui_icon(srna, ICON_WORKSPACE);
prop = RNA_def_property(srna, "layout_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Screen_layout_name_get", "rna_Screen_layout_name_length",
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 6ab591fb332..e6e9ff6664d 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -83,11 +83,11 @@ static EnumPropertyItem rna_enum_gpencil_weight_brush_items[] = {
{ 0, NULL, 0, NULL, NULL }
};
-static const EnumPropertyItem rna_enum_gpencil_lockaxis_items[] = {
+static const EnumPropertyItem rna_enum_gpencil_lock_axis_items[] = {
{ GP_LOCKAXIS_NONE, "GP_LOCKAXIS_NONE", ICON_UNLOCKED, "None", "" },
- { GP_LOCKAXIS_X, "GP_LOCKAXIS_X", ICON_NDOF_DOM, "Y-Z Plane", "Project strokes to plane locked to X" },
- { GP_LOCKAXIS_Y, "GP_LOCKAXIS_Y", ICON_NDOF_DOM, "X-Z Plane", "Project strokes to plane locked to Y" },
- { GP_LOCKAXIS_Z, "GP_LOCKAXIS_Z", ICON_NDOF_DOM, "X-Y Plane", "Project strokes to plane locked to Z" },
+ { GP_LOCKAXIS_X, "GP_LOCKAXIS_X", ICON_AXIS_SIDE, "Y-Z Plane", "Project strokes to plane locked to X" },
+ { GP_LOCKAXIS_Y, "GP_LOCKAXIS_Y", ICON_AXIS_FRONT, "X-Z Plane", "Project strokes to plane locked to Y" },
+ { GP_LOCKAXIS_Z, "GP_LOCKAXIS_Z", ICON_AXIS_TOP, "X-Y Plane", "Project strokes to plane locked to Z" },
{ 0, NULL, 0, NULL, NULL }
};
#endif
@@ -1103,8 +1103,8 @@ static void rna_def_particle_edit(BlenderRNA *brna)
static void rna_def_gpencil_sculpt(BlenderRNA *brna)
{
static const EnumPropertyItem prop_direction_items[] = {
- {0, "ADD", ICON_ZOOMIN, "Add", "Add effect of brush"},
- {GP_EDITBRUSH_FLAG_INVERT, "SUBTRACT", ICON_ZOOMOUT, "Subtract", "Subtract effect of brush"},
+ {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
+ {GP_EDITBRUSH_FLAG_INVERT, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -1183,9 +1183,9 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
/* lock axis */
- prop = RNA_def_property(srna, "lockaxis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "lock_axis");
- RNA_def_property_enum_items(prop, rna_enum_gpencil_lockaxis_items);
+ RNA_def_property_enum_items(prop, rna_enum_gpencil_lock_axis_items);
RNA_def_property_ui_text(prop, "Lock Axis", "");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c
index 22ebd3f7567..fe4e20bbd58 100644
--- a/source/blender/makesrna/intern/rna_shader_fx.c
+++ b/source/blender/makesrna/intern/rna_shader_fx.c
@@ -52,6 +52,7 @@ const EnumPropertyItem rna_enum_object_shaderfx_type_items[] = {
{eShaderFxType_Blur, "FX_BLUR", ICON_SHADERFX, "Blur", "Apply Gaussian Blur to object" },
{eShaderFxType_Colorize, "FX_COLORIZE", ICON_SHADERFX, "Colorize", "Apply different tint effects" },
{eShaderFxType_Flip, "FX_FLIP", ICON_SHADERFX, "Flip", "Flip image" },
+ {eShaderFxType_Glow, "FX_GLOW", ICON_SHADERFX, "Glow", "Create a glow effect" },
{eShaderFxType_Light, "FX_LIGHT", ICON_SHADERFX, "Light", "Simulate ilumination" },
{eShaderFxType_Pixel, "FX_PIXEL", ICON_SHADERFX, "Pixelate", "Pixelate image"},
{eShaderFxType_Rim, "FX_RIM", ICON_SHADERFX, "Rim", "Add a rim to the image" },
@@ -71,6 +72,12 @@ static const EnumPropertyItem rna_enum_shaderfx_rim_modes_items[] = {
{0, NULL, 0, NULL, NULL }
};
+static const EnumPropertyItem rna_enum_shaderfx_glow_modes_items[] = {
+ {eShaderFxGlowMode_Luminance, "LUMINANCE", 0, "Luminance", "" },
+ {eShaderFxGlowMode_Color, "COLOR", 0, "Color", "" },
+ {0, NULL, 0, NULL, NULL }
+};
+
static const EnumPropertyItem rna_enum_shaderfx_colorize_modes_items[] = {
{eShaderFxColorizeMode_GrayScale, "GRAYSCALE", 0, "Gray Scale", "" },
{eShaderFxColorizeMode_Sepia, "SEPIA", 0, "Sepia", "" },
@@ -108,6 +115,8 @@ static StructRNA *rna_ShaderFx_refine(struct PointerRNA *ptr)
return &RNA_ShaderFxSwirl;
case eShaderFxType_Flip:
return &RNA_ShaderFxFlip;
+ case eShaderFxType_Glow:
+ return &RNA_ShaderFxGlow;
case eShaderFxType_Light:
return &RNA_ShaderFxLight;
/* Default */
@@ -483,6 +492,64 @@ static void rna_def_shader_fx_shadow(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
}
+static void rna_def_shader_fx_glow(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "ShaderFxGlow", "ShaderFx");
+ RNA_def_struct_ui_text(srna, "Glow Effect", "Glow effect");
+ RNA_def_struct_sdna(srna, "GlowShaderFxData");
+ RNA_def_struct_ui_icon(srna, ICON_SHADERFX);
+
+ prop = RNA_def_property(srna, "glow_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_float_sdna(prop, NULL, "glow_color");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Glow Color", "Color used for generated glow");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
+ prop = RNA_def_property(srna, "select_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_float_sdna(prop, NULL, "select_color");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Select Color", "Color selected to apply glow");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, rna_enum_shaderfx_glow_modes_items);
+ RNA_def_property_ui_text(prop, "Mode", "Glow mode");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "threshold");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
+ RNA_def_property_ui_text(prop, "Threshold", "Limit to select color for glow effect");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
+ /* use blur fields to make compatible with blur filter, but only makes public first array element */
+ prop = RNA_def_property(srna, "radius", PROP_INT, PROP_PIXEL);
+ RNA_def_property_int_sdna(prop, NULL, "blur[0]");
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_text(prop, "Radius", "Number of pixels for bluring glow (set to 0 to disable)");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
+ prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "samples");
+ RNA_def_property_range(prop, 1, 32);
+ RNA_def_property_ui_range(prop, 1, 32, 2, -1);
+ RNA_def_property_int_default(prop, 4);
+ RNA_def_property_ui_text(prop, "Samples", "Number of Blur Samples");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
+ prop = RNA_def_property(srna, "use_alpha_mode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_GLOW_USE_ALPHA);
+ RNA_def_property_ui_text(prop, "Use Alpha", "Glow only areas with alpha");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+}
+
static void rna_def_shader_fx_swirl(BlenderRNA *brna)
{
StructRNA *srna;
@@ -631,6 +698,7 @@ void RNA_def_shader_fx(BlenderRNA *brna)
rna_def_shader_fx_pixel(brna);
rna_def_shader_fx_rim(brna);
rna_def_shader_fx_shadow(brna);
+ rna_def_shader_fx_glow(brna);
rna_def_shader_fx_swirl(brna);
rna_def_shader_fx_flip(brna);
rna_def_shader_fx_light(brna);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index c2224fe767b..80053095044 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -72,7 +72,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = {
/* General */
{0, "", ICON_NONE, "General", ""},
{SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", "3D viewport"},
- {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"},
+ {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE, "UV/Image Editor", "View and edit images and UV Maps"},
{SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"},
{SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", "Video editing tools"},
{SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"},
@@ -81,7 +81,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = {
{0, "", ICON_NONE, "Animation", ""},
//{SPACE_ACTION, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */
{SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
- {SPACE_IPO, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", "Edit drivers and keyframe interpolation"},
+ {SPACE_IPO, "GRAPH_EDITOR", ICON_GRAPH, "Graph Editor", "Edit drivers and keyframe interpolation"},
{SPACE_NLA, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", "Combine and layer Actions"},
/* Scripting */
@@ -99,16 +99,16 @@ const EnumPropertyItem rna_enum_space_type_items[] = {
/* Data */
{0, "", ICON_NONE, "Data", ""},
- {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"},
- {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"},
- {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"},
+ {SPACE_OUTLINER, "OUTLINER", ICON_OUTLINER, "Outliner", "Overview of scene graph and all available data-blocks"},
+ {SPACE_BUTS, "PROPERTIES", ICON_PROPERTIES, "Properties", "Edit properties of active object and related data-blocks"},
+ {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"},
{SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences",
"Edit persistent configuration settings"},
{0, NULL, 0, NULL, NULL}
};
const EnumPropertyItem rna_enum_space_graph_mode_items[] = {
- {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "Graph Editor",
+ {SIPO_MODE_ANIMATION, "FCURVES", ICON_GRAPH, "Graph Editor",
"Edit animation/keyframes displayed as 2D curves"},
{SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
{0, NULL, 0, NULL, NULL}
@@ -238,10 +238,10 @@ static const EnumPropertyItem autosnap_items[] = {
#endif
const EnumPropertyItem rna_enum_shading_type_items[] = {
- {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
- {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display in solid mode"},
- {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "LookDev", "Display in LookDev mode"},
- {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"},
+ {OB_WIRE, "WIREFRAME", ICON_SHADING_WIRE, "Wireframe", "Display the object as wire edges"},
+ {OB_SOLID, "SOLID", ICON_SHADING_SOLID, "Solid", "Display in solid mode"},
+ {OB_MATERIAL, "MATERIAL", ICON_SHADING_TEXTURE, "LookDev", "Display in LookDev mode"},
+ {OB_RENDER, "RENDERED", ICON_SHADING_RENDERED, "Rendered", "Display render preview"},
{0, NULL, 0, NULL, NULL}
};
@@ -1197,10 +1197,10 @@ static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(
PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
{
static const EnumPropertyItem pivot_items[] = {
- {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
- {V3D_AROUND_CENTER_MEAN, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
- {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
- {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
+ {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
+ {V3D_AROUND_CENTER_MEAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
+ {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
+ {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_PIVOT_INDIVIDUAL,
"Individual Origins", "Pivot around each selected island's own median point"},
{0, NULL, 0, NULL, NULL}
};
@@ -2295,7 +2295,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
{SO_SEQUENCE, "SEQUENCE", ICON_SEQUENCE, "Sequence", "Display sequence data-blocks"},
{SO_LIBRARIES, "LIBRARIES", ICON_FILE_BLEND, "Blender File", "Display data of current file and linked libraries"},
{SO_DATA_API, "DATA_API", ICON_RNA, "Data API", "Display low level Blender data and its properties"},
- {SO_ID_ORPHANS, "ORPHAN_DATA", ICON_EXTERNAL_DATA, "Orphan Data",
+ {SO_ID_ORPHANS, "ORPHAN_DATA", ICON_ORPHAN_DATA, "Orphan Data",
"Display data-blocks which are unused and/or will be lost when the file is reloaded"},
{0, NULL, 0, NULL, NULL}
};
@@ -2783,6 +2783,11 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+ prop = RNA_def_property(srna, "show_wpaint_contours", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "overlay.wpaint_flag", V3D_OVERLAY_WPAINT_CONTOURS);
+ RNA_def_property_ui_text(prop, "Show Weight Contours", "Show contour lines formed by points with the same interpolated weight");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_WEIGHT);
RNA_def_property_ui_text(prop, "Show Weights", "Display weights in editmode");
@@ -4027,9 +4032,9 @@ static void rna_def_space_graph(BlenderRNA *brna)
/* this is basically the same as the one for the 3D-View, but with some entries omitted */
static const EnumPropertyItem gpivot_items[] = {
- {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
- {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
- {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
+ {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
+ {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
+ {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_PIVOT_INDIVIDUAL, "Individual Centers", ""},
/*{V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", 0, "Median Point", ""}, */
/*{V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, */
{0, NULL, 0, NULL, NULL}
@@ -4921,7 +4926,7 @@ static void rna_def_space_clip(BlenderRNA *brna)
static const EnumPropertyItem view_items[] = {
{SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
- {SC_VIEW_GRAPH, "GRAPH", ICON_IPO, "Graph", "Show graph view for active element"},
+ {SC_VIEW_GRAPH, "GRAPH", ICON_GRAPH, "Graph", "Show graph view for active element"},
{SC_VIEW_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dopesheet", "Dopesheet view for tracking data"},
{0, NULL, 0, NULL, NULL}
};
@@ -4933,12 +4938,12 @@ static void rna_def_space_clip(BlenderRNA *brna)
};
static const EnumPropertyItem pivot_items[] = {
- {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
+ {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center",
"Pivot around bounding box center of selected object(s)"},
- {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
- {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
+ {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
+ {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_CENTER_ONLY,
"Individual Origins", "Pivot around each object's own origin"},
- {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
+ {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_PIVOT_MEDIAN, "Median Point",
"Pivot around the median point of selected objects"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 3928b75a2b2..523c4691460 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -378,7 +378,7 @@ static void uilist_draw_item(uiList *ui_list, bContext *C, uiLayout *layout, Poi
RNA_parameter_list_free(&list);
}
-static void uilist_draw_filter(uiList *ui_list, bContext *C, uiLayout *layout)
+static void uilist_draw_filter(uiList *ui_list, bContext *C, uiLayout *layout, bool reverse)
{
extern FunctionRNA rna_UIList_draw_filter_func;
@@ -392,6 +392,7 @@ static void uilist_draw_filter(uiList *ui_list, bContext *C, uiLayout *layout)
RNA_parameter_list_create(&list, &ul_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "layout", &layout);
+ RNA_parameter_set_lookup(&list, "reverse", &reverse);
ui_list->type->ext.call((bContext *)C, &ul_ptr, func, &list);
RNA_parameter_list_free(&list);
@@ -1307,6 +1308,7 @@ static void rna_def_uilist(BlenderRNA *brna)
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_pointer(func, "layout", "UILayout", "", "Layout to draw the item");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
+ RNA_def_boolean(func, "reverse", false, "", "Display items in reverse order");
/* filter */
func = RNA_def_function(srna, "filter_items", NULL);
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 87b8307fafc..f5a74c868fc 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -49,16 +49,12 @@
#define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
#define DEF_ICON_VECTOR(name) {ICON_##name, (#name), 0, (#name), ""},
-#define DEF_ICON_MONO(name) {ICON_##name, (#name), 0, (#name), ""},
+#define DEF_ICON_COLOR(name) {ICON_##name, (#name), 0, (#name), ""},
#define DEF_ICON_BLANK(name)
const EnumPropertyItem rna_enum_icon_items[] = {
#include "UI_icons.h"
{0, NULL, 0, NULL, NULL}
};
-#undef DEF_ICON
-#undef DEF_ICON_VECTOR
-#undef DEF_ICON_MONO
-#undef DEF_ICON_BLANK
#ifdef RNA_RUNTIME
@@ -1036,7 +1032,8 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Default maximum number of rows to display", 0, INT_MAX);
RNA_def_enum(func, "type", rna_enum_uilist_layout_type_items, UILST_LAYOUT_DEFAULT, "Type", "Type of layout to use");
RNA_def_int(func, "columns", 9, 0, INT_MAX, "", "Number of items to display per row, for GRID layout", 0, INT_MAX);
-
+ RNA_def_boolean(func, "reverse", false, "", "Display items in reverse order");
+
func = RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index d3da1eac7e7..8e6dda65e95 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1229,6 +1229,37 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Gizmo B", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ /* Icon colors. */
+ prop = RNA_def_property(srna, "icon_collection", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "icon_collection");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Collection", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "icon_object", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "icon_object");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Object", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "icon_object_data", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "icon_object_data");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Object Data", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "icon_modifier", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "icon_modifier");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Modifier", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "icon_shading", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "icon_shading");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Shading", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
}
static void rna_def_userdef_theme_space_common(StructRNA *srna)
@@ -3087,22 +3118,22 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem active_theme_area[] = {
- {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
+ {0, "USER_INTERFACE", ICON_WORKSPACE, "User Interface", ""},
{19, "STYLE", ICON_FONTPREVIEW, "Text Style", ""},
{18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
{1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
- {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
+ {3, "GRAPH_EDITOR", ICON_GRAPH, "Graph Editor", ""},
{4, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", ""},
{5, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", ""},
- {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
+ {6, "IMAGE_EDITOR", ICON_IMAGE, "UV/Image Editor", ""},
{7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
{8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
{9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
- {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
- {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
+ {11, "PROPERTIES", ICON_PROPERTIES, "Properties", ""},
+ {12, "OUTLINER", ICON_OUTLINER, "Outliner", ""},
{14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
{15, "INFO", ICON_INFO, "Info", ""},
- {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
+ {16, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", ""},
{17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
{20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
{21, "TOPBAR", ICON_NONE, "Top Bar", ""},
@@ -3968,6 +3999,11 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
+ prop = RNA_def_property(srna, "use_grease_pencil_reverse_layers", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_REVERSE_LAYERS);
+ RNA_def_property_ui_text(prop, "Layers list Top-Down",
+ "Order the grease pencil list of layers from Top to Down");
+
prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
RNA_def_property_range(prop, 1, 500);
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c
index e900b51c4eb..5504ca68c6d 100644
--- a/source/blender/makesrna/intern/rna_workspace.c
+++ b/source/blender/makesrna/intern/rna_workspace.c
@@ -294,7 +294,7 @@ static void rna_def_workspace(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "WorkSpace");
RNA_def_struct_ui_text(srna, "Workspace", "Workspace data-block, defining the working environment for the user");
/* TODO: real icon, just to show something */
- RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
+ RNA_def_struct_ui_icon(srna, ICON_WORKSPACE);
prop = RNA_def_property(srna, "screens", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layouts", NULL);