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/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesrna/intern/makesrna.c11
-rw-r--r--source/blender/makesrna/intern/rna_access_compare_override.c12
-rw-r--r--source/blender/makesrna/intern/rna_brush.c10
-rw-r--r--source/blender/makesrna/intern/rna_define.c10
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c51
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c9
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c56
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c81
-rw-r--r--source/blender/makesrna/intern/rna_object.c10
-rw-r--r--source/blender/makesrna/intern/rna_rna.c50
-rw-r--r--source/blender/makesrna/intern/rna_space.c30
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c16
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
14 files changed, 261 insertions, 91 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 72cdaecb2c3..94cfd8464ae 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -189,7 +189,6 @@ set(SRC
../../../../intern/guardedalloc/intern/mallocn.c
../../../../intern/guardedalloc/intern/mallocn_guarded_impl.c
../../../../intern/guardedalloc/intern/mallocn_lockfree_impl.c
- ../../../../intern/guardedalloc/intern/mmap_win.c
# Needed for defaults.
../../../../release/datafiles/userdef/userdef_default.c
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index e9e00ff6f71..bec3db10905 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -4758,8 +4758,14 @@ static const char *cpp_classes =
"class CollectionIterator {\n"
"public:\n"
" CollectionIterator() : iter(), t(iter.ptr), init(false) { iter.valid = false; }\n"
+ " CollectionIterator(const PointerRNA &ptr) : CollectionIterator() { this->begin(ptr); }\n"
" ~CollectionIterator(void) { if (init) Tend(&iter); };\n"
"\n"
+ " CollectionIterator(const CollectionIterator &other) = delete;\n"
+ " CollectionIterator(CollectionIterator &&other) = delete;\n"
+ " CollectionIterator &operator=(const CollectionIterator &other) = delete;\n"
+ " CollectionIterator &operator=(CollectionIterator &&other) = delete;\n"
+ "\n"
" operator bool(void)\n"
" { return iter.valid != 0; }\n"
" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator++() { Tnext(&iter); t = "
@@ -4777,9 +4783,6 @@ static const char *cpp_classes =
"true; }\n"
"\n"
"private:\n"
- " const CollectionIterator<T, Tbegin, Tnext, Tend>& operator = "
- "(const CollectionIterator<T, Tbegin, Tnext, Tend>& /*copy*/) {}\n"
- ""
" CollectionPropertyIterator iter;\n"
" T t;\n"
" bool init;\n"
@@ -4794,6 +4797,8 @@ static const char *cpp_classes =
"\n"
" void begin(CollectionIterator<T, Tbegin, Tnext, Tend>& iter)\n"
" { iter.begin(ptr); }\n"
+ " CollectionIterator<T, Tbegin, Tnext, Tend> begin()\n"
+ " { return CollectionIterator<T, Tbegin, Tnext, Tend>(ptr); }\n"
" CollectionIterator<T, Tbegin, Tnext, Tend> end()\n"
" { return CollectionIterator<T, Tbegin, Tnext, Tend>(); } /* test */ \n"
""
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index 1e7f5e841ba..2d6f1bbc059 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -42,6 +42,7 @@
#include "BKE_armature.h"
#include "BKE_idprop.h"
+#include "BKE_idtype.h"
#include "BKE_lib_override.h"
#include "BKE_main.h"
@@ -1178,6 +1179,17 @@ void RNA_struct_override_apply(Main *bmain,
#endif
}
}
+
+ /* Some cases (like point caches) may require additional post-processing. */
+ if (RNA_struct_is_a(ptr_dst->type, &RNA_ID)) {
+ ID *id_dst = ptr_dst->data;
+ ID *id_src = ptr_src->data;
+ const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(id_dst);
+ if (id_type->lib_override_apply_post != NULL) {
+ id_type->lib_override_apply_post(id_dst, id_src);
+ }
+ }
+
#ifdef DEBUG_OVERRIDE_TIMEIT
TIMEIT_END_AVERAGED(RNA_struct_override_apply);
#endif
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 2af6c04147c..4f98c6e8e07 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1464,13 +1464,13 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
/* fill factor size */
- prop = RNA_def_property(srna, "fill_factor", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "fill_factor");
- RNA_def_property_range(prop, 1, 8);
+ prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fill_factor");
+ RNA_def_property_range(prop, GPENCIL_MIN_FILL_FAC, 8.0f);
RNA_def_property_ui_text(
prop,
- "Resolution",
- "Multiplier for fill resolution, higher resolution is more accurate but slower");
+ "Precision",
+ "Factor for fill boundary accuracy, higher values are more accurate but slower");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index cec6a50d170..da04ac63ee3 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -4111,6 +4111,16 @@ PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont_,
ASSERT_SOFT_HARD_LIMITS;
+#ifdef DEBUG
+ /* Properties with PROP_PERCENTAGE should use a range like 0 to 100, unlike PROP_FACTOR. */
+ if (hardmax < 2.0f) {
+ CLOG_WARN(&LOG,
+ "Percentage property with incorrect range: %s.%s",
+ CONTAINER_RNA_ID(cont),
+ identifier);
+ }
+#endif
+
prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_default(prop, default_value);
if (hardmin != hardmax) {
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 81e20003d8f..209dc21d386 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -182,6 +182,16 @@ static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe
WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
}
+static void rna_GpencilLayerMatrix_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ bGPDlayer *gpl = (bGPDlayer *)ptr->data;
+
+ loc_eul_size_to_mat4(gpl->layer_mat, gpl->location, gpl->rotation, gpl->scale);
+ invert_m4_m4(gpl->layer_invmat, gpl->layer_mat);
+
+ rna_GPencil_update(bmain, scene, ptr);
+}
+
static void rna_GPencil_curve_edit_mode_toggle(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ToolSettings *ts = scene->toolsettings;
@@ -940,7 +950,7 @@ static void rna_GPencil_frame_remove(bGPDlayer *layer, ReportList *reports, Poin
static bGPDframe *rna_GPencil_frame_copy(bGPDlayer *layer, bGPDframe *src)
{
- bGPDframe *frame = BKE_gpencil_frame_duplicate(src);
+ bGPDframe *frame = BKE_gpencil_frame_duplicate(src, true);
while (BKE_gpencil_layer_frame_find(layer, frame->framenum)) {
frame->framenum++;
@@ -2012,6 +2022,45 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Blend Mode", "Blend mode");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ /* Layer transforms. */
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "location");
+ RNA_def_property_ui_text(prop, "Location", "Values for change location");
+ RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
+ RNA_def_property_update(prop, 0, "rna_GpencilLayerMatrix_update");
+
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float_sdna(prop, NULL, "rotation");
+ RNA_def_property_ui_text(prop, "Rotation", "Values for changes in rotation");
+ RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
+ RNA_def_property_update(prop, 0, "rna_GpencilLayerMatrix_update");
+
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "scale");
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Scale", "Values for changes in scale");
+ RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
+ RNA_def_property_update(prop, 0, "rna_GpencilLayerMatrix_update");
+
+ /* Layer matrix. */
+ prop = RNA_def_property(srna, "matrix_layer", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "layer_mat");
+ RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON);
+ RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+ RNA_def_property_ui_text(prop, "Matrix Layer", "Local Layer transformation matrix");
+
+ /* Layer inverse matrix. */
+ prop = RNA_def_property(srna, "matrix_inverse_layer", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "layer_invmat");
+ RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON);
+ RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+ RNA_def_property_ui_text(
+ prop, "Matrix Layer Inverse", "Local Layer transformation inverse matrix");
+
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 89eb989a442..71d5a53adb2 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -489,7 +489,7 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_ui_text(prop, "Seed", "Random seed");
+ RNA_def_property_ui_text(prop, "Noise Seed", "Random seed");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_FACTOR);
@@ -498,6 +498,13 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Scale", "Scale the noise frequency");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+ prop = RNA_def_property(srna, "noise_offset", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "noise_offset");
+ RNA_def_property_range(prop, 0.0, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0, 100.0, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Noise Offset", "Offset the noise along the strokes");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "use_custom_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_CUSTOM_CURVE);
RNA_def_property_ui_text(
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index e02e47745b0..c13f592f7fb 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1632,33 +1632,35 @@ static IDProperty *rna_NodesModifier_properties(PointerRNA *ptr, bool create)
static void rna_def_property_subdivision_common(StructRNA *srna)
{
static const EnumPropertyItem prop_uv_smooth_items[] = {
- {SUBSURF_UV_SMOOTH_NONE, "NONE", 0, "None", "UVs are not smoothed, boundaries are kept sharp"},
- {SUBSURF_UV_SMOOTH_PRESERVE_CORNERS,
- "PRESERVE_CORNERS",
- 0,
- "Keep Corners",
- "UVs are smoothed, corners on discontinuous boundary are kept sharp"},
-# if 0
- {SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS,
- "PRESERVE_CORNERS_AND_JUNCTIONS",
- 0,
- "Smooth, keep corners+junctions",
- "UVs are smoothed, corners on discontinuous boundary and "
- "junctions of 3 or more regions are kept sharp"},
- {SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE,
- "PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE",
- 0,
- "Smooth, keep corners+junctions+concave",
- "UVs are smoothed, corners on discontinuous boundary, "
- "junctions of 3 or more regions and darts and concave corners are kept sharp"},
- {SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES,
- "PRESERVE_BOUNDARIES",
- 0,
- "Smooth, keep corners",
- "UVs are smoothed, boundaries are kept sharp"},
-# endif
- {SUBSURF_UV_SMOOTH_ALL, "PRESERVE_BOUNDARIES", 0, "All", "UVs and boundaries are smoothed"},
- {0, NULL, 0, NULL, NULL},
+ {SUBSURF_UV_SMOOTH_NONE,
+ "NONE",
+ 0,
+ "None",
+ "UVs are not smoothed, boundaries are kept sharp"},
+ {SUBSURF_UV_SMOOTH_PRESERVE_CORNERS,
+ "PRESERVE_CORNERS",
+ 0,
+ "Keep Corners",
+ "UVs are smoothed, corners on discontinuous boundary are kept sharp"},
+ {SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS,
+ "PRESERVE_CORNERS_AND_JUNCTIONS",
+ 0,
+ "Keep Corners, Junctions",
+ "UVs are smoothed, corners on discontinuous boundary and "
+ "junctions of 3 or more regions are kept sharp"},
+ {SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE,
+ "PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE",
+ 0,
+ "Keep Corners, Junctions, Concave",
+ "UVs are smoothed, corners on discontinuous boundary, "
+ "junctions of 3 or more regions and darts and concave corners are kept sharp"},
+ {SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES,
+ "PRESERVE_BOUNDARIES",
+ 0,
+ "Keep boundaries",
+ "UVs are smoothed, boundaries are kept sharp"},
+ {SUBSURF_UV_SMOOTH_ALL, "SMOOTH_ALL", 0, "All", "UVs and boundaries are smoothed"},
+ {0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem prop_boundary_smooth_items[] = {
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 1cd3593e4a4..a4dcc677035 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1980,22 +1980,6 @@ static const EnumPropertyItem *rna_GeometryNodeAttributeFill_domain_itemf(
return itemf_function_check(rna_enum_attribute_domain_items, attribute_fill_domain_supported);
}
-static bool attribute_math_operation_supported(const EnumPropertyItem *item)
-{
- return ELEM(item->value,
- NODE_MATH_ADD,
- NODE_MATH_SUBTRACT,
- NODE_MATH_MULTIPLY,
- NODE_MATH_DIVIDE) &&
- (item->identifier[0] != '\0');
-}
-static const EnumPropertyItem *rna_GeometryNodeAttributeMath_operation_itemf(
- bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
-{
- *r_free = true;
- return itemf_function_check(rna_enum_node_math_items, attribute_math_operation_supported);
-}
-
/**
* This bit of ugly code makes sure the float / attribute option shows up instead of
* vector / attribute if the node uses an operation that uses a float for input B.
@@ -4757,9 +4741,10 @@ static void def_sh_tex_sky(StructRNA *srna)
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "altitude", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "altitude", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_ui_text(prop, "Altitude", "Height from sea level");
- RNA_def_property_range(prop, 0.0f, 60.0f);
+ RNA_def_property_range(prop, 0.0f, 60000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 60000.0f, 10, 1);
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
@@ -8579,10 +8564,9 @@ static void def_geo_attribute_math(StructRNA *srna)
prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "operation");
RNA_def_property_enum_items(prop, rna_enum_node_math_items);
- RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_GeometryNodeAttributeMath_operation_itemf");
RNA_def_property_enum_default(prop, NODE_MATH_ADD);
RNA_def_property_ui_text(prop, "Operation", "");
- RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
prop = RNA_def_property(srna, "input_type_a", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "input_type_a");
@@ -8595,6 +8579,12 @@ static void def_geo_attribute_math(StructRNA *srna)
RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_float);
RNA_def_property_ui_text(prop, "Input Type B", "");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+
+ prop = RNA_def_property(srna, "input_type_c", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "input_type_c");
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_float);
+ RNA_def_property_ui_text(prop, "Input Type C", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
static void def_geo_attribute_vector_math(StructRNA *srna)
@@ -8648,16 +8638,17 @@ static void def_geo_point_instance(StructRNA *srna)
};
PropertyRNA *prop;
+ RNA_def_struct_sdna_from(srna, "NodeGeometryPointInstance", "storage");
prop = RNA_def_property(srna, "instance_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_sdna(prop, NULL, "instance_type");
RNA_def_property_enum_items(prop, instance_type_items);
RNA_def_property_enum_default(prop, GEO_NODE_POINT_INSTANCE_TYPE_OBJECT);
RNA_def_property_ui_text(prop, "Instance Type", "");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
prop = RNA_def_property(srna, "use_whole_collection", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", 1);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION);
RNA_def_property_ui_text(prop, "Whole Collection", "Instance entire collection on each point");
RNA_def_property_update(prop, 0, "rna_Node_socket_update");
}
@@ -8698,7 +8689,7 @@ static void def_geo_attribute_attribute_compare(StructRNA *srna)
prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_node_float_compare_items);
- RNA_def_property_enum_default(prop, NODE_MATH_ADD);
+ RNA_def_property_enum_default(prop, NODE_FLOAT_COMPARE_GREATER_THAN);
RNA_def_property_ui_text(prop, "Operation", "");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
@@ -8862,6 +8853,19 @@ static void def_geo_point_translate(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_attribute_sample_texture(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "id");
+ RNA_def_property_struct_type(prop, "Texture");
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+ RNA_def_property_ui_text(prop, "Texture", "Texture to sample values from");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update_relations");
+}
+
static void def_geo_object_info(StructRNA *srna)
{
PropertyRNA *prop;
@@ -8875,6 +8879,37 @@ static void def_geo_object_info(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
+static void def_geo_points_to_volume(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem resolution_mode_items[] = {
+ {GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT,
+ "VOXEL_AMOUNT",
+ 0,
+ "Amount",
+ "Specify the approximate number of voxels along the diagonal"},
+ {GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_SIZE,
+ "VOXEL_SIZE",
+ 0,
+ "Size",
+ "Specify the voxel side length"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryPointsToVolume", "storage");
+
+ prop = RNA_def_property(srna, "resolution_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, resolution_mode_items);
+ RNA_def_property_ui_text(prop, "Resolution Mode", "How the voxel size is specified");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+
+ prop = RNA_def_property(srna, "input_type_radius", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_float);
+ RNA_def_property_ui_text(prop, "Radius Input Type", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
/* -------------------------------------------------------------------------- */
static void rna_def_shader_node(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index faa20e642cf..c418c8eb4dc 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -85,16 +85,16 @@ const EnumPropertyItem rna_enum_object_mode_items[] = {
ICON_GREASEPENCIL,
"Draw",
"Paint Grease Pencil Strokes"},
- {OB_MODE_VERTEX_GPENCIL,
- "VERTEX_GPENCIL",
- ICON_VPAINT_HLT,
- "Vertex Paint",
- "Grease Pencil Vertex Paint Strokes"},
{OB_MODE_WEIGHT_GPENCIL,
"WEIGHT_GPENCIL",
ICON_WPAINT_HLT,
"Weight Paint",
"Grease Pencil Weight Paint Strokes"},
+ {OB_MODE_VERTEX_GPENCIL,
+ "VERTEX_GPENCIL",
+ ICON_VPAINT_HLT,
+ "Vertex Paint",
+ "Grease Pencil Vertex Paint Strokes"},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index c929e3ab1aa..cad0d77607b 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -1279,12 +1279,22 @@ static int rna_property_override_diff_propptr(Main *bmain,
0);
if (is_id) {
- /* For now, once we deal with nodetrees we'll want to get rid of that one. */
- // BLI_assert(no_ownership);
+ /* Owned IDs (the ones we want to actually compare in depth, instead of just comparing pointer
+ * values) should be always properly tagged as 'virtual' overrides. */
+ ID *id = propptr_a->owner_id;
+ if (id != NULL && !ID_IS_OVERRIDE_LIBRARY(id)) {
+ id = propptr_b->owner_id;
+ if (id != NULL && !ID_IS_OVERRIDE_LIBRARY(id)) {
+ id = NULL;
+ }
+ }
+
+ BLI_assert(no_ownership || id == NULL || ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id));
+ UNUSED_VARS_NDEBUG(id);
}
if (override) {
- if (no_ownership /* || is_id */ || is_null || is_type_diff || !is_valid_for_diffing) {
+ if (no_ownership || is_null || is_type_diff || !is_valid_for_diffing) {
/* In case this pointer prop does not own its data (or one is NULL), do not compare structs!
* This is a quite safe path to infinite loop, among other nasty issues.
* Instead, just compare pointers themselves. */
@@ -1304,9 +1314,9 @@ static int rna_property_override_diff_propptr(Main *bmain,
BLI_assert(op->rna_prop_type == property_type);
}
+ IDOverrideLibraryPropertyOperation *opop = NULL;
if (created || rna_itemname_a != NULL || rna_itemname_b != NULL ||
rna_itemindex_a != -1 || rna_itemindex_b != -1) {
- IDOverrideLibraryPropertyOperation *opop;
opop = BKE_lib_override_library_property_operation_get(op,
IDOVERRIDE_LIBRARY_OP_REPLACE,
rna_itemname_b,
@@ -1327,6 +1337,38 @@ static int rna_property_override_diff_propptr(Main *bmain,
else {
BKE_lib_override_library_operations_tag(op, IDOVERRIDE_LIBRARY_TAG_UNUSED, false);
}
+
+ if (is_id && no_ownership) {
+ if (opop == NULL) {
+ opop = BKE_lib_override_library_property_operation_find(op,
+ rna_itemname_b,
+ rna_itemname_a,
+ rna_itemindex_b,
+ rna_itemindex_a,
+ true,
+ NULL);
+ BLI_assert(opop != NULL);
+ }
+
+ BLI_assert(propptr_a->data == propptr_a->owner_id);
+ BLI_assert(propptr_b->data == propptr_b->owner_id);
+ ID *id_a = propptr_a->data;
+ ID *id_b = propptr_b->data;
+ if (ELEM(NULL, id_a, id_b)) {
+ /* In case one of the pointer is NULL and not the other, we consider that the
+ * override is not matching its reference anymore. */
+ opop->flag &= ~IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE;
+ }
+ else if (id_a->override_library != NULL && id_a->override_library->reference == id_b) {
+ opop->flag |= IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE;
+ }
+ else if (id_b->override_library != NULL && id_b->override_library->reference == id_a) {
+ opop->flag |= IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE;
+ }
+ else {
+ opop->flag &= ~IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE;
+ }
+ }
}
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2ee84f70752..160d93dea58 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2279,6 +2279,20 @@ static bool rna_SpaceNodeEditor_tree_type_poll(void *Cv, bNodeTreeType *type)
}
}
+static void rna_SpaceNodeEditor_cursor_location_get(PointerRNA *ptr, float value[2])
+{
+ const SpaceNode *snode = (SpaceNode *)ptr->data;
+
+ ED_node_cursor_location_get(snode, value);
+}
+
+static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float value[2])
+{
+ SpaceNode *snode = (SpaceNode *)ptr->data;
+
+ ED_node_cursor_location_set(snode, value);
+}
+
const EnumPropertyItem *RNA_enum_node_tree_types_itemf_impl(bContext *C, bool *r_free)
{
return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free);
@@ -2346,9 +2360,13 @@ static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode,
{
ARegion *region = CTX_wm_region(C);
- UI_view2d_region_to_view(&region->v2d, x, y, &snode->cursor[0], &snode->cursor[1]);
- snode->cursor[0] /= UI_DPI_FAC;
- snode->cursor[1] /= UI_DPI_FAC;
+ float cursor_location[2];
+
+ UI_view2d_region_to_view(&region->v2d, x, y, &cursor_location[0], &cursor_location[1]);
+ cursor_location[0] /= UI_DPI_FAC;
+ cursor_location[1] /= UI_DPI_FAC;
+
+ ED_node_cursor_location_set(snode, cursor_location);
}
static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr,
@@ -6815,11 +6833,13 @@ static void rna_def_space_node(BlenderRNA *brna)
RNA_def_property_enum_items(prop, backdrop_channels_items);
RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
-
/* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */
prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
- RNA_def_property_float_sdna(prop, NULL, "cursor");
+ RNA_def_property_float_funcs(prop,
+ "rna_SpaceNodeEditor_cursor_location_get",
+ "rna_SpaceNodeEditor_cursor_location_set",
+ NULL);
RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 1870c660efd..bcf75fb284f 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -976,22 +976,6 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, cleanup_items);
RNA_def_property_ui_text(prop, "Action", "Cleanup action to execute");
- /* ** default tracker settings ** */
- prop = RNA_def_property(srna, "show_default_expanded", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED);
- RNA_def_property_ui_text(
- prop, "Show Expanded", "Show default options expanded in the user interface");
- RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
-
- /* ** extra tracker settings ** */
- prop = RNA_def_property(srna, "show_extra_expanded", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED);
- RNA_def_property_ui_text(
- prop, "Show Expanded", "Show extra options expanded in the user interface");
- RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
-
/* solver settings */
prop = RNA_def_property(srna, "use_tripod_solver", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 3d123f07c2b..445ff773868 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4756,6 +4756,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Gizmo Size", "Diameter of the gizmo");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+ prop = RNA_def_property(srna, "gizmo_size_navigate_v3d", PROP_INT, PROP_PIXEL);
+ RNA_def_property_range(prop, 30, 200);
+ RNA_def_property_ui_text(prop, "Navigate Gizmo Size", "The Navigate Gizmo size");
+ RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
+
/* Lookdev */
prop = RNA_def_property(srna, "lookdev_sphere_size", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "lookdev_sphere_size");