[Bf-blender-cvs] [86972d294f7] temp_bmesh_multires: Dyntopo sculpt: fix bug with boundary flags
Commit: 86972d294f7f9036e5f1d82a8e109e32b260bd33 Author: Joseph Eagar Date: Sat Sep 11 13:38:42 2021 -0700 Branches: temp_bmesh_multires https://developer.blender.org/rB86972d294f7f9036e5f1d82a8e109e32b260bd33 Dyntopo sculpt: fix bug with boundary flags === M source/blender/blenkernel/intern/dyntopo.c === diff --git a/source/blender/blenkernel/intern/dyntopo.c b/source/blender/blenkernel/intern/dyntopo.c index 211a35a3abd..f9e90ede763 100644 --- a/source/blender/blenkernel/intern/dyntopo.c +++ b/source/blender/blenkernel/intern/dyntopo.c @@ -592,7 +592,7 @@ BLI_INLINE void surface_smooth_v_safe(PBVH *pbvh, BMVert *v, float fac) MDynTopoVert *mv2 = BKE_PBVH_DYNVERT(cd_dyn_vert, v2); const bool bound2 = mv2->flag & DYNVERT_SMOOTH_BOUNDARY; -if (bound1 && !bound2) { +if (bound1 != bound2) { continue; } @@ -2948,7 +2948,7 @@ static void short_edge_queue_create(EdgeQueueContext *eq_ctx, continue; } - if (!(mv1->flag & DYNVERT_ALL_BOUNDARY) != !(mv2->flag & DYNVERT_ALL_BOUNDARY)) { + if ((mv1->flag & DYNVERT_ALL_BOUNDARY) != (mv2->flag & DYNVERT_ALL_BOUNDARY)) { continue; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [15405685d9a] master: Cleanup: Remove no-op/unused code
Commit: 15405685d9a0111588a769fdba98e3d34464513f Author: Hans Goudey Date: Sat Sep 11 15:00:36 2021 -0500 Branches: master https://developer.blender.org/rB15405685d9a0111588a769fdba98e3d34464513f Cleanup: Remove no-op/unused code === M source/blender/blenkernel/BKE_displist.h M source/blender/blenkernel/intern/displist.cc === diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index 37e144ebbd3..db5663fcc94 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -82,7 +82,6 @@ DispList *BKE_displist_find(struct ListBase *lb, int type); void BKE_displist_normals_add(struct ListBase *lb); void BKE_displist_count(const struct ListBase *lb, int *totvert, int *totface, int *tottri); void BKE_displist_free(struct ListBase *lb); -bool BKE_displist_has_faces(const struct ListBase *lb); void BKE_displist_make_curveTypes(struct Depsgraph *depsgraph, const struct Scene *scene, @@ -94,10 +93,6 @@ void BKE_displist_make_curveTypes_forRender(struct Depsgraph *depsgraph, struct ListBase *dispbase, struct Mesh **r_final); void BKE_displist_make_mball(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob); -void BKE_displist_make_mball_forRender(struct Depsgraph *depsgraph, - struct Scene *scene, - struct Object *ob, - struct ListBase *dispbase); void BKE_curve_calc_modifiers_pre(struct Depsgraph *depsgraph, const struct Scene *scene, diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index bdab508eb1f..f37978d14bb 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -104,17 +104,6 @@ DispList *BKE_displist_find(ListBase *lb, int type) return nullptr; } -bool BKE_displist_has_faces(const ListBase *lb) -{ - LISTBASE_FOREACH (const DispList *, dl, lb) { -if (ELEM(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) { - return true; -} - } - - return false; -} - void BKE_displist_copy(ListBase *lbn, const ListBase *lb) { BKE_displist_free(lbn); @@ -691,23 +680,9 @@ void BKE_displist_make_mball(Depsgraph *depsgraph, Scene *scene, Object *ob) BKE_mball_texspace_calc(ob); object_deform_mball(ob, >runtime.curve_cache->disp); - -/* No-op for MBALLs anyway... */ -boundbox_displist_object(ob); } } -void BKE_displist_make_mball_forRender(Depsgraph *depsgraph, - Scene *scene, - Object *ob, - ListBase *dispbase) -{ - BKE_mball_polygonize(depsgraph, scene, ob, dispbase); - BKE_mball_texspace_calc(ob); - - object_deform_mball(ob, dispbase); -} - static ModifierData *curve_get_tessellate_point(const Scene *scene, const Object *ob, const bool for_render, @@ -1606,27 +1581,26 @@ void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) /* this is confusing, there's also min_max_object, applying the obmat... */ static void boundbox_displist_object(Object *ob) { - if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { -/* Curve's BB is already calculated as a part of modifier stack, - * here we only calculate object BB based on final display list. */ + BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)); + /* Curve's BB is already calculated as a part of modifier stack, + * here we only calculate object BB based on final display list. */ -/* object's BB is calculated from final displist */ -if (ob->runtime.bb == nullptr) { - ob->runtime.bb = (BoundBox *)MEM_callocN(sizeof(BoundBox), __func__); -} + /* object's BB is calculated from final displist */ + if (ob->runtime.bb == nullptr) { +ob->runtime.bb = (BoundBox *)MEM_callocN(sizeof(BoundBox), __func__); + } -const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); -if (mesh_eval) { - BKE_object_boundbox_calc_from_mesh(ob, mesh_eval); -} -else { - float min[3], max[3]; + const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); + if (mesh_eval) { +BKE_object_boundbox_calc_from_mesh(ob, mesh_eval); + } + else { +float min[3], max[3]; - INIT_MINMAX(min, max); - BKE_displist_minmax(>runtime.curve_cache->disp, min, max); - BKE_boundbox_init_from_minmax(ob->runtime.bb, min, max); +INIT_MINMAX(min, max); +BKE_displist_minmax(>runtime.curve_cache->disp, min, max); +
[Bf-blender-cvs] [b9febb54a49] master: Geometry Nodes: Support modifier on curve objects
Commit: b9febb54a492ac6c93802fb0aa189d4c3fd99b0b Author: Hans Goudey Date: Sat Sep 11 13:54:40 2021 -0500 Branches: master https://developer.blender.org/rBb9febb54a492ac6c93802fb0aa189d4c3fd99b0b Geometry Nodes: Support modifier on curve objects With this commit, curve objects support the geometry nodes modifier. Curves objects now evaluate to `CurveEval` unless there was a previous implicit conversion (tessellating modifiers, mesh modifiers, or the settings in the curve "Geometry" panel). In the new code, curves are only considered to be the wire edges-- any generated surface is a mesh instead, stored in the evaluated geometry set. The consolidation of concepts mentioned above allows remove a lot of code that had to do with maintaining the `DispList` type temporarily for modifiers and rendering. Instead, render engines see a separate object for the mesh from the mesh geometry component, and when the curve object evaluates to a curve, the `CurveEval` is always used for drawing wire edges. However, currently the `DispList` type is still maintained and used as an intermediate step in implicit mesh conversion. In the future, more uses of it could be changed to use `CurveEval` and `Mesh` instead. This is mostly not changed behavior, it is just a formalization of existing logic after recent fixes for 2.8 versions last year and two years ago. Also, in the future more functionality can be converted to nodes, removing cases of implicit conversions. For more discussion on that topic, see T89676. The `use_fill_deform` option is removed. It has not worked properly since 2.62, and the choice for filling a curve before or after deformation will work much better and be clearer with a node system. Applying the geometry nodes modifier to generate a curve is not implemented with this commit, so applying the modifier won't work at all. This is a separate technical challenge, and should be solved in a separate step. Differential Revision: https://developer.blender.org/D11597 === M release/scripts/startup/bl_operators/geometry_nodes.py M release/scripts/startup/bl_ui/properties_data_curve.py M source/blender/blenkernel/BKE_displist.h M source/blender/blenkernel/intern/displist.cc M source/blender/blenkernel/intern/geometry_component_curve.cc M source/blender/blenkernel/intern/geometry_set.cc M source/blender/blenkernel/intern/geometry_set_instances.cc M source/blender/blenkernel/intern/mesh_convert.c M source/blender/blenkernel/intern/object.c M source/blender/blenkernel/intern/object_dupli.cc M source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_object.cc M source/blender/draw/engines/overlay/overlay_edit_text.c M source/blender/draw/engines/overlay/overlay_wireframe.c M source/blender/draw/intern/draw_cache.c M source/blender/draw/intern/draw_cache.h M source/blender/draw/intern/draw_cache_impl_curve.cc M source/blender/editors/curve/editcurve_add.c M source/blender/editors/space_spreadsheet/space_spreadsheet.cc M source/blender/io/alembic/intern/abc_reader_curves.cc M source/blender/io/usd/intern/usd_reader_curve.cc M source/blender/io/usd/intern/usd_reader_nurbs.cc M source/blender/makesdna/DNA_curve_types.h M source/blender/makesdna/DNA_object_types.h M source/blender/makesrna/intern/rna_curve.c M source/blender/modifiers/intern/MOD_nodes.cc === diff --git a/release/scripts/startup/bl_operators/geometry_nodes.py b/release/scripts/startup/bl_operators/geometry_nodes.py index ec2887a1a74..258a73bd70b 100644 --- a/release/scripts/startup/bl_operators/geometry_nodes.py +++ b/release/scripts/startup/bl_operators/geometry_nodes.py @@ -42,8 +42,8 @@ def geometry_node_group_empty_new(): def geometry_modifier_poll(context): ob = context.object -# Test object support for geometry node modifier (No curve, or hair object support yet) -if not ob or ob.type not in {'MESH', 'POINTCLOUD', 'VOLUME'}: +# Test object support for geometry node modifier (No hair object support yet) +if not ob or ob.type not in {'MESH', 'POINTCLOUD', 'VOLUME', 'CURVE', 'FONT'}: return False return True diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 85f672cd50f..e5b675db2c5 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -120,7 +120,6 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel): sub = col.column() sub.active = (curve.dimensions == '2D' or (curve.bevel_mode != 'OBJECT' and curve.dimensions == '3D')) sub.prop(curve, "fill_mode") -col.prop(curve, "use_fill_deform") if is_curve:
[Bf-blender-cvs] [9d435076746] soc-2021-knife-tools: Knife: Moved code to world space
Commit: 9d435076746ee147953b457cda0c84ee849565d0 Author: Cian Jinks Date: Sat Sep 11 19:16:24 2021 +0100 Branches: soc-2021-knife-tools https://developer.blender.org/rB9d435076746ee147953b457cda0c84ee849565d0 Knife: Moved code to world space This patch migrates the knife tool code to use world space coordinates instead of object space. This is required to implement the ability to cut across multiple objects at once and the ability to use the geometry of other objects as a cutting reference. This introduces precision errors for objects with very large scale or location, however it may be possible to add a switch between world space and object space coordinates depending on whether the user is in multi-object edit mode or not. === M source/blender/editors/mesh/editmesh_knife.c === diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index e0540e8c1e8..7081346de06 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -121,7 +121,6 @@ typedef struct KnifeVert { ListBase faces; float co[3], cageco[3]; - float wcageco[3]; bool is_face, in_space; bool is_cut; /* Along a cut created by user input (will draw too). */ bool is_invalid; @@ -163,7 +162,6 @@ typedef struct KnifeLineHit { typedef struct KnifePosData { float co[3]; float cage[3]; - float wcage[3]; /* At most one of vert, edge, or bmface should be non-NULL, * saying whether the point is snapped to a vertex, edge, or in a face. @@ -318,7 +316,6 @@ typedef struct KnifeTool_OpData { short constrain_axis; short constrain_axis_mode; bool axis_constrained; - float curr_cage_adjusted[3]; char axis_string[2]; short dist_angle_mode; @@ -383,13 +380,17 @@ enum { static void knifetool_raycast_planes(const KnifeTool_OpData *kcd, float r_v1[3], float r_v2[3]) { float planes[4][4]; - planes_from_projmat(kcd->projmat, planes[2], planes[0], planes[1], planes[3], NULL, NULL); + float curr_os[3]; + float prev_os[3]; + mul_v3_m4v3(curr_os, kcd->ob_imat, kcd->curr.cage); + mul_v3_m4v3(prev_os, kcd->ob_imat, kcd->prev.cage); + /* Ray-cast all planes. */ { float ray_dir[3]; -float ray_hit_best[2][3] = {{UNPACK3(kcd->prev.cage)}, {UNPACK3(kcd->curr.cage)}}; +float ray_hit_best[2][3] = {{UNPACK3(prev_os)}, {UNPACK3(curr_os)}}; float lambda_best[2] = {-FLT_MAX, FLT_MAX}; int i; @@ -401,20 +402,20 @@ static void knifetool_raycast_planes(const KnifeTool_OpData *kcd, float r_v1[3], float curr_cage_adjust[3]; float co_depth[3]; - copy_v3_v3(co_depth, kcd->prev.cage); + copy_v3_v3(co_depth, prev_os); mul_m4_v3(kcd->ob->obmat, co_depth); ED_view3d_win_to_3d(kcd->vc.v3d, kcd->region, co_depth, kcd->curr.mval, curr_cage_adjust); mul_m4_v3(kcd->ob_imat, curr_cage_adjust); - sub_v3_v3v3(ray_dir, curr_cage_adjust, kcd->prev.cage); + sub_v3_v3v3(ray_dir, curr_cage_adjust, prev_os); } #endif for (i = 0; i < 4; i++) { float ray_hit[3]; float lambda_test; - if (isect_ray_plane_v3(kcd->prev.cage, ray_dir, planes[i], _test, false)) { -madd_v3_v3v3fl(ray_hit, kcd->prev.cage, ray_dir, lambda_test); + if (isect_ray_plane_v3(prev_os, ray_dir, planes[i], _test, false)) { +madd_v3_v3v3fl(ray_hit, prev_os, ray_dir, lambda_test); if (lambda_test < 0.0f) { if (lambda_test > lambda_best[0]) { copy_v3_v3(ray_hit_best[0], ray_hit); @@ -432,6 +433,8 @@ static void knifetool_raycast_planes(const KnifeTool_OpData *kcd, float r_v1[3], copy_v3_v3(r_v1, ray_hit_best[0]); copy_v3_v3(r_v2, ray_hit_best[1]); +mul_m4_v3(kcd->ob->obmat, r_v1); +mul_m4_v3(kcd->ob->obmat, r_v2); } } @@ -514,13 +517,7 @@ static void knifetool_draw_visible_distances(const KnifeTool_OpData *kcd) const int distance_precision = 4; /* Calculate distance and convert to string. */ - float prev_cage_world[3]; - float curr_cage_world[3]; - copy_v3_v3(prev_cage_world, kcd->mdata.corr_prev_cage); - copy_v3_v3(curr_cage_world, kcd->curr.cage); - mul_m4_v3(kcd->ob->obmat, prev_cage_world); - mul_m4_v3(kcd->ob->obmat, curr_cage_world); - const float cut_len = len_v3v3(prev_cage_world, curr_cage_world); + const float cut_len = len_v3v3(kcd->mdata.corr_prev_cage, kcd->curr.cage); UnitSettings *unit = >scene->unit; if (unit->system == USER_UNIT_NONE) { @@ -736,7 +733,7 @@ static void knifetool_draw_visible_angles(const KnifeTool_OpData *kcd) if (min_angle > KNIFE_FLT_EPSBIG) { /* Last vertex in screen space. */ float end_ss[2]; - ED_view3d_project_float_v2_m4(kcd->region, end, end_ss, (float(*)[4])kcd->projmat); + ED_view3d_project_float_global(kcd->region, end, end_ss,
[Bf-blender-cvs] SVN commit: bf-blender [62694] trunk/lib/tests/io_tests: Updating .blend files for io tests to later version.
Revision: 62694 https://developer.blender.org/rBL62694 Author: howardt Date: 2021-09-11 19:40:56 +0200 (Sat, 11 Sep 2021) Log Message: --- Updating .blend files for io tests to later version. A later version of blender allows the use of C unit tests that read them. Getting ready for merging fast obj i/o and its new unit tests. Modified Paths: -- trunk/lib/tests/io_tests/blend_geometry/all_quads.blend trunk/lib/tests/io_tests/blend_geometry/all_tris.blend trunk/lib/tests/io_tests/blend_geometry/cube_all_data.blend trunk/lib/tests/io_tests/blend_geometry/edges.blend trunk/lib/tests/io_tests/blend_geometry/fgons.blend trunk/lib/tests/io_tests/blend_geometry/mixed_quads_and_tris.blend trunk/lib/tests/io_tests/blend_geometry/nurbs.blend trunk/lib/tests/io_tests/blend_geometry/suzanne_all_data.blend trunk/lib/tests/io_tests/blend_geometry/vertices.blend Added Paths: --- trunk/lib/tests/io_tests/blend_scene/all_curves.blend trunk/lib/tests/io_tests/obj/all_tris.mtl trunk/lib/tests/io_tests/obj/all_tris.obj Modified: trunk/lib/tests/io_tests/blend_geometry/all_quads.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/all_tris.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/cube_all_data.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/edges.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/fgons.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/mixed_quads_and_tris.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/nurbs.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/suzanne_all_data.blend === (Binary files differ) Modified: trunk/lib/tests/io_tests/blend_geometry/vertices.blend === (Binary files differ) Added: trunk/lib/tests/io_tests/blend_scene/all_curves.blend === (Binary files differ) Index: trunk/lib/tests/io_tests/blend_scene/all_curves.blend === --- trunk/lib/tests/io_tests/blend_scene/all_curves.blend 2021-09-06 08:07:16 UTC (rev 62693) +++ trunk/lib/tests/io_tests/blend_scene/all_curves.blend 2021-09-11 17:40:56 UTC (rev 62694) Property changes on: trunk/lib/tests/io_tests/blend_scene/all_curves.blend ___ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/lib/tests/io_tests/obj/all_tris.mtl === --- trunk/lib/tests/io_tests/obj/all_tris.mtl (rev 0) +++ trunk/lib/tests/io_tests/obj/all_tris.mtl 2021-09-11 17:40:56 UTC (rev 62694) @@ -0,0 +1,2 @@ +# Blender 3.0.0 Alpha MTL File: 'all_tris.blend' +# www.blender.org Added: trunk/lib/tests/io_tests/obj/all_tris.obj === --- trunk/lib/tests/io_tests/obj/all_tris.obj (rev 0) +++ trunk/lib/tests/io_tests/obj/all_tris.obj 2021-09-11 17:40:56 UTC (rev 62694) @@ -0,0 +1,58 @@ +# Blender 3.0.0 Alpha +# www.blender.org +mtllib all_tris.mtl +o Cube +v 1.00 -1.00 -1.00 +v 1.00 -1.00 1.00 +v -1.00 -1.00 1.00 +v -1.00 -1.00 -1.00 +v 1.00 1.00 -0.99 +v 0.99 1.00 1.01 +v -1.00 1.00 1.00 +v -1.00 1.00 -1.00 +vn 0.00 0.00 -1.00 +vn 0.00 0.00 -1.00 +vn -1.00 -0.00 -0.00 +vn -1.00 -0.00 -0.00 +vn -0.00 -0.00 1.00 +vn -0.00 0.00 1.00 +vn 1.00 -0.00 0.00 +vn 1.00 0.00 0.01 +vn 0.00 1.00 0.00 +vn 0.00 1.00 0.00 +vn 0.00 -1.00 0.00 +vn 0.00 -1.00 0.00 +vt 1.00 0.00 +vt 0.00 0.00 +vt 0.00 0.00 +vt 0.00 1.00 +vt 1.00 0.00 +vt 0.00 0.00 +vt 0.00 1.00 +vt 1.00 1.00 +vt 1.00 1.00 +vt 0.00 1.00 +vt 1.00 0.00 +vt 0.00 0.00 +vt 1.00 0.00 +vt 1.00 1.00 +vt 0.00 1.00 +vt 1.00 0.00 +vt 1.00
[Bf-blender-cvs] [c946fdb2e5f] master: Calm Warning: Unused Variable
Commit: c946fdb2e5fc1eab139f70f01ea4e673435455bd Author: Harley Acheson Date: Sat Sep 11 09:06:47 2021 -0700 Branches: master https://developer.blender.org/rBc946fdb2e5fc1eab139f70f01ea4e673435455bd Calm Warning: Unused Variable Calms warning for unused variable in `constraint_copy_to_selected_poll` by using UNUSED_VARS. See D12453 for further details Differential Revision: https://developer.blender.org/D12453 Reviewed by Campbell Barton === M source/blender/editors/object/object_constraint.c === diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index c46e868899c..8702b18a46f 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1786,7 +1786,8 @@ static bool constraint_copy_to_selected_poll(bContext *C) if (pchan) { bool found = false; -CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, chan, selected_pose_bones, Object *, UNUSED(ob)) { +CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, chan, selected_pose_bones, Object *, ob) { + UNUSED_VARS(ob); if (pchan != chan) { /** NOTE: Can not return here, because CTX_DATA_BEGIN_WITH_ID allocated * a list that needs to be freed by CTX_DATA_END. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [863460e5a5c] master: Compositor: Full frame previews
Commit: 863460e5a5cb196a8c6ca1050a2dbc1efd7957e0 Author: Manuel Castilla Date: Sat Sep 11 15:12:22 2021 +0200 Branches: master https://developer.blender.org/rB863460e5a5cb196a8c6ca1050a2dbc1efd7957e0 Compositor: Full frame previews Adds full frame implementation to PreviewOperation. Part of T88150. === M source/blender/compositor/operations/COM_PreviewOperation.cc M source/blender/compositor/operations/COM_PreviewOperation.h === diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cc b/source/blender/compositor/operations/COM_PreviewOperation.cc index e7c11613aa3..fa8b5ffcabf 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cc +++ b/source/blender/compositor/operations/COM_PreviewOperation.cc @@ -171,4 +171,43 @@ eCompositorPriority PreviewOperation::getRenderPriority() const return eCompositorPriority::Low; } +void PreviewOperation::get_area_of_interest(const int input_idx, +const rcti _area, +rcti _input_area) +{ + BLI_assert(input_idx == 0); + UNUSED_VARS_NDEBUG(input_idx); + + r_input_area.xmin = output_area.xmin / m_divider; + r_input_area.xmax = output_area.xmax / m_divider; + r_input_area.ymin = output_area.ymin / m_divider; + r_input_area.ymax = output_area.ymax / m_divider; +} + +void PreviewOperation::update_memory_buffer_partial(MemoryBuffer *UNUSED(output), +const rcti , +Span inputs) +{ + MemoryBuffer *input = inputs[0]; + struct ColormanageProcessor *cm_processor = IMB_colormanagement_display_processor_new( + m_viewSettings, m_displaySettings); + + rcti buffer_area; + BLI_rcti_init(_area, 0, this->getWidth(), 0, this->getHeight()); + BuffersIteratorBuilder it_builder( + m_outputBuffer, buffer_area, area, COM_data_type_num_channels(DataType::Color)); + + for (BuffersIterator it = it_builder.build(); !it.is_end(); ++it) { +const float rx = it.x / m_divider; +const float ry = it.y / m_divider; + +float color[4]; +input->read_elem_checked(rx, ry, color); +IMB_colormanagement_processor_apply_v4(cm_processor, color); +rgba_float_to_uchar(it.out, color); + } + + IMB_colormanagement_processor_free(cm_processor); +} + } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h index 0f43f01c5d6..05dae9c4dd8 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.h +++ b/source/blender/compositor/operations/COM_PreviewOperation.h @@ -20,13 +20,13 @@ #include "BKE_global.h" #include "BLI_rect.h" -#include "COM_NodeOperation.h" +#include "COM_MultiThreadedOperation.h" #include "DNA_color_types.h" #include "DNA_image_types.h" namespace blender::compositor { -class PreviewOperation : public NodeOperation { +class PreviewOperation : public MultiThreadedOperation { protected: unsigned char *m_outputBuffer; @@ -63,6 +63,11 @@ class PreviewOperation : public NodeOperation { bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override; + + void get_area_of_interest(int input_idx, const rcti _area, rcti _input_area) override; + void update_memory_buffer_partial(MemoryBuffer *output, +const rcti , +Span inputs) override; }; } // namespace blender::compositor ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cbe05edde59] master: Compositor: Fix crash when hashing unconnected operations
Commit: cbe05edde59637a3e5a34ca0794aef2ad56faae2 Author: Manuel Castilla Date: Sat Sep 11 15:11:59 2021 +0200 Branches: master https://developer.blender.org/rBcbe05edde59637a3e5a34ca0794aef2ad56faae2 Compositor: Fix crash when hashing unconnected operations It was causing some tests to fail when enabling Full Frame mode. === M source/blender/compositor/intern/COM_NodeOperation.cc === diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index a87485fd51c..3bbd1b22d60 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -63,6 +63,10 @@ std::optional NodeOperation::generate_hash() hash.parents_hash_ = 0; for (NodeOperationInput : m_inputs) { +if (!socket.isConnected()) { + continue; +} + NodeOperation = socket.getLink()->getOperation(); const bool is_constant = input.get_flags().is_constant_operation; combine_hashes(hash.parents_hash_, get_default_hash(is_constant)); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f7805eaeb58] temp-compositor-fixes: Compositor: Full frame previews
Commit: f7805eaeb58b85efa4a4d0df1d7253a566d018ac Author: Manuel Castilla Date: Sat Sep 11 15:12:22 2021 +0200 Branches: temp-compositor-fixes https://developer.blender.org/rBf7805eaeb58b85efa4a4d0df1d7253a566d018ac Compositor: Full frame previews Adds full frame implementation to PreviewOperation. Part of T88150. === M source/blender/compositor/operations/COM_PreviewOperation.cc M source/blender/compositor/operations/COM_PreviewOperation.h === diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cc b/source/blender/compositor/operations/COM_PreviewOperation.cc index e7c11613aa3..fa8b5ffcabf 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cc +++ b/source/blender/compositor/operations/COM_PreviewOperation.cc @@ -171,4 +171,43 @@ eCompositorPriority PreviewOperation::getRenderPriority() const return eCompositorPriority::Low; } +void PreviewOperation::get_area_of_interest(const int input_idx, +const rcti _area, +rcti _input_area) +{ + BLI_assert(input_idx == 0); + UNUSED_VARS_NDEBUG(input_idx); + + r_input_area.xmin = output_area.xmin / m_divider; + r_input_area.xmax = output_area.xmax / m_divider; + r_input_area.ymin = output_area.ymin / m_divider; + r_input_area.ymax = output_area.ymax / m_divider; +} + +void PreviewOperation::update_memory_buffer_partial(MemoryBuffer *UNUSED(output), +const rcti , +Span inputs) +{ + MemoryBuffer *input = inputs[0]; + struct ColormanageProcessor *cm_processor = IMB_colormanagement_display_processor_new( + m_viewSettings, m_displaySettings); + + rcti buffer_area; + BLI_rcti_init(_area, 0, this->getWidth(), 0, this->getHeight()); + BuffersIteratorBuilder it_builder( + m_outputBuffer, buffer_area, area, COM_data_type_num_channels(DataType::Color)); + + for (BuffersIterator it = it_builder.build(); !it.is_end(); ++it) { +const float rx = it.x / m_divider; +const float ry = it.y / m_divider; + +float color[4]; +input->read_elem_checked(rx, ry, color); +IMB_colormanagement_processor_apply_v4(cm_processor, color); +rgba_float_to_uchar(it.out, color); + } + + IMB_colormanagement_processor_free(cm_processor); +} + } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h index 0f43f01c5d6..05dae9c4dd8 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.h +++ b/source/blender/compositor/operations/COM_PreviewOperation.h @@ -20,13 +20,13 @@ #include "BKE_global.h" #include "BLI_rect.h" -#include "COM_NodeOperation.h" +#include "COM_MultiThreadedOperation.h" #include "DNA_color_types.h" #include "DNA_image_types.h" namespace blender::compositor { -class PreviewOperation : public NodeOperation { +class PreviewOperation : public MultiThreadedOperation { protected: unsigned char *m_outputBuffer; @@ -63,6 +63,11 @@ class PreviewOperation : public NodeOperation { bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override; + + void get_area_of_interest(int input_idx, const rcti _area, rcti _input_area) override; + void update_memory_buffer_partial(MemoryBuffer *output, +const rcti , +Span inputs) override; }; } // namespace blender::compositor ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0a829a811e0] temp-compositor-fixes: Compositor: Fix crash when hashing unconnected operations
Commit: 0a829a811e0a9bf466712e919648c7f388891057 Author: Manuel Castilla Date: Sat Sep 11 15:11:59 2021 +0200 Branches: temp-compositor-fixes https://developer.blender.org/rB0a829a811e0a9bf466712e919648c7f388891057 Compositor: Fix crash when hashing unconnected operations It was causing some tests to fail when enabling Full Frame mode. === M source/blender/compositor/intern/COM_NodeOperation.cc === diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index a87485fd51c..3bbd1b22d60 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -63,6 +63,10 @@ std::optional NodeOperation::generate_hash() hash.parents_hash_ = 0; for (NodeOperationInput : m_inputs) { +if (!socket.isConnected()) { + continue; +} + NodeOperation = socket.getLink()->getOperation(); const bool is_constant = input.get_flags().is_constant_operation; combine_hashes(hash.parents_hash_, get_default_hash(is_constant)); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a460e4e9d8b] temp-lineart-contained: LineArt: Cleanup trimming patch.
Commit: a460e4e9d8b8c8a62f2c5070df5fc7daf50187db Author: YimingWu Date: Sat Sep 11 19:23:51 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rBa460e4e9d8b8c8a62f2c5070df5fc7daf50187db LineArt: Cleanup trimming patch. === M release/datafiles/locale M release/scripts/addons M release/scripts/addons_contrib M source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c M source/tools === diff --git a/release/datafiles/locale b/release/datafiles/locale index 4833954c0ac..62e82958a76 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 4833954c0ac85cc407e1d5a153aa11b1d1823ec0 +Subproject commit 62e82958a760dad775d9b3387d7fb535fd6de4c6 diff --git a/release/scripts/addons b/release/scripts/addons index f86f25e6221..4475cbd11a6 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit f86f25e62217264495d05f116ccb09d575fe9841 +Subproject commit 4475cbd11a636382d57571e0f5dfeff1f90bd6b7 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 5a82baad9f9..788441f2930 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 5a82baad9f986722104280e8354a4427d8e9eab1 +Subproject commit 788441f2930465bbfba8f0797b12dcef1d46694d diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c index e9afc88813d..3088d54359f 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c @@ -1015,20 +1015,21 @@ static LineartEdgeChainItem *lineart_chain_create_crossing_point(LineartRenderBu LineartEdgeChainItem *eci_outside) { float isec[2]; - float LU[2] = {-1.0f, 1.0f}, LB[2] = {-1.0f, -1.0f}, RU[2] = {1.0f, 1.0f}, RB[2] = {1.0f, -1.0f}; + float ref_lu[2] = {-1.0f, 1.0f}, ref_lb[2] = {-1.0f, -1.0f}, ref_ru[2] = {1.0f, 1.0f}, +ref_rb[2] = {1.0f, -1.0f}; bool found = false; LineartEdgeChainItem *eci2 = eci_outside, *eci1 = eci_inside; if (eci2->pos[0] < -1.0f) { -found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, LU, LB, isec) > 0); +found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, ref_lu, ref_lb, isec) > 0); } if (!found && eci2->pos[0] > 1.0f) { -found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, RU, RB, isec) > 0); +found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, ref_ru, ref_rb, isec) > 0); } if (!found && eci2->pos[1] < -1.0f) { -found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, LB, RB, isec) > 0); +found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, ref_lb, ref_rb, isec) > 0); } if (!found && eci2->pos[1] > 1.0f) { -found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, LU, RU, isec) > 0); +found = (isect_seg_seg_v2_point(eci1->pos, eci2->pos, ref_lu, ref_ru, isec) > 0); } if (UNLIKELY(!found)) { diff --git a/source/tools b/source/tools index 01f51a0e551..c8579c5cf43 16 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit 01f51a0e551ab730f0934dc6488613690ac4bf8f +Subproject commit c8579c5cf43229843df505da9644b5b0b7201974 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7ae3b3abf8c] temp-lineart-contained: LineArt: Cleanup smooth patch.
Commit: 7ae3b3abf8cd84947b38d3b54c43b234a3876ff8 Author: YimingWu Date: Sat Sep 11 19:07:06 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rB7ae3b3abf8cd84947b38d3b54c43b234a3876ff8 LineArt: Cleanup smooth patch. === M source/blender/makesdna/DNA_gpencil_modifier_types.h M source/blender/makesdna/DNA_gpencil_types.h M source/blender/makesrna/intern/rna_gpencil_modifier.c === diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index aa37c97a33a..6c4dc8a5119 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -990,7 +990,7 @@ typedef struct LineartGpencilModifierData { /** `0..PI` angle, for splitting strokes at sharp points. */ float angle_splitting_threshold; - /** Strength for smoothing jagged chains */ + /** Strength for smoothing jagged chains. */ float chain_smooth_tolerance; /* CPU mode */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 68bd2961f23..0f570f8603d 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -49,6 +49,8 @@ struct MDeformVert; #define GPENCIL_MIN_FILL_FAC 0.05f #define GPENCIL_MAX_FILL_FAC 8.0f +#define GPENCIL_MAX_THICKNESS 5000 + /* * */ /* GP Stroke Points */ diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 54309afdb18..38de0dcf1b8 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -26,6 +26,7 @@ #include "DNA_brush_types.h" #include "DNA_cachefile_types.h" #include "DNA_gpencil_modifier_types.h" +#include "DNA_gpencil_types.h" #include "DNA_mesh_types.h" #include "DNA_object_force_types.h" #include "DNA_object_types.h" @@ -3209,8 +3210,7 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna) prop = RNA_def_property(srna, "thickness", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Thickness", "The thickness for the generated strokes"); RNA_def_property_ui_range(prop, 1, 100, 1, 1); - /* GPencil internal limit, use hard coded value for now until we have a marco. */ - RNA_def_property_range(prop, 1, 5000); + RNA_def_property_range(prop, 1, GPENCIL_MAX_THICKNESS); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_FACTOR); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4e78b89e487] master: Geometry Nodes: add field support for socket inspection
Commit: 4e78b89e487e9b9707d583c6b2578ad122c59d5e Author: Jacques Lucke Date: Sat Sep 11 13:05:20 2021 +0200 Branches: master https://developer.blender.org/rB4e78b89e487e9b9707d583c6b2578ad122c59d5e Geometry Nodes: add field support for socket inspection Since fields were committed to master, socket inspection did not work correctly for all socket types anymore. Now the same functionality as before is back. Furthermore, fields that depend on some input will now show the inputs in the socket inspection. I added support for evaluating constant fields more immediately. This has the benefit that the same constant field is not evaluated more than once. It also helps with making the field independent of the multi-functions that it uses. We might still want to change the ownership handling for the multi-functions of nodes a bit, but that can be done separately. Differential Revision: https://developer.blender.org/D12444 === M source/blender/blenkernel/BKE_geometry_set.hh M source/blender/blenkernel/intern/attribute_access.cc M source/blender/editors/space_node/node_draw.cc M source/blender/functions/FN_field.hh M source/blender/functions/FN_multi_function_builder.hh M source/blender/functions/intern/field.cc M source/blender/functions/intern/multi_function_builder.cc M source/blender/functions/tests/FN_multi_function_test.cc M source/blender/modifiers/intern/MOD_nodes_evaluator.cc === diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index c3d594d7dcd..3da35cb4fe1 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -657,10 +657,17 @@ class AttributeFieldInput : public fn::FieldInput { { } + StringRefNull attribute_name() const + { +return name_; + } + const GVArray *get_varray_for_context(const fn::FieldContext , IndexMask mask, ResourceScope ) const override; + std::string socket_inspection_name() const override; + uint64_t hash() const override; bool is_equal_to(const fn::FieldNode ) const override; }; @@ -683,6 +690,8 @@ class AnonymousAttributeFieldInput : public fn::FieldInput { IndexMask mask, ResourceScope ) const override; + std::string socket_inspection_name() const override; + uint64_t hash() const override; bool is_equal_to(const fn::FieldNode ) const override; }; diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index 08bd5dc5981..2a5bb99a18b 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -32,6 +32,8 @@ #include "BLI_float2.hh" #include "BLI_span.hh" +#include "BLT_translation.h" + #include "CLG_log.h" #include "NOD_type_conversions.hh" @@ -1318,6 +1320,13 @@ const GVArray *AttributeFieldInput::get_varray_for_context(const fn::FieldContex return nullptr; } +std::string AttributeFieldInput::socket_inspection_name() const +{ + std::stringstream ss; + ss << TIP_("Attribute: ") << name_; + return ss.str(); +} + uint64_t AttributeFieldInput::hash() const { return get_default_hash_2(name_, type_); @@ -1346,6 +1355,13 @@ const GVArray *AnonymousAttributeFieldInput::get_varray_for_context( return nullptr; } +std::string AnonymousAttributeFieldInput::socket_inspection_name() const +{ + std::stringstream ss; + ss << TIP_("Anonymous Attribute: ") << debug_name_; + return ss.str(); +} + uint64_t AnonymousAttributeFieldInput::hash() const { return get_default_hash_2(anonymous_id_.get(), type_); diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 5b4e3b3b6f5..aa241071425 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -41,10 +41,12 @@ #include "BLI_span.hh" #include "BLI_string_ref.hh" #include "BLI_vector.hh" +#include "BLI_vector_set.hh" #include "BLT_translation.h" #include "BKE_context.h" +#include "BKE_geometry_set.hh" #include "BKE_idtype.h" #include "BKE_lib_id.h" #include "BKE_main.h" @@ -78,6 +80,8 @@ #include "NOD_geometry_nodes_eval_log.hh" +#include "FN_field_cpp_type.hh" + #include "node_intern.h" /* own include */ #ifdef WITH_COMPOSITOR @@ -88,7 +92,11 @@ using blender::Map; using blender::Set; using blender::Span; using blender::Vector; +using blender::VectorSet; using blender::fn::CPPType; +using blender::fn::FieldCPPType; +using blender::fn::FieldInput; +using blender::fn::GField; using blender::fn::GPointer; namespace geo_log =
[Bf-blender-cvs] [166c8be7ac0] master: Cleanup: use nullptr
Commit: 166c8be7ac018c461514453b9947a23b7ac2ef26 Author: Jacques Lucke Date: Sat Sep 11 12:41:46 2021 +0200 Branches: master https://developer.blender.org/rB166c8be7ac018c461514453b9947a23b7ac2ef26 Cleanup: use nullptr === M source/blender/functions/intern/multi_function_procedure.cc M source/blender/io/alembic/intern/abc_reader_mesh.cc === diff --git a/source/blender/functions/intern/multi_function_procedure.cc b/source/blender/functions/intern/multi_function_procedure.cc index e024cee79c8..2aa760a494f 100644 --- a/source/blender/functions/intern/multi_function_procedure.cc +++ b/source/blender/functions/intern/multi_function_procedure.cc @@ -242,7 +242,7 @@ void MFProcedure::add_parameter(MFParamType::InterfaceType interface_type, MFVar void MFProcedure::set_entry(MFInstruction ) { - if (entry_ != NULL) { + if (entry_ != nullptr) { entry_->prev_.remove_first_occurrence_and_reorder(MFInstructionCursor::ForEntry()); } entry_ = diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index dbccc8f2851..eab94139f55 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -457,7 +457,7 @@ static void read_velocity(const V3fArraySamplePtr , const float velocity_scale) { CustomDataLayer *velocity_layer = BKE_id_attribute_new( - >id, "velocity", CD_PROP_FLOAT3, ATTR_DOMAIN_POINT, NULL); + >id, "velocity", CD_PROP_FLOAT3, ATTR_DOMAIN_POINT, nullptr); float(*velocity)[3] = (float(*)[3])velocity_layer->data; const int num_velocity_vectors = static_cast(velocities->size()); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [29deaaee007] soc-2021-uv-edge-select-support: Fix: Deselecting edges in sticky vertex mode
Commit: 29deaaee007faaa9a42a73d29dc1b15f330e745b Author: Siddhartha Jejurkar Date: Sat Sep 11 15:25:40 2021 +0530 Branches: soc-2021-uv-edge-select-support https://developer.blender.org/rB29deaaee007faaa9a42a73d29dc1b15f330e745b Fix: Deselecting edges in sticky vertex mode Fixes the bug where deselecting an UV edge in sticky vertex mode would deselect the UV vertices as well. === M source/blender/editors/uvedit/uvedit_select.c === diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index 98fa6753b61..14480acff9f 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -457,12 +457,24 @@ void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, if (uvedit_face_visible_test(scene, l_radial_iter->f)) { uvedit_edge_select_set(scene, em, l_radial_iter, select, do_history, cd_loop_uv_offset); - uvedit_uv_select_shared_location( - scene, em, l_radial_iter, select, false, do_history, cd_loop_uv_offset); - uvedit_uv_select_shared_location( - scene, em, l_radial_iter->next, select, false, do_history, cd_loop_uv_offset); + if (select) { +uvedit_uv_select_shared_location( +scene, em, l_radial_iter, select, false, do_history, cd_loop_uv_offset); +uvedit_uv_select_shared_location( +scene, em, l_radial_iter->next, select, false, do_history, cd_loop_uv_offset); + } + else { +if (!uvedit_vert_is_any_other_edge_selected(scene, l_radial_iter, cd_loop_uv_offset)) { + uvedit_uv_select_shared_location( + scene, em, l_radial_iter, select, false, do_history, cd_loop_uv_offset); +} +if (!uvedit_vert_is_any_other_edge_selected( +scene, l_radial_iter->next, cd_loop_uv_offset)) { + uvedit_uv_select_shared_location( + scene, em, l_radial_iter->next, select, false, do_history, cd_loop_uv_offset); +} + } } - } while ((l_radial_iter = l_radial_iter->radial_next) != l); break; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aeeffb935e9] master: Functions: store cursors to previous instructions
Commit: aeeffb935e9406fa2cdcb84828aa0e498b2df664 Author: Jacques Lucke Date: Sat Sep 11 11:43:59 2021 +0200 Branches: master https://developer.blender.org/rBaeeffb935e9406fa2cdcb84828aa0e498b2df664 Functions: store cursors to previous instructions Now an instruction knows the cursors where it is inserted instead of just the instruction that references it. This has two benefits: * An instruction knows when it is the entry instruction. * The cursor can contain more information, e.g. if it is linked to the true or false branch of a branch instruction. This also simplifies updating the procedure in future optimization passes. === M source/blender/functions/FN_multi_function_procedure.hh M source/blender/functions/FN_multi_function_procedure_builder.hh M source/blender/functions/intern/multi_function_procedure.cc M source/blender/functions/intern/multi_function_procedure_builder.cc === diff --git a/source/blender/functions/FN_multi_function_procedure.hh b/source/blender/functions/FN_multi_function_procedure.hh index 62f2292c1d9..4c06ce98ee3 100644 --- a/source/blender/functions/FN_multi_function_procedure.hh +++ b/source/blender/functions/FN_multi_function_procedure.hh @@ -42,6 +42,55 @@ enum class MFInstructionType { Return, }; +/** + * An #MFInstructionCursor points to a position in a multi-function procedure, where an instruction + * can be inserted. + */ +class MFInstructionCursor { + public: + enum Type { +None, +Entry, +Call, +Destruct, +Branch, +Dummy, + }; + + private: + Type type_ = None; + MFInstruction *instruction_ = nullptr; + /* Only used when it is a branch instruction. */ + bool branch_output_ = false; + + public: + MFInstructionCursor() = default; + MFInstructionCursor(MFCallInstruction ); + MFInstructionCursor(MFDestructInstruction ); + MFInstructionCursor(MFBranchInstruction , bool branch_output); + MFInstructionCursor(MFDummyInstruction ); + + static MFInstructionCursor ForEntry(); + + MFInstruction *next(MFProcedure ) const; + void set_next(MFProcedure , MFInstruction *new_instruction) const; + + MFInstruction *instruction() const; + + Type type() const; + + friend bool operator==(const MFInstructionCursor , const MFInstructionCursor ) + { +return a.type_ == b.type_ && a.instruction_ == b.instruction_ && + a.branch_output_ == b.branch_output_; + } + + friend bool operator!=(const MFInstructionCursor , const MFInstructionCursor ) + { +return !(a == b); + } +}; + /** * A variable is similar to a virtual register in other libraries. During evaluation, every is * either uninitialized or contains a value for every index (remember, a multi-function procedure @@ -73,7 +122,7 @@ class MFVariable : NonCopyable, NonMovable { class MFInstruction : NonCopyable, NonMovable { protected: MFInstructionType type_; - Vector prev_; + Vector prev_; friend MFProcedure; friend MFCallInstruction; @@ -89,8 +138,7 @@ class MFInstruction : NonCopyable, NonMovable { * Other instructions that come before this instruction. There can be multiple previous * instructions when branching is used in the procedure. */ - Span prev(); - Span prev() const; + Span prev() const; }; /** @@ -275,6 +323,50 @@ using MFDestructInstruction = fn::MFDestructInstruction; using MFProcedure = fn::MFProcedure; } // namespace multi_function_procedure_types +/* + * MFInstructionCursor inline methods. + */ + +inline MFInstructionCursor::MFInstructionCursor(MFCallInstruction ) +: type_(Call), instruction_() +{ +} + +inline MFInstructionCursor::MFInstructionCursor(MFDestructInstruction ) +: type_(Destruct), instruction_() +{ +} + +inline MFInstructionCursor::MFInstructionCursor(MFBranchInstruction , +bool branch_output) +: type_(Branch), instruction_(), branch_output_(branch_output) +{ +} + +inline MFInstructionCursor::MFInstructionCursor(MFDummyInstruction ) +: type_(Dummy), instruction_() +{ +} + +inline MFInstructionCursor MFInstructionCursor::ForEntry() +{ + MFInstructionCursor cursor; + cursor.type_ = Type::Entry; + return cursor; +} + +inline MFInstruction *MFInstructionCursor::instruction() const +{ + /* This isn't really const correct unfortunately, because to make it correct we'll need a const + * version of #MFInstructionCursor. */ + return instruction_; +} + +inline MFInstructionCursor::Type MFInstructionCursor::type() const +{ + return type_; +} + /* * MFVariable inline methods. */ @@ -308,12 +400,7 @@ inline MFInstructionType MFInstruction::type() const return type_; } -inline Span MFInstruction::prev() -{ - return prev_; -} -
[Bf-blender-cvs] [62c2b377fd2] temp-lineart-contained: LineArt: Better smoothing algo.
Commit: 62c2b377fd26e255c340a89695ae6c9a4c63fc7a Author: YimingWu Date: Sat Sep 11 17:13:45 2021 +0800 Branches: temp-lineart-contained https://developer.blender.org/rB62c2b377fd26e255c340a89695ae6c9a4c63fc7a LineArt: Better smoothing algo. === M release/datafiles/locale M release/scripts/addons M release/scripts/addons_contrib M source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h M source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c M source/blender/makesdna/DNA_gpencil_modifier_defaults.h M source/tools === diff --git a/release/datafiles/locale b/release/datafiles/locale index 8a05b618f03..4833954c0ac 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 8a05b618f031582c006c6f62b9e60619ab3eef8b +Subproject commit 4833954c0ac85cc407e1d5a153aa11b1d1823ec0 diff --git a/release/scripts/addons b/release/scripts/addons index 67f1fbca148..f86f25e6221 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 67f1fbca1482d9d9362a4001332e785c3fd5d230 +Subproject commit f86f25e62217264495d05f116ccb09d575fe9841 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index ef6ef414d22..5a82baad9f9 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit ef6ef414d22c2578fad99327743b925ab640a99c +Subproject commit 5a82baad9f986722104280e8354a4427d8e9eab1 diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h index 6f01e3a2fa8..a5860698cba 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h +++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h @@ -174,6 +174,8 @@ typedef struct LineartEdgeChain { /** Chain now only contains one type of segments */ int type; + /** Will only connect chains that has the same loop id. */ + int loop_id; unsigned char material_mask_bits; unsigned char intersection_mask; diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c index e798477d70b..e9afc88813d 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c @@ -582,9 +582,14 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb) rb->chains.last = rb->chains.first = NULL; + int loop_id = 0; while ((ec = BLI_pophead()) != NULL) { ec->next = ec->prev = NULL; BLI_addtail(>chains, ec); + +ec->loop_id = loop_id; +loop_id++; + LineartEdgeChainItem *first_eci = (LineartEdgeChainItem *)ec->chain.first; int fixed_occ = first_eci->occlusion; unsigned char fixed_mask = first_eci->material_mask_bits; @@ -609,6 +614,7 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb) new_ec = lineart_chain_create(rb); new_ec->chain.first = eci; new_ec->chain.last = ec->chain.last; +new_ec->loop_id = loop_id; ec->chain.last = eci->prev; ((LineartEdgeChainItem *)ec->chain.last)->next = 0; eci->prev = 0; @@ -699,6 +705,7 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartRenderBuf int occlusion, unsigned char material_mask_bits, unsigned char isec_mask, +int loop_id, float dist, float *result_new_len, LineartBoundingArea *caller_ba) @@ -747,7 +754,10 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartRenderBuf float new_len = rb->use_geometry_space_chain ? len_v3v3(cre->eci->gpos, eci->gpos) : len_v2v2(cre->eci->pos, eci->pos); -if (new_len < dist) { +/* If the vertex is not from the same contour loop, then we tighten up the range, this way we + * could chain small loops better and later smooth out. */ +if (((cre->ec->loop_id == loop_id) && (new_len < dist)) || +((cre->ec->loop_id != loop_id) && (new_len < dist / 10))) { closest_cre = cre; dist = new_len; if (result_new_len) { @@ -771,6 +781,7 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartRenderBuf occlusion, \
[Bf-blender-cvs] [d7dc751a942] soc-2021-simulation-display: Fix memory leak in non primitive collision shape
Commit: d7dc751a9426a5bce0c4f50b62bed47bd1da85c5 Author: soumya pochiraju Date: Sat Sep 11 11:57:40 2021 +0530 Branches: soc-2021-simulation-display https://developer.blender.org/rBd7dc751a9426a5bce0c4f50b62bed47bd1da85c5 Fix memory leak in non primitive collision shape - The previous commit didn't fix the leak as the mesh data was not being freed every draw call - Now the mesh is generated during evaluation along with the physics shape. - The collisions shape draw data mesh is stored in the shared struct, along with the physics references === M source/blender/blenkernel/intern/rigidbody.c M source/blender/draw/engines/overlay/overlay_extra.c M source/blender/draw/intern/draw_cache.c M source/blender/makesdna/DNA_rigidbody_types.h === diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index d0e86c193dc..56caf7e1ec2 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -201,11 +201,10 @@ void BKE_rigidbody_free_object(Object *ob, RigidBodyWorld *rbw) rbo->shared->physics_shape = NULL; } -if (rbo->col_shape_draw_data) { -BKE_mesh_free(rbo->col_shape_draw_data); -BKE_id_free(NULL, rbo->col_shape_draw_data); - // MEM_freeN(rbo->col_shape_draw_data); -rbo->col_shape_draw_data = NULL; +if (rbo->shared->col_shape_draw_data) { +BKE_mesh_free(rbo->shared->col_shape_draw_data); +BKE_id_free(NULL, rbo->shared->col_shape_draw_data); +rbo->shared->col_shape_draw_data = NULL; } MEM_freeN(rbo->shared); @@ -639,13 +638,19 @@ static void rigidbody_validate_sim_shape(RigidBodyWorld *rbw, Object *ob, bool r RB_shape_delete(rbo->shared->physics_shape); } /* Delete old debug drawing mesh data if it exists. */ -if (rbo->col_shape_draw_data) { -BKE_mesh_free(rbo->col_shape_draw_data); -BKE_id_free(NULL, rbo->col_shape_draw_data); - // MEM_freeN(rbo->col_shape_draw_data); -rbo->col_shape_draw_data = NULL; +if (rbo->shared->col_shape_draw_data) { +BKE_mesh_free(rbo->shared->col_shape_draw_data); +BKE_id_free(NULL, rbo->shared->col_shape_draw_data); +rbo->shared->col_shape_draw_data = NULL; } rbo->shared->physics_shape = new_shape; + +if(rbo->shape == RB_SHAPE_CONVEXH) { +BKE_rigidbody_store_convex_hull_draw_data(ob); +} +if(rbo->shape == RB_SHAPE_TRIMESH) { +BKE_rigidbody_store_trimesh_draw_data(ob); +} } } @@ -1320,7 +1325,7 @@ RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type) zero_v3(rbo->pvel); zero_v3(rbo->vel); - rbo->col_shape_draw_data = NULL; + rbo->shared->col_shape_draw_data = NULL; /* use triangle meshes for passive objects * use convex hulls for active objects since dynamic triangle meshes are very unstable @@ -2620,7 +2625,7 @@ void BKE_rigidbody_store_convex_hull_draw_data(Object *ob) { } MEM_freeN(mloop_src); plConvexHullDelete(hull); -ob->rigidbody_object->col_shape_draw_data = hull_draw_data; +ob->rigidbody_object->shared->col_shape_draw_data = hull_draw_data; } @@ -2665,7 +2670,7 @@ void BKE_rigidbody_store_trimesh_draw_data(Object *ob) { BKE_mesh_convert_mfaces_to_mpolys(trimesh_draw_data); BKE_mesh_calc_edges(trimesh_draw_data, false, false); -ob->rigidbody_object->col_shape_draw_data = trimesh_draw_data; +ob->rigidbody_object->shared->col_shape_draw_data = trimesh_draw_data; } diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index 9a48ac3a39f..cad9247ef17 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -373,20 +373,14 @@ static void OVERLAY_non_primitive_collision_shape(OVERLAY_ExtraCallBuffers *cb, { if(ob->rigidbody_object){ - if(ob->rigidbody_object->col_shape_draw_data == NULL) { - switch(ob->rigidbody_object->shape) { -case RB_SHAPE_CONVEXH: - BKE_rigidbody_store_convex_hull_draw_data(ob); - break; -case RB_SHAPE_TRIMESH: - BKE_rigidbody_store_trimesh_draw_data(ob); - break; - } - DRW_cache_non_primitive_col_shape_store_ob(ob); + if(ob->rigidbody_object->shared->col_shape_draw_data == NULL) { + } - GPUBatch *geom = DRW_cache_non_primitive_col_shape_get(ob); - if(geom){ - OVERLAY_extra_wire(cb, geom, ob->obmat, color); + else { +GPUBatch *geom = DRW_cache_non_primitive_col_shape_get(ob); +if(geom){ +