[Bf-blender-cvs] [6b11df31af7] temp-lineart-contained: LineArt: Fix incorrect fov when sensor fit is not Auto.
Commit: 6b11df31af782459613d0db6b01c025a3c84bcbd Author: YimingWu Date: Tue Apr 27 11:26:44 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rB6b11df31af782459613d0db6b01c025a3c84bcbd LineArt: Fix incorrect fov when sensor fit is not Auto. === M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c === diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index 0a27ec41153..73a79093d20 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -1914,8 +1914,23 @@ static void lineart_main_load_geometries( } if (cam->type == CAM_PERSP) { -if (asp < 1) { - fov /= asp; +if (cam->sensor_fit == CAMERA_SENSOR_FIT_AUTO) { + if (asp < 1) { +fov /= asp; + } + else { +fov *= asp; + } +} +else if (cam->sensor_fit == CAMERA_SENSOR_FIT_HOR) { + if (asp < 1) { +fov /= asp; + } +} +else if (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) { + if (asp > 1) { +fov *= asp; + } } lineart_matrix_perspective_44d(proj, fov, asp, cam->clip_start, cam->clip_end); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dac54c3af8f] temp-lineart-contained: Merge remote-tracking branch 'origin/master' into temp-lineart-contained
Commit: dac54c3af8f31f0a28c5b748d34ab3acab4640dc Author: YimingWu Date: Tue Apr 27 10:56:09 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rBdac54c3af8f31f0a28c5b748d34ab3acab4640dc Merge remote-tracking branch 'origin/master' into temp-lineart-contained === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [542f022afd1] master: Merge branch 'blender-v2.93-release'
Commit: 542f022afd1c3c6f444ee54707796ac03a317617 Author: Hans Goudey Date: Mon Apr 26 22:23:55 2021 -0500 Branches: master https://developer.blender.org/rB542f022afd1c3c6f444ee54707796ac03a317617 Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f682812f41f] blender-v2.93-release: Fix T87749: Fix text jitter in buttons with icons
Commit: f682812f41f0957ac1f72cc105dfc06f250d7755 Author: Hans Goudey Date: Mon Apr 26 22:23:23 2021 -0500 Branches: blender-v2.93-release https://developer.blender.org/rBf682812f41f0957ac1f72cc105dfc06f250d7755 Fix T87749: Fix text jitter in buttons with icons This patch fixes the remaining issues described in T87749. The jitter was caused by inconsistent rounding when using the floats icon_size and icon_padding to offset the bound for the text drawing. Using `round_fl_to_int` leads to consistent results and fixes the jitter that remained in some buttons with icons, UI lists, and breadcrumbs. Differential Revision: https://developer.blender.org/D11062 === M source/blender/editors/interface/interface_widgets.c === diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 8dbebe2a94c..c9c1f56dc98 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2416,7 +2416,7 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle, but->block->aspect = aspect_orig; #endif -rect->xmin += icon_size + icon_padding; +rect->xmin += round_fl_to_int(icon_size + icon_padding); } if (!no_text_padding) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [77aac42fbc0] master: Cleanup: Make function static
Commit: 77aac42fbc0d46fcb1e53a69d6123a678d59ef29 Author: Hans Goudey Date: Mon Apr 26 22:19:39 2021 -0500 Branches: master https://developer.blender.org/rB77aac42fbc0d46fcb1e53a69d6123a678d59ef29 Cleanup: Make function static === M source/blender/editors/object/object_intern.h M source/blender/editors/object/object_modifier.c === diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index ededcbfdba8..5bf04e195fe 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -157,10 +157,6 @@ bool edit_modifier_poll_generic(struct bContext *C, const bool is_liboverride_allowed); void edit_modifier_properties(struct wmOperatorType *ot); bool edit_modifier_invoke_properties(struct bContext *C, struct wmOperator *op); -bool edit_modifier_invoke_properties_with_hover(struct bContext *C, -struct wmOperator *op, -const struct wmEvent *event, -int *r_retval); struct ModifierData *edit_modifier_property_get(struct wmOperator *op, struct Object *ob, diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 49c07b28f07..0d896f14888 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1120,10 +1120,10 @@ bool edit_modifier_invoke_properties(bContext *C, wmOperator *op) * with a UI panel below the mouse cursor, unless a specific modifier is set with a context * pointer. Used in order to apply modifier operators on hover over their panels. */ -bool edit_modifier_invoke_properties_with_hover(bContext *C, -wmOperator *op, -const wmEvent *event, -int *r_retval) +static bool edit_modifier_invoke_properties_with_hover(bContext *C, + wmOperator *op, + const wmEvent *event, + int *r_retval) { if (RNA_struct_property_is_set(op->ptr, "modifier")) { return true; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2841d225a9e] master: Merge branch 'blender-v2.93-release'
Commit: 2841d225a9ef41160e705b8612b418373b7d12a1 Author: Hans Goudey Date: Mon Apr 26 22:17:00 2021 -0500 Branches: master https://developer.blender.org/rB2841d225a9ef41160e705b8612b418373b7d12a1 Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fe79935f002] blender-v2.93-release: Fix T87401: Drop-down can apply the wrong modifier
Commit: fe79935f0021755ba133020a3414f6c29b46e9aa Author: Hans Goudey Date: Mon Apr 26 22:16:12 2021 -0500 Branches: blender-v2.93-release https://developer.blender.org/rBfe79935f0021755ba133020a3414f6c29b46e9aa Fix T87401: Drop-down can apply the wrong modifier The trouble was that there was a context pointer "modifier" in the property editor context that returned the active modifier. But the "modifier" variable was already used in many places, for pointers that are *not* equivalent to the active modifier. The context pointer for the active modifier was unecessary anyway. If we need to access a context pointer for the active modifier in the property editor then we can add it. Until then it only adds confusion. === M source/blender/editors/object/object_intern.h M source/blender/editors/object/object_modifier.c M source/blender/editors/space_buttons/buttons_context.c === diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 5b2e0e36ba9..ededcbfdba8 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -157,10 +157,10 @@ bool edit_modifier_poll_generic(struct bContext *C, const bool is_liboverride_allowed); void edit_modifier_properties(struct wmOperatorType *ot); bool edit_modifier_invoke_properties(struct bContext *C, struct wmOperator *op); -bool edit_modifier_invoke_properties_with_hover_no_active(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event, - int *r_retval); +bool edit_modifier_invoke_properties_with_hover(struct bContext *C, +struct wmOperator *op, +const struct wmEvent *event, +int *r_retval); struct ModifierData *edit_modifier_property_get(struct wmOperator *op, struct Object *ob, diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 2c279eb64ee..49c07b28f07 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1116,20 +1116,27 @@ bool edit_modifier_invoke_properties(bContext *C, wmOperator *op) } /** - * If the "modifier" property is not set,fill the modifier property with the name of the modifier - * with a UI panel below the mouse cursor, without checking the context pointer. Used in order to - * apply modifier operators on hover over their panels. If this checked the context pointer then it - * would always use the active modifier, which isn't desired. + * If the "modifier" property is not set, fill the modifier property with the name of the modifier + * with a UI panel below the mouse cursor, unless a specific modifier is set with a context + * pointer. Used in order to apply modifier operators on hover over their panels. */ -bool edit_modifier_invoke_properties_with_hover_no_active(bContext *C, - wmOperator *op, - const wmEvent *event, - int *r_retval) +bool edit_modifier_invoke_properties_with_hover(bContext *C, +wmOperator *op, +const wmEvent *event, +int *r_retval) { if (RNA_struct_property_is_set(op->ptr, "modifier")) { return true; } + /* Note that the context pointer is *not* the active modifier, it is set in UI layouts. */ + PointerRNA ctx_ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + if (ctx_ptr.data != NULL) { +ModifierData *md = ctx_ptr.data; +RNA_string_set(op->ptr, "modifier", md->name); +return true; + } + PointerRNA *panel_ptr = UI_region_panel_custom_data_under_cursor(C, event); if (panel_ptr == NULL || RNA_pointer_is_null(panel_ptr)) { *r_retval = OPERATOR_CANCELLED; @@ -1211,7 +1218,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) static int modifier_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int retval; - if (edit_modifier_invoke_properties_with_hover_no_active(C, op, event, &retval)) { + if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_remove_exec(C, op); } return retval; @@ -1257,7 +1264,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) static int mod
[Bf-blender-cvs] [f5123b1fc9a] master: Merge branch 'blender-v2.93-release'
Commit: f5123b1fc9ad7a04c263d9cbee169473e58e780b Author: Aaron Carlisle Date: Mon Apr 26 20:55:01 2021 -0400 Branches: master https://developer.blender.org/rBf5123b1fc9ad7a04c263d9cbee169473e58e780b Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [51c13be8207] blender-v2.93-release: Update RNA/User Manual Mappings
Commit: 51c13be8207fc5c3eb222711ad1477cbac848c4c Author: Aaron Carlisle Date: Mon Apr 26 20:52:59 2021 -0400 Branches: blender-v2.93-release https://developer.blender.org/rB51c13be8207fc5c3eb222711ad1477cbac848c4c Update RNA/User Manual Mappings === M release/scripts/modules/rna_manual_reference.py === diff --git a/release/scripts/modules/rna_manual_reference.py b/release/scripts/modules/rna_manual_reference.py index 2ed1e22a94f..b6fda8911cc 100644 --- a/release/scripts/modules/rna_manual_reference.py +++ b/release/scripts/modules/rna_manual_reference.py @@ -41,10 +41,12 @@ url_manual_mapping = ( ("bpy.types.fluiddomainsettings.sndparticle_potential_max_wavecrest*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-max-wavecrest"), ("bpy.types.fluiddomainsettings.sndparticle_potential_min_wavecrest*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-min-wavecrest"), ("bpy.types.movietrackingsettings.refine_intrinsics_principal_point*", "movie_clip/tracking/clip/toolbar/solve.html#bpy-types-movietrackingsettings-refine-intrinsics-principal-point"), + ("bpy.types.cyclesrenderlayersettings.denoising_optix_input_passes*", "render/layers/denoising.html#bpy-types-cyclesrenderlayersettings-denoising-optix-input-passes"), ("bpy.types.fluiddomainsettings.sndparticle_potential_max_energy*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-max-energy"), ("bpy.types.fluiddomainsettings.sndparticle_potential_min_energy*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-potential-min-energy"), ("bpy.types.movietrackingsettings.refine_intrinsics_focal_length*", "movie_clip/tracking/clip/toolbar/solve.html#bpy-types-movietrackingsettings-refine-intrinsics-focal-length"), ("bpy.types.rigidbodyconstraint.rigidbodyconstraint.use_breaking*", "physics/rigid_body/constraints/introduction.html#bpy-types-rigidbodyconstraint-rigidbodyconstraint-use-breaking"), + ("bpy.types.cyclesrendersettings.preview_denoising_input_passes*", "render/cycles/render_settings/sampling.html#bpy-types-cyclesrendersettings-preview-denoising-input-passes"), ("bpy.types.fluiddomainsettings.sndparticle_sampling_trappedair*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-sampling-trappedair"), ("bpy.types.fluiddomainsettings.sndparticle_sampling_wavecrest*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-sndparticle-sampling-wavecrest"), ("bpy.types.rigidbodyconstraint.use_override_solver_iterations*", "physics/rigid_body/constraints/introduction.html#bpy-types-rigidbodyconstraint-use-override-solver-iterations"), @@ -107,6 +109,7 @@ url_manual_mapping = ( ("bpy.types.fluiddomainsettings.use_bubble_particles*", "physics/fluid/type/domain/liquid/particles.html#bpy-types-fluiddomainsettings-use-bubble-particles"), ("bpy.types.linestylegeometrymodifier_simplification*", "render/freestyle/parameter_editor/line_style/modifiers/geometry/simplification.html#bpy-types-linestylegeometrymodifier-simplification"), ("bpy.types.materialgpencilstyle.use_overlap_strokes*", "grease_pencil/materials/properties.html#bpy-types-materialgpencilstyle-use-overlap-strokes"), + ("bpy.types.spacespreadsheet.geometry_component_type*", "editors/spreadsheet.html#bpy-types-spacespreadsheet-geometry-component-type"), ("bpy.types.toolsettings.use_gpencil_weight_data_add*", "grease_pencil/modes/draw/introduction.html#bpy-types-toolsettings-use-gpencil-weight-data-add"), ("bpy.types.view3doverlay.texture_paint_mode_opacity*", "editors/3dview/display/overlays.html#bpy-types-view3doverlay-texture-paint-mode-opacity"), ("bpy.types.bakesettings.use_pass_ambient_occlusion*", "render/cycles/baking.html#bpy-types-bakesettings-use-pass-ambient-occlusion"), @@ -139,6 +142,7 @@ url_manual_mapping = ( ("bpy.ops.gpencil.vertex_color_brightness_contrast*", "grease_pencil/modes/vertex_paint/editing.html#bpy-ops-gpencil-vertex-color-brightness-contrast"), ("bpy.ops.view3d.edit_mesh_extrude_individual_move*", "modeling/meshes/editing/face/extrude_faces.html#bpy-ops-view3d-edit-mesh-extrude-individual-move"), ("bpy.ops.view3d.edit_mesh_extrude_manifold_normal*", "modeling/meshes/tools/extrude_manifold.html#bpy-ops-view3d-edit-mesh-extrude-manifold-normal"), + ("bpy.types.cyclesrendersettings.ao_bounces_render*", "render/cycles/render_settings/light_paths.html#bpy-types-cyclesrendersettings-ao-bounces-render"), ("bpy.types.cyclesrendersettings.use_distance_cull*", "render/cycles/render_setting
[Bf-blender-cvs] [82f5e0200c5] temp_bmesh_multires: * Fix bug in last commit where boundary flags weren't properly updated after symmetrize.
Commit: 82f5e0200c55453e33d992f6c84e5e11a4de889c Author: Joseph Eagar Date: Mon Apr 26 17:44:38 2021 -0700 Branches: temp_bmesh_multires https://developer.blender.org/rB82f5e0200c55453e33d992f6c84e5e11a4de889c * Fix bug in last commit where boundary flags weren't properly updated after symmetrize. === M source/blender/blenkernel/BKE_pbvh.h M source/blender/blenkernel/intern/pbvh_bmesh.c M source/blender/editors/sculpt_paint/sculpt.c === diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index d804bd6e7bc..2d9872d5068 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -693,6 +693,10 @@ void BKE_pbvh_bmesh_check_tris(PBVH *pbvh, PBVHNode *node); PBVHTriBuf *BKE_pbvh_bmesh_get_tris(PBVH *pbvh, PBVHNode *node); void BKE_pbvh_bmesh_free_tris(PBVH *pbvh, PBVHNode *node); +/*recalculates boundary flags for *all* vertices. used by + symmetrize.*/ +void BKE_pbvh_recalc_bmesh_boundary(PBVH *pbvh); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index c9204107d02..e8973030c89 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -3211,6 +3211,23 @@ static void pbvh_bmesh_create_nodes_fast_recursive( /* Public API */ +/*Used by symmetrize to update boundary flags*/ +void BKE_pbvh_recalc_bmesh_boundary(PBVH *pbvh) +{ + BMVert *v; + BMIter iter; + + BM_ITER_MESH (v, &iter, pbvh->bm, BM_VERTS_OF_MESH) { +MDynTopoVert *mv = BKE_PBVH_DYNVERT(pbvh->cd_dyn_vert, v); + +if (BM_vert_is_boundary(v)) { + mv->flag |= DYNVERT_BOUNDARY; +} else { + mv->flag &= ~DYNVERT_BOUNDARY; +} + } +} + /* Build a PBVH from a BMesh */ void BKE_pbvh_build_bmesh(PBVH *pbvh, BMesh *bm, diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 4d1d384661d..a407ad677cc 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -8990,6 +8990,8 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *op) BM_mesh_toolflags_set(ss->bm, false); + BKE_pbvh_recalc_bmesh_boundary(ss->pbvh); + /* Finish undo. */ BM_log_all_added(ss->bm, ss->bm_log); SCULPT_undo_push_end(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [676ef58a891] master: Cleanup: Fix unused variable warning in lite build
Commit: 676ef58a891508ce9c21a5a098d2da73b1523a61 Author: Hans Goudey Date: Mon Apr 26 17:03:06 2021 -0500 Branches: master https://developer.blender.org/rB676ef58a891508ce9c21a5a098d2da73b1523a61 Cleanup: Fix unused variable warning in lite build === M source/blender/modifiers/intern/MOD_volume_displace.cc === diff --git a/source/blender/modifiers/intern/MOD_volume_displace.cc b/source/blender/modifiers/intern/MOD_volume_displace.cc index 6a148e824fa..af4b31d6bfc 100644 --- a/source/blender/modifiers/intern/MOD_volume_displace.cc +++ b/source/blender/modifiers/intern/MOD_volume_displace.cc @@ -305,7 +305,7 @@ static void displace_volume(ModifierData *md, const ModifierEvalContext *ctx, Vo } #else - UNUSED_VARS(md, ctx); + UNUSED_VARS(md, volume, ctx); BKE_modifier_set_error(ctx->object, md, "Compiled without OpenVDB"); #endif } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cb3ea6636eb] master: Merge branch 'blender-v2.93-release'
Commit: cb3ea6636eb158ea930a2161fb907f27cb924e8f Author: Hans Goudey Date: Mon Apr 26 17:02:15 2021 -0500 Branches: master https://developer.blender.org/rBcb3ea6636eb158ea930a2161fb907f27cb924e8f Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [14b26fc9765] blender-v2.93-release: Fix T87702: Cannot generate one point with line node in end points mode
Commit: 14b26fc976590c6daa752d4327270540b757b652 Author: Hans Goudey Date: Mon Apr 26 17:01:56 2021 -0500 Branches: blender-v2.93-release https://developer.blender.org/rB14b26fc976590c6daa752d4327270540b757b652 Fix T87702: Cannot generate one point with line node in end points mode Counts of less than one weren't allowed in end points mode mostly to avoid a division by zero when calculating the delta. It's trivial to allow a count of one, so this commit does that, with the point placed at the start location. === M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc index 1634569f9e9..2eeb87695a8 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc @@ -151,7 +151,10 @@ static void geo_node_mesh_primitive_line_exec(GeoNodeExecParams params) } else if (count_mode == GEO_NODE_MESH_LINE_COUNT_TOTAL) { const int count = params.extract_input("Count"); - if (count > 1) { + if (count == 1) { +mesh = create_line_mesh(start, float3(0), count); + } + else { const float3 delta = total_delta / (float)(count - 1); mesh = create_line_mesh(start, delta, count); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1ddc36d42d1] temp-gpencil-bezier-stroke-type: GPencil: Add vertex draw to bezier strokes
Commit: 1ddc36d42d18b32e8ee07ed69df54bff7885e839 Author: Falk David Date: Mon Apr 26 23:40:56 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rB1ddc36d42d18b32e8ee07ed69df54bff7885e839 GPencil: Add vertex draw to bezier strokes === M source/blender/editors/gpencil/gpencil_vertex_paint.c === diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c index 327f5961e1e..4792e8a01f0 100644 --- a/source/blender/editors/gpencil/gpencil_vertex_paint.c +++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c @@ -37,6 +37,7 @@ #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_gpencil.h" +#include "BKE_gpencil_geom.h" #include "BKE_material.h" #include "BKE_report.h" @@ -160,6 +161,27 @@ typedef struct tGP_BrushVertexpaintData { } tGP_BrushVertexpaintData; +/* TODO: This function is duplicated in other places and should not be here. */ +static bool gpencil_3d_point_to_screen_space( +ARegion *region, const rcti *rect, const float diff_mat[4][4], const float co[3], int r_co[2]) +{ + float parent_co[3]; + mul_v3_m4v3(parent_co, diff_mat, co); + int screen_co[2]; + if (ED_view3d_project_int_global( + region, parent_co, screen_co, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == + V3D_PROJ_RET_OK) { +if (!ELEM(V2D_IS_CLIPPED, screen_co[0], screen_co[1]) && +BLI_rcti_isect_pt(rect, screen_co[0], screen_co[1])) { + copy_v2_v2_int(r_co, screen_co); + return true; +} + } + r_co[0] = V2D_IS_CLIPPED; + r_co[1] = V2D_IS_CLIPPED; + return false; +} + /* Ensure the buffer to hold temp selected point size is enough to save all points selected. */ static tGP_Selected *gpencil_select_buffer_ensure(tGP_Selected *buffer_array, int *buffer_size, @@ -435,20 +457,40 @@ static bool brush_tint_apply(tGP_BrushVertexpaintData *gso, /* Apply color to Stroke point. */ if (GPENCIL_TINT_VERTEX_COLOR_STROKE(brush) && (pt_index > -1)) { -bGPDspoint *pt = &gps->points[pt_index]; -if (brush_invert_check(gso)) { - pt->vert_color[3] -= inf; - CLAMP_MIN(pt->vert_color[3], 0.0f); +if (GPENCIL_STROKE_TYPE_BEZIER(gps)) { + bGPDcurve_point *pt = &gps->editcurve->curve_points[pt_index]; + if (brush_invert_check(gso)) { +pt->vert_color[3] -= inf; +CLAMP_MIN(pt->vert_color[3], 0.0f); + } + else { +/* Premult. */ +mul_v3_fl(pt->vert_color, pt->vert_color[3]); +/* "Alpha over" blending. */ +interp_v3_v3v3(pt->vert_color, pt->vert_color, gso->linear_color, inf); +pt->vert_color[3] = pt->vert_color[3] * (1.0 - inf) + inf; +/* Un-premult. */ +if (pt->vert_color[3] > 0.0f) { + mul_v3_fl(pt->vert_color, 1.0f / pt->vert_color[3]); +} + } } else { - /* Premult. */ - mul_v3_fl(pt->vert_color, pt->vert_color[3]); - /* "Alpha over" blending. */ - interp_v3_v3v3(pt->vert_color, pt->vert_color, gso->linear_color, inf); - pt->vert_color[3] = pt->vert_color[3] * (1.0 - inf) + inf; - /* Un-premult. */ - if (pt->vert_color[3] > 0.0f) { -mul_v3_fl(pt->vert_color, 1.0f / pt->vert_color[3]); + bGPDspoint *pt = &gps->points[pt_index]; + if (brush_invert_check(gso)) { +pt->vert_color[3] -= inf; +CLAMP_MIN(pt->vert_color[3], 0.0f); + } + else { +/* Premult. */ +mul_v3_fl(pt->vert_color, pt->vert_color[3]); +/* "Alpha over" blending. */ +interp_v3_v3v3(pt->vert_color, pt->vert_color, gso->linear_color, inf); +pt->vert_color[3] = pt->vert_color[3] * (1.0 - inf) + inf; +/* Un-premult. */ +if (pt->vert_color[3] > 0.0f) { + mul_v3_fl(pt->vert_color, 1.0f / pt->vert_color[3]); +} } } } @@ -820,9 +862,71 @@ static void gpencil_save_selected_point(tGP_BrushVertexpaintData *gso, gso->pbuffer_used++; } +static void gpencil_vertexpaint_select_curve(tGP_BrushVertexpaintData *gso, + bGPDstroke *gps, + const char tool, + const float diff_mat[4][4], + const float bound_mat[4][4]) +{ + ARegion *region = gso->region; + GP_SpaceConversion *gsc = &gso->gsc; + rcti *rect = &gso->brush_rect; + Brush *brush = gso->brush; + const int radius = (brush->flag & GP_BRUSH_USE_PRESSURE) ? gso->brush->size * gso->pressure : + gso->brush->size; + bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps; + bGPDcurve *gpc = gps->editcurve; + + /* Check stro
[Bf-blender-cvs] [7030e3a0168] geometry-nodes-curve-support: Splines: Fix curve to mesh node issues
Commit: 7030e3a016816f360aaa9bbc72fcab5690dcb9bc Author: Hans Goudey Date: Mon Apr 26 15:49:51 2021 -0500 Branches: geometry-nodes-curve-support https://developer.blender.org/rB7030e3a016816f360aaa9bbc72fcab5690dcb9bc Splines: Fix curve to mesh node issues - The expected flat axis of profile objects is now the Z axis, like the existing curve objects. - Simplify/speed up the "sharp edge" marking logic. === M source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc index 3c59837e6c1..975d60b5868 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc @@ -183,7 +183,7 @@ static void spline_extrude_to_mesh_data(const Spline &spline, GVArray_Typed radii = radii_varray->typed(); for (const int i_ring : IndexRange(spline_vert_len)) { float4x4 point_matrix = float4x4::from_normalized_axis_data( -positions[i_ring], tangents[i_ring], normals[i_ring]); +positions[i_ring], normals[i_ring], tangents[i_ring]); point_matrix.apply_scale(radii[i_ring]); @@ -196,14 +196,11 @@ static void spline_extrude_to_mesh_data(const Spline &spline, /* Mark edge loops from sharp vector control points sharp. */ if (profile_spline.type() == Spline::Bezier) { const BezierSpline &bezier_spline = static_cast(profile_spline); -Span mappings = bezier_spline.evaluated_mappings(); -for (const int i_profile : mappings.index_range()) { - const float index = std::floor(mappings[i_profile]); - if ((mappings[i_profile] - index) == 0.0f) { -if (bezier_spline.point_is_sharp(index)) { - mark_edges_sharp( - edges.slice(spline_edges_start + spline_edge_len * i_profile, spline_edge_len)); -} +Span control_point_offsets = bezier_spline.control_point_offsets(); +for (const int i : control_point_offsets.index_range()) { + if (bezier_spline.point_is_sharp(i)) { +mark_edges_sharp(edges.slice( +spline_edges_start + spline_edge_len * control_point_offsets[i], spline_edge_len)); } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [936dfae3de1] geometry-nodes-curve-support: Merge branch 'master' into geometry-nodes-curve-support
Commit: 936dfae3de1f179c751606a1a971facacd32ae04 Author: Hans Goudey Date: Mon Apr 26 15:14:32 2021 -0500 Branches: geometry-nodes-curve-support https://developer.blender.org/rB936dfae3de1f179c751606a1a971facacd32ae04 Merge branch 'master' into geometry-nodes-curve-support === === diff --cc source/blender/blenkernel/BKE_geometry_set.hh index 677d869666b,89cdef34297..cb0d0b25a33 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@@ -389,8 -380,8 +389,10 @@@ struct GeometrySet void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); + void replace_volume(Volume *volume, + GeometryOwnershipType ownership = GeometryOwnershipType::Owned); + void replace_curve(SplineGroup *mesh, + GeometryOwnershipType ownership = GeometryOwnershipType::Owned); }; /** A geometry component that can store a mesh. */ diff --cc source/blender/modifiers/intern/MOD_nodes.cc index f72a21ffe1b,cc8f4a544c0..c71a6cd6813 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@@ -171,22 -182,12 +182,12 @@@ static void add_object_relation(const M { DEG_add_object_relation(ctx->node, &object, DEG_OB_COMP_TRANSFORM, "Nodes Modifier"); if (&(ID &)object != &ctx->object->id) { - if (object.type == OB_EMPTY) { - Collection *collection_instance = object.instance_collection; - if (collection_instance != nullptr) { - add_collection_object_relations_recursive(ctx, *collection_instance); - } + if (object.type == OB_EMPTY && object.instance_collection != nullptr) { + add_collection_relation(ctx, *object.instance_collection); } -else if (ELEM(object.type, OB_MESH, OB_POINTCLOUD, OB_VOLUME)) { +else if (ELEM(object.type, OB_MESH, OB_POINTCLOUD, OB_VOLUME, OB_CURVE)) { DEG_add_object_relation(ctx->node, &object, DEG_OB_COMP_GEOMETRY, "Nodes Modifier"); - /* We don't know exactly what attributes from the other object we will need. */ - CustomData_MeshMasks mask; - mask.vmask = CD_MASK_PROP_ALL | CD_MASK_MDEFORMVERT; - mask.pmask = CD_MASK_PROP_ALL; - mask.lmask = CD_MASK_PROP_ALL; - mask.fmask = CD_MASK_PROP_ALL; - mask.emask = CD_MASK_PROP_ALL; - DEG_add_customdata_mask(ctx->node, &object, &mask); + DEG_add_customdata_mask(ctx->node, &object, &dependency_data_mask); } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7e17dbfcf38] master: Cleanup: Move displist.cc to C++
Commit: 7e17dbfcf385a89ffe9012b86b14a21ea0a737fd Author: Hans Goudey Date: Mon Apr 26 15:11:53 2021 -0500 Branches: master https://developer.blender.org/rB7e17dbfcf385a89ffe9012b86b14a21ea0a737fd Cleanup: Move displist.cc to C++ This is a change split from the geometry nodes curves branch. Since curve object modifier evaluation happens in this file, moving it to C++ will be quite helpful to support the `GeometrySet` type. Other than that, the code in the branch intends to replace a fair amount of this file anyway, so I don't plan to do any further cleanup here. Differential Revision: https://developer.blender.org/D11078 === M source/blender/blenkernel/CMakeLists.txt R087source/blender/blenkernel/intern/displist.c source/blender/blenkernel/intern/displist.cc === diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index adf321da8f0..69df29527dd 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -117,7 +117,7 @@ set(SRC intern/customdata_file.c intern/data_transfer.c intern/deform.c - intern/displist.c + intern/displist.cc intern/displist_tangent.c intern/dynamicpaint.c intern/editlattice.c diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.cc similarity index 87% rename from source/blender/blenkernel/intern/displist.c rename to source/blender/blenkernel/intern/displist.cc index ad8939fa5d1..20534ef933b 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.cc @@ -21,9 +21,9 @@ * \ingroup bke */ -#include -#include -#include +#include +#include +#include #include "MEM_guardedalloc.h" @@ -82,7 +82,7 @@ void BKE_displist_free(ListBase *lb) { DispList *dl; - while ((dl = BLI_pophead(lb))) { + while ((dl = (DispList *)BLI_pophead(lb))) { BKE_displist_elem_free(dl); } } @@ -95,7 +95,7 @@ DispList *BKE_displist_find_or_create(ListBase *lb, int type) } } - DispList *dl = MEM_callocN(sizeof(DispList), "find_disp"); + DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), "find_disp"); dl->type = type; BLI_addtail(lb, dl); @@ -110,7 +110,7 @@ DispList *BKE_displist_find(ListBase *lb, int type) } } - return NULL; + return nullptr; } bool BKE_displist_has_faces(const ListBase *lb) @@ -129,11 +129,11 @@ void BKE_displist_copy(ListBase *lbn, const ListBase *lb) BKE_displist_free(lbn); LISTBASE_FOREACH (const DispList *, dl, lb) { -DispList *dln = MEM_dupallocN(dl); +DispList *dln = (DispList *)MEM_dupallocN(dl); BLI_addtail(lbn, dln); -dln->verts = MEM_dupallocN(dl->verts); -dln->nors = MEM_dupallocN(dl->nors); -dln->index = MEM_dupallocN(dl->index); +dln->verts = (float *)MEM_dupallocN(dl->verts); +dln->nors = (float *)MEM_dupallocN(dl->nors); +dln->index = (int *)MEM_dupallocN(dl->index); } } @@ -146,8 +146,8 @@ void BKE_displist_normals_add(ListBase *lb) LISTBASE_FOREACH (DispList *, dl, lb) { if (dl->type == DL_INDEX3) { - if (dl->nors == NULL) { -dl->nors = MEM_callocN(sizeof(float[3]), "dlnors"); + if (dl->nors == nullptr) { +dl->nors = (float *)MEM_callocN(sizeof(float[3]), "dlnors"); if (dl->flag & DL_BACK_CURVE) { dl->nors[2] = -1.0f; @@ -158,8 +158,8 @@ void BKE_displist_normals_add(ListBase *lb) } } else if (dl->type == DL_SURF) { - if (dl->nors == NULL) { -dl->nors = MEM_callocN(sizeof(float[3]) * dl->nr * dl->parts, "dlnors"); + if (dl->nors == nullptr) { +dl->nors = (float *)MEM_callocN(sizeof(float[3]) * dl->nr * dl->parts, "dlnors"); vdata = dl->verts; ndata = dl->nors; @@ -338,9 +338,9 @@ static void curve_to_displist(const Curve *cu, * and resolution > 1. */ const bool use_cyclic_sample = is_cyclic && (samples_len != 2); - DispList *dl = MEM_callocN(sizeof(DispList), __func__); + DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__); /* Add one to the length because of 'BKE_curve_forward_diff_bezier'. */ - dl->verts = MEM_mallocN(sizeof(float[3]) * (samples_len + 1), "dlverts"); + dl->verts = (float *)MEM_mallocN(sizeof(float[3]) * (samples_len + 1), "dlverts"); BLI_addtail(r_dispbase, dl); dl->parts = 1; dl->nr = samples_len; @@ -393,8 +393,8 @@ static void curve_to_displist(const Curve *cu, } else if (nu->type == CU_NURBS) { const int len = (resolution * SEGMENTSU(nu)); - DispList *dl = MEM_callocN(sizeof(DispList), __func__); - dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts"); + DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__); + dl->verts = (float *)ME
[Bf-blender-cvs] [e032ca2e25b] master: Cleanup: Replace modifyVolume with modifyGeometrySet
Commit: e032ca2e25bf2e305b660da7a6026834e2e5006f Author: Hans Goudey Date: Mon Apr 26 14:42:03 2021 -0500 Branches: master https://developer.blender.org/rBe032ca2e25bf2e305b660da7a6026834e2e5006f Cleanup: Replace modifyVolume with modifyGeometrySet This allows us to remove a callback from the modifier type info struct. In the future the these modifiers might just be replaced by nodes internally anyway, but in the meantime it's nice to unify the handling of evaluated geometry a bit. Differential Revision: https://developer.blender.org/D11080 === M source/blender/blenkernel/BKE_geometry_set.hh M source/blender/blenkernel/BKE_modifier.h M source/blender/blenkernel/intern/geometry_set.cc M source/blender/blenkernel/intern/object.c M source/blender/blenkernel/intern/volume.cc M source/blender/modifiers/intern/MOD_armature.c M source/blender/modifiers/intern/MOD_array.c M source/blender/modifiers/intern/MOD_bevel.c M source/blender/modifiers/intern/MOD_boolean.cc M source/blender/modifiers/intern/MOD_build.c M source/blender/modifiers/intern/MOD_cast.c M source/blender/modifiers/intern/MOD_cloth.c M source/blender/modifiers/intern/MOD_collision.c M source/blender/modifiers/intern/MOD_correctivesmooth.c M source/blender/modifiers/intern/MOD_curve.c M source/blender/modifiers/intern/MOD_datatransfer.c M source/blender/modifiers/intern/MOD_decimate.c M source/blender/modifiers/intern/MOD_displace.c M source/blender/modifiers/intern/MOD_dynamicpaint.c M source/blender/modifiers/intern/MOD_edgesplit.c M source/blender/modifiers/intern/MOD_explode.c M source/blender/modifiers/intern/MOD_fluid.c M source/blender/modifiers/intern/MOD_hook.c M source/blender/modifiers/intern/MOD_laplaciandeform.c M source/blender/modifiers/intern/MOD_laplaciansmooth.c M source/blender/modifiers/intern/MOD_lattice.c M source/blender/modifiers/intern/MOD_mask.cc M source/blender/modifiers/intern/MOD_mesh_to_volume.cc M source/blender/modifiers/intern/MOD_meshcache.c M source/blender/modifiers/intern/MOD_meshdeform.c M source/blender/modifiers/intern/MOD_meshsequencecache.c M source/blender/modifiers/intern/MOD_mirror.c M source/blender/modifiers/intern/MOD_multires.c M source/blender/modifiers/intern/MOD_nodes.cc M source/blender/modifiers/intern/MOD_none.c M source/blender/modifiers/intern/MOD_normal_edit.c M source/blender/modifiers/intern/MOD_ocean.c M source/blender/modifiers/intern/MOD_particleinstance.c M source/blender/modifiers/intern/MOD_particlesystem.c M source/blender/modifiers/intern/MOD_remesh.c M source/blender/modifiers/intern/MOD_screw.c M source/blender/modifiers/intern/MOD_shapekey.c M source/blender/modifiers/intern/MOD_shrinkwrap.c M source/blender/modifiers/intern/MOD_simpledeform.c M source/blender/modifiers/intern/MOD_skin.c M source/blender/modifiers/intern/MOD_smooth.c M source/blender/modifiers/intern/MOD_softbody.c M source/blender/modifiers/intern/MOD_solidify.c M source/blender/modifiers/intern/MOD_subsurf.c M source/blender/modifiers/intern/MOD_surface.c M source/blender/modifiers/intern/MOD_surfacedeform.c M source/blender/modifiers/intern/MOD_triangulate.c M source/blender/modifiers/intern/MOD_uvproject.c M source/blender/modifiers/intern/MOD_uvwarp.c M source/blender/modifiers/intern/MOD_volume_displace.cc M source/blender/modifiers/intern/MOD_volume_to_mesh.cc M source/blender/modifiers/intern/MOD_warp.c M source/blender/modifiers/intern/MOD_wave.c M source/blender/modifiers/intern/MOD_weighted_normal.c M source/blender/modifiers/intern/MOD_weightvgedit.c M source/blender/modifiers/intern/MOD_weightvgmix.c M source/blender/modifiers/intern/MOD_weightvgproximity.c M source/blender/modifiers/intern/MOD_weld.c M source/blender/modifiers/intern/MOD_wireframe.c === diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 58935aca0a8..89cdef34297 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -380,6 +380,8 @@ struct GeometrySet { void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); + void replace_volume(Volume *volume, + GeometryOwnershipType ownership = GeometryOwnershipType::Owned); }; /** A geometry component that can store a mesh. */ diff --git a/source/blender/
[Bf-blender-cvs] [39ce17f3dfa] asset-browser-poselib: UI: Improve walk navigation in UI List template
Commit: 39ce17f3dfa076bb7cd007360e4e4206c0255a2b Author: Nathan Craddock Date: Fri Apr 23 21:55:36 2021 -0600 Branches: asset-browser-poselib https://developer.blender.org/rB39ce17f3dfa076bb7cd007360e4e4206c0255a2b UI: Improve walk navigation in UI List template Add improved arrow key walk navigation in grid layout UI List templates. Pressing up or down walks the active item to the adjacent row in that direction, while left and right walk through the items along the columns wrapping at the rows. Differential Revision: https://developer.blender.org/D11063 === M source/blender/editors/interface/interface_handlers.c M source/blender/editors/interface/interface_templates.c M source/blender/makesdna/DNA_screen_types.h === diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index d7f1b88c2b5..92503a32d92 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9230,6 +9230,27 @@ static void ui_list_activate_row_from_index( ui_list->flag |= UILST_SCROLL_TO_ACTIVE_ITEM; } +static int ui_list_get_increment(const uiList *ui_list, const int type, const int columns) +{ + int increment = 0; + + /* Handle column offsets for grid layouts. */ + if (ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY) && + ELEM(ui_list->layout_type, UILST_LAYOUT_GRID, UILST_LAYOUT_BIG_PREVIEW_GRID)) { +increment = (type == EVT_UPARROWKEY) ? -columns : columns; + } + else { +/* Left or right in grid layouts or any direction in single column layouts increments by 1. */ +increment = ELEM(type, EVT_UPARROWKEY, EVT_LEFTARROWKEY, WHEELUPMOUSE) ? -1 : 1; + } + + if ((ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) != 0) { +increment *= -1; + } + + return increment; +} + static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *region, uiBut *listbox) { int retval = WM_UI_HANDLER_CONTINUE; @@ -9267,21 +9288,15 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi retval = ui_list_handle_click_drag(C, ui_list, region, event); } else if (val == KM_PRESS) { -if ((ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY) && +if ((ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY, EVT_LEFTARROWKEY, EVT_RIGHTARROWKEY) && !IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) || ((ELEM(type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->ctrl && !IS_EVENT_MOD(event, shift, alt, oskey { const int value_orig = RNA_property_int_get(&listbox->rnapoin, listbox->rnaprop); - int value, min, max, inc; + int value, min, max; - /* activate up/down the list */ value = value_orig; - if ((ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) != 0) { -inc = ELEM(type, EVT_UPARROWKEY, WHEELUPMOUSE) ? 1 : -1; - } - else { -inc = ELEM(type, EVT_UPARROWKEY, WHEELUPMOUSE) ? -1 : 1; - } + const int inc = ui_list_get_increment(ui_list, type, dyn_data->columns); if (dyn_data->items_filter_neworder || dyn_data->items_filter_flags) { /* If we have a display order different from diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 67bc478d1ee..27db5c0b3ab 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -6129,6 +6129,8 @@ static void uilist_prepare(uiList *ui_list, activei_row = items->active_item_idx; } + dyn_data->columns = columns; + if (!use_auto_size) { /* No auto-size, yet we clamp at min size! */ actual_rows = max_ii(ui_list->list_grip, actual_rows); diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 7d01cfd39c8..e1084030865 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -263,6 +263,9 @@ typedef struct uiListDyn { /** Minimal visual height of the list (in rows). */ int visual_height_min; + /** Number of columns drawn for grid layouts. */ + int columns; + /** Number of items in collection. */ int items_len; /** Number of items actually visible after filtering. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [399aed9a81d] geometry-nodes-curve-support: Splines: Fix interpolation for bezier splines
Commit: 399aed9a81d17960a0a0cbec7f145bf0bcb1868b Author: Hans Goudey Date: Mon Apr 26 14:17:25 2021 -0500 Branches: geometry-nodes-curve-support https://developer.blender.org/rB399aed9a81d17960a0a0cbec7f145bf0bcb1868b Splines: Fix interpolation for bezier splines Also parallelize some of the calculations, since I was reworking how the mapping was calculated anyway. I still haven't tuned the grain size. === M source/blender/blenkernel/BKE_spline.hh M source/blender/blenkernel/intern/spline_bezier.cc M source/blender/blenkernel/intern/spline_nurbs.cc === diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh index 4e4b6eed156..c06273db828 100644 --- a/source/blender/blenkernel/BKE_spline.hh +++ b/source/blender/blenkernel/BKE_spline.hh @@ -90,18 +90,6 @@ class Spline { Spline(Spline &other) : type_(other.type_), is_cyclic(other.is_cyclic), normal_mode(other.normal_mode) { -if (!other.tangent_cache_dirty_) { - evaluated_tangents_cache_ = other.evaluated_tangents_cache_; - tangent_cache_dirty_ = false; -} -if (!other.normal_cache_dirty_) { - evaluated_normals_cache_ = other.evaluated_normals_cache_; - normal_cache_dirty_ = false; -} -if (!other.length_cache_dirty_) { - evaluated_lengths_cache_ = other.evaluated_lengths_cache_; - length_cache_dirty_ = false; -} } virtual SplinePtr copy() const = 0; @@ -188,12 +176,19 @@ class BezierSpline final : public Spline { blender::Vector handle_positions_end_; blender::Vector radii_; blender::Vector tilts_; - int resolution_u_; + int resolution_; - mutable bool base_cache_dirty_ = true; - mutable std::mutex base_cache_mutex_; - mutable blender::Vector evaluated_positions_cache_; - mutable blender::Vector evaluated_mappings_cache_; + mutable bool offset_cache_dirty_ = true; + mutable std::mutex offset_cache_mutex_; + mutable blender::Vector offset_cache_; + + mutable bool position_cache_dirty_ = true; + mutable std::mutex position_cache_mutex_; + mutable blender::Vector evaluated_position_cache_; + + mutable bool mapping_cache_dirty_ = true; + mutable std::mutex mapping_cache_mutex_; + mutable blender::Vector evaluated_mapping_cache_; public: virtual SplinePtr copy() const final; @@ -207,13 +202,8 @@ class BezierSpline final : public Spline { handle_positions_end_(other.handle_positions_end_), radii_(other.radii_), tilts_(other.tilts_), -resolution_u_(other.resolution_u_) +resolution_(other.resolution_) { -if (!other.base_cache_dirty_) { - evaluated_positions_cache_ = other.evaluated_positions_cache_; - evaluated_mappings_cache_ = other.evaluated_mappings_cache_; - base_cache_dirty_ = false; -} } int size() const final; @@ -256,6 +246,7 @@ class BezierSpline final : public Spline { void mark_cache_invalid() final; int evaluated_points_size() const final; + blender::Span control_point_offsets() const; blender::Span evaluated_mappings() const; blender::Span evaluated_positions() const final; struct InterpolationData { @@ -268,18 +259,13 @@ class BezierSpline final : public Spline { virtual blender::fn::GVArrayPtr interpolate_to_evaluated_points( const blender::fn::GVArray &source_data) const; - protected: - void correct_final_tangents() const; - private: void correct_end_tangents() const final; bool segment_is_vector(const int start_index) const; void evaluate_bezier_segment(const int index, const int next_index, - int &offset, - blender::MutableSpan positions, - blender::MutableSpan mappings) const; - void evaluate_bezier_position_and_mapping() const; + blender::MutableSpan positions) const; + blender::Array evaluated_point_offsets() const; }; /** @@ -307,7 +293,7 @@ class NURBSpline final : public Spline { blender::Vector radii_; blender::Vector tilts_; blender::Vector weights_; - int resolution_u_; + int resolution_; uint8_t order_; mutable bool knots_dirty_ = true; @@ -316,7 +302,7 @@ class NURBSpline final : public Spline { mutable bool position_cache_dirty_ = true; mutable std::mutex position_cache_mutex_; - mutable blender::Vector evaluated_positions_cache_; + mutable blender::Vector evaluated_position_cache_; mutable bool basis_cache_dirty_ = true; mutable std::mutex basis_cache_mutex_; @@ -331,7 +317,7 @@ class NURBSpline final : public Spline { radii_(other.radii_), tilts_(other.tilts_), weights_(other.weights_), -resolution_u_(other.resolution_u_), +resolution_(other.resolution_), order_(other.order_)
[Bf-blender-cvs] [948d1b02841] asset-browser-snap-dragging: Merge remote-tracking branch 'origin/master' into asset-browser-snap-dragging
Commit: 948d1b028412fb8d11c2b6f5fde780c30a4166cd Author: Julian Eisel Date: Mon Apr 26 21:02:09 2021 +0200 Branches: asset-browser-snap-dragging https://developer.blender.org/rB948d1b028412fb8d11c2b6f5fde780c30a4166cd Merge remote-tracking branch 'origin/master' into asset-browser-snap-dragging === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8a8208bd953] asset-browser-snap-dragging: Merge remote-tracking branch 'origin/master' into asset-browser-snap-dragging
Commit: 8a8208bd9537ea5b9985b478be8877297dd13f6e Author: Julian Eisel Date: Mon Apr 26 14:38:41 2021 +0200 Branches: asset-browser-snap-dragging https://developer.blender.org/rB8a8208bd9537ea5b9985b478be8877297dd13f6e Merge remote-tracking branch 'origin/master' into asset-browser-snap-dragging === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a7bda035163] master: Fix T87842: Outliner in `Blender File` mode has large performance impact
Commit: a7bda035163ec07901d590389a04d1730b291f13 Author: Julian Eisel Date: Mon Apr 26 19:30:31 2021 +0200 Branches: master https://developer.blender.org/rBa7bda035163ec07901d590389a04d1730b291f13 Fix T87842: Outliner in `Blender File` mode has large performance impact The Outliner was doing a full rebuild of its tree in response to transform notifiers. I don't see any reason for this, a simple redraw without rebuilding should be just fine. The same optimization could be done for other object notifiers, but I'll check on them separately. === M source/blender/editors/space_outliner/space_outliner.c === diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 5d774049e3e..728be1ccaaf 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -155,6 +155,8 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) case NC_OBJECT: switch (wmn->data) { case ND_TRANSFORM: + ED_region_tag_redraw_no_rebuild(region); + break; case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_DRAW: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [607cd463b3c] master: Merge branch 'blender-v2.93-release'
Commit: 607cd463b3c9ddbd9f8a5fdb7a0bb47dd2937bef Author: Jacques Lucke Date: Mon Apr 26 19:21:24 2021 +0200 Branches: master https://developer.blender.org/rB607cd463b3c9ddbd9f8a5fdb7a0bb47dd2937bef Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [49b3d00c10b] blender-v2.93-release: Fix: crash after recent commit
Commit: 49b3d00c10b8df7fad21ca664b1eebe171c2c361 Author: Jacques Lucke Date: Mon Apr 26 19:19:44 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rB49b3d00c10b8df7fad21ca664b1eebe171c2c361 Fix: crash after recent commit This was a mistake in rBb67fe05d4bea2d3c9efbd127e9d9dc3a897e89e6. === M source/blender/depsgraph/intern/builder/deg_builder_relations.cc === diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index b8cab43f676..0f8b613f7ac 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -654,7 +654,7 @@ void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_coll /* An instance is part of the geometry of the collection. */ if (cob->ob->type == OB_EMPTY) { -Collection *collection_instance = object->instance_collection; +Collection *collection_instance = cob->ob->instance_collection; if (collection_instance != nullptr) { OperationKey collection_instance_key{ &collection_instance->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DONE}; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [eb0d6808516] master: Merge branch 'blender-v2.93-release'
Commit: eb0d6808516497655a159645b7e1796f734909db Author: Philipp Oeser Date: Mon Apr 26 18:05:10 2021 +0200 Branches: master https://developer.blender.org/rBeb0d6808516497655a159645b7e1796f734909db Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [38bfa8902b2] blender-v2.93-release: Fix T87771: Immediate Crash on "Edit Source" in Compositor
Commit: 38bfa8902b241d67deb93eda85a0f0a143d73a6e Author: Philipp Oeser Date: Mon Apr 26 12:02:25 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rB38bfa8902b241d67deb93eda85a0f0a143d73a6e Fix T87771: Immediate Crash on "Edit Source" in Compositor Caused by {rB278011e44d43}. Framebuffer management since above commit now seems to require region bind/unbind in for the operator to be able to redraw correctly without using the same framebuffer in multiple contexts. Maniphest Tasks: T87771 Differential Revision: https://developer.blender.org/D11084 === M source/blender/editors/interface/interface_ops.c === diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 62be13c11c9..1fb7a931c08 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1380,7 +1380,9 @@ static int editsource_exec(bContext *C, wmOperator *op) /* redraw and get active button python info */ ED_region_do_layout(C, region); +WM_draw_region_viewport_bind(region); ED_region_do_draw(C, region); +WM_draw_region_viewport_unbind(region); region->do_draw = false; for (BLI_ghashIterator_init(&ghi, ui_editsource_info->hash); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c266632ff68] master: LineArt: UI fixes to match the content for 2.93 manual.
Commit: c266632ff68666588dfc8d5537f789df2a16e248 Author: YimingWu Date: Mon Apr 26 23:30:54 2021 +0800 Branches: master https://developer.blender.org/rBc266632ff68666588dfc8d5537f789df2a16e248 LineArt: UI fixes to match the content for 2.93 manual. Reviewed by: Sebastian Parborg Differential Revision: https://developer.blender.org/D11089 === M release/scripts/startup/bl_ui/properties_material.py M release/scripts/startup/bl_ui/properties_object.py M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c === diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index aca7ba3c5ad..217ec248764 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -286,19 +286,17 @@ class MATERIAL_PT_lineart(MaterialButtonsPanel, Panel): def draw(self, context): layout = self.layout +layout.use_property_split = True mat = context.material lineart = mat.lineart layout.prop(lineart, "use_transparency") -if lineart.use_transparency: - -layout.label(text="Transparency Masks:") - -row = layout.row(align=True) -for i in range(8): -row.prop(lineart, "use_transparency_mask", text=str(i), index=i, toggle=True) +row = layout.row(align=True, heading="Masks") +row.active = lineart.use_transparency +for i in range(8): +row.prop(lineart, "use_transparency_mask", text=str(i), index=i, toggle=True) classes = ( diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 033e6196323..4ea1ec26738 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -329,7 +329,9 @@ class OBJECT_PT_lineart(ObjectButtonsPanel, Panel): row = layout.row(heading="Override Crease") row.prop(lineart, "use_crease_override", text="") -row.prop(lineart, "crease_threshold", slider=True, text="") +subrow = row.row() +subrow.active = lineart.use_crease_override +subrow.prop(lineart, "crease_threshold", slider=True, text="") class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel): diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c index 080a3caa32f..a2f35c8e575 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c @@ -335,7 +335,7 @@ static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel) if (use_multiple_levels) { uiLayout *col = uiLayoutColumn(layout, true); uiItemR(col, ptr, "level_start", 0, NULL, ICON_NONE); -uiItemR(col, ptr, "level_end", 0, NULL, ICON_NONE); +uiItemR(col, ptr, "level_end", 0, IFACE_("End"), ICON_NONE); } else { uiItemR(layout, ptr, "level_start", 0, IFACE_("Level"), ICON_NONE); @@ -367,7 +367,7 @@ static void transparency_panel_draw(const bContext *UNUSED(C), Panel *panel) uiLayout *row = uiLayoutRow(layout, true); uiLayoutSetPropDecorate(row, false); - uiLayout *sub = uiLayoutRow(row, true); + uiLayout *sub = uiLayoutRowWithHeading(row, true, IFACE_("Masks")); char text[2] = "0"; PropertyRNA *prop = RNA_struct_find_property(ptr, "use_transparency_mask"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [768e2f12dca] temp-gpencil-bezier-stroke-type: GPencil: Makes points visible but smaller
Commit: 768e2f12dcad9e216c09a3db7c54b420be106fff Author: Antonio Vazquez Date: Mon Apr 26 17:19:30 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rB768e2f12dcad9e216c09a3db7c54b420be106fff GPencil: Makes points visible but smaller === M source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl === diff --git a/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl index 0591269037e..ee7375714aa 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl @@ -81,7 +81,7 @@ void main() finalColor.rgb = clamp(colorUnselect.rgb + vec3(0.3), 0.0, 1.0); } if (is_point_hidden) { -discard_vert(); +gl_PointSize = sizeVertexGpencil * 0.8; } if (doStrokeEndpoints && !doWeightColor) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c032bd1acc8] temp-gpencil-bezier-stroke-type: GPencil: Discard verts instead of hide
Commit: c032bd1acc899c3823732f6d0d7d3acd996512f2 Author: Antonio Vazquez Date: Mon Apr 26 17:10:22 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rBc032bd1acc899c3823732f6d0d7d3acd996512f2 GPencil: Discard verts instead of hide === M source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl === diff --git a/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl index 1c6c220410a..0591269037e 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl @@ -81,7 +81,7 @@ void main() finalColor.rgb = clamp(colorUnselect.rgb + vec3(0.3), 0.0, 1.0); } if (is_point_hidden) { -finalColor.a = 0.0; +discard_vert(); } if (doStrokeEndpoints && !doWeightColor) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fb587e68be3] temp-gpencil-bezier-stroke-type: GPencil: Experimental hide edit points
Commit: fb587e68be3be67a0acdeaeb602c265c6bdb5aeb Author: Antonio Vazquez Date: Mon Apr 26 16:42:39 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rBfb587e68be3be67a0acdeaeb602c265c6bdb5aeb GPencil: Experimental hide edit points WIP (not compilable) === M source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl M source/blender/draw/intern/draw_cache_impl_gpencil.c === diff --git a/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl index a6161d36a07..1c6c220410a 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_gpencil_vert.glsl @@ -21,12 +21,13 @@ void discard_vert() gl_Position = vec4(0.0, 0.0, -3e36, 0.0); } -#define GP_EDIT_POINT_SELECTED 1u /* 1 << 0 */ +#define GP_EDIT_POINT_SELECTED 1u /* 1 << 0 */ #define GP_EDIT_STROKE_SELECTED 2u /* 1 << 1 */ -#define GP_EDIT_MULTIFRAME 4u /* 1 << 2 */ -#define GP_EDIT_STROKE_START 8u/* 1 << 3 */ -#define GP_EDIT_STROKE_END 16u /* 1 << 4 */ -#define GP_EDIT_POINT_DIMMED 32u /* 1 << 5 */ +#define GP_EDIT_MULTIFRAME 4u /* 1 << 2 */ +#define GP_EDIT_STROKE_START 8u /* 1 << 3 */ +#define GP_EDIT_STROKE_END 16u /* 1 << 4 */ +#define GP_EDIT_POINT_DIMMED 32u /* 1 << 5 */ +#define GP_EDIT_POINT_HIDDEN 64u /* 1 << 6 */ #ifdef USE_POINTS # define colorUnselect colorGpencilVertex @@ -62,6 +63,7 @@ void main() bool is_stroke_sel = (vflag & GP_EDIT_STROKE_SELECTED) != 0u; bool is_point_sel = (vflag & GP_EDIT_POINT_SELECTED) != 0u; bool is_point_dimmed = (vflag & GP_EDIT_POINT_DIMMED) != 0u; + bool is_point_hidden = (vflag & GP_EDIT_POINT_HIDDEN) != 0u; if (doWeightColor) { finalColor.rgb = weight_to_rgb(weight); @@ -78,6 +80,9 @@ void main() if (is_point_dimmed) { finalColor.rgb = clamp(colorUnselect.rgb + vec3(0.3), 0.0, 1.0); } + if (is_point_hidden) { +finalColor.a = 0.0; + } if (doStrokeEndpoints && !doWeightColor) { bool is_stroke_start = (vflag & GP_EDIT_STROKE_START) != 0u; diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index e18aaa4deb1..36573c64ffb 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -685,6 +685,7 @@ void DRW_cache_gpencil_sbuffer_clear(Object *ob) #define GP_EDIT_STROKE_START (1 << 3) #define GP_EDIT_STROKE_END (1 << 4) #define GP_EDIT_POINT_DIMMED (1 << 5) +#define GP_EDIT_POINT_HIDDEN (1 << 6) typedef struct gpEditIterData { gpEditVert *verts; @@ -706,6 +707,9 @@ static uint32_t gpencil_point_edit_flag( if (!is_bezier) { SET_FLAG_FROM_TEST(sflag, pt->runtime.pt_orig == NULL, GP_EDIT_POINT_DIMMED); } + else { +SET_FLAG_FROM_TEST(sflag, ((pt->flag & GP_SPOINT_IS_BEZT_CONTROL) == 0), GP_EDIT_POINT_HIDDEN); + } return sflag; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [22fd81dad9e] temp-gpencil-bezier-stroke-type: Merge branch 'temp-gpencil-bezier-stroke-type' of git.blender.org:blender into temp-gpencil-bezier-stroke-type
Commit: 22fd81dad9e6ce7f16a270685bf0b3d2dba791b7 Author: Antonio Vazquez Date: Mon Apr 26 16:57:34 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rB22fd81dad9e6ce7f16a270685bf0b3d2dba791b7 Merge branch 'temp-gpencil-bezier-stroke-type' of git.blender.org:blender into temp-gpencil-bezier-stroke-type === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [85b78a14d29] temp-gpencil-bezier-stroke-type: GPencil: Add IS_BEZT_CONTROL flag for poly points
Commit: 85b78a14d29b14fccd1608186f9f148c44f21db3 Author: Falk David Date: Mon Apr 26 16:57:18 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rB85b78a14d29b14fccd1608186f9f148c44f21db3 GPencil: Add IS_BEZT_CONTROL flag for poly points This flags indicates that the poly point is "linked" to a bezier control point. === M source/blender/blenkernel/intern/gpencil_curve.c M source/blender/makesdna/DNA_gpencil_types.h === diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index 82aad79c874..75914136c07 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -1626,6 +1626,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps, gps->totpoints = points_len; gps->points = MEM_recallocN(gps->points, sizeof(bGPDspoint) * gps->totpoints); + bGPDcurve_point *gpc_pt = &curve_point_array[0]; /* write new data to stroke point array */ for (int i = 0; i < points_len; i++) { bGPDspoint *pt = &gps->points[i]; @@ -1644,6 +1645,11 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps, /* deselect points */ pt->flag &= ~GP_SPOINT_SELECT; + +if (gpc_pt->point_index == i) { + pt->flag |= GP_SPOINT_IS_BEZT_CONTROL; + gpc_pt++; +} } gps->flag &= ~GP_STROKE_SELECT; BKE_gpencil_stroke_select_index_reset(gps); diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index d650bed67c6..b6308283def 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -112,6 +112,8 @@ typedef enum eGPDspoint_Flag { GP_SPOINT_TAG = (1 << 1), /* stroke point is temp tagged (for some editing operation) */ GP_SPOINT_TEMP_TAG = (1 << 2), + /* Stroke point is "linked" to control point of bezier handle. */ + GP_SPOINT_IS_BEZT_CONTROL = (1 << 3), } eGPSPoint_Flag; /* * */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9027265f6ac] asset-browser-poselib: Fix uninitialized variable use
Commit: 9027265f6ac1b2dd3b17394bcfa6350e04a73b05 Author: Julian Eisel Date: Mon Apr 26 16:45:50 2021 +0200 Branches: asset-browser-poselib https://developer.blender.org/rB9027265f6ac1b2dd3b17394bcfa6350e04a73b05 Fix uninitialized variable use Mistake in dc009dd6c1c1. === M source/blender/editors/armature/pose_lib_2.c === diff --git a/source/blender/editors/armature/pose_lib_2.c b/source/blender/editors/armature/pose_lib_2.c index f11b0348d4b..b636a65c790 100644 --- a/source/blender/editors/armature/pose_lib_2.c +++ b/source/blender/editors/armature/pose_lib_2.c @@ -680,15 +680,15 @@ void POSELIB_OT_blend_pose_asset(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* Properties: */ - RNA_def_float_factor(ot->srna, - "blend_factor", - 0.0f, - 0.0f, - 1.0f, - "Blend Factor", - "Amount that the pose is applied on top of the existing poses", - 0.0f, - 1.0f); + prop = RNA_def_float_factor(ot->srna, + "blend_factor", + 0.0f, + 0.0f, + 1.0f, + "Blend Factor", + "Amount that the pose is applied on top of the existing poses", + 0.0f, + 1.0f); /* Blending should always start at 0%, and not at whatever percentage was last used. This RNA * property just exists for symmetry with the Apply operator (and thus simplicity of the rest of * the code, which can assume this property exists). */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d89d53b453d] master: Merge branch 'blender-v2.93-release'
Commit: d89d53b453d58155dbb907cb68f37dcb73fc749f Author: Jacques Lucke Date: Mon Apr 26 16:44:06 2021 +0200 Branches: master https://developer.blender.org/rBd89d53b453d58155dbb907cb68f37dcb73fc749f Merge branch 'blender-v2.93-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b67fe05d4be] blender-v2.93-release: Depsgraph: support depending on collection geometry
Commit: b67fe05d4bea2d3c9efbd127e9d9dc3a897e89e6 Author: Jacques Lucke Date: Mon Apr 26 16:35:22 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rBb67fe05d4bea2d3c9efbd127e9d9dc3a897e89e6 Depsgraph: support depending on collection geometry This fixes T87666 and T83252. The boolean modifier and geometry nodes can depend on the geometry of an entire collection. Before, the modifiers had to manually create relations to all the objects in the collection. This worked for the most part, but was cumbersome and did not solve all issues. For example, the modifiers were not properly updated when objects were added/removed from the referenced collection. This commit introduces the concept of "collection geometry" in the depsgraph. The geometry of a collection depends on the transforms and geometry of all the objects in it. The boolean modifier and geometry nodes can now just depend on the collection geometry instead of creating all the dependencies themselves. Differential Revision: https://developer.blender.org/D11053 === M source/blender/blenkernel/intern/collection.c M source/blender/depsgraph/DEG_depsgraph_build.h M source/blender/depsgraph/intern/builder/deg_builder_nodes.cc M source/blender/depsgraph/intern/builder/deg_builder_relations.cc M source/blender/depsgraph/intern/depsgraph_build.cc M source/blender/depsgraph/intern/depsgraph_tag.cc M source/blender/makesdna/DNA_ID.h M source/blender/modifiers/intern/MOD_boolean.cc M source/blender/modifiers/intern/MOD_nodes.cc === diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index b29dd007c51..3170c3aa65c 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -1150,6 +1150,8 @@ bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob) BKE_main_collection_sync(bmain); } + DEG_id_tag_update(&collection->id, ID_RECALC_GEOMETRY); + return true; } @@ -1201,6 +1203,8 @@ bool BKE_collection_object_remove(Main *bmain, BKE_main_collection_sync(bmain); } + DEG_id_tag_update(&collection->id, ID_RECALC_GEOMETRY); + return true; } diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h index 4e618d8625d..5f9e78837a7 100644 --- a/source/blender/depsgraph/DEG_depsgraph_build.h +++ b/source/blender/depsgraph/DEG_depsgraph_build.h @@ -40,6 +40,7 @@ struct Object; struct Scene; struct Simulation; struct bNodeTree; +struct Collection; #include "BLI_sys_types.h" @@ -137,6 +138,12 @@ void DEG_add_object_relation(struct DepsNodeHandle *node_handle, struct Object *object, eDepsObjectComponentType component, const char *description); +void DEG_add_collection_geometry_relation(struct DepsNodeHandle *node_handle, + struct Collection *collection, + const char *description); +void DEG_add_collection_geometry_customdata_mask(struct DepsNodeHandle *node_handle, + struct Collection *collection, + const struct CustomData_MeshMasks *masks); void DEG_add_simulation_relation(struct DepsNodeHandle *node_handle, struct Simulation *simulation, const char *description); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index d8dc66883a0..ec5037fb29c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -554,6 +554,7 @@ void DepsgraphNodeBuilder::build_collection(LayerCollection *from_layer_collecti id_node->is_directly_visible = is_collection_visible; build_idproperties(collection->id.properties); +add_operation_node(&collection->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DONE); } if (from_layer_collection != nullptr) { /* If we came from layer collection we don't go deeper, view layer diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 3cc2ec02165..b8cab43f676 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -635,11 +635,38 @@ void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_coll ComponentKey duplicator_key(object != nullptr ? &object->id : nullptr, NodeType::DUPLI); if (!gro
[Bf-blender-cvs] [2ffabbd5296] asset-browser-poselib: Merge remote-tracking branch 'origin/master' into asset-browser-poselib
Commit: 2ffabbd5296556d56a6401207d309a7a61ba1d7e Author: Julian Eisel Date: Mon Apr 26 16:14:27 2021 +0200 Branches: asset-browser-poselib https://developer.blender.org/rB2ffabbd5296556d56a6401207d309a7a61ba1d7e Merge remote-tracking branch 'origin/master' into asset-browser-poselib === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ceec9a6ddd1] temp-gpencil-bezier-stroke-type: GPencil: Fix drawing for Bezier weight paint
Commit: ceec9a6ddd1496e83ccb0919760df11dd91c2bda Author: Antonio Vazquez Date: Mon Apr 26 16:14:03 2021 +0200 Branches: temp-gpencil-bezier-stroke-type https://developer.blender.org/rBceec9a6ddd1496e83ccb0919760df11dd91c2bda GPencil: Fix drawing for Bezier weight paint === M source/blender/draw/intern/draw_cache_impl_gpencil.c === diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index 49b5e0fecd3..e18aaa4deb1 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -696,16 +696,16 @@ typedef struct gpEditCurveIterData { int vgindex; } gpEditCurveIterData; -static uint32_t gpencil_point_edit_flag(const bool layer_lock, -const bGPDspoint *pt, -int v, -int v_len) +static uint32_t gpencil_point_edit_flag( +const bool layer_lock, const bool is_bezier, const bGPDspoint *pt, int v, int v_len) { uint32_t sflag = 0; SET_FLAG_FROM_TEST(sflag, (!layer_lock) && pt->flag & GP_SPOINT_SELECT, GP_EDIT_POINT_SELECTED); SET_FLAG_FROM_TEST(sflag, v == 0, GP_EDIT_STROKE_START); SET_FLAG_FROM_TEST(sflag, v == (v_len - 1), GP_EDIT_STROKE_END); - SET_FLAG_FROM_TEST(sflag, pt->runtime.pt_orig == NULL, GP_EDIT_POINT_DIMMED); + if (!is_bezier) { +SET_FLAG_FROM_TEST(sflag, pt->runtime.pt_orig == NULL, GP_EDIT_POINT_DIMMED); + } return sflag; } @@ -724,6 +724,7 @@ static void gpencil_edit_stroke_iter_cb(bGPDlayer *gpl, const int v = gps->runtime.stroke_start + 1; MDeformVert *dvert = ((iter->vgindex > -1) && gps->dvert) ? gps->dvert : NULL; gpEditVert *vert_ptr = iter->verts + v; + const bool is_bezier = GPENCIL_STROKE_TYPE_BEZIER(gps); const bool layer_lock = (gpl->flag & GP_LAYER_LOCKED); uint32_t sflag = 0; @@ -732,12 +733,14 @@ static void gpencil_edit_stroke_iter_cb(bGPDlayer *gpl, SET_FLAG_FROM_TEST(sflag, gpf->runtime.onion_id != 0.0f, GP_EDIT_MULTIFRAME); for (int i = 0; i < v_len; i++) { -vert_ptr->vflag = sflag | gpencil_point_edit_flag(layer_lock, &gps->points[i], i, v_len); +vert_ptr->vflag = sflag | + gpencil_point_edit_flag(layer_lock, is_bezier, &gps->points[i], i, v_len); vert_ptr->weight = gpencil_point_edit_weight(dvert, i, iter->vgindex); vert_ptr++; } /* Draw line to first point to complete the loop for cyclic strokes. */ - vert_ptr->vflag = sflag | gpencil_point_edit_flag(layer_lock, &gps->points[0], 0, v_len); + vert_ptr->vflag = sflag | +gpencil_point_edit_flag(layer_lock, is_bezier, &gps->points[0], 0, v_len); vert_ptr->weight = gpencil_point_edit_weight(dvert, 0, iter->vgindex); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6111568598d] temp-gpu-compute-shaders: Use storage objects.
Commit: 6111568598d561080477bc717b6d5d70bce6ec3c Author: Jeroen Bakker Date: Mon Apr 26 11:34:35 2021 +0200 Branches: temp-gpu-compute-shaders https://developer.blender.org/rB6111568598d561080477bc717b6d5d70bce6ec3c Use storage objects. === M source/blender/gpu/GPU_compute.h M source/blender/gpu/GPU_shader.h M source/blender/gpu/GPU_state.h M source/blender/gpu/intern/gpu_compute.cc M source/blender/gpu/intern/gpu_shader.cc M source/blender/gpu/intern/gpu_shader_private.hh M source/blender/gpu/opengl/gl_shader.cc M source/blender/gpu/opengl/gl_shader.hh M source/blender/gpu/opengl/gl_state.hh M source/blender/gpu/opengl/gl_texture.cc M source/blender/gpu/tests/gpu_shader_test.cc M source/blender/gpu/tests/gpu_testing.cc === diff --git a/source/blender/gpu/GPU_compute.h b/source/blender/gpu/GPU_compute.h index 88230e8a065..a048f72c0a0 100644 --- a/source/blender/gpu/GPU_compute.h +++ b/source/blender/gpu/GPU_compute.h @@ -20,13 +20,18 @@ #pragma once +#include "BLI_sys_types.h" + #include "GPU_shader.h" #ifdef __cplusplus extern "C" { #endif -void GPU_compute_dispatch(GPUShader *shader, int groups_x_len, int groups_y_len, int groups_z_len); +void GPU_compute_dispatch(GPUShader *shader, + uint groups_x_len, + uint groups_y_len, + uint groups_z_len); #ifdef __cplusplus } diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index 22d607327e7..bb84aaa0645 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -88,6 +88,8 @@ void GPU_shader_unbind(void); bool GPU_shader_transform_feedback_enable(GPUShader *shader, struct GPUVertBuf *vertbuf); void GPU_shader_transform_feedback_disable(GPUShader *shader); +void GPU_shader_attach_vertex_buffer(GPUShader *shader, struct GPUVertBuf *vertbuf, int location); + int GPU_shader_get_program(GPUShader *shader); typedef enum { diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h index 0687f271670..16106e3053b 100644 --- a/source/blender/gpu/GPU_state.h +++ b/source/blender/gpu/GPU_state.h @@ -39,6 +39,8 @@ typedef enum eGPUBarrier { GPU_BARRIER_NONE = 0, GPU_BARRIER_SHADER_IMAGE_ACCESS = (1 << 0), GPU_BARRIER_TEXTURE_FETCH = (1 << 1), + GPU_BARRIER_VERTEX_ATTRIB_ARRAY = (1 << 2), + GPU_BARRIER_SHADER_STORAGE = (1 << 3), } eGPUBarrier; ENUM_OPERATORS(eGPUBarrier, GPU_BARRIER_TEXTURE_FETCH) diff --git a/source/blender/gpu/intern/gpu_compute.cc b/source/blender/gpu/intern/gpu_compute.cc index 6c5f6bafee1..963726538c1 100644 --- a/source/blender/gpu/intern/gpu_compute.cc +++ b/source/blender/gpu/intern/gpu_compute.cc @@ -26,7 +26,7 @@ extern "C" { #endif -void GPU_compute_dispatch(GPUShader *shader, int groups_x_len, int groups_y_len, int groups_z_len) +void GPU_compute_dispatch(GPUShader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len) { blender::gpu::GPUBackend &gpu_backend = *blender::gpu::GPUBackend::get(); GPU_shader_bind(shader); diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc index fdd912bfd87..b5c3b2c3f58 100644 --- a/source/blender/gpu/intern/gpu_shader.cc +++ b/source/blender/gpu/intern/gpu_shader.cc @@ -582,6 +582,17 @@ void GPU_shader_transform_feedback_disable(GPUShader *shader) /** \} */ +/* */ +/** \name Buffer binding + * \{ */ + +void GPU_shader_attach_vertex_buffer(GPUShader *shader, struct GPUVertBuf *vertbuf, int position) +{ + unwrap(shader)->attach_buffer(vertbuf, position); +} + +/** \} */ + /* */ /** \name Uniforms / Resource location * \{ */ diff --git a/source/blender/gpu/intern/gpu_shader_private.hh b/source/blender/gpu/intern/gpu_shader_private.hh index 281f01dbc22..a6f2e61 100644 --- a/source/blender/gpu/intern/gpu_shader_private.hh +++ b/source/blender/gpu/intern/gpu_shader_private.hh @@ -57,6 +57,8 @@ class Shader { virtual bool transform_feedback_enable(GPUVertBuf *) = 0; virtual void transform_feedback_disable(void) = 0; + virtual void attach_buffer(GPUVertBuf *vertex_buffer, uint location) = 0; + virtual void bind(void) = 0; virtual void unbind(void) = 0; diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 8cdbc647dcf..c0809a0387e 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -26,6 +26,7 @@ #include "BLI_string.h" #include "BLI_vector.hh" +#include "GPU_capabilities.h" #include "GPU_platform.h" #include "gl_backend.hh" @@ -299,6 +300,21 @@ void GLShader::transform_feedback_disable() /** \}
[Bf-blender-cvs] [cc0e98534d9] temp-gpu-compute-shaders: More research inside test cases.
Commit: cc0e98534d96f482967efe86b05f516c2b6688d9 Author: Jeroen Bakker Date: Mon Apr 26 15:14:57 2021 +0200 Branches: temp-gpu-compute-shaders https://developer.blender.org/rBcc0e98534d96f482967efe86b05f516c2b6688d9 More research inside test cases. === M source/blender/gpu/tests/gpu_shader_test.cc === diff --git a/source/blender/gpu/tests/gpu_shader_test.cc b/source/blender/gpu/tests/gpu_shader_test.cc index 3e778ca3e10..f74b5feead4 100644 --- a/source/blender/gpu/tests/gpu_shader_test.cc +++ b/source/blender/gpu/tests/gpu_shader_test.cc @@ -15,7 +15,7 @@ namespace blender::gpu::tests { -TEST_F(GPUTest, gpu_shader_compute) +TEST_F(GPUTest, gpu_shader_compute_2d) { if (!GPU_compute_shader_support()) { @@ -43,12 +43,12 @@ void main() { )"; GPUShader *shader = GPU_shader_create_compute( - compute_glsl, nullptr, nullptr, "gpu_shader_compute"); + compute_glsl, nullptr, nullptr, "gpu_shader_compute_2d"); EXPECT_NE(shader, nullptr); /* Create texture to store result and attach to shader. */ GPUTexture *texture = GPU_texture_create_2d( - "gpu_shader_compute", SIZE, SIZE, 0, GPU_RGBA32F, nullptr); + "gpu_shader_compute_2d", SIZE, SIZE, 0, GPU_RGBA32F, nullptr); EXPECT_NE(texture, nullptr); GPU_shader_bind(shader); @@ -76,7 +76,7 @@ void main() { GPU_shader_free(shader); } -TEST_F(GPUTest, gpu_shader_compute_write_vbo) +TEST_F(GPUTest, gpu_shader_compute_1d) { if (!GPU_compute_shader_support()) { @@ -92,44 +92,108 @@ TEST_F(GPUTest, gpu_shader_compute_write_vbo) layout(local_size_x = 1) in; -struct VBOData { - vec4 pos; -}; +layout(rgba32f, binding = 1) uniform image1D outputVboData; + +void main() { + int index = int(gl_GlobalInvocationID.x); + vec4 pos = vec4(gl_GlobalInvocationID.x); + imageStore(outputVboData, index, pos); +} + +)"; + + GPUShader *shader = GPU_shader_create_compute( + compute_glsl, nullptr, nullptr, "gpu_shader_compute_1d"); + EXPECT_NE(shader, nullptr); + + /* Construct Texture. */ + GPUTexture *texture = GPU_texture_create_1d("gpu_shader_compute_1d", SIZE, 0, GPU_RGBA32F, NULL); + EXPECT_NE(texture, nullptr); + + GPU_shader_bind(shader); + GPU_texture_image_bind(texture, GPU_shader_get_texture_binding(shader, "outputVboData")); -layout(std140, binding = 1) buffer outputVboData { - VBOData data[]; + /* Dispatch compute task. */ + GPU_compute_dispatch(shader, SIZE, 1, 1); + + /* Check if compute has been done. */ + GPU_memory_barrier(GPU_BARRIER_TEXTURE_FETCH); + + /* Create texture to load back result. */ + float *data = static_cast(GPU_texture_read(texture, GPU_DATA_FLOAT, 0)); + EXPECT_NE(data, nullptr); + for (int index = 0; index < SIZE; index++) { +float expected_value = index; +EXPECT_FLOAT_EQ(data[index * 4 + 0], expected_value); +EXPECT_FLOAT_EQ(data[index * 4 + 1], expected_value); +EXPECT_FLOAT_EQ(data[index * 4 + 2], expected_value); +EXPECT_FLOAT_EQ(data[index * 4 + 3], expected_value); + } + MEM_freeN(data); + + /* Cleanup. */ + GPU_shader_unbind(); + GPU_texture_unbind(texture); + GPU_texture_free(texture); + GPU_shader_free(shader); +} + +TEST_F(GPUTest, gpu_shader_compute_vbo) +{ + + if (!GPU_compute_shader_support()) { +/* We can't test as a the platform does not support compute shaders. */ +std::cout << "Skipping compute shader test: platform not supported"; +return; + } + + static constexpr uint SIZE = 128; + + /* Build compute shader. */ + const char *compute_glsl = R"( + +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer outputVboData +{ + vec4 Positions[]; }; void main() { int index = int(gl_GlobalInvocationID.x); vec4 pos = vec4(gl_GlobalInvocationID.x); - data[index].pos = pos; + Positions[index] = pos; } )"; GPUShader *shader = GPU_shader_create_compute( - compute_glsl, nullptr, nullptr, "gpu_shader_compute"); + compute_glsl, nullptr, nullptr, "gpu_shader_compute_vbo"); EXPECT_NE(shader, nullptr); + GPU_shader_bind(shader); /* Construct VBO. */ static GPUVertFormat format = {0}; GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); /* TODO: Should add a new GPU_USAGE_TYPE. (device only) that won't upload the data. */ - GPUVertBuf *vbo = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_STATIC); + GPUVertBuf *vbo = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_DYNAMIC); GPU_vertbuf_data_alloc(vbo, SIZE); - - GPU_shader_bind(shader); - GPU_shader_attach_vertex_buffer(shader, vbo, 1); + /* Store vbo with known values for easier debugging. */ + float dummy[4] = {0.1f, 0.2f, 0.3f, 0.4f}; + for (int i = 0; i < SIZE; i++) { +GPU_vertbuf_vert_set(vbo, i, dummy); + } + GPU_vertbuf_use(vbo); + GPU_shader_attach_vertex_buffer(shader, vbo, 0); /* Dispatch compute task. */ GP
[Bf-blender-cvs] [e12a8aedce5] master: Cleanup: remove use of deprecated uint32, utin16 types
Commit: e12a8aedce52a05a635a4a70721a33352fe5de58 Author: Campbell Barton Date: Mon Apr 26 14:23:31 2021 +1000 Branches: master https://developer.blender.org/rBe12a8aedce52a05a635a4a70721a33352fe5de58 Cleanup: remove use of deprecated uint32, utin16 types === M source/blender/imbuf/intern/tiff.c === diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 001cd4e1575..12f7553d5e4 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -374,7 +374,7 @@ static void scanline_separate_32bit(float *rectf, const float *fbuf, int scanlin static void imb_read_tiff_resolution(ImBuf *ibuf, TIFF *image) { - uint16 unit; + uint16_t unit; float xres; float yres; @@ -569,7 +569,7 @@ ImBuf *imb_loadtiff(const unsigned char *mem, TIFF *image = NULL; ImBuf *ibuf = NULL, *hbuf; ImbTIFFMemFile memFile; - uint32 width, height; + uint32_t width, height; char *format = NULL; int level; short spp; @@ -690,7 +690,7 @@ void imb_loadtiletiff( ImBuf *ibuf, const unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect) { TIFF *image = NULL; - uint32 width, height; + uint32_t width, height; ImbTIFFMemFile memFile; image = imb_tiff_client_open(&memFile, mem, size); @@ -761,7 +761,7 @@ void imb_loadtiletiff( bool imb_savetiff(ImBuf *ibuf, const char *filepath, int flags) { TIFF *image = NULL; - uint16 samplesperpixel, bitspersample; + uint16_t samplesperpixel, bitspersample; size_t npixels; unsigned char *pixels = NULL; unsigned char *from = NULL, *to = NULL; @@ -774,7 +774,7 @@ bool imb_savetiff(ImBuf *ibuf, const char *filepath, int flags) /* check for a valid number of bytes per pixel. Like the PNG writer, * the TIFF writer supports 1, 3 or 4 bytes per pixel, corresponding * to gray, RGB, RGBA respectively. */ - samplesperpixel = (uint16)((ibuf->planes + 7) >> 3); + samplesperpixel = (uint16_t)((ibuf->planes + 7) >> 3); if ((samplesperpixel > 4) || (samplesperpixel == 2)) { fprintf(stderr, "imb_savetiff: unsupported number of bytes per " ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8f03c9b19a8] master: Cleanup: compiler warning
Commit: 8f03c9b19a83f637de406cf9294fa0147529b188 Author: Campbell Barton Date: Mon Apr 26 22:52:26 2021 +1000 Branches: master https://developer.blender.org/rB8f03c9b19a83f637de406cf9294fa0147529b188 Cleanup: compiler warning === M source/blender/editors/transform/transform_convert_mesh.c === diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c index 59f314f5301..9ef033639f6 100644 --- a/source/blender/editors/transform/transform_convert_mesh.c +++ b/source/blender/editors/transform/transform_convert_mesh.c @@ -292,8 +292,8 @@ static void tc_mesh_customdatacorrect_init_container_merge_group(TransDataContai tcld->arena, tcld->merge_group.data_len * sizeof(*tcld->merge_group.data)); } -struct TransCustomDataLayer *tc_mesh_customdatacorrect_create(TransDataContainer *tc, - const bool use_merge_group) +static struct TransCustomDataLayer *tc_mesh_customdatacorrect_create(TransDataContainer *tc, + const bool use_merge_group) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); BMesh *bm = em->bm; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bac9562f156] master: Cleanup: spelling
Commit: bac9562f15639066b076decb9ca3151391eb54a0 Author: Campbell Barton Date: Mon Apr 26 22:54:17 2021 +1000 Branches: master https://developer.blender.org/rBbac9562f15639066b076decb9ca3151391eb54a0 Cleanup: spelling === M source/blender/blenkernel/BKE_geometry_set.hh M source/blender/editors/mask/mask_shapekey.c M source/blender/editors/screen/screen_edit.c === diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 027338a5d5c..58935aca0a8 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -114,7 +114,7 @@ struct AttributeInitVArray : public AttributeInit { * Sometimes data is created before a geometry component is available. In that case, it's * preferable to move data directly to the created attribute to avoid a new allocation and a copy. * - * Note that this will only have a benefit for attributes that are stored directly as contigious + * Note that this will only have a benefit for attributes that are stored directly as contiguous * arrays, so not for some built-in attributes. * * The array must be allocated with MEM_*, since `attribute_try_create` will free the array if it diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c index 1eb6613d8fe..81bf66da72c 100644 --- a/source/blender/editors/mask/mask_shapekey.c +++ b/source/blender/editors/mask/mask_shapekey.c @@ -220,8 +220,8 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot) } /* - * - loop over selected shapekeys. - * - find firstsel/lastsel pairs. + * - loop over selected shape-keys. + * - find first-selected/last-selected pairs. * - move these into a temp list. * - re-key all the original shapes. * - copy unselected values back from the original. diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 082e7bc5718..75aa709a5d1 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -519,7 +519,7 @@ static bool screen_area_join_ex( screen_area_join_aligned(C, screen, sa1, sa2); if (close_all_remainders || offset1 < 0 || offset2 > 0) { -/* Close both if trimiming sa1. */ +/* Close both if trimming `sa1`. */ screen_area_close(C, screen, side1); screen_area_close(C, screen, side2); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [94960250b53] master: Cycles: Fix build with OptiX 7.3 SDK
Commit: 94960250b539c46315808fcb9bdb9d64c0f71eea Author: Patrick Mours Date: Mon Apr 26 14:55:39 2021 +0200 Branches: master https://developer.blender.org/rB94960250b539c46315808fcb9bdb9d64c0f71eea Cycles: Fix build with OptiX 7.3 SDK === M intern/cycles/device/device_optix.cpp === diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp index fcf8fab9cc4..cce11507fa1 100644 --- a/intern/cycles/device/device_optix.cpp +++ b/intern/cycles/device/device_optix.cpp @@ -955,14 +955,21 @@ class OptiXDevice : public CUDADevice { // Create OptiX denoiser handle on demand when it is first used OptixDenoiserOptions denoiser_options = {}; assert(task.denoising.input_passes >= 1 && task.denoising.input_passes <= 3); +# if OPTIX_ABI_VERSION >= 47 +denoiser_options.guideAlbedo = task.denoising.input_passes >= 2; +denoiser_options.guideNormal = task.denoising.input_passes >= 3; +check_result_optix_ret(optixDenoiserCreate( +context, OPTIX_DENOISER_MODEL_KIND_HDR, &denoiser_options, &denoiser)); +# else denoiser_options.inputKind = static_cast( OPTIX_DENOISER_INPUT_RGB + (task.denoising.input_passes - 1)); -# if OPTIX_ABI_VERSION < 28 +#if OPTIX_ABI_VERSION < 28 denoiser_options.pixelFormat = OPTIX_PIXEL_FORMAT_FLOAT3; -# endif +#endif check_result_optix_ret(optixDenoiserCreate(context, &denoiser_options, &denoiser)); check_result_optix_ret( optixDenoiserSetModel(denoiser, OPTIX_DENOISER_MODEL_KIND_HDR, NULL, 0)); +# endif // OptiX denoiser handle was created with the requested number of input passes denoiser_input_passes = task.denoising.input_passes; @@ -1032,10 +1039,34 @@ class OptiXDevice : public CUDADevice { # endif output_layers[0].format = OPTIX_PIXEL_FORMAT_FLOAT3; +# if OPTIX_ABI_VERSION >= 47 + OptixDenoiserLayer image_layers = {}; + image_layers.input = input_layers[0]; + image_layers.output = output_layers[0]; + + OptixDenoiserGuideLayer guide_layers = {}; + guide_layers.albedo = input_layers[1]; + guide_layers.normal = input_layers[2]; +# endif + // Finally run denonising OptixDenoiserParams params = {}; // All parameters are disabled/zero +# if OPTIX_ABI_VERSION >= 47 check_result_optix_ret(optixDenoiserInvoke(denoiser, - 0, + NULL, + ¶ms, + denoiser_state.device_pointer, + scratch_offset, + &guide_layers, + &image_layers, + 1, + overlap_offset.x, + overlap_offset.y, + denoiser_state.device_pointer + scratch_offset, + scratch_size)); +# else + check_result_optix_ret(optixDenoiserInvoke(denoiser, + NULL, ¶ms, denoiser_state.device_pointer, scratch_offset, @@ -1046,6 +1077,7 @@ class OptiXDevice : public CUDADevice { output_layers, denoiser_state.device_pointer + scratch_offset, scratch_size)); +# endif # if OPTIX_DENOISER_NO_PIXEL_STRIDE void *output_args[] = {&input_ptr, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d7c762d2f75] master: Cleanup: Rearrange the functions in 'transform_convert_mesh.c'
Commit: d7c762d2f7533a6f77a912f82937e79fb046362e Author: Germano Cavalcante Date: Mon Apr 26 09:35:03 2021 -0300 Branches: master https://developer.blender.org/rBd7c762d2f7533a6f77a912f82937e79fb046362e Cleanup: Rearrange the functions in 'transform_convert_mesh.c' The creation of `TransCustomData` is best located at the beginning of the file as it is a specific struct of the file and can be used a lot locally. === M source/blender/editors/transform/transform_convert_mesh.c === diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c index 872f3e1385a..59f314f5301 100644 --- a/source/blender/editors/transform/transform_convert_mesh.c +++ b/source/blender/editors/transform/transform_convert_mesh.c @@ -48,1530 +48,1551 @@ #include "transform_convert.h" -#define USE_FACE_SUBSTITUTE - /* */ -/** \name Island Creation +/** \name Container TransCustomData Creation * \{ */ -void transform_convert_mesh_islands_calc(struct BMEditMesh *em, - const bool calc_single_islands, - const bool calc_island_center, - const bool calc_island_axismtx, - struct TransIslandData *r_island_data) -{ - struct TransIslandData data = {NULL}; +struct TransCustomDataMergeGroup { + /** map {BMVert: TransCustomDataLayerVert} */ + struct LinkNode **cd_loop_groups; +}; - BMesh *bm = em->bm; - char htype; - char itype; - int i; +struct TransCustomDataLayer { + BMesh *bm; + struct MemArena *arena; - /* group vars */ - int *groups_array = NULL; - int(*group_index)[2] = NULL; + struct GHash *origfaces; + struct BMesh *bm_origfaces; - bool has_only_single_islands = bm->totedgesel == 0 && bm->totfacesel == 0; - if (has_only_single_islands && !calc_single_islands) { -return; + /* Special handle for multi-resolution. */ + int cd_loop_mdisp_offset; + + /* Optionally merge custom-data groups (this keeps UVs connected for example). */ + struct { +/** map {BMVert: TransDataBasic} */ +struct GHash *origverts; +struct TransCustomDataMergeGroup *data; +int data_len; +/** Array size of 'layer_math_map_len' + * maps #TransCustomDataLayerVert.cd_group index to absolute #CustomData layer index */ +int *customdatalayer_map; +/** Number of math BMLoop layers. */ +int customdatalayer_map_len; + } merge_group; + + bool use_merge_group; +}; + +static void tc_mesh_customdatacorrect_free_fn(struct TransInfo *UNUSED(t), + struct TransDataContainer *UNUSED(tc), + struct TransCustomData *custom_data) +{ + struct TransCustomDataLayer *tcld = custom_data->data; + bmesh_edit_end(tcld->bm, BMO_OPTYPE_FLAG_UNTAN_MULTIRES); + + if (tcld->bm_origfaces) { +BM_mesh_free(tcld->bm_origfaces); + } + if (tcld->origfaces) { +BLI_ghash_free(tcld->origfaces, NULL, NULL); + } + if (tcld->merge_group.origverts) { +BLI_ghash_free(tcld->merge_group.origverts, NULL, NULL); + } + if (tcld->arena) { +BLI_memarena_free(tcld->arena); + } + if (tcld->merge_group.customdatalayer_map) { +MEM_freeN(tcld->merge_group.customdatalayer_map); } - data.island_vert_map = MEM_mallocN(sizeof(*data.island_vert_map) * bm->totvert, __func__); - /* we shouldn't need this, but with incorrect selection flushing - * its possible we have a selected vertex that's not in a face, - * for now best not crash in that case. */ - copy_vn_i(data.island_vert_map, bm->totvert, -1); + MEM_freeN(tcld); + custom_data->data = NULL; +} - if (!has_only_single_islands) { -if (em->selectmode & (SCE_SELECT_VERTEX | SCE_SELECT_EDGE)) { - groups_array = MEM_mallocN(sizeof(*groups_array) * bm->totedgesel, __func__); - data.island_tot = BM_mesh_calc_edge_groups( - bm, groups_array, &group_index, NULL, NULL, BM_ELEM_SELECT); +#define USE_FACE_SUBSTITUTE +#ifdef USE_FACE_SUBSTITUTE +# define FACE_SUBSTITUTE_INDEX INT_MIN - htype = BM_EDGE; - itype = BM_VERTS_OF_EDGE; +/** + * Search for a neighboring face with area and preferably without selected vertex. + * Used to replace area-less faces in custom-data correction. + */ +static BMFace *tc_mesh_customdatacorrect_find_best_face_substitute(BMFace *f) +{ + BMFace *best_face = NULL; + BMLoop *l; + BMIter liter; + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { +BMLoop *l_radial_next = l->radial_next; +BMFace *f_test = l_radial_next->f; +if (f_test == f) { + continue; } -else { /* (bm->selectmode & SCE_SELECT_FACE) */ - groups_array = MEM_mallocN(sizeof(*groups_array) *
[Bf-blender-cvs] [a65d5dadeb6] blender-v2.93-release: DeprecationWarning fix
Commit: a65d5dadeb610a8262acb0d9a57b3a15eec14e96 Author: Erik Abrahamsson Date: Mon Apr 26 09:38:35 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rBa65d5dadeb610a8262acb0d9a57b3a15eec14e96 DeprecationWarning fix This gets rid of a `DeprecationWarning` in bpy_types.py caused by invalid escape sequences. More info here: https://docs.python.org/3/library/re.html Reviewed By: mont29 Differential Revision: https://developer.blender.org/D10998 === M release/scripts/modules/bpy_types.py === diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index ee9115b6643..4ea8c88e8d9 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -923,7 +923,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): # Perform a "natural sort", so 20 comes after 3 (for example). files.sort( key=lambda file_path: -tuple(int(t) if t.isdigit() else t for t in re.split("(\d+)", file_path[0].lower())), +tuple(int(t) if t.isdigit() else t for t in re.split(r"(\d+)", file_path[0].lower())), ) col = layout.column(align=True) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b5dc1def418] temp-lineart-contained: LineArt: Offset strokes instead of In Front.
Commit: b5dc1def4185312c2f173213696dcc92e0a0575c Author: YimingWu Date: Mon Apr 26 15:20:43 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rBb5dc1def4185312c2f173213696dcc92e0a0575c LineArt: Offset strokes instead of In Front. === M source/blender/editors/object/object_add.c M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c M source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h M source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c M source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c M source/blender/makesdna/DNA_gpencil_modifier_defaults.h M source/blender/makesdna/DNA_gpencil_modifier_types.h M source/blender/makesrna/intern/rna_gpencil_modifier.c === diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index a0de1e0fa84..7bfdb26196f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1419,9 +1419,6 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) if (md->target_material) { id_us_plus(&md->target_material->id); } - - /* Stroke object is drawn in front of meshes by default. */ - ob->dtx |= OB_DRAW_IN_FRONT; } case GP_EMPTY: /* do nothing */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c index 203f56b11e7..58ff8625fd3 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c @@ -157,7 +157,8 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec } if (!gpd->runtime.lineart_cache) { -MOD_lineart_compute_feature_lines(depsgraph, lmd, &gpd->runtime.lineart_cache); +MOD_lineart_compute_feature_lines( +depsgraph, lmd, &gpd->runtime.lineart_cache, (!(ob->dtx & OB_DRAW_IN_FRONT))); MOD_lineart_destroy_render_data(lmd); } else { @@ -188,7 +189,8 @@ static void bakeModifier(Main *UNUSED(bmain), } if (!gpd->runtime.lineart_cache) { -MOD_lineart_compute_feature_lines(depsgraph, lmd, &gpd->runtime.lineart_cache); +MOD_lineart_compute_feature_lines( +depsgraph, lmd, &gpd->runtime.lineart_cache, (!(ob->dtx & OB_DRAW_IN_FRONT))); MOD_lineart_destroy_render_data(lmd); } @@ -461,6 +463,25 @@ static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel) uiItemO(col, NULL, ICON_NONE, "OBJECT_OT_lineart_clear_all"); } +static void composition_panel_draw(const bContext *C, Panel *panel) +{ + PointerRNA ob_ptr; + PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr); + + uiLayout *layout = panel->layout; + + const bool show_in_front = RNA_boolean_get(&ob_ptr, "show_in_front"); + + uiLayoutSetPropSep(layout, true); + + uiItemR(layout, &ob_ptr, "show_in_front", 0, NULL, ICON_NONE); + + uiLayout *row = uiLayoutRow(layout, false); + uiLayoutSetActive(row, !show_in_front); + + uiItemR(row, ptr, "stroke_offset", UI_ITEM_R_SLIDER, NULL, ICON_NONE); +} + static void panelRegister(ARegionType *region_type) { PanelType *panel_type = gpencil_modifier_panel_register( @@ -480,6 +501,8 @@ static void panelRegister(ARegionType *region_type) region_type, "chaining", "Chaining", NULL, chaining_panel_draw, panel_type); gpencil_modifier_subpanel_register( region_type, "vgroup", "Vertex Weight Transfer", NULL, vgroup_panel_draw, panel_type); + gpencil_modifier_subpanel_register( + region_type, "composition", "Composition", NULL, composition_panel_draw, panel_type); gpencil_modifier_subpanel_register( region_type, "baking", "Baking", NULL, baking_panel_draw, panel_type); } diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h index b2bd22c98ec..696623f9ef9 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h +++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h @@ -600,13 +600,15 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb); void MOD_lineart_chain_connect(LineartRenderBuffer *rb); void MOD_lineart_chain_discard_short(LineartRenderBuffer *rb, const float threshold); void MOD_lineart_chain_split_angle(LineartRenderBuffer *rb, float angle_threshold_rad); +void MOD_lineart_chain_offset_towards_camera(LineartRenderBuffer *rb, float dist); int MOD_lineart_chain_count(const LineartLineChain *rlc); void MOD_lineart_chain_clear_picked_flag(LineartCache *lc); bool MOD_lineart_compute_feature_lines(struct Depsgraph *depsgraph,
[Bf-blender-cvs] [40691f442f1] temp-lineart-contained: Merge remote-tracking branch 'origin/master' into temp-lineart-contained
Commit: 40691f442f14fee91f396e1818c5bb27e4730100 Author: YimingWu Date: Mon Apr 26 14:02:09 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rB40691f442f14fee91f396e1818c5bb27e4730100 Merge remote-tracking branch 'origin/master' into temp-lineart-contained === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9b64927a8aa] master: Merge branch 'blender-v2.93-release'
Commit: 9b64927a8aabe3f71784be1022a1daf3fb4e0b28 Author: Jacques Lucke Date: Mon Apr 26 09:16:53 2021 +0200 Branches: master https://developer.blender.org/rB9b64927a8aabe3f71784be1022a1daf3fb4e0b28 Merge branch 'blender-v2.93-release' === === diff --cc source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc index 405f0cd9455,018431225e5..1ae3f462cfa --- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc @@@ -78,85 -57,69 +57,70 @@@ std::unique_ptr GeometryD { std::lock_guard lock{mutex_}; - bke::ReadAttributePtr attribute_ptr = component_->attribute_try_get_for_read(column_id.name); - if (!attribute_ptr) { + bke::ReadAttributeLookup attribute = component_->attribute_try_get_for_read(column_id.name); + if (!attribute) { return {}; } - const bke::ReadAttribute *attribute = scope_.add(std::move(attribute_ptr), __func__); - if (attribute->domain() != domain_) { + const fn::GVArray *varray = scope_.add(std::move(attribute.varray), __func__); + if (attribute.domain != domain_) { return {}; } - int domain_size = attribute->size(); - switch (attribute->custom_data_type()) { + int domain_size = varray->size(); + const CustomDataType type = bke::cpp_type_to_custom_data_type(varray->type()); + switch (type) { case CD_PROP_FLOAT: - if (column_id.index != -1) { - return {}; - } return column_values_from_function( - column_id.name, domain_size, [attribute](int index, CellValue &r_cell_value) { + column_id.name, domain_size, [varray](int index, CellValue &r_cell_value) { float value; -attribute->get(index, &value); +varray->get(index, &value); r_cell_value.value_float = value; }); case CD_PROP_INT32: - if (column_id.index != -1) { - return {}; - } return column_values_from_function( - column_id.name, domain_size, [attribute](int index, CellValue &r_cell_value) { + column_id.name, domain_size, [varray](int index, CellValue &r_cell_value) { int value; -attribute->get(index, &value); +varray->get(index, &value); r_cell_value.value_int = value; }); case CD_PROP_BOOL: - if (column_id.index != -1) { - return {}; - } return column_values_from_function( - column_id.name, domain_size, [attribute](int index, CellValue &r_cell_value) { + column_id.name, domain_size, [varray](int index, CellValue &r_cell_value) { bool value; -attribute->get(index, &value); +varray->get(index, &value); r_cell_value.value_bool = value; }); case CD_PROP_FLOAT2: { - if (column_id.index < 0 || column_id.index > 1) { - return {}; - } - const std::array suffixes = {" X", " Y"}; - const std::string name = StringRef(column_id.name) + suffixes[column_id.index]; return column_values_from_function( - name, domain_size, [varray, axis = column_id.index](int index, CellValue &r_cell_value) { + column_id.name, + domain_size, - [attribute](int index, CellValue &r_cell_value) { ++ [varray](int index, CellValue &r_cell_value) { float2 value; -attribute->get(index, &value); +varray->get(index, &value); - r_cell_value.value_float = value[axis]; - }); + r_cell_value.value_float2 = value; + }, + default_float2_column_width); } case CD_PROP_FLOAT3: { - if (column_id.index < 0 || column_id.index > 2) { - return {}; - } - const std::array suffixes = {" X", " Y", " Z"}; - const std::string name = StringRef(column_id.name) + suffixes[column_id.index]; return column_values_from_function( - name, domain_size, [varray, axis = column_id.index](int index, CellValue &r_cell_value) { + column_id.name, + domain_size, - [attribute](int index, CellValue &r_cell_value) { ++ [varray](int index, CellValue &r_cell_value) { float3 value; -attribute->get(index, &value); +varray->get(index, &value); - r_cell_value.value_float = value[axis]; - }); + r_cell_value.value_float3 = value; + }, + default_float3_column_width); } case CD_PROP_COLOR: { - if (column_id.index < 0 || column_id.index > 3) { - return {}; - } - const std::array suffixes = {" R", " G", " B", " A"}; - const std::string n
[Bf-blender-cvs] [a17ea1a6691] blender-v2.93-release: Spreadsheet: combine vector/color spreadsheet columns
Commit: a17ea1a6691920cc307f3e44dd285b2d8e8bdd35 Author: Jacques Lucke Date: Mon Apr 26 09:09:50 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rBa17ea1a6691920cc307f3e44dd285b2d8e8bdd35 Spreadsheet: combine vector/color spreadsheet columns Differential Revision: https://developer.blender.org/D11056 === M source/blender/editors/space_spreadsheet/space_spreadsheet.cc M source/blender/editors/space_spreadsheet/spreadsheet_cell_value.hh M source/blender/editors/space_spreadsheet/spreadsheet_column.cc M source/blender/editors/space_spreadsheet/spreadsheet_column.hh M source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh M source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc M source/blender/editors/space_spreadsheet/spreadsheet_layout.cc M source/blender/makesdna/DNA_space_types.h === diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc index 190f50ed443..fc9606b1249 100644 --- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc +++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc @@ -304,7 +304,12 @@ static void update_visible_columns(ListBase &columns, DataSource &data_source) continue; } -used_ids.add(*column->id); +if (!used_ids.add(*column->id)) { + /* Remove duplicate columns for now. */ + BLI_remlink(&columns, column); + spreadsheet_column_free(column); + continue; +} } data_source.foreach_default_column_ids([&](const SpreadsheetColumnID &column_id) { diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_cell_value.hh b/source/blender/editors/space_spreadsheet/spreadsheet_cell_value.hh index 0627cff7abc..d1e80f1d87e 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_cell_value.hh +++ b/source/blender/editors/space_spreadsheet/spreadsheet_cell_value.hh @@ -18,6 +18,10 @@ #include +#include "BLI_color.hh" +#include "BLI_float2.hh" +#include "BLI_float3.hh" + struct Object; struct Collection; @@ -44,6 +48,9 @@ class CellValue { std::optional value_int; std::optional value_float; std::optional value_bool; + std::optional value_float2; + std::optional value_float3; + std::optional value_color; std::optional value_object; std::optional value_collection; }; diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column.cc b/source/blender/editors/space_spreadsheet/spreadsheet_column.cc index 6c573ce7238..de40545fdae 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_column.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_column.cc @@ -37,7 +37,6 @@ SpreadsheetColumnID *spreadsheet_column_id_copy(const SpreadsheetColumnID *src_c { SpreadsheetColumnID *new_column_id = spreadsheet_column_id_new(); new_column_id->name = BLI_strdup(src_column_id->name); - new_column_id->index = src_column_id->index; return new_column_id; } diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column.hh b/source/blender/editors/space_spreadsheet/spreadsheet_column.hh index 0f74ee0141a..bb245851d55 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_column.hh +++ b/source/blender/editors/space_spreadsheet/spreadsheet_column.hh @@ -24,7 +24,7 @@ namespace blender { template<> struct DefaultHash { uint64_t operator()(const SpreadsheetColumnID &column_id) const { -return get_default_hash_2(StringRef(column_id.name), column_id.index); +return get_default_hash(StringRef(column_id.name)); } }; } // namespace blender @@ -32,7 +32,7 @@ template<> struct DefaultHash { inline bool operator==(const SpreadsheetColumnID &a, const SpreadsheetColumnID &b) { using blender::StringRef; - return StringRef(a.name) == StringRef(b.name) && a.index == b.index; + return StringRef(a.name) == StringRef(b.name); } namespace blender::ed::spreadsheet { diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh b/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh index 58a2776e0fc..373c988a41c 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh +++ b/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh @@ -74,11 +74,19 @@ template class LambdaColumnValues : public ColumnValues { /* Utility function that simplifies creating a spreadsheet column from a lambda function. */ template std::unique_ptr column_values_from_function(std::string name, - int size, - GetValueF get_value) + const int size, +