[Bf-blender-cvs] [8e31e53aa0e] master: Function to return a list of keyframe segments
Commit: 8e31e53aa0ee9693582ad5b72cfe5732b57c72fd Author: Christoph Lendenfeld Date: Fri Dec 17 22:43:02 2021 + Branches: master https://developer.blender.org/rB8e31e53aa0ee9693582ad5b72cfe5732b57c72fd Function to return a list of keyframe segments Add a function that returns a list of keyframe segments A segment being a continuous selection of keyframes Will be used by future operators in the graph editor Reviewed by: Sybren A. Stüvel Differential Revision: https://developer.blender.org/D13531 Ref: D13531 === M release/datafiles/locale M release/scripts/addons M release/scripts/addons_contrib M source/blender/editors/animation/keyframes_general.c M source/blender/editors/include/ED_keyframes_edit.h M source/tools === diff --git a/release/datafiles/locale b/release/datafiles/locale index 9d270fd007f..620b85f16d0 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 9d270fd007f628b23ccbcbd87caa2dc35286b26a +Subproject commit 620b85f16d03a6aadd7cae56969c9c29b06b992d diff --git a/release/scripts/addons b/release/scripts/addons index b3c179b2869..c60fef38175 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit b3c179b2869d86c44a4b29e2c638ce2a596a820d +Subproject commit c60fef38175ad989ee0c45e924cb27e1417c8667 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 16467648282..7936dde9ece 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 16467648282500cc229c271f62201ef897f2c2c3 +Subproject commit 7936dde9ece881d531b1a2ee6c45ddb56d30038c diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index dc5d71b5a1e..4fa5dee99a6 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -345,6 +345,28 @@ static bool find_fcurve_segment(FCurve *fcu, return in_segment; } +/* Return a list of FCurveSegment with a start index and a length. + * A segment is a continuous selection of keyframes. + * Keys that have BEZT_FLAG_IGNORE_TAG set are treated as unselected. + * The caller is responsible for freeing the memory. */ +ListBase find_fcurve_segments(FCurve *fcu) +{ + ListBase segments = {NULL, NULL}; + int segment_start_idx = 0; + int segment_len = 0; + int current_index = 0; + + while (find_fcurve_segment(fcu, current_index, _start_idx, _len)) { +FCurveSegment *segment; +segment = MEM_callocN(sizeof(*segment), "FCurveSegment"); +segment->start_index = segment_start_idx; +segment->length = segment_len; +BLI_addtail(, segment); +current_index = segment_start_idx + segment_len; + } + return segments; +} + /* */ /* Check if the keyframe interpolation type is supported */ @@ -440,15 +462,12 @@ bool decimate_fcurve(bAnimListElem *ale, float remove_ratio, float error_sq_max) fcu->bezt[i].f2 &= ~BEZT_FLAG_TEMP_TAG; } - /* Only decimate the individual selected curve segments. */ - int segment_start_idx = 0; - int segment_len = 0; - int current_index = 0; - - while (find_fcurve_segment(fcu, current_index, _start_idx, _len)) { -decimate_fcurve_segment(fcu, segment_start_idx, segment_len, remove_ratio, error_sq_max); -current_index = segment_start_idx + segment_len; + ListBase segments = find_fcurve_segments(fcu); + LISTBASE_FOREACH (FCurveSegment *, segment, ) { +decimate_fcurve_segment( +fcu, segment->start_index, segment->length, remove_ratio, error_sq_max); } + BLI_freelistN(); uint old_totvert = fcu->totvert; fcu->bezt = NULL; diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index bafe68bd28d..8a7831db0ea 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -380,6 +380,11 @@ bool delete_fcurve_keys(struct FCurve *fcu); void clear_fcurve_keys(struct FCurve *fcu); void duplicate_fcurve_keys(struct FCurve *fcu); +typedef struct FCurveSegment { + struct FCurveSegment *next, *prev; + int start_index, length; +} FCurveSegment; +ListBase find_fcurve_segments(struct FCurve *fcu); void clean_fcurve(struct bAnimContext *ac, struct bAnimListElem *ale, float thresh, diff --git a/source/tools b/source/tools index b22d19e47f4..26bc78162ec 16 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit b22d19e47f4d0353082f3d9f30ee8d244c5266d5 +Subproject commit 26bc78162ec89f21453ce3ded7b999bc6649f32b ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe:
[Bf-blender-cvs] [76fd2ff9fa4] master: Fix T94184: Outliner: Collection dragging tooltip is not updating
Commit: 76fd2ff9fa49c7aefe530635472bc61cf7c5a3e2 Author: Germano Cavalcante Date: Fri Dec 17 19:13:14 2021 -0300 Branches: master https://developer.blender.org/rB76fd2ff9fa49c7aefe530635472bc61cf7c5a3e2 Fix T94184: Outliner: Collection dragging tooltip is not updating In the context of the dragdrop tooltip, the event referenced to the window is out of date and contains invalid `mval` values. Avoid using `win->eventstate` as much as possible. === M source/blender/editors/space_outliner/outliner_dragdrop.c === diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index a4d5f2635d4..85fee590447 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -123,7 +123,7 @@ static ID *outliner_ID_drop_find(bContext *C, const wmEvent *event, short idcode /* Find tree element to drop into, with additional before and after reorder support. */ static TreeElement *outliner_drop_insert_find(bContext *C, - const wmEvent *event, + const int xy[2], TreeElementInsertType *r_insert_type) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -136,8 +136,11 @@ static TreeElement *outliner_drop_insert_find(bContext *C, return NULL; } - UI_view2d_region_to_view( - >v2d, event->mval[0], event->mval[1], _mval[0], _mval[1]); + int mval[2]; + mval[0] = xy[0] - region->winrct.xmin; + mval[1] = xy[1] - region->winrct.ymin; + + UI_view2d_region_to_view(>v2d, mval[0], mval[1], _mval[0], _mval[1]); te_hovered = outliner_find_item_at_y(space_outliner, _outliner->tree, view_mval[1]); if (te_hovered) { @@ -216,10 +219,10 @@ static bool is_pchan_element(TreeElement *te) } static TreeElement *outliner_drop_insert_collection_find(bContext *C, - const wmEvent *event, + const int xy[2], TreeElementInsertType *r_insert_type) { - TreeElement *te = outliner_drop_insert_find(C, event, r_insert_type); + TreeElement *te = outliner_drop_insert_find(C, xy, r_insert_type); if (!te) { return NULL; } @@ -707,7 +710,7 @@ static bool datastack_drop_init(bContext *C, const wmEvent *event, StackDropData return false; } - TreeElement *te_target = outliner_drop_insert_find(C, event, _data->insert_type); + TreeElement *te_target = outliner_drop_insert_find(C, event->xy, _data->insert_type); if (!te_target) { return false; } @@ -1088,14 +1091,12 @@ static Collection *collection_parent_from_ID(ID *id) return NULL; } -static bool collection_drop_init(bContext *C, - wmDrag *drag, - const wmEvent *event, - CollectionDrop *data) +static bool collection_drop_init( +bContext *C, wmDrag *drag, const int xy[2], const bool is_link, CollectionDrop *data) { /* Get collection to drop into. */ TreeElementInsertType insert_type; - TreeElement *te = outliner_drop_insert_collection_find(C, event, _type); + TreeElement *te = outliner_drop_insert_collection_find(C, xy, _type); if (!te) { return false; } @@ -1123,7 +1124,7 @@ static bool collection_drop_init(bContext *C, /* Get collection to drag out of. */ ID *parent = drag_id->from_parent; Collection *from_collection = collection_parent_from_ID(parent); - if (event->ctrl) { + if (is_link) { from_collection = NULL; } @@ -1164,7 +1165,7 @@ static bool collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event _outliner->tree, TSE_HIGHLIGHTED_ANY | TSE_DRAG_ANY, false); CollectionDrop data; - if (!event->shift && collection_drop_init(C, drag, event, )) { + if (!event->shift && collection_drop_init(C, drag, event->xy, event->ctrl, )) { TreeElement *te = data.te; TreeStoreElem *tselem = TREESTORE(te); if (!data.from || event->ctrl) { @@ -1201,13 +1202,14 @@ static bool collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event static char *collection_drop_tooltip(bContext *C, wmDrag *drag, - const int UNUSED(xy[2]), + const int xy[2], wmDropBox *UNUSED(drop)) { - wmWindowManager *wm = CTX_wm_manager(C); - const wmEvent *event = wm->winactive ? wm->winactive->eventstate : NULL; + wmWindow *win = CTX_wm_window(C); + const wmEvent *event = win ? win->eventstate : NULL; + CollectionDrop data; -
[Bf-blender-cvs] [285ad21335a] temp-T94185-id_remapping-experiment-a: Add ID_remapper.
Commit: 285ad21335a2294f1c789c29bfab221a09d4459d Author: Jeroen Bakker Date: Fri Dec 17 17:03:41 2021 +0100 Branches: temp-T94185-id_remapping-experiment-a https://developer.blender.org/rB285ad21335a2294f1c789c29bfab221a09d4459d Add ID_remapper. Currently not being used. === M source/blender/blenkernel/BKE_lib_remap.h M source/blender/blenkernel/CMakeLists.txt A source/blender/blenkernel/intern/lib_id_remapper.cc === diff --git a/source/blender/blenkernel/BKE_lib_remap.h b/source/blender/blenkernel/BKE_lib_remap.h index 9c8caa0266b..f8af3516437 100644 --- a/source/blender/blenkernel/BKE_lib_remap.h +++ b/source/blender/blenkernel/BKE_lib_remap.h @@ -154,6 +154,32 @@ void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_ void BKE_library_callback_remap_editor_id_reference_set( BKE_library_remap_editor_id_reference_cb func); +/* IDRemapper */ +struct IDRemapper; + +/** + * \brief Create a new ID Remapper. + * + * An ID remapper stores multiple remapping rules. + */ +struct IDRemapper *BKE_id_remapper_create(void); + +/** \brief Free the given ID Remapper. */ +void BKE_id_remapper_free(struct IDRemapper *id_remapper); +/** \brief Add a new remapping. */ +void BKE_id_remapper_add(struct IDRemapper *id_remapper, struct ID *old_id, struct ID *new_id); +/** + * \brief Apply a remapping. + * + * Update the id pointer stored in the given id_ptr_ptr id a remapping rule exists. + * + * \returns + * false id pointer stored at the given id_ptr_ptr doesn't have a remap rule and isn't + * modified. + * true id pointer stored at the given id_ptr_ptr has a remap rule that is applied. + */ +bool BKE_id_remapper_apply(const struct IDRemapper *id_remapper, struct ID **id_ptr_ptr); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index f6e7f1c2473..3bb8439f129 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -177,6 +177,7 @@ set(SRC intern/lib_id.c intern/lib_id_delete.c intern/lib_id_eval.c + intern/lib_id_remapper.cc intern/lib_override.c intern/lib_query.c intern/lib_remap.c diff --git a/source/blender/blenkernel/intern/lib_id_remapper.cc b/source/blender/blenkernel/intern/lib_id_remapper.cc new file mode 100644 index 000..9d8a5f2ed0d --- /dev/null +++ b/source/blender/blenkernel/intern/lib_id_remapper.cc @@ -0,0 +1,82 @@ + +#include "BKE_lib_remap.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_map.hh" + +namespace blender::bke::id::remapper { +struct IDRemapper { + private: + Map mappings; + + public: + void add(ID *old_id, ID *new_id) + { +BLI_assert(old_id != nullptr); +mappings.add_as(old_id, new_id); + } + + bool apply(ID **id_ptr_ptr) const + { +BLI_assert(id_ptr_ptr != nullptr); +if (*id_ptr_ptr == nullptr) { + return false; +} + +if (!mappings.contains(*id_ptr_ptr)) { + return false; +} + +*id_ptr_ptr = mappings.lookup(*id_ptr_ptr); +return true; + } +}; + +} // namespace blender::bke::id::remapper + +extern "C" { +/** \brief wrap CPP IDRemapper to a C handle. */ +static IDRemapper *wrap(blender::bke::id::remapper::IDRemapper *remapper) +{ + return static_cast(static_cast(remapper)); +} + +/** \brief wrap C handle to a CPP IDRemapper. */ +static blender::bke::id::remapper::IDRemapper *unwrap(IDRemapper *remapper) +{ + return static_cast(static_cast(remapper)); +} + +/** \brief wrap C handle to a CPP IDRemapper. */ +static const blender::bke::id::remapper::IDRemapper *unwrap_const(const IDRemapper *remapper) +{ + return static_cast( + static_cast(remapper)); +} + +IDRemapper *BKE_id_remapper_create(void) +{ + blender::bke::id::remapper::IDRemapper *remapper = + MEM_new(__func__); + return wrap(remapper); +} + +void BKE_id_remapper_free(IDRemapper *id_remapper) +{ + blender::bke::id::remapper::IDRemapper *remapper = unwrap(id_remapper); + MEM_delete(remapper); +} + +void BKE_id_remapper_add(IDRemapper *id_remapper, ID *old_id, ID *new_id) +{ + blender::bke::id::remapper::IDRemapper *remapper = unwrap(id_remapper); + remapper->add(old_id, new_id); +} + +bool BKE_id_remapper_apply(const IDRemapper *id_remapper, ID **id_ptr_ptr) +{ + const blender::bke::id::remapper::IDRemapper *remapper = unwrap_const(id_remapper); + return remapper->apply(id_ptr_ptr); +} +} \ No newline at end of file ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ce02477e248] asset-greasepencil: Merge branch 'master' into asset-greasepencil
Commit: ce02477e248c44a3a61095f042b0557f44e837e2 Author: Antonio Vazquez Date: Fri Dec 17 16:58:01 2021 +0100 Branches: asset-greasepencil https://developer.blender.org/rBce02477e248c44a3a61095f042b0557f44e837e2 Merge branch 'master' into asset-greasepencil === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2648d920d8a] master: Theme: Node Group color only needs RGB, not RGBA
Commit: 2648d920d8ac5c590a6fc28ee1cbb5bc48a9bc07 Author: Dalai Felinto Date: Fri Dec 17 16:44:23 2021 +0100 Branches: master https://developer.blender.org/rB2648d920d8ac5c590a6fc28ee1cbb5bc48a9bc07 Theme: Node Group color only needs RGB, not RGBA The node group alpha theme was used for the overlay drawing in the node editor. Since this was removed (919e513fa8f) the alpha channel doesn't need to be exposed anymore. Reported as part of T93654. === M source/blender/makesrna/intern/rna_userdef.c === diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index dd1252ffebf..929cf94615b 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2889,7 +2889,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) prop = RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxc"); - RNA_def_property_array(prop, 4); + RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Group Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0aabaa4583b] master: Cleanup: Use signed integers in the weld modifier
Commit: 0aabaa4583b33786ccd597d0af98f9e3e3249ffd Author: Hans Goudey Date: Fri Dec 17 11:04:13 2021 -0300 Branches: master https://developer.blender.org/rB0aabaa4583b33786ccd597d0af98f9e3e3249ffd Cleanup: Use signed integers in the weld modifier The style guide mentions that unsigned integers shouldn't be used to show that a value won't be negative. Many places don't follow this properly yet. The modifier used to cast an array of `uint` to `int` in order to pass it to `BLI_kdtree_3d_calc_duplicates_fast`. That is no longer necessary. Differential Revision: https://developer.blender.org/D13613 === M source/blender/modifiers/intern/MOD_weld.c === diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index f842bef3298..aa19e84b909 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -70,68 +70,68 @@ #include "MOD_ui_common.h" /* Indicates when the element was not computed. */ -#define OUT_OF_CONTEXT (uint)(-1) +#define OUT_OF_CONTEXT (int)(-1) /* Indicates if the edge or face will be collapsed. */ -#define ELEM_COLLAPSED (uint)(-2) +#define ELEM_COLLAPSED (int)(-2) /* indicates whether an edge or vertex in groups_map will be merged. */ -#define ELEM_MERGED (uint)(-2) +#define ELEM_MERGED (int)(-2) /* Used to indicate a range in an array specifying a group. */ struct WeldGroup { - uint len; - uint ofs; + int len; + int ofs; }; /* Edge groups that will be merged. Final vertices are also indicated. */ struct WeldGroupEdge { struct WeldGroup group; - uint v1; - uint v2; + int v1; + int v2; }; typedef struct WeldVert { /* Indexes relative to the original Mesh. */ - uint vert_dest; - uint vert_orig; + int vert_dest; + int vert_orig; } WeldVert; typedef struct WeldEdge { union { -uint flag; +int flag; struct { /* Indexes relative to the original Mesh. */ - uint edge_dest; - uint edge_orig; - uint vert_a; - uint vert_b; + int edge_dest; + int edge_orig; + int vert_a; + int vert_b; }; }; } WeldEdge; typedef struct WeldLoop { union { -uint flag; +int flag; struct { /* Indexes relative to the original Mesh. */ - uint vert; - uint edge; - uint loop_orig; - uint loop_skip_to; + int vert; + int edge; + int loop_orig; + int loop_skip_to; }; }; } WeldLoop; typedef struct WeldPoly { union { -uint flag; +int flag; struct { /* Indexes relative to the original Mesh. */ - uint poly_dst; - uint poly_orig; - uint loop_start; - uint loop_end; + int poly_dst; + int poly_orig; + int loop_start; + int loop_end; /* Final Polygon Size. */ - uint len; + int len; /* Group of loops that will be affected. */ struct WeldGroup loops; }; @@ -141,53 +141,53 @@ typedef struct WeldPoly { typedef struct WeldMesh { /* Group of vertices to be merged. */ struct WeldGroup *vert_groups; - uint *vert_groups_buffer; + int *vert_groups_buffer; /* Group of edges to be merged. */ struct WeldGroupEdge *edge_groups; - uint *edge_groups_buffer; + int *edge_groups_buffer; /* From the original index of the vertex, this indicates which group it is or is going to be * merged. */ - uint *edge_groups_map; + int *edge_groups_map; /* References all polygons and loops that will be affected. */ WeldLoop *wloop; WeldPoly *wpoly; WeldPoly *wpoly_new; - uint wloop_len; - uint wpoly_len; - uint wpoly_new_len; + int wloop_len; + int wpoly_len; + int wpoly_new_len; /* From the actual index of the element in the mesh, it indicates what is the index of the Weld * element above. */ - uint *loop_map; - uint *poly_map; + int *loop_map; + int *poly_map; - uint vert_kill_len; - uint edge_kill_len; - uint loop_kill_len; - uint poly_kill_len; /* Including the new polygons. */ + int vert_kill_len; + int edge_kill_len; + int loop_kill_len; + int poly_kill_len; /* Including the new polygons. */ /* Size of the affected polygon with more sides. */ - uint max_poly_len; + int max_poly_len; } WeldMesh; typedef struct WeldLoopOfPolyIter { - uint loop_start; - uint loop_end; + int loop_start; + int loop_end; const WeldLoop *wloop; const MLoop *mloop; - const uint *loop_map; + const int *loop_map; /* Weld group. */ - uint *group; + int *group; - uint l_curr; - uint l_next; + int l_curr; + int l_next; /* Return */ - uint group_len; - uint v; - uint e; + int group_len; + int v; + int e; char type; } WeldLoopOfPolyIter; @@ -200,19 +200,19 @@ static bool weld_iter_loop_of_poly_begin(WeldLoopOfPolyIter *iter,
[Bf-blender-cvs] [552dce0de7d] master: Cleanup: quiet warning due to incompatible pointer types
Commit: 552dce0de7d539205954e1f3139aca0535dc9f3f Author: Jacques Lucke Date: Fri Dec 17 15:46:00 2021 +0100 Branches: master https://developer.blender.org/rB552dce0de7d539205954e1f3139aca0535dc9f3f Cleanup: quiet warning due to incompatible pointer types === M source/blender/blenkernel/intern/lib_override.c === diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 83ed0ee4c08..6e1bac71d3f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -470,8 +470,9 @@ static void lib_override_group_tag_data_object_to_collection_init_collection_pro } LinkNodePair **collections_linkedlist_p; -if (!BLI_ghash_ensure_p( -data->linked_object_to_instantiating_collections, ob, _linkedlist_p)) { +if (!BLI_ghash_ensure_p(data->linked_object_to_instantiating_collections, +ob, +(void ***)_linkedlist_p)) { *collections_linkedlist_p = BLI_memarena_calloc(data->mem_arena, sizeof(**collections_linkedlist_p)); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [77760194fe9] master: Cleanup: use new c++ guarded allocator api in some files
Commit: 77760194fe9ec67721ca7ea5ef111f734d2e240a Author: Jacques Lucke Date: Fri Dec 17 15:40:06 2021 +0100 Branches: master https://developer.blender.org/rB77760194fe9ec67721ca7ea5ef111f734d2e240a Cleanup: use new c++ guarded allocator api in some files === M source/blender/blenkernel/intern/curveprofile.cc M source/blender/editors/space_spreadsheet/space_spreadsheet.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_align_rotation_to_vector.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_clamp.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_color_ramp.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_combine_xyz.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_compare.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_convert.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_curve_map.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_map_range.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_math.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_mix.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_proximity.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_randomize.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_separate_xyz.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_transfer.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_vector_math.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_vector_rotate.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_curve_select_by_handle_type.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_curve_set_handles.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_curve_spline_type.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_curve_subdivide.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_curve_to_points.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_instance.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_rotate.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_scale.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_translate.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_points_to_volume.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_raycast.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_subdivision_surface.cc M source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_volume_to_mesh.cc M source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc M source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc M source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc M source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc M source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc M source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc M source/blender/nodes/geometry/nodes/node_geo_curve_primitive_line.cc M source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc M source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc M source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc M source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc M source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc M source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc M source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc M source/blender/nodes/geometry/nodes/node_geo_image_texture.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc M source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc M source/blender/nodes/geometry/nodes/node_geo_raycast.cc M source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc M source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc M source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc M source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc M
[Bf-blender-cvs] [a3ad5abf2fe] master: Allocator: simplify using guarded allocator in C++ code
Commit: a3ad5abf2fe85d623f9e78fefc34e27bdc14632e Author: Jacques Lucke Date: Fri Dec 17 15:38:15 2021 +0100 Branches: master https://developer.blender.org/rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e Allocator: simplify using guarded allocator in C++ code Using the `MEM_*` API from C++ code was a bit annoying: * When converting C to C++ code, one often has to add a type cast on returned `void *`. That leads to having the same type name three times in the same line. This patch reduces the amount to two and removes the `sizeof(...)` from the line. * The existing alternative of using `OBJECT_GUARDED_NEW` looks a out of place compared to other allocation methods. Sometimes `MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined in C++ code. It doesn't look great but it's definitely better. The downside is that it makes the name of the allocation less useful. That's because the same name is used for all allocations of a type, independend of where it is allocated. This patch introduces three new functions: `MEM_new`, `MEM_cnew` and `MEM_delete`. These cover the majority of use cases (array allocation is not covered). The `OBJECT_GUARDED_*` macros are removed because they are not needed anymore. Differential Revision: https://developer.blender.org/D13502 === M intern/guardedalloc/MEM_guardedalloc.h M intern/libmv/intern/utildefines.h M intern/opencolorio/ocio_impl.cc M intern/opensubdiv/internal/evaluator/evaluator_capi.cc M intern/opensubdiv/internal/topology/topology_refiner_capi.cc M source/blender/blenkernel/intern/volume.cc M source/blender/blenlib/intern/task_scheduler.cc M source/blender/editors/asset/intern/asset_indexer.cc M source/blender/editors/asset/intern/asset_temp_id_consumer.cc M source/blender/editors/interface/interface_view.cc M source/blender/editors/space_file/asset_catalog_tree_view.cc M source/blender/editors/space_node/node_geometry_attribute_search.cc M source/blender/modifiers/intern/MOD_nodes.cc === diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 3c006b9a70c..043f7055ab1 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -259,6 +259,49 @@ void MEM_use_guarded_allocator(void); #endif /* __cplusplus */ #ifdef __cplusplus + +# include +# include + +/** + * Allocate new memory for and constructs an object of type #T. + * #MEM_delete should be used to delete the object. Just calling #MEM_freeN is not enough when #T + * is not a trivial type. + */ +template +inline T *MEM_new(const char *allocation_name, Args &&...args) +{ + void *buffer = MEM_mallocN(sizeof(T), allocation_name); + return new (buffer) T(std::forward(args)...); +} + +/** + * Allocates zero-initialized memory for an object of type #T. The constructor of #T is not called, + * therefor this should only used with trivial types (like all C types). + * It's valid to call #MEM_freeN on a pointer returned by this, because a destructor call is not + * necessary, because the type is trivial. + */ +template inline T *MEM_cnew(const char *allocation_name) +{ + static_assert(std::is_trivial_v, "For non-trivial types, MEM_new should be used."); + return static_cast(MEM_callocN(sizeof(T), allocation_name)); +} + +/** + * Destructs and deallocates an object previously allocated with any `MEM_*` function. + * Passing in null does nothing. + */ +template inline void MEM_delete(const T *ptr) +{ + if (ptr == nullptr) { +/* Support #ptr being null, because C++ `delete` supports that as well. */ +return; + } + /* C++ allows destruction of const objects, so the pointer is allowed to be const. */ + ptr->~T(); + MEM_freeN(const_cast(ptr)); +} + /* Allocation functions (for C++ only). */ # define MEM_CXX_CLASS_ALLOC_FUNCS(_id) \ public: \ @@ -292,36 +335,6 @@ void MEM_use_guarded_allocator(void); { \ } -/* Needed when type includes a namespace, then the namespace should not be - * specified after ~, so using a macro fails. */ -template inline void OBJECT_GUARDED_DESTRUCTOR(T *what) -{ - what->~T(); -} - -# if defined __GNUC__ -#define OBJECT_GUARDED_NEW(type, args...) new (MEM_mallocN(sizeof(type), __func__)) type(args) -# else -#define OBJECT_GUARDED_NEW(type, ...) \ - new (MEM_mallocN(sizeof(type), __FUNCTION__)) type(__VA_ARGS__) -# endif -# define OBJECT_GUARDED_DELETE(what, type) \ -{ \ - if (what) { \ -OBJECT_GUARDED_DESTRUCTOR((type *)what); \ -MEM_freeN(what); \ - } \ -} \ -(void)0 -# define OBJECT_GUARDED_SAFE_DELETE(what, type) \ -{ \ - if (what) { \ -OBJECT_GUARDED_DESTRUCTOR((type *)what); \ -MEM_freeN(what); \ -what = NULL; \ - } \ -} \ -(void)0
[Bf-blender-cvs] [c0d96ca9a5d] master: UI: make Remap User dialog in outliner wider
Commit: c0d96ca9a5dbf168348b6a6bdee2f635c0c1685c Author: Phil Stopford Date: Fri Dec 17 15:05:02 2021 +0100 Branches: master https://developer.blender.org/rBc0d96ca9a5dbf168348b6a6bdee2f635c0c1685c UI: make Remap User dialog in outliner wider The previous size was too small for common object names. Differential Revision: https://developer.blender.org/D13604 === M source/blender/editors/space_outliner/outliner_edit.c === diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 97e5c046452..34f442eb2f7 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -654,7 +654,7 @@ static int outliner_id_remap_invoke(bContext *C, wmOperator *op, const wmEvent * outliner_id_remap_find_tree_element(C, op, _outliner->tree, fmval[1]); } - return WM_operator_props_dialog_popup(C, op, 200); + return WM_operator_props_dialog_popup(C, op, 400); } static const EnumPropertyItem *outliner_id_itemf(bContext *C, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3b965ba10bf] master: UI: Fix node socket alignment in some cases
Commit: 3b965ba10bf649922477cee41da9ed492299313c Author: Alessio Monti di Sopra Date: Fri Dec 17 08:03:47 2021 -0600 Branches: master https://developer.blender.org/rB3b965ba10bf649922477cee41da9ed492299313c UI: Fix node socket alignment in some cases The patch fixes some misalignments in the nodes' sockets/options recently introduced in 26d2caee3ba0, while maintaining the original fix for T92268. The original fix made the top padding always of the same size; while that works when the first row of the other node is `Socket | Socket`, it doesn't for other more common cases, `like Socket | Node Option`, where the text results misaligned. Differential Revision: https://developer.blender.org/D13451 === M source/blender/editors/space_node/node_draw.cc === diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index d68f16f6197..69d66b3fa7a 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -365,6 +365,10 @@ static void node_update_basis(const bContext , bNodeTree , bNode , PointerRNA nodeptr; RNA_pointer_create(, _Node, , ); + const bool node_options = node.typeinfo->draw_buttons && (node.flag & NODE_OPTIONS); + const bool inputs_first = node.inputs.first && +!(node.outputs.first || (node.flag & NODE_PREVIEW) || node_options); + /* Get "global" coordinates. */ float2 loc = node_to_view(node, float2(0)); /* Round the node origin because text contents are always pixel-aligned. */ @@ -377,7 +381,7 @@ static void node_update_basis(const bContext , bNodeTree , bNode , dy -= NODE_DY; /* Add a little bit of padding above the top socket. */ - if (node.outputs.first || node.inputs.first) { + if (node.outputs.first || inputs_first) { dy -= NODE_DYS / 2; } @@ -478,7 +482,7 @@ static void node_update_basis(const bContext , bNodeTree , bNode , } /* Buttons rect? */ - if (node.typeinfo->draw_buttons && (node.flag & NODE_OPTIONS)) { + if (node_options) { dy -= NODE_DYS / 2; uiLayout *layout = UI_block_layout(, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b386f960f6a] master: Fix error in Cycles geometry update tagging after pointcloud addition
Commit: b386f960f6ab37a65075bf48b09815c2a28c5ad5 Author: Brecht Van Lommel Date: Fri Dec 17 14:59:24 2021 +0100 Branches: master https://developer.blender.org/rBb386f960f6ab37a65075bf48b09815c2a28c5ad5 Fix error in Cycles geometry update tagging after pointcloud addition Thanks to Christophe Hery for spotting this. === M intern/cycles/scene/geometry.cpp === diff --git a/intern/cycles/scene/geometry.cpp b/intern/cycles/scene/geometry.cpp index 558b0e13b0f..dfd10cb12b5 100644 --- a/intern/cycles/scene/geometry.cpp +++ b/intern/cycles/scene/geometry.cpp @@ -1370,22 +1370,22 @@ enum { DEVICE_MESH_DATA_MODIFIED = (1 << 1), DEVICE_POINT_DATA_MODIFIED = (1 << 2), - ATTR_FLOAT_MODIFIED = (1 << 2), - ATTR_FLOAT2_MODIFIED = (1 << 3), - ATTR_FLOAT3_MODIFIED = (1 << 4), - ATTR_FLOAT4_MODIFIED = (1 << 5), - ATTR_UCHAR4_MODIFIED = (1 << 6), - - CURVE_DATA_NEED_REALLOC = (1 << 7), - MESH_DATA_NEED_REALLOC = (1 << 8), - POINT_DATA_NEED_REALLOC = (1 << 9), - - ATTR_FLOAT_NEEDS_REALLOC = (1 << 10), - ATTR_FLOAT2_NEEDS_REALLOC = (1 << 11), - ATTR_FLOAT3_NEEDS_REALLOC = (1 << 12), - ATTR_FLOAT4_NEEDS_REALLOC = (1 << 13), - - ATTR_UCHAR4_NEEDS_REALLOC = (1 << 14), + ATTR_FLOAT_MODIFIED = (1 << 3), + ATTR_FLOAT2_MODIFIED = (1 << 4), + ATTR_FLOAT3_MODIFIED = (1 << 5), + ATTR_FLOAT4_MODIFIED = (1 << 6), + ATTR_UCHAR4_MODIFIED = (1 << 7), + + CURVE_DATA_NEED_REALLOC = (1 << 8), + MESH_DATA_NEED_REALLOC = (1 << 9), + POINT_DATA_NEED_REALLOC = (1 << 10), + + ATTR_FLOAT_NEEDS_REALLOC = (1 << 11), + ATTR_FLOAT2_NEEDS_REALLOC = (1 << 12), + ATTR_FLOAT3_NEEDS_REALLOC = (1 << 13), + ATTR_FLOAT4_NEEDS_REALLOC = (1 << 14), + + ATTR_UCHAR4_NEEDS_REALLOC = (1 << 15), ATTRS_NEED_REALLOC = (ATTR_FLOAT_NEEDS_REALLOC | ATTR_FLOAT2_NEEDS_REALLOC | ATTR_FLOAT3_NEEDS_REALLOC | ATTR_FLOAT4_NEEDS_REALLOC | ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [67734d18539] master: Fix T94142, T94182: Cycles metal broken after pointcloud changes
Commit: 67734d18539743494152428e1c1c105f2ee2fd29 Author: Michael Date: Fri Dec 17 14:39:20 2021 +0100 Branches: master https://developer.blender.org/rB67734d18539743494152428e1c1c105f2ee2fd29 Fix T94142, T94182: Cycles metal broken after pointcloud changes Missing ccl_private form an older patch. Differential Revision: https://developer.blender.org/D13612 === M intern/cycles/kernel/geom/point.h M intern/cycles/kernel/geom/point_intersect.h === diff --git a/intern/cycles/kernel/geom/point.h b/intern/cycles/kernel/geom/point.h index 021135b76fb..6d46b934f09 100644 --- a/intern/cycles/kernel/geom/point.h +++ b/intern/cycles/kernel/geom/point.h @@ -46,8 +46,11 @@ ccl_device float point_attribute_float(KernelGlobals kg, } } -ccl_device float2 point_attribute_float2( -KernelGlobals kg, const ShaderData *sd, const AttributeDescriptor desc, float2 *dx, float2 *dy) +ccl_device float2 point_attribute_float2(KernelGlobals kg, + ccl_private const ShaderData *sd, + const AttributeDescriptor desc, + ccl_private float2 *dx, + ccl_private float2 *dy) { # ifdef __RAY_DIFFERENTIALS__ if (dx) @@ -64,8 +67,11 @@ ccl_device float2 point_attribute_float2( } } -ccl_device float3 point_attribute_float3( -KernelGlobals kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy) +ccl_device float3 point_attribute_float3(KernelGlobals kg, + ccl_private const ShaderData *sd, + const AttributeDescriptor desc, + ccl_private float3 *dx, + ccl_private float3 *dy) { # ifdef __RAY_DIFFERENTIALS__ if (dx) @@ -82,8 +88,11 @@ ccl_device float3 point_attribute_float3( } } -ccl_device float4 point_attribute_float4( -KernelGlobals kg, const ShaderData *sd, const AttributeDescriptor desc, float4 *dx, float4 *dy) +ccl_device float4 point_attribute_float4(KernelGlobals kg, + ccl_private const ShaderData *sd, + const AttributeDescriptor desc, + ccl_private float4 *dx, + ccl_private float4 *dy) { # ifdef __RAY_DIFFERENTIALS__ if (dx) diff --git a/intern/cycles/kernel/geom/point_intersect.h b/intern/cycles/kernel/geom/point_intersect.h index 24afa33c53a..7abb0453ae5 100644 --- a/intern/cycles/kernel/geom/point_intersect.h +++ b/intern/cycles/kernel/geom/point_intersect.h @@ -23,7 +23,7 @@ CCL_NAMESPACE_BEGIN #ifdef __POINTCLOUD__ ccl_device_forceinline bool point_intersect_test( -const float4 point, const float3 P, const float3 dir, const float tmax, float *t) +const float4 point, const float3 P, const float3 dir, const float tmax, ccl_private float *t) { const float3 center = float4_to_float3(point); const float radius = point.w; @@ -93,7 +93,7 @@ ccl_device_forceinline bool point_intersect(KernelGlobals kg, ccl_device_inline void point_shader_setup(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private const Intersection *isect, - const Ray *ray) + ccl_private const Ray *ray) { sd->shader = kernel_tex_fetch(__points_shader, isect->prim); sd->P = ray->P + ray->D * isect->t; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f3c1d0e3a3b] master: Fix T94137: GPencil: Eraser does not erase first point
Commit: f3c1d0e3a3b80bdeeb917500bd4f0bcce396adda Author: Philipp Oeser Date: Thu Dec 16 11:22:23 2021 +0100 Branches: master https://developer.blender.org/rBf3c1d0e3a3b80bdeeb917500bd4f0bcce396adda Fix T94137: GPencil: Eraser does not erase first point The eraser checks the current, previous and next point (and sets pc0, pc1 & pc2 corresponding to that for futher occlusion/brush/clipping checks). For the very first point, it sets pc0 to pc1 [which makes sense, there is no previous point, so we should assume the previous segment is "visible" as soon as the first point is], but does so *before* pc1 is even calculated. This makes following occlusion/brush/clipping checks work with zero values [which leads to no earsing in most cases]. Now *first* calculate pc1, *then* set pc0 to pc1. Maniphest Tasks: T94137 Differential Revision: https://developer.blender.org/D13593 === M source/blender/editors/gpencil/gpencil_paint.c === diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index dabe2050b28..d1fbd3bc507 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1567,6 +1567,12 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, } bGPDspoint npt; + gpencil_point_to_parent_space(pt1, p->diff_mat, ); + gpencil_point_to_xy(>gsc, gps, , [0], [1]); + + gpencil_point_to_parent_space(pt2, p->diff_mat, ); + gpencil_point_to_xy(>gsc, gps, , [0], [1]); + if (pt0) { gpencil_point_to_parent_space(pt0, p->diff_mat, ); gpencil_point_to_xy(>gsc, gps, , [0], [1]); @@ -1576,12 +1582,6 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, copy_v2_v2_int(pc0, pc1); } - gpencil_point_to_parent_space(pt1, p->diff_mat, ); - gpencil_point_to_xy(>gsc, gps, , [0], [1]); - - gpencil_point_to_parent_space(pt2, p->diff_mat, ); - gpencil_point_to_xy(>gsc, gps, , [0], [1]); - /* Check that point segment of the boundbox of the eraser stroke */ if (((!ELEM(V2D_IS_CLIPPED, pc0[0], pc0[1])) && BLI_rcti_isect_pt(rect, pc0[0], pc0[1])) || ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1])) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) || ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dbc41b30f88] soc-2021-uv-edge-select-support: Merge branch 'master' into soc-2021-uv-edge-select-support
Commit: dbc41b30f88b96f7d8c6e995b17f5930eb55cc77 Author: Siddhartha Jejurkar Date: Fri Dec 17 18:31:32 2021 +0530 Branches: soc-2021-uv-edge-select-support https://developer.blender.org/rBdbc41b30f88b96f7d8c6e995b17f5930eb55cc77 Merge branch 'master' into soc-2021-uv-edge-select-support === === diff --cc source/blender/editors/uvedit/uvedit_intern.h index 9bc8a165b1f,1fa96a932ed..0a0dd9a133b --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@@ -92,9 -91,17 +92,18 @@@ bool uv_find_nearest_edge_multi(struct struct Object **objects, const uint objects_len, const float co[2], +const float penalty, struct UvNearestHit *hit); + /** + * \param only_in_face: when true, only hit faces which `co` is inside. + * This gives users a result they might expect, especially when zoomed in. + * + * \note Concave faces can cause odd behavior, although in practice this isn't often an issue. + * The center can be outside the face, in this case the distance to the center + * could cause the face to be considered too far away. + * If this becomes an issue we could track the distance to the faces closest edge. + */ bool uv_find_nearest_face_ex(struct Scene *scene, struct Object *obedit, const float co[2], ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7c9e4099854] master: Outliner ID Remap Users: hide ID type from the UI
Commit: 7c9e4099854a4fc8eab4db97173c1aacd25f9e08 Author: Philipp Oeser Date: Wed Dec 8 12:45:56 2021 +0100 Branches: master https://developer.blender.org/rB7c9e4099854a4fc8eab4db97173c1aacd25f9e08 Outliner ID Remap Users: hide ID type from the UI The correct type should be set by invoke already, changing it to a non- matching type (e.g. trying to remap Mesh users with a Camera block) does not really make sense afaict, reason being that we would be presented with the "Invalid old/new ID pair" message in such case anyways (code checks GS(old_id->name) == GS(new_id->name)). This alone wouldnt be a pressing issue, but since doing this with an object ID type crashes atm., it seems to make sense to clean this up now (of course the crash should be looked into, but this is for a separate patch -- if that is solved, we could also think about adding the "Remap Users" entry back in the context menu for objects as well [which was removed in rB17bd5c9d4b1e for some reason]). Part of T93799. Differential Revision: https://developer.blender.org/D13512 === M source/blender/editors/space_outliner/outliner_edit.c === diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 9d4b14a1f57..97e5c046452 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -703,6 +703,8 @@ void OUTLINER_OT_id_remap(wmOperatorType *ot) prop = RNA_def_enum(ot->srna, "id_type", rna_enum_id_type_items, ID_OB, "ID Type", ""); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); + /* Changing ID type wont make sense, would return early with "Invalid old/new ID pair" anyways. */ + RNA_def_property_flag(prop, PROP_HIDDEN); prop = RNA_def_enum(ot->srna, "old_id", DummyRNA_NULL_items, 0, "Old ID", "Old ID to replace"); RNA_def_property_enum_funcs_runtime(prop, NULL, NULL, outliner_id_itemf); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9690b7c91b9] master: Fix (unreported): missed running versioning code in some files
Commit: 9690b7c91b992c1c3d909a471c95022659039278 Author: Jacques Lucke Date: Fri Dec 17 13:49:53 2021 +0100 Branches: master https://developer.blender.org/rB9690b7c91b992c1c3d909a471c95022659039278 Fix (unreported): missed running versioning code in some files The versioning code was accidentally put not at the very bottom. That lead to a situation where it wasn't run on some files that happened to be within a specific short time frame. Since the versioning code is idempotent, it can just run again on existing files. Therefore, this commit just moves it back to the bottom so that it is executed on all files again. Broken Commit: rB5b61737a8f41688699fd1d711a25b7cea86d1530. === M source/blender/blenloader/intern/versioning_300.c === diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index bc3cd7a09cb..7a7f12a7e58 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -2432,22 +2432,6 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - -/* Add node storage for map range node. */ -FOREACH_NODETREE_BEGIN (bmain, ntree, id) { - LISTBASE_FOREACH (bNode *, node, >nodes) { -if (node->type == SH_NODE_MAP_RANGE) { - if (node->storage == NULL) { -NodeMapRange *data = MEM_callocN(sizeof(NodeMapRange), __func__); -data->clamp = node->custom1; -data->data_type = CD_PROP_FLOAT; -data->interpolation_type = node->custom2; -node->storage = data; - } -} - } -} -FOREACH_NODETREE_END; } if (!MAIN_VERSION_ATLEAST(bmain, 301, 5)) { @@ -2475,5 +2459,21 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ + +/* Add node storage for map range node. */ +FOREACH_NODETREE_BEGIN (bmain, ntree, id) { + LISTBASE_FOREACH (bNode *, node, >nodes) { +if (node->type == SH_NODE_MAP_RANGE) { + if (node->storage == NULL) { +NodeMapRange *data = MEM_callocN(sizeof(NodeMapRange), __func__); +data->clamp = node->custom1; +data->data_type = CD_PROP_FLOAT; +data->interpolation_type = node->custom2; +node->storage = data; + } +} + } +} +FOREACH_NODETREE_END; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [367b484841a] master: Fix T94166: set handle position node crashed after refactor
Commit: 367b484841a4d2d2c7a0ad0ec397071804c29210 Author: Jacques Lucke Date: Fri Dec 17 10:40:01 2021 +0100 Branches: master https://developer.blender.org/rB367b484841a4d2d2c7a0ad0ec397071804c29210 Fix T94166: set handle position node crashed after refactor This was an oversight in rB8e2c9f2dd3118bfdb69ccf0ab2b9f968a854aae4. === M source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc index 30a61574e19..f98b4116526 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc @@ -65,7 +65,7 @@ static void set_position_in_component(const GeometryNodeCurveHandleMode mode, evaluator.add(position_field); evaluator.add(offset_field); evaluator.evaluate(); - const IndexMask selection = evaluator.get_evaluated_as_mask(0); + const IndexMask selection = evaluator.get_evaluated_selection_as_mask(); CurveComponent *curve_component = static_cast(); CurveEval *curve = curve_component->get_for_write(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs