[Bf-blender-cvs] [745ff852f54] gsoc-2021-porting-modifiers-to-nodes-solidify: Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-solidify
Commit: 745ff852f546ca4f0b23b083ac6f467910fd3eef Author: Fabian Schempp Date: Fri Aug 6 07:58:14 2021 +0200 Branches: gsoc-2021-porting-modifiers-to-nodes-solidify https://developer.blender.org/rB745ff852f546ca4f0b23b083ac6f467910fd3eef Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-solidify # Conflicts: # source/blender/blenkernel/BKE_node.h # source/blender/geometry/intern/solidify_nonmanifold.c # source/blender/nodes/NOD_static_types.h === === diff --cc source/blender/blenkernel/BKE_node.h index 3e28a44d4bb,caa7ab6de0a..54d3b80fb5c --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@@ -1459,7 -1473,10 +1473,11 @@@ int ntreeTexExecTree(struct bNodeTree * #define GEO_NODE_CURVE_PRIMITIVE_LINE 1068 #define GEO_NODE_CURVE_ENDPOINTS 1069 #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070 - #define GEO_NODE_SOLIDIFY 1071 + #define GEO_NODE_CURVE_TRIM 1071 + #define GEO_NODE_CURVE_SET_HANDLES 1072 + #define GEO_NODE_CURVE_SPLINE_TYPE 1073 + #define GEO_NODE_CURVE_SELECT_HANDLES 1074 ++#define GEO_NODE_SOLIDIFY 1075 /** \} */ diff --cc source/blender/blenkernel/intern/node.cc index 2c56d34586b,4aec5a9e667..a52f4f020d5 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@@ -5147,9 -5181,9 +5181,10 @@@ static void registerGeometryNodes( register_node_type_geo_points_to_volume(); register_node_type_geo_raycast(); register_node_type_geo_sample_texture(); + register_node_type_geo_select_by_handle_type(); register_node_type_geo_select_by_material(); register_node_type_geo_separate_components(); + register_node_type_geo_solidify(); register_node_type_geo_subdivision_surface(); register_node_type_geo_switch(); register_node_type_geo_transform(); diff --cc source/blender/nodes/NOD_geometry.h index 63f6d289342,856d787c8d0..2dcc64b1d4d --- a/source/blender/nodes/NOD_geometry.h +++ b/source/blender/nodes/NOD_geometry.h @@@ -92,9 -95,9 +95,10 @@@ void register_node_type_geo_point_trans void register_node_type_geo_points_to_volume(void); void register_node_type_geo_raycast(void); void register_node_type_geo_sample_texture(void); + void register_node_type_geo_select_by_handle_type(void); void register_node_type_geo_select_by_material(void); void register_node_type_geo_separate_components(void); +void register_node_type_geo_solidify(void); void register_node_type_geo_subdivision_surface(void); void register_node_type_geo_switch(void); void register_node_type_geo_transform(void); diff --cc source/blender/nodes/NOD_static_types.h index 6417e9f87b3,3852819746e..33ff92dbff8 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@@ -332,8 -337,6 +337,7 @@@ DefNode(GeometryNode, GEO_NODE_POINTS_T DefNode(GeometryNode, GEO_NODE_RAYCAST, def_geo_raycast, "RAYCAST", Raycast, "Raycast", "") DefNode(GeometryNode, GEO_NODE_SELECT_BY_MATERIAL, 0, "SELECT_BY_MATERIAL", SelectByMaterial, "Select by Material", "") DefNode(GeometryNode, GEO_NODE_SEPARATE_COMPONENTS, 0, "SEPARATE_COMPONENTS", SeparateComponents, "Separate Components", "") - DefNode(GeometryNode, GEO_NODE_MESH_SUBDIVIDE, 0, "MESH_SUBDIVIDE", MeshSubdivide, "Mesh Subdivide", "") +DefNode(GeometryNode, GEO_NODE_SOLIDIFY, def_geo_solidify, "SOLIDIFY", Solidify, "Solidify", "") DefNode(GeometryNode, GEO_NODE_SUBDIVISION_SURFACE, 0, "SUBDIVISION_SURFACE", SubdivisionSurface, "Subdivision Surface", "") DefNode(GeometryNode, GEO_NODE_SWITCH, def_geo_switch, "SWITCH", Switch, "Switch", "") DefNode(GeometryNode, GEO_NODE_TRANSFORM, 0, "TRANSFORM", Transform, "Transform", "") ___ 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] [a7dc3d1e902] soc-2021-porting-modifiers-to-nodes-extrude: Merge remote-tracking branch 'origin/soc-2021-porting-modifiers-to-nodes-extrude' into soc-2021-porting-modifiers-to-nodes-e
Commit: a7dc3d1e902f9725a2504dc77bc4d29cb48a0033 Author: Fabian Schempp Date: Fri Aug 6 07:53:56 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rBa7dc3d1e902f9725a2504dc77bc4d29cb48a0033 Merge remote-tracking branch 'origin/soc-2021-porting-modifiers-to-nodes-extrude' into soc-2021-porting-modifiers-to-nodes-extrude === === ___ 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] [6fd836f53b0] soc-2021-porting-modifiers-to-nodes-extrude: Merged Master
Commit: 6fd836f53b0b6914933ce60b6649f5981519fe98 Author: Fabian Schempp Date: Thu Aug 5 23:50:08 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rB6fd836f53b0b6914933ce60b6649f5981519fe98 Merged Master === === diff --cc source/blender/blenkernel/BKE_node.h index 73921f3e61d,084ec20c172..bfa3c58cbe2 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@@ -1475,7 -1475,7 +1475,8 @@@ int ntreeTexExecTree(struct bNodeTree * #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070 #define GEO_NODE_CURVE_TRIM 1071 #define GEO_NODE_CURVE_SET_HANDLES 1072 - #define GEO_NODE_EXTRUDE 1073 + #define GEO_NODE_CURVE_SPLINE_TYPE 1073 ++#define GEO_NODE_EXTRUDE 1074 /** \} */ diff --cc source/blender/bmesh/operators/bmo_inset.c index b02a3e8652f,4833290aa0b..23d63bbe5ab --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@@ -1121,13 -1096,7 +1121,12 @@@ void bmo_inset_region_exec(BMesh *bm, B } /* apply the offset */ -madd_v3_v3fl(v_split->co, tvec, thickness); +if (use_attributes) { - printf("index: %i\n", v_split->head.index); + madd_v3_v3fl(v_split->co, tvec, thickness_array[v_split->head.index]); +} +else { + madd_v3_v3fl(v_split->co, tvec, thickness); +} } /* this saves expensive/slow glue check for common cases */ ___ 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] [bc97d783290] master: Cleanup: use MEM_SAFE_FREE macro
Commit: bc97d7832906318a1185b3fb460b1d8d89020ba0 Author: Campbell Barton Date: Fri Aug 6 13:59:38 2021 +1000 Branches: master https://developer.blender.org/rBbc97d7832906318a1185b3fb460b1d8d89020ba0 Cleanup: use MEM_SAFE_FREE macro === M source/blender/blenkernel/intern/boids.c M source/blender/blenkernel/intern/brush.c M source/blender/blenkernel/intern/cloth.c M source/blender/blenkernel/intern/colortools.c M source/blender/blenkernel/intern/curve.c M source/blender/blenkernel/intern/customdata.c M source/blender/blenkernel/intern/deform.c M source/blender/blenkernel/intern/dynamicpaint.c M source/blender/blenkernel/intern/fluid.c M source/blender/blenkernel/intern/mesh.c M source/blender/blenkernel/intern/multires.c M source/blender/blenkernel/intern/object.c M source/blender/blenkernel/intern/object_deform.c M source/blender/blenkernel/intern/particle.c M source/blender/blenkernel/intern/particle_system.c M source/blender/blenkernel/intern/softbody.c M source/blender/blenkernel/intern/text_suggestions.c M source/blender/blenkernel/intern/texture.c M source/blender/blentranslation/intern/blt_lang.c M source/blender/editors/animation/fmodifier_ui.c M source/blender/editors/animation/keyframes_general.c M source/blender/editors/armature/meshlaplacian.c M source/blender/editors/curve/editcurve.c M source/blender/editors/gpencil/gpencil_convert.c M source/blender/editors/gpencil/gpencil_sculpt_paint.c M source/blender/editors/interface/interface_eyedropper_driver.c M source/blender/editors/interface/interface_handlers.c M source/blender/editors/mesh/editmesh_utils.c M source/blender/editors/mesh/mesh_mirror.c M source/blender/editors/physics/particle_edit.c M source/blender/editors/physics/particle_edit_undo.c M source/blender/editors/screen/area.c M source/blender/editors/screen/screen_edit.c M source/blender/editors/screen/screen_ops.c M source/blender/editors/sculpt_paint/paint_image_2d.c M source/blender/editors/sculpt_paint/sculpt.c M source/blender/editors/sculpt_paint/sculpt_dyntopo.c M source/blender/editors/space_clip/tracking_ops_solve.c M source/blender/editors/space_file/space_file.c M source/blender/editors/space_image/image_ops.c M source/blender/editors/space_info/info_stats.c M source/blender/editors/space_sequencer/sequencer_add.c M source/blender/editors/space_text/text_draw.c M source/blender/editors/space_text/text_ops.c M source/blender/editors/space_view3d/view3d_edit.c M source/blender/editors/uvedit/uvedit_parametrizer.c M source/blender/editors/uvedit/uvedit_smart_stitch.c M source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c M source/blender/imbuf/intern/colormanagement.c M source/blender/imbuf/intern/moviecache.c M source/blender/makesrna/intern/rna_access.c M source/blender/render/intern/texture_pointdensity.c M source/blender/render/intern/zbuf.c M source/blender/sequencer/intern/effects.c M source/blender/windowmanager/intern/wm_operators.c === diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 9caf416cd0c..a7257133821 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -342,10 +342,7 @@ static bool rule_avoid_collision(BoidRule *rule, } } } - if (ptn) { -MEM_freeN(ptn); -ptn = NULL; - } + MEM_SAFE_FREE(ptn); /* check boids in other systems */ for (pt = bbd->sim->psys->targets.first; pt; pt = pt->next) { @@ -401,10 +398,7 @@ static bool rule_avoid_collision(BoidRule *rule, } } - if (ptn) { -MEM_freeN(ptn); -ptn = NULL; - } + MEM_SAFE_FREE(ptn); } } @@ -435,10 +429,7 @@ static bool rule_separate(BoidRule *UNUSED(rule), len = ptn[1].dist; ret = 1; } - if (ptn) { -MEM_freeN(ptn); -ptn = NULL; - } + MEM_SAFE_FREE(ptn); /* check other boid systems */ for (pt = bbd->sim->psys->targets.first; pt; pt = pt->next) { @@ -457,10 +448,7 @@ static bool rule_separate(BoidRule *UNUSED(rule), ret = true; } - if (ptn) { -MEM_freeN(ptn); -ptn = NULL; - } + MEM_SAFE_FREE(ptn); } } return ret; @@ -723,10 +711,7 @@ static bool rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Part f_strength += bbd->part->boids->strength * health; - if (ptn) { -MEM_freeN(ptn); -ptn = NULL; - } + MEM_SAFE_FREE(ptn); /* add other friendlies and calculate enemy strength and find closest enemy */ for (pt = bbd->sim->psys->targets.fi
[Bf-blender-cvs] [f504422d92c] soc-2021-curves: Added support for cutting Poly and NURBS splines
Commit: f504422d92cda23efc18bd9c085ec8fc05543741 Author: dilithjay Date: Thu Aug 5 18:53:26 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rBf504422d92cda23efc18bd9c085ec8fc05543741 Added support for cutting Poly and NURBS splines === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 0f90f782ee7..361c657fa0c 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -46,7 +46,7 @@ /* Data structure to keep track of details about the cut location */ typedef struct CutBeztData { /* Index of the last bez triple before the cut. */ - int bezt_index; + int bezt_index, bp_index; /* Nurb to which the cut belongs to. */ Nurb *nurb; /* Minimum distance to curve from mouse location. */ @@ -59,7 +59,7 @@ typedef struct CutBeztData { float prev_loc[3], cut_loc[3], next_loc[3]; /* Mouse location as floats. */ float mval[2]; -} CutBeztData; +} CutData; /* Data required segment altering functionality. */ typedef struct MoveSegmentData { @@ -220,7 +220,8 @@ static float get_view_zoom(const float depth[3], const ViewContext *vc) return 15.0f / len_v2v2(p1_3d, p2_3d); } -/* Get the closest point on an edge to a given point based on perpendicular distance. */ +/* Get the closest point on an edge to a given point based on perpendicular distance. Return true + * if closest point on curve. */ static bool get_closest_point_on_edge(float point[3], const float pos[2], const float pos1[3], @@ -344,7 +345,7 @@ static void update_data_if_nearest_point_in_segment(BezTriple *bezt1, void *op_data) { - CutBeztData *data = op_data; + CutData *data = op_data; float resolu = nu->resolu; float *points = MEM_mallocN(sizeof(float[3]) * (resolu + 1), "makeCut_bezier"); @@ -396,7 +397,7 @@ static void update_data_if_nearest_point_in_segment(BezTriple *bezt1, /* Update the closest point in the data structure. */ static void update_closest_point_in_data(void *op_data, int resolution, ViewContext *vc) { - CutBeztData *data = op_data; + CutData *data = op_data; bool found_min = false; float point[3]; float factor; @@ -467,10 +468,10 @@ static void calculate_new_bezier_point(const float point_prev[3], /* Update the nearest point data for all nurbs. */ static void update_data_for_all_nurbs(ListBase *nurbs, ViewContext *vc, void *op_data) { - CutBeztData *data = op_data; + CutData *data = op_data; for (Nurb *nu = nurbs->first; nu; nu = nu->next) { -if (nu->type == CU_BEZIER) { +if (nu->bezt) { float screen_co[2]; if (data->nurb == NULL) { ED_view3d_project_float_object( @@ -493,6 +494,36 @@ static void update_data_for_all_nurbs(ListBase *nurbs, ViewContext *vc, void *op update_data_if_nearest_point_in_segment(bezt + 1, nu->bezt, nu, i, vc, screen_co, data); } } +else if (nu->bp) { + float screen_co[2]; + ED_view3d_project_float_object( + vc->region, nu->bp->vec, screen_co, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN); + if (data->nurb == NULL) { +data->nurb = nu; +data->bp_index = 0; +data->min_dist = len_manhattan_v2v2(screen_co, data->mval); +copy_v3_v3(data->cut_loc, nu->bp->vec); + } + + for (int i = 0; i < nu->pntsu - 1; i++) { +float point[3], factor; +bool found_min = get_closest_point_on_edge( +point, data->mval, (nu->bp + i)->vec, (nu->bp + i + 1)->vec, vc, &factor); +if (found_min) { + float point_2d[2]; + ED_view3d_project_float_object( + vc->region, point, point_2d, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN); + float dist = len_manhattan_v2v2(point_2d, data->mval); + if (dist < data->min_dist) { +data->min_dist = dist; +data->nurb = nu; +data->bp_index = i; +data->parameter = factor; +copy_v3_v3(data->cut_loc, point); + } +} + } +} } } @@ -500,7 +531,7 @@ static void update_data_for_all_nurbs(ListBase *nurbs, ViewContext *vc, void *op static void add_bezt_to_nurb(Nurb *nu, void *op_data, Curve *cu) { EditNurb *editnurb = cu->editnurb; - CutBeztData *data = op_data; + CutData *data = op_data; BezTriple *bezt1 = (BezTriple *)MEM_mallocN((nu->pntsu + 1) * sizeof(BezTriple), "new_bezt_nurb"); @@ -553,16 +584,60 @@ static void add_bezt_to_nurb(Nurb *nu, void *op_data, Curve *cu) new_bezt->f1 = new_bezt->f2 = new_bezt->f3 = 1; } +/* Insert a bezt t
[Bf-blender-cvs] [7637083dc3e] soc-2021-curves: Bug Fix with close loop on poly splines
Commit: 7637083dc3e5628be90c3de40282a0a8be18b060 Author: dilithjay Date: Thu Aug 5 15:55:40 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB7637083dc3e5628be90c3de40282a0a8be18b060 Bug Fix with close loop on poly splines === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 8c5bac549b1..0f90f782ee7 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -660,7 +660,6 @@ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewCo else { bezt2 = bezt1 + 1; } - bezt1->f1 = bezt1->f2 = bezt1->f3 = bezt2->f1 = bezt2->f2 = bezt2->f3 = 1; float mouse_3d[3]; mouse_location_to_worldspace(event->mval, bezt1->vec[1], vc, mouse_3d); @@ -707,8 +706,8 @@ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewCo } } -/* Close the spline if endpoints are selected consecutively. */ -static void close_loop_if_endpoints( +/* Close the spline if endpoints are selected consecutively. Return true if loop was closed. */ +static bool close_loop_if_endpoints( Nurb *sel_nu, BezTriple *sel_bezt, BPoint *sel_bp, ViewContext *vc, bContext *C) { if (sel_bezt || sel_bp) { @@ -717,7 +716,7 @@ static void close_loop_if_endpoints( bool is_bp_endpoint = (sel_nu->bp && (sel_bp == sel_nu->bp || sel_bp == sel_nu->bp + sel_nu->pntsu - 1)); if (!(is_bezt_endpoint || is_bp_endpoint)) { - return; + return false; } short hand; @@ -727,13 +726,16 @@ static void close_loop_if_endpoints( Base *basact = NULL; ED_curve_pick_vert(vc, 1, &nu, &bezt, &bp, &hand, &basact); -if (nu == sel_nu && bezt != sel_bezt && -((nu->bezt && (bezt == nu->bezt || bezt == nu->bezt + nu->pntsu - 1)) || - (nu->bp && (bp == nu->bp || bp == nu->bp + nu->pntsu - 1 { +if (nu == sel_nu && +((nu->bezt && bezt != sel_bezt && + (bezt == nu->bezt || bezt == nu->bezt + nu->pntsu - 1)) || + (nu->bp && bp != sel_bp && (bp == nu->bp || bp == nu->bp + nu->pntsu - 1 { View3D *v3d = CTX_wm_view3d(C); ListBase *editnurb = object_editcurve_get(vc->obedit); curve_toggle_cyclic(v3d, editnurb, 0); + return true; } +return false; } } @@ -893,10 +895,10 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) else { copy_v2_v2_int(vc.mval, event->mval); if (nu && !(nu->flagu & CU_NURB_CYCLIC)) { -close_loop_if_endpoints(nu, bezt, bp, &vc, C); +bool closed = close_loop_if_endpoints(nu, bezt, bp, &vc, C); /* Set "new" to true to be able to click and drag to control handles when added. */ -RNA_boolean_set(op->ptr, "new", true); +RNA_boolean_set(op->ptr, "new", closed); } } } ___ 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] [4e8b8f85215] soc-2021-curves: Bug fix: error when selecting NURBS spline
Commit: 4e8b8f85215def80260db70468ecd36f04e0ac32 Author: dilithjay Date: Thu Aug 5 19:21:39 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB4e8b8f85215def80260db70468ecd36f04e0ac32 Bug fix: error when selecting NURBS spline === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 361c657fa0c..f1a7b1bc5ae 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -44,7 +44,7 @@ #include "RNA_define.h" /* Data structure to keep track of details about the cut location */ -typedef struct CutBeztData { +typedef struct CutData { /* Index of the last bez triple before the cut. */ int bezt_index, bp_index; /* Nurb to which the cut belongs to. */ @@ -706,6 +706,7 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even ListBase *nurbs = BKE_curve_editNurbs_get(cu); CutData data = {.bezt_index = 0, + .bp_index = 0, .min_dist = 1, .parameter = 0.5f, .has_prev = false, @@ -716,7 +717,7 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even update_data_for_all_nurbs(nurbs, vc, &data); float threshold_distance = get_view_zoom(data.cut_loc, vc); - if (data.min_dist < threshold_distance) { + if (!data.nurb->bp && data.min_dist < threshold_distance) { MoveSegmentData *seg_data; op->customdata = seg_data = MEM_callocN(sizeof(MoveSegmentData), "MoveSegmentData"); seg_data->bezt_index = data.bezt_index; @@ -815,8 +816,8 @@ static bool close_loop_if_endpoints( curve_toggle_cyclic(v3d, editnurb, 0); return true; } -return false; } + return false; } enum { ___ 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] [2bbbed9f014] soc-2021-curves: Suppressed several build warnings
Commit: 2bbbed9f014e22deac8156de66441f98ab6ec6ac Author: dilithjay Date: Thu Aug 5 15:13:26 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB2bbbed9f014e22deac8156de66441f98ab6ec6ac Suppressed several build warnings === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 765952279a5..f1157d4f9b6 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -619,7 +619,6 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even { Curve *cu = vc->obedit->data; ListBase *nurbs = BKE_curve_editNurbs_get(cu); - float mouse_point[2] = {(float)event->mval[0], (float)event->mval[1]}; CutBeztData data = {.bezt_index = 0, .min_dist = 1, @@ -676,7 +675,6 @@ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewCo } bezt1->f1 = bezt1->f2 = bezt1->f3 = bezt2->f1 = bezt2->f2 = bezt2->f3 = 1; - float mouse_point[2] = {(float)event->mval[0], (float)event->mval[1]}; float mouse_3d[3]; mouse_location_to_worldspace(event->mval, bezt1->vec[1], vc, mouse_3d); @@ -722,8 +720,8 @@ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewCo } } -/* Close the spline if endpoints are selected consecutively. Returns true if endpoints selected. */ -static bool close_loop_if_endpoints( +/* Close the spline if endpoints are selected consecutively. */ +static void close_loop_if_endpoints( Nurb *sel_nu, BezTriple *sel_bezt, BPoint *sel_bp, ViewContext *vc, bContext *C) { if (sel_bezt || sel_bp) { @@ -908,7 +906,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) else { copy_v2_v2_int(vc.mval, event->mval); if (nu && !(nu->flagu & CU_NURB_CYCLIC)) { -bool is_endpoints = close_loop_if_endpoints(nu, bezt, bp, &vc, C); +close_loop_if_endpoints(nu, bezt, bp, &vc, C); /* Set "new" to true to be able to click and drag to control handles when added. */ RNA_boolean_set(op->ptr, "new", true); ___ 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] [f8c9a849f65] soc-2021-curves: Merge branch 'master' into soc-2021-curves
Commit: f8c9a849f65e932b6fba8c755b77fc20a6b0695f Author: dilithjay Date: Thu Aug 5 19:23:57 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rBf8c9a849f65e932b6fba8c755b77fc20a6b0695f Merge branch 'master' into soc-2021-curves === === ___ 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] [b8f4c9eb0ef] soc-2021-curves: Bug fix: loop closes when same endpoint selected
Commit: b8f4c9eb0ef09fc0545043939efacfeb4b631dab Author: dilithjay Date: Thu Aug 5 15:32:50 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rBb8f4c9eb0ef09fc0545043939efacfeb4b631dab Bug fix: loop closes when same endpoint selected === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index aec5665570a..8c5bac549b1 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -727,8 +727,9 @@ static void close_loop_if_endpoints( Base *basact = NULL; ED_curve_pick_vert(vc, 1, &nu, &bezt, &bp, &hand, &basact); -if (nu == sel_nu && ((nu->bezt && (bezt == nu->bezt || bezt == nu->bezt + nu->pntsu - 1)) || - (nu->bp && (bp == nu->bp || bp == nu->bp + nu->pntsu - 1 { +if (nu == sel_nu && bezt != sel_bezt && +((nu->bezt && (bezt == nu->bezt || bezt == nu->bezt + nu->pntsu - 1)) || + (nu->bp && (bp == nu->bp || bp == nu->bp + nu->pntsu - 1 { View3D *v3d = CTX_wm_view3d(C); ListBase *editnurb = object_editcurve_get(vc->obedit); curve_toggle_cyclic(v3d, editnurb, 0); ___ 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] [0ab15326314] soc-2021-curves: Added comments
Commit: 0ab153263147fe2a8dbe9ad8e5f83fb7095c2c44 Author: dilithjay Date: Thu Aug 5 15:23:41 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB0ab153263147fe2a8dbe9ad8e5f83fb7095c2c44 Added comments === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index f1157d4f9b6..3b47331c54c 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -61,8 +61,11 @@ typedef struct CutBeztData { float mval[2]; } CutBeztData; +/* Data required segment altering functionality. */ typedef struct MoveSegmentData { + /* Nurb being altered. */ Nurb *nu; + /* Index of the BezTriple before the segment. */ int bezt_index; } MoveSegmentData; @@ -148,6 +151,7 @@ static void free_up_handles_for_movement(BezTriple *bezt, bool f1, bool f3) } } +/* Move BezTriple to mouse. */ static void move_selected_bezt_to_mouse(BezTriple *bezt, ViewContext *vc, const wmEvent *event) { /* Get mouse location in 3D space. */ @@ -170,6 +174,7 @@ static void move_selected_bezt_to_mouse(BezTriple *bezt, ViewContext *vc, const } } +/* Move BPoint to mouse. */ static void move_bp_to_mouse(BPoint *bp, const wmEvent *event, const ViewContext *vc) { /* Get mouse location in 3D space. */ ___ 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] [0e28ba97ccd] soc-2021-curves: Removed unused include headers
Commit: 0e28ba97ccd4a749e38c7a5622fe51875dcb230b Author: dilithjay Date: Thu Aug 5 15:09:44 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB0e28ba97ccd4a749e38c7a5622fe51875dcb230b Removed unused include headers === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index a3218a35f8e..765952279a5 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -19,55 +19,29 @@ */ #include "DNA_curve_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" -#include "BLI_linklist.h" #include "BLI_listbase.h" #include "BLI_math.h" -#include "BLI_mempool.h" #include "BKE_context.h" #include "BKE_curve.h" -#include "BKE_fcurve.h" -#include "BKE_layer.h" -#include "BKE_report.h" #include "DEG_depsgraph.h" #include "WM_api.h" -#include "WM_toolsystem.h" -#include "WM_types.h" #include "ED_curve.h" -#include "ED_object.h" -#include "ED_outliner.h" #include "ED_screen.h" -#include "ED_select_utils.h" -#include "ED_space_api.h" #include "ED_view3d.h" -#include "GPU_batch.h" -#include "GPU_batch_presets.h" -#include "GPU_immediate.h" -#include "GPU_immediate_util.h" -#include "GPU_matrix.h" -#include "GPU_state.h" - #include "BKE_object.h" -#include "BKE_paint.h" #include "curve_intern.h" -#include "UI_interface.h" -#include "UI_resources.h" - #include "RNA_access.h" #include "RNA_define.h" -#include "RNA_enum_types.h" /* Data structure to keep track of details about the cut location */ typedef struct CutBeztData { ___ 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] [2c380e81cdf] soc-2021-curves: Merge branch 'master' into soc-2021-curves
Commit: 2c380e81cdf8dfac96625f7672d8e152cb7b189a Author: dilithjay Date: Thu Aug 5 08:10:20 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB2c380e81cdf8dfac96625f7672d8e152cb7b189a Merge branch 'master' into soc-2021-curves === === ___ 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] [80454e38adc] soc-2021-curves: Removed vertex select when altering segment
Commit: 80454e38adc917c121fcc96e7479d672a8dffe9a Author: dilithjay Date: Thu Aug 5 15:25:49 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB80454e38adc917c121fcc96e7479d672a8dffe9a Removed vertex select when altering segment === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 3b47331c54c..aec5665570a 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -646,24 +646,6 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even return false; } -static void deselect_all(Curve *cu) -{ - LISTBASE_FOREACH (Nurb *, nu, &(cu->editnurb->nurbs)) { -if (nu->type == CU_BEZIER) { - BezTriple *bezt = nu->bezt; - for (int i = 0; i < nu->pntsu; i++, bezt++) { -bezt->f1 = bezt->f2 = bezt->f3 = 0; - } -} -else { - BPoint *bp = nu->bp; - for (int i = 0; i < nu->pntsu; i++, bp++) { -bp->f1 = 0; - } -} - } -} - /* Move segment to mouse pointer. */ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewContext *vc) { @@ -901,7 +883,6 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) if (!retval) { if (is_curve_nearby(&vc, op, event)) { RNA_boolean_set(op->ptr, "moving_segment", true); -deselect_all(obedit->data); moving_segment = true; } else { ___ 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] [aaf029a30c1] soc-2021-curves: Select adjacent vertices when moving a segment
Commit: aaf029a30c16d2460f502eb2d150d817011af2f9 Author: dilithjay Date: Thu Aug 5 08:07:21 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rBaaf029a30c16d2460f502eb2d150d817011af2f9 Select adjacent vertices when moving a segment === M release/datafiles/locale M release/scripts/addons M release/scripts/addons_contrib M source/blender/editors/curve/editcurve_pen.c === diff --git a/release/datafiles/locale b/release/datafiles/locale index 62e82958a76..ca39c1459bc 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 62e82958a760dad775d9b3387d7fb535fd6de4c6 +Subproject commit ca39c1459bcd99300afe3591fa5ffe40f5ba5eef diff --git a/release/scripts/addons b/release/scripts/addons index 4475cbd11a6..2aa81ec3365 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 4475cbd11a636382d57571e0f5dfeff1f90bd6b7 +Subproject commit 2aa81ec3365c5ed2478f9783f78a38e77c0ef6c1 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 788441f2930..98f6085e9d7 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 788441f2930465bbfba8f0797b12dcef1d46694d +Subproject commit 98f6085e9d71ba35d41e5aafbcb7981bd7c48275 diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 89ff3ca5eeb..a3218a35f8e 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -26,6 +26,7 @@ #include "BLI_blenlib.h" #include "BLI_linklist.h" +#include "BLI_listbase.h" #include "BLI_math.h" #include "BLI_mempool.h" @@ -667,6 +668,24 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even return false; } +static void deselect_all(Curve *cu) +{ + LISTBASE_FOREACH (Nurb *, nu, &(cu->editnurb->nurbs)) { +if (nu->type == CU_BEZIER) { + BezTriple *bezt = nu->bezt; + for (int i = 0; i < nu->pntsu; i++, bezt++) { +bezt->f1 = bezt->f2 = bezt->f3 = 0; + } +} +else { + BPoint *bp = nu->bp; + for (int i = 0; i < nu->pntsu; i++, bp++) { +bp->f1 = 0; + } +} + } +} + /* Move segment to mouse pointer. */ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewContext *vc) { @@ -681,6 +700,7 @@ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewCo else { bezt2 = bezt1 + 1; } + bezt1->f1 = bezt1->f2 = bezt1->f3 = bezt2->f1 = bezt2->f2 = bezt2->f3 = 1; float mouse_point[2] = {(float)event->mval[0], (float)event->mval[1]}; float mouse_3d[3]; @@ -904,6 +924,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) if (!retval) { if (is_curve_nearby(&vc, op, event)) { RNA_boolean_set(op->ptr, "moving_segment", true); +deselect_all(obedit->data); moving_segment = true; } else { ___ 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] [b04d4b6adbd] soc-2021-curves: Merge branch 'master' into soc-2021-curves
Commit: b04d4b6adbd095438bed7e1608044d7ca7e504ca Author: dilithjay Date: Wed Aug 4 11:20:57 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rBb04d4b6adbd095438bed7e1608044d7ca7e504ca Merge branch 'master' into soc-2021-curves === === ___ 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] [99738fbfdc8] master: Fix memory leak from rB263fa406cd2b
Commit: 99738fbfdc8b4639d95c796bcc8711bd89c1aaa4 Author: Hans Goudey Date: Thu Aug 5 21:10:54 2021 -0500 Branches: master https://developer.blender.org/rB99738fbfdc8b4639d95c796bcc8711bd89c1aaa4 Fix memory leak from rB263fa406cd2b === M source/blender/blenkernel/intern/mesh_convert.c === diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index fbcd916a0df..ca594470cba 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -1666,6 +1666,7 @@ void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, /* skip the listbase */ MEMCPY_STRUCT_AFTER(mesh_dst, &tmp, id.prev); + BLI_freelistN(&mesh_dst->vertex_group_names); BKE_defgroup_copy_list(&mesh_dst->vertex_group_names, &mesh_src->vertex_group_names); mesh_dst->vertex_group_active_index = mesh_src->vertex_group_active_index; ___ 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] [1f8485ae822] master: Geometry Nodes: Select by Handle Type Node
Commit: 1f8485ae8222d4bcf6c71b8156bc61525cc5f391 Author: Hans Goudey Date: Thu Aug 5 18:42:20 2021 -0500 Branches: master https://developer.blender.org/rB1f8485ae8222d4bcf6c71b8156bc61525cc5f391 Geometry Nodes: Select by Handle Type Node Just like the "Select by Material" node, this node outputs a boolean attribute for control points that have a matching handle type. By default left and right handles are considered, but it's possible to only check one side with the toggle in the node. Differential Revision: https://developer.blender.org/D12135 === M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/intern/node.cc M source/blender/makesdna/DNA_node_types.h M source/blender/makesrna/intern/rna_nodetree.c M source/blender/nodes/CMakeLists.txt M source/blender/nodes/NOD_geometry.h M source/blender/nodes/NOD_static_types.h A source/blender/nodes/geometry/nodes/node_geo_curve_select_by_handle_type.cc === diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 03859b04c50..9c67ab1e57f 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -512,6 +512,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeCurveReverse"), NodeItem("GeometryNodeCurveSplineType"), NodeItem("GeometryNodeCurveSetHandles"), +NodeItem("GeometryNodeCurveSelectHandles"), ]), GeometryNodeCategory("GEO_PRIMITIVES_CURVE", "Curve Primitives", items=[ NodeItem("GeometryNodeCurvePrimitiveLine"), diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 084ec20c172..caa7ab6de0a 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1476,6 +1476,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_CURVE_TRIM 1071 #define GEO_NODE_CURVE_SET_HANDLES 1072 #define GEO_NODE_CURVE_SPLINE_TYPE 1073 +#define GEO_NODE_CURVE_SELECT_HANDLES 1074 /** \} */ diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 54bcdf4c92a..4aec5a9e667 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -5181,6 +5181,7 @@ static void registerGeometryNodes() register_node_type_geo_points_to_volume(); register_node_type_geo_raycast(); register_node_type_geo_sample_texture(); + register_node_type_geo_select_by_handle_type(); register_node_type_geo_select_by_material(); register_node_type_geo_separate_components(); register_node_type_geo_subdivision_surface(); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 4b08aeb2008..ad7722d3ed0 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1367,6 +1367,13 @@ typedef struct NodeGeometryCurveSetHandles { uint8_t mode; } NodeGeometryCurveSetHandles; +typedef struct NodeGeometryCurveSelectHandles { + /* GeometryNodeCurveHandleType. */ + uint8_t handle_type; + /* GeometryNodeCurveHandleMode. */ + uint8_t mode; +} NodeGeometryCurveSelectHandles; + typedef struct NodeGeometryCurvePrimitiveLine { /* GeometryNodeCurvePrimitiveLineMode. */ uint8_t mode; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index cd7cbbf76d3..5de7aa9a18b 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -439,6 +439,34 @@ static const EnumPropertyItem rna_node_geometry_attribute_randomize_operation_it {0, NULL, 0, NULL, NULL}, }; +static const EnumPropertyItem rna_node_geometry_curve_handle_type_items[] = { +{GEO_NODE_CURVE_HANDLE_FREE, + "FREE", + ICON_HANDLE_FREE, + "Free", + "The handle can be moved anywhere, and doesn't influence the point's other handle"}, +{GEO_NODE_CURVE_HANDLE_AUTO, + "AUTO", + ICON_HANDLE_AUTO, + "Auto", + "The location is automatically calculated to be smooth"}, +{GEO_NODE_CURVE_HANDLE_VECTOR, + "VECTOR", + ICON_HANDLE_VECTOR, + "Vector", + "The location is calculated to point to the next/previous control point"}, +{GEO_NODE_CURVE_HANDLE_ALIGN, + "ALIGN", + ICON_HANDLE_ALIGNED, + "Align", + "The location is constrained to point in the opposite direction as the other handle"}, +{0, NULL, 0, NULL, NULL}}; + +static const EnumPropertyItem rna_node_geometry_curve_handle_side_items[] = { +{GEO_NODE_CURVE_HANDLE_LEFT, "LEFT", ICON_NONE, "Left", "Use the left handles"}, +{GEO_NODE_CURVE_HANDLE_RIGHT, "RIGHT", ICON_NONE, "Right", "Use the right handles"}, +{0, NUL
[Bf-blender-cvs] [bc0d55e724a] master: Fix: Avoid floating point error in some mesh primitive nodes
Commit: bc0d55e724a27fba61a93cc95f2cc48e205e1cd8 Author: Mattias Fredriksson Date: Thu Aug 5 18:34:32 2021 -0500 Branches: master https://developer.blender.org/rBbc0d55e724a27fba61a93cc95f2cc48e205e1cd8 Fix: Avoid floating point error in some mesh primitive nodes Some mesh primitives created using geometry nodes use loops to create vertices and accumulates positions/angles in FP variables. This allows rounding errors to accumulate and can introduce significant errors. To minimize changes from original implementation, variables allowing errors to accumulate are replaced by: delta * index. Affected Mesh Primitives nodes are Line, Grid, Cylinder, Circle, Cone, and UV-Sphere. Differential Revision: https://developer.blender.org/D12136 === M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc index 96c6f073ab3..131f9548b40 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc @@ -126,11 +126,11 @@ static Mesh *create_circle_mesh(const float radius, MutableSpan edges{mesh->medge, mesh->totedge}; MutableSpan polys{mesh->mpoly, mesh->totpoly}; - float angle = 0.0f; - const float angle_delta = 2.0f * M_PI / static_cast(verts_num); - for (MVert &vert : verts) { -copy_v3_v3(vert.co, float3(std::cos(angle) * radius, std::sin(angle) * radius, 0.0f)); -angle += angle_delta; + /* Assign vertex coordinates. */ + const float angle_delta = 2.0f * (M_PI / static_cast(verts_num)); + for (const int i : IndexRange(verts_num)) { +const float angle = i * angle_delta; +copy_v3_v3(verts[i].co, float3(std::cos(angle) * radius, std::sin(angle) * radius, 0.0f)); } if (fill_type == GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN) { copy_v3_v3(verts.last().co, float3(0)); diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc index 790a518e584..b834f5e2fa0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc @@ -318,9 +318,9 @@ Mesh *create_cylinder_or_cone_mesh(const float radius_top, /* Calculate vertex positions. */ const int top_verts_start = 0; const int bottom_verts_start = top_verts_start + (!top_is_point ? verts_num : 1); - float angle = 0.0f; - const float angle_delta = 2.0f * M_PI / static_cast(verts_num); + const float angle_delta = 2.0f * (M_PI / static_cast(verts_num)); for (const int i : IndexRange(verts_num)) { +const float angle = i * angle_delta; const float x = std::cos(angle); const float y = std::sin(angle); if (!top_is_point) { @@ -330,7 +330,6 @@ Mesh *create_cylinder_or_cone_mesh(const float radius_top, copy_v3_v3(verts[bottom_verts_start + i].co, float3(x * radius_bottom, y * radius_bottom, -height)); } -angle += angle_delta; } if (top_is_point) { copy_v3_v3(verts[top_verts_start].co, float3(0.0f, 0.0f, height)); diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc index 7a97ae8e318..410290c79ee 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc @@ -79,19 +79,17 @@ static Mesh *create_grid_mesh(const int verts_x, MutableSpan polys{mesh->mpoly, mesh->totpoly}; { -const float dx = size_x / edges_x; -const float dy = size_y / edges_y; -float x = -size_x * 0.5; +const float dx = edges_x == 0 ? 0.0f : size_x / edges_x; +const float dy = edges_y == 0 ? 0.0f : size_y / edges_y; +const float x_shift = edges_x / 2.0f; +const float y_shift = edges_y / 2.0f; for (const int x_index : IndexRange(verts_x)) { - float y = -size_y * 0.5; for (const int y_index : IndexRange(verts_y)) { const int vert_index = x_index * verts_y + y_index; -verts[vert_index].co[0] = x; -verts[vert_index].co[1] = y; +verts[vert_index].co[0] = (x_index - x_shift) * dx; +verts[vert_index].co[1] = (y_index - y_shift) * dy; verts[vert_index].co[2] = 0.0f; -y += dy; } - x += dx; } } diff --git
[Bf-blender-cvs] [263fa406cd2] master: Fix T90087: Assigning object data doesn't copy vertex groups
Commit: 263fa406cd2bc1aefe410fe735c22967ee052e22 Author: Hans Goudey Date: Thu Aug 5 18:27:07 2021 -0500 Branches: master https://developer.blender.org/rB263fa406cd2bc1aefe410fe735c22967ee052e22 Fix T90087: Assigning object data doesn't copy vertex groups Assigning a mesh seems to do its own parameter copying, which means we need to manual copy its vertex groups here, which was just overlooked in rB3b6ee8cee708. Differential Revision: https://developer.blender.org/D12110 === M source/blender/blenkernel/intern/mesh_convert.c === diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index 0e4fe91e577..fbcd916a0df 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -38,6 +38,7 @@ #include "BLI_utildefines.h" #include "BKE_DerivedMesh.h" +#include "BKE_deform.h" #include "BKE_displist.h" #include "BKE_editmesh.h" #include "BKE_key.h" @@ -1665,6 +1666,9 @@ void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, /* skip the listbase */ MEMCPY_STRUCT_AFTER(mesh_dst, &tmp, id.prev); + BKE_defgroup_copy_list(&mesh_dst->vertex_group_names, &mesh_src->vertex_group_names); + mesh_dst->vertex_group_active_index = mesh_src->vertex_group_active_index; + if (take_ownership) { if (alloctype == CD_ASSIGN) { CustomData_free_typemask(&mesh_src->vdata, mesh_src->totvert, ~mask->vmask); ___ 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] [4fd687f4a3f] egl: enable EGL on buildbot for testing
Commit: 4fd687f4a3f91338dcd9e70bd6a4517ce5fd454d Author: Christian Rauch Date: Fri Aug 6 00:24:21 2021 +0100 Branches: egl https://developer.blender.org/rB4fd687f4a3f91338dcd9e70bd6a4517ce5fd454d enable EGL on buildbot for testing === M build_files/config/pipeline_config.yaml === diff --git a/build_files/config/pipeline_config.yaml b/build_files/config/pipeline_config.yaml index 611df59caec..7f3836a745f 100644 --- a/build_files/config/pipeline_config.yaml +++ b/build_files/config/pipeline_config.yaml @@ -65,6 +65,9 @@ buildbot: darwin-x86_64: overrides: {} linux-x86_64: -overrides: {} +overrides: { +WITH_SYSTEM_GLEW: "OFF", +WITH_GL_EGL: "ON" +} windows-amd64: overrides: {} ___ 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] [40455c21fac] temp-geometry-nodes-fields-prototype: Support switching between two fields in the switch node
Commit: 40455c21fac59d54f8cb77fe146bc7940bc424c3 Author: Hans Goudey Date: Thu Aug 5 18:10:28 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB40455c21fac59d54f8cb77fe146bc7940bc424c3 Support switching between two fields in the switch node === M source/blender/nodes/geometry/nodes/node_geo_switch.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_switch.cc b/source/blender/nodes/geometry/nodes/node_geo_switch.cc index 0aa5c68aaf5..3fb90445741 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_switch.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_switch.cc @@ -91,6 +91,31 @@ static void geo_node_switch_update(bNodeTree *UNUSED(ntree), bNode *node) } } +template +static void output_input_field(GeoNodeExecParams ¶ms, + const bool input, + const StringRef input_suffix, + const StringRef output_identifier) +{ + const std::string name_a = "False" + input_suffix; + const std::string name_b = "True" + input_suffix; + if (input) { +params.set_input_unused(name_a); +if (params.lazy_require_input(name_b)) { + return; +} + +params.set_output(output_identifier, params.get_input_field(name_b)); + } + else { +params.set_input_unused(name_b); +if (params.lazy_require_input(name_a)) { + return; +} +params.set_output(output_identifier, params.get_input_field(name_a)); + } +} + template static void output_input(GeoNodeExecParams ¶ms, const bool input, @@ -124,19 +149,19 @@ static void geo_node_switch_exec(GeoNodeExecParams params) const bool input = params.get_input("Switch"); switch ((eNodeSocketDatatype)storage.input_type) { case SOCK_FLOAT: { - output_input(params, input, "", "Output"); + output_input_field(params, input, "", "Output"); break; } case SOCK_INT: { - output_input(params, input, "_001", "Output_001"); + output_input_field(params, input, "_001", "Output_001"); break; } case SOCK_BOOLEAN: { - output_input(params, input, "_002", "Output_002"); + output_input_field(params, input, "_002", "Output_002"); break; } case SOCK_VECTOR: { - output_input(params, input, "_003", "Output_003"); + output_input_field(params, input, "_003", "Output_003"); break; } case SOCK_RGBA: { ___ 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] [4233128fa5f] temp-geometry-nodes-fields-prototype: Add a node to store a field in a geometry and output an anonymous attribute
Commit: 4233128fa5f479648e00a0ccaf07b18148f333e5 Author: Hans Goudey Date: Thu Aug 5 17:43:15 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB4233128fa5f479648e00a0ccaf07b18148f333e5 Add a node to store a field in a geometry and output an anonymous attribute === M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/intern/node.cc M source/blender/makesdna/DNA_node_types.h M source/blender/makesrna/intern/rna_nodetree.c M source/blender/nodes/CMakeLists.txt M source/blender/nodes/NOD_geometry.h M source/blender/nodes/NOD_static_types.h A source/blender/nodes/geometry/nodes/node_geo_attribute_store_anonymous.cc === diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index f7d09edafff..11c03f89a5d 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -482,6 +482,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeAttributeRemove"), NodeItem("GeometryNodeAttributeMapRange"), NodeItem("GeometryNodeAttributeTransfer"), +NodeItem("GeometryNodeAttributeStore"), ]), GeometryNodeCategory("GEO_COLOR", "Color", items=[ NodeItem("ShaderNodeRGBCurve"), diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 077c6095452..fb0c11fde69 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1479,6 +1479,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_INDEX 1074 #define GEO_NODE_EXTRUDE 1075 #define GEO_NODE_CURVE_SPLINE_TYPE 1076 +#define GEO_NODE_ATTRIBUTE_STORE_ANONYMOUS 1077 /** \} */ diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 66cf1b39f22..fecba5c3009 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -5192,6 +5192,7 @@ static void registerGeometryNodes() register_node_type_geo_triangulate(); register_node_type_geo_viewer(); register_node_type_geo_volume_to_mesh(); + register_node_type_geo_attribute_store_anonymous(); } static void registerFunctionNodes() diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 7257d5bd461..9e78174a676 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1410,6 +1410,13 @@ typedef struct NodeGeometryRaycast { uint8_t mapping; } NodeGeometryRaycast; +typedef struct NodeGeometryAttributeStore { + /* CustomDataType. */ + int8_t data_type; + /* AttributeDomain. */ + int8_t domain; +} NodeGeometryAttributeStore; + typedef struct NodeGeometryAttribute { /* eNodeSocketDatatype. */ int8_t output_type; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 3426ad7a217..065eed13156 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -9128,6 +9128,26 @@ static void def_geo_attribute_fill(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } +static void def_geo_attribute_store_anonymous(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeGeometryAttributeStore", "storage"); + + prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_GeometryNodeAttributeFill_type_itemf"); + RNA_def_property_enum_default(prop, CD_PROP_FLOAT); + RNA_def_property_ui_text(prop, "Data Type", "Type of data stored in attribute"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_GeometryNode_socket_update"); + + prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items); + RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); + RNA_def_property_ui_text(prop, "Domain", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + static void def_geo_attribute_convert(StructRNA *srna) { PropertyRNA *prop; diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index d2abbfcdff4..6c88f5ff76f 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -143,6 +143,7 @@ set(SRC geometry/nodes/node_geo_extrude.cc + geometry/nodes/node_geo_attribute_store_anonymous.cc geometry/nodes/node_geo_attribute.cc geometry/nodes/node_geo_attribute_clamp.cc geometry/nodes/node_geo_attribute_color_ramp.cc diff --git
[Bf-blender-cvs] [d55046b1670] temp-geometry-nodes-fields-prototype: Support field for curve set spline type selection
Commit: d55046b1670c7036b594b7c757d7b32051099698 Author: Hans Goudey Date: Thu Aug 5 17:50:23 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rBd55046b1670c7036b594b7c757d7b32051099698 Support field for curve set spline type selection === M source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc index fe3f42625ae..7d432f5bb24 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc @@ -25,7 +25,7 @@ static bNodeSocketTemplate geo_node_curve_spline_type_in[] = { {SOCK_GEOMETRY, N_("Curve")}, -{SOCK_STRING, N_("Selection")}, +{SOCK_BOOLEAN, N_("Selection"), 1, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE}, {-1, ""}, }; @@ -255,12 +255,17 @@ static void geo_node_curve_spline_type_exec(GeoNodeExecParams params) return; } - const CurveComponent *curve_component = geometry_set.get_component_for_read(); - const CurveEval &curve = *curve_component->get_for_read(); + const CurveComponent &curve_component = *geometry_set.get_component_for_read(); + const CurveEval &curve = *curve_component.get_for_read(); - const std::string selection_name = params.extract_input("Selection"); - GVArray_Typed selection = curve_component->attribute_get_for_read( - selection_name, ATTR_DOMAIN_CURVE, true); + bke::FieldRef field = params.get_input_field("Selection"); + bke::FieldInputs field_inputs = field->prepare_inputs(); + Vector> field_input_values; + prepare_field_inputs(field_inputs, curve_component, ATTR_DOMAIN_CURVE, field_input_values); + bke::FieldOutput field_output = field->evaluate( + IndexRange(curve_component.attribute_domain_size(ATTR_DOMAIN_CURVE)), field_inputs); + + GVArray_Typed selection{field_output.varray_ref()}; std::unique_ptr new_curve = std::make_unique(); for (const int i : curve.splines().index_range()) { ___ 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] [2d0442e9434] temp-geometry-nodes-fields-prototype: Use "true" defaults for selection fields
Commit: 2d0442e9434c7b817a94181eeda86c69de0b98f1 Author: Hans Goudey Date: Thu Aug 5 17:50:33 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB2d0442e9434c7b817a94181eeda86c69de0b98f1 Use "true" defaults for selection fields === M source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc M source/blender/nodes/geometry/nodes/node_geo_material_assign.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc index 868e059d163..d5171f99695 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc @@ -23,7 +23,7 @@ static bNodeSocketTemplate geo_node_curve_set_handles_in[] = { {SOCK_GEOMETRY, N_("Curve")}, -{SOCK_BOOLEAN, N_("Selection"), 0, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE}, +{SOCK_BOOLEAN, N_("Selection"), 1, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE}, {-1, ""}, }; diff --git a/source/blender/nodes/geometry/nodes/node_geo_material_assign.cc b/source/blender/nodes/geometry/nodes/node_geo_material_assign.cc index b1d38582059..04b08f7b5f6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_material_assign.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_material_assign.cc @@ -36,7 +36,7 @@ static bNodeSocketTemplate geo_node_material_assign_in[] = { 0.0f, PROP_NONE, SOCK_HIDE_LABEL}, -{SOCK_BOOLEAN, N_("Selection"), 0, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE}, +{SOCK_BOOLEAN, N_("Selection"), 1, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE}, {-1, ""}, }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [798496233ac] temp-geometry-nodes-fields-prototype: Rename the "Attribute Fill" node to "Store Persistent Attribute"
Commit: 798496233ac2f727443b3f8fc016bf95bcbc11da Author: Hans Goudey Date: Thu Aug 5 17:42:57 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB798496233ac2f727443b3f8fc016bf95bcbc11da Rename the "Attribute Fill" node to "Store Persistent Attribute" === M source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc index faf7f2316e6..66b55fef8c6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc @@ -171,7 +171,8 @@ void register_node_type_geo_attribute_fill() { static bNodeType ntype; - geo_node_type_base(&ntype, GEO_NODE_ATTRIBUTE_FILL, "Attribute Fill", NODE_CLASS_ATTRIBUTE, 0); + geo_node_type_base( + &ntype, GEO_NODE_ATTRIBUTE_FILL, "Store Persistent Attribute", NODE_CLASS_ATTRIBUTE, 0); node_type_socket_templates(&ntype, geo_node_attribute_fill_in, geo_node_attribute_fill_out); node_type_init(&ntype, geo_node_attribute_fill_init); node_type_update(&ntype, geo_node_attribute_fill_update); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8645ea16dec] temp-geometry-nodes-fields-prototype: Remove attribute nodes that have been made redundant
Commit: 8645ea16dec1be5240c6523d500c0e74cde8f267 Author: Hans Goudey Date: Thu Aug 5 14:28:58 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB8645ea16dec1be5240c6523d500c0e74cde8f267 Remove attribute nodes that have been made redundant === M release/scripts/startup/nodeitems_builtins.py === diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 687c9caddc3..f7d09edafff 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -475,20 +475,10 @@ texture_node_categories = [ geometry_node_categories = [ # Geometry Nodes GeometryNodeCategory("GEO_ATTRIBUTE", "Attribute", items=[ -NodeItem("GeometryNodeAttributeRandomize"), -NodeItem("GeometryNodeAttributeMath"), -NodeItem("GeometryNodeAttributeClamp"), -NodeItem("GeometryNodeAttributeCompare"), -NodeItem("GeometryNodeAttributeConvert"), NodeItem("GeometryNodeAttributeCurveMap"), NodeItem("GeometryNodeAttributeFill"), NodeItem("GeometryNodeAttributeMix"), -NodeItem("GeometryNodeAttributeColorRamp"), -NodeItem("GeometryNodeAttributeVectorMath"), -NodeItem("GeometryNodeAttributeVectorRotate"), NodeItem("GeometryNodeAttributeSampleTexture"), -NodeItem("GeometryNodeAttributeCombineXYZ"), -NodeItem("GeometryNodeAttributeSeparateXYZ"), NodeItem("GeometryNodeAttributeRemove"), NodeItem("GeometryNodeAttributeMapRange"), NodeItem("GeometryNodeAttributeTransfer"), ___ 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] [5e292d923f3] temp-geometry-nodes-fields-prototype: Merge branch 'master' into temp-geometry-nodes-fields-prototype
Commit: 5e292d923f345b0bc71359142614232905ee33d1 Author: Hans Goudey Date: Thu Aug 5 14:13:16 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB5e292d923f345b0bc71359142614232905ee33d1 Merge branch 'master' into temp-geometry-nodes-fields-prototype === === ___ 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] [504e3c563f8] soc-2021-porting-modifiers-to-nodes-extrude: added side selection.
Commit: 504e3c563f851fc0296fb2d6b96704233c477814 Author: Fabian Schempp Date: Thu Aug 5 23:47:44 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rB504e3c563f851fc0296fb2d6b96704233c477814 added side selection. === M source/blender/bmesh/intern/bmesh_mesh.c M source/blender/bmesh/intern/bmesh_mesh.h M source/blender/bmesh/intern/bmesh_opdefines.c M source/blender/bmesh/operators/bmo_inset.c M source/blender/makesrna/intern/rna_nodetree.c M source/blender/nodes/NOD_static_types.h M source/blender/nodes/geometry/nodes/node_geo_extrude.cc === diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index ad8158e2e6f..217c3502b40 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1455,12 +1455,7 @@ void BM_select_vertices(BMesh *bm, const bool *mask) BMVert *v; int i = 0; BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { -if (mask[i]) { - BM_elem_flag_set(v, BM_ELEM_SELECT, true); -} -else { - BM_elem_flag_set(v, BM_ELEM_SELECT, false); -} +BM_elem_flag_set(v, BM_ELEM_SELECT, mask[i]); i++; } } @@ -1474,12 +1469,7 @@ void BM_select_edges(BMesh *bm, const bool *mask) BMEdge *e; int i = 0; BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { -if (mask[i]) { - BM_elem_flag_set(e, BM_ELEM_SELECT, true); -} -else { - BM_elem_flag_set(e, BM_ELEM_SELECT, false); -} +BM_elem_flag_set(e, BM_ELEM_SELECT, mask[i]); i++; } } @@ -1493,14 +1483,47 @@ void BM_select_faces(BMesh *bm, const bool *mask) BMFace *f; int i = 0; BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { -if (mask[i]) { - BM_elem_flag_set(f, BM_ELEM_SELECT, true); -} -else { - BM_elem_flag_set(f, BM_ELEM_SELECT, false); -} +BM_elem_flag_set(f, BM_ELEM_SELECT, mask[i]); +i++; + } +} + +void BM_get_selected_faces(BMesh *bm, bool **selection) +{ + BMIter iter; + BMFace *f; + int i = 0; + *selection = MEM_malloc_arrayN((size_t)bm->totface, sizeof(bool), "bm faces"); + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { +(*selection)[i] = BM_elem_flag_test(f, BM_ELEM_SELECT); i++; } + // BMO_slot_map_elem_get() +} + +void BM_get_tagged_faces(BMesh *bm, bool **selection) +{ + BMIter iter; + BMFace *f; + int i = 0; + *selection = MEM_malloc_arrayN((size_t)bm->totface, sizeof(bool), "bm faces"); + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { +(*selection)[i] = BM_elem_flag_test(f, BM_ELEM_TAG); +i++; + } +} + +void BM_tag_new_faces(BMesh *bm, BMOperator *b_mesh_operator) +{ + BMIter iter; + BMFace *f; + int i = 0; + //*selection = MEM_malloc_arrayN((size_t)bm->totface, sizeof(bool), "bm faces"); + BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false); + BMO_ITER (f, &iter, b_mesh_operator->slots_out, "faces.out", BM_FACE) { +BM_elem_flag_enable(f, BM_ELEM_TAG); + } + // BMO_slot_map_elem_get() } void BM_tag_vertices(BMesh *bm, const bool *mask) @@ -1509,12 +1532,7 @@ void BM_tag_vertices(BMesh *bm, const bool *mask) BMVert *v; int i = 0; BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { -if (mask[i]) { - BM_elem_flag_set(v, BM_ELEM_TAG, true); -} -else { - BM_elem_flag_set(v, BM_ELEM_TAG, false); -} +BM_elem_flag_set(v, BM_ELEM_TAG, mask[i]); i++; } } @@ -1528,12 +1546,7 @@ void BM_tag_edges(BMesh *bm, const bool *mask) BMEdge *e; int i = 0; BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { -if (mask[i]) { - BM_elem_flag_set(e, BM_ELEM_TAG, true); -} -else { - BM_elem_flag_set(e, BM_ELEM_TAG, false); -} +BM_elem_flag_set(e, BM_ELEM_TAG, mask[i]); i++; } } @@ -1547,12 +1560,7 @@ void BM_tag_faces(BMesh *bm, const bool *mask) BMFace *f; int i = 0; BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { -if (mask[i]) { - BM_elem_flag_set(f, BM_ELEM_TAG, true); -} -else { - BM_elem_flag_set(f, BM_ELEM_TAG, false); -} +BM_elem_flag_set(f, BM_ELEM_TAG, mask[i]); i++; } } diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h index eb7dcaac046..99baaa1421f 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.h +++ b/source/blender/bmesh/intern/bmesh_mesh.h @@ -138,6 +138,9 @@ void BM_mesh_vert_coords_apply_with_mat4(BMesh *bm, void BM_select_vertices(BMesh *bm, const bool *mask); void BM_select_edges(BMesh *bm, const bool *mask); void BM_select_faces(BMesh *bm, const bool *mask); +void BM_get_selected_faces(BMesh *bm, bool **selection); void BM_tag_vertices(BMesh *bm, const bool *mask); void BM_tag_edges(BMesh *bm, const bool *mask); -void BM_tag_faces(BMesh *bm, const bool *mask); \ No newline at
[Bf-blender-cvs] [991f6b15f39] soc-2021-porting-modifiers-to-nodes-extrude: Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-extrude
Commit: 991f6b15f39afe292d5f77ab191b29d8fcdae636 Author: Fabian Schempp Date: Thu Aug 5 23:50:08 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rB991f6b15f39afe292d5f77ab191b29d8fcdae636 Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-extrude # Conflicts: # source/blender/blenkernel/BKE_node.h === === diff --cc source/blender/blenkernel/BKE_node.h index 73921f3e61d,084ec20c172..bfa3c58cbe2 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@@ -1475,7 -1475,7 +1475,8 @@@ int ntreeTexExecTree(struct bNodeTree * #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070 #define GEO_NODE_CURVE_TRIM 1071 #define GEO_NODE_CURVE_SET_HANDLES 1072 - #define GEO_NODE_EXTRUDE 1073 + #define GEO_NODE_CURVE_SPLINE_TYPE 1073 ++#define GEO_NODE_EXTRUDE 1074 /** \} */ ___ 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] [aef45a4ef25] soc-2021-porting-modifiers-to-nodes-extrude: Merge remote-tracking branch 'origin/soc-2021-porting-modifiers-to-nodes-extrude' into soc-2021-porting-modifiers-to-nodes-e
Commit: aef45a4ef2593365eeb40f11f4b8ea3d399c9717 Author: Fabian Schempp Date: Thu Aug 5 23:48:58 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rBaef45a4ef2593365eeb40f11f4b8ea3d399c9717 Merge remote-tracking branch 'origin/soc-2021-porting-modifiers-to-nodes-extrude' into soc-2021-porting-modifiers-to-nodes-extrude # Conflicts: # source/blender/bmesh/intern/bmesh_mesh.c # source/blender/bmesh/intern/bmesh_mesh.h # source/blender/nodes/NOD_static_types.h # source/blender/nodes/geometry/nodes/node_geo_extrude.cc === === ___ 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] [b5573bfbf45] soc-2021-porting-modifiers-to-nodes-extrude: Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-extrude
Commit: b5573bfbf45fb67a5ee4081f3e22f9e73c74e8ae Author: Fabian Schempp Date: Tue Aug 3 21:02:56 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rBb5573bfbf45fb67a5ee4081f3e22f9e73c74e8ae Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-extrude === === diff --cc source/blender/nodes/NOD_static_types.h index 103c7297e19,a091f28f3a0..420349356a1 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@@ -303,13 -305,10 +305,11 @@@ DefNode(GeometryNode, GEO_NODE_CURVE_RE DefNode(GeometryNode, GEO_NODE_CURVE_SET_HANDLES, def_geo_curve_set_handles, "CURVE_SET_HANDLES", CurveSetHandles, "Set Handle Type", "") DefNode(GeometryNode, GEO_NODE_CURVE_SUBDIVIDE, def_geo_curve_subdivide, "CURVE_SUBDIVIDE", CurveSubdivide, "Curve Subdivide", "") DefNode(GeometryNode, GEO_NODE_CURVE_TO_MESH, 0, "CURVE_TO_MESH", CurveToMesh, "Curve to Mesh", "") - DefNode(GeometryNode, GEO_NODE_CURVE_TRIM, def_geo_curve_trim, "CURVE_TRIM", CurveTrim, "Curve Trim", "") - DefNode(GeometryNode, GEO_NODE_CURVE_REVERSE, 0, "CURVE_REVERSE", CurveReverse, "Curve Reverse", "") DefNode(GeometryNode, GEO_NODE_CURVE_TO_POINTS, def_geo_curve_to_points, "CURVE_TO_POINTS", CurveToPoints, "Curve to Points", "") - DefNode(GeometryNode, GEO_NODE_CURVE_ENDPOINTS, 0, "CURVE_ENDPOINTS", CurveEndpoints, "Curve Endpoints", "") + DefNode(GeometryNode, GEO_NODE_CURVE_TRIM, def_geo_curve_trim, "CURVE_TRIM", CurveTrim, "Curve Trim", "") DefNode(GeometryNode, GEO_NODE_DELETE_GEOMETRY, 0, "DELETE_GEOMETRY", DeleteGeometry, "Delete Geometry", "") DefNode(GeometryNode, GEO_NODE_EDGE_SPLIT, 0, "EDGE_SPLIT", EdgeSplit, "Edge Split", "") +DefNode(GeometryNode, GEO_NODE_EXTRUDE, 0, "EXTRUDE", Extrude, "Extrude", "") DefNode(GeometryNode, GEO_NODE_INPUT_MATERIAL, def_geo_input_material, "INPUT_MATERIAL", InputMaterial, "Material", "") DefNode(GeometryNode, GEO_NODE_IS_VIEWPORT, 0, "IS_VIEWPORT", IsViewport, "Is Viewport", "") DefNode(GeometryNode, GEO_NODE_JOIN_GEOMETRY, 0, "JOIN_GEOMETRY", JoinGeometry, "Join Geometry", "") ___ 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] [ba9561ab0de] soc-2021-porting-modifiers-to-nodes-extrude: Geometry Nodes: Extrude
Commit: ba9561ab0de6c0b387b1082a7657b2d83d4481c1 Author: Fabian Schempp Date: Mon Aug 2 19:02:38 2021 +0200 Branches: soc-2021-porting-modifiers-to-nodes-extrude https://developer.blender.org/rBba9561ab0de6c0b387b1082a7657b2d83d4481c1 Geometry Nodes: Extrude Differential Revision: https://developer.blender.org/D12108 === M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/intern/node.cc M source/blender/bmesh/intern/bmesh_mesh.c M source/blender/bmesh/intern/bmesh_mesh.h M source/blender/nodes/CMakeLists.txt M source/blender/nodes/NOD_geometry.h M source/blender/nodes/NOD_static_types.h A source/blender/nodes/geometry/nodes/node_geo_extrude.cc === diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 09820291222..1d3daf01e86 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -551,6 +551,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeEdgeSplit"), NodeItem("GeometryNodeSubdivisionSurface"), NodeItem("GeometryNodeMeshSubdivide"), +NodeItem("GeometryNodeExtrude"), ]), GeometryNodeCategory("GEO_PRIMITIVES_MESH", "Mesh Primitives", items=[ NodeItem("GeometryNodeMeshCircle"), diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index cecb3118038..7dd4b6ab85b 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1466,6 +1466,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070 #define GEO_NODE_CURVE_TRIM 1071 #define GEO_NODE_CURVE_SET_HANDLES 1072 +#define GEO_NODE_EXTRUDE 1073 /** \} */ diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 9888e23a7bd..aa92fede3a5 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -5155,6 +5155,7 @@ static void registerGeometryNodes() register_node_type_geo_curve_trim(); register_node_type_geo_delete_geometry(); register_node_type_geo_edge_split(); + register_node_type_geo_extrude(); register_node_type_geo_input_material(); register_node_type_geo_is_viewport(); register_node_type_geo_join_geometry(); diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index b2958a9e744..ad8158e2e6f 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1446,4 +1446,114 @@ void BM_mesh_vert_coords_apply_with_mat4(BMesh *bm, } } +/** +* Use to select bmesh vertex data based on an array of bool. +*/ +void BM_select_vertices(BMesh *bm, const bool *mask) +{ + BMIter iter; + BMVert *v; + int i = 0; + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { +if (mask[i]) { + BM_elem_flag_set(v, BM_ELEM_SELECT, true); +} +else { + BM_elem_flag_set(v, BM_ELEM_SELECT, false); +} +i++; + } +} + +/** + * Use to select bmesh edge data based on an array of bool. + */ +void BM_select_edges(BMesh *bm, const bool *mask) +{ + BMIter iter; + BMEdge *e; + int i = 0; + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { +if (mask[i]) { + BM_elem_flag_set(e, BM_ELEM_SELECT, true); +} +else { + BM_elem_flag_set(e, BM_ELEM_SELECT, false); +} +i++; + } +} + +/** + * Use to select bmesh face data based on an array of bool. + */ +void BM_select_faces(BMesh *bm, const bool *mask) +{ + BMIter iter; + BMFace *f; + int i = 0; + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { +if (mask[i]) { + BM_elem_flag_set(f, BM_ELEM_SELECT, true); +} +else { + BM_elem_flag_set(f, BM_ELEM_SELECT, false); +} +i++; + } +} + +void BM_tag_vertices(BMesh *bm, const bool *mask) +{ + BMIter iter; + BMVert *v; + int i = 0; + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { +if (mask[i]) { + BM_elem_flag_set(v, BM_ELEM_TAG, true); +} +else { + BM_elem_flag_set(v, BM_ELEM_TAG, false); +} +i++; + } +} + +/** + * Use to temporary tag bmesh edge data based on an array of bool. + */ +void BM_tag_edges(BMesh *bm, const bool *mask) +{ + BMIter iter; + BMEdge *e; + int i = 0; + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { +if (mask[i]) { + BM_elem_flag_set(e, BM_ELEM_TAG, true); +} +else { + BM_elem_flag_set(e, BM_ELEM_TAG, false); +} +i++; + } +} + +/** + * Use to temporary tag bmesh face data based on an array of bool. + */ +void BM_tag_faces(BMesh *bm, const bool *mask) +{ + BMIter iter; + BMFace *f; + int i = 0; + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { +if (mask[i]) { + BM_elem_flag_
[Bf-blender-cvs] [786c8bf5ced] windows_make_docpy: Windows: Add support to compile python apid docs from make file
Commit: 786c8bf5ced7e9fcc11ccfddd4f82855284da4f4 Author: Aaron Carlisle Date: Thu Aug 5 16:14:47 2021 -0400 Branches: windows_make_docpy https://developer.blender.org/rB786c8bf5ced7e9fcc11ccfddd4f82855284da4f4 Windows: Add support to compile python apid docs from make file === A build_files/windows/doc_py.cmd A build_files/windows/find_sphinx.cmd M build_files/windows/parse_arguments.cmd M build_files/windows/reset_variables.cmd M build_files/windows/show_help.cmd M make.bat === diff --git a/build_files/windows/doc_py.cmd b/build_files/windows/doc_py.cmd new file mode 100644 index 000..1366dada6f9 --- /dev/null +++ b/build_files/windows/doc_py.cmd @@ -0,0 +1,34 @@ +set SOURCEDIR=%BLENDER_DIR%/doc/python_api/sphinx-in +set BUILDDIR=%BLENDER_DIR%/doc/python_api/sphinx-out +if "%BF_LANG%" == "" set BF_LANG=en +set SPHINXOPTS=-j auto -D language=%BF_LANG% + +call "%~dp0\find_sphinx.cmd" + +if EXIST "%SPHINX_BIN%" ( +goto detect_sphinx_done +) + +echo unable to locate sphinx-build, run "set sphinx_BIN=full_path_to_sphinx-build.exe" +exit /b 1 + +:detect_sphinx_done + +call "%~dp0\find_blender.cmd" + +if EXIST "%BLENDER_BIN%" ( +goto detect_blender_done +) + +echo unable to locate blender, run "set BLENDER_BIN=full_path_to_blender.exe" +exit /b 1 + +:detect_blender_done + +%BLENDER_BIN% ^ + --background -noaudio --factory-startup ^ + --python %BLENDER_DIR%/doc/python_api/sphinx_doc_gen.py + +%SPHINX_BIN% -b html %SPHINXOPTS% %O% %SOURCEDIR% %BUILDDIR% + +:EOF diff --git a/build_files/windows/find_sphinx.cmd b/build_files/windows/find_sphinx.cmd new file mode 100644 index 000..9e3820a40f9 --- /dev/null +++ b/build_files/windows/find_sphinx.cmd @@ -0,0 +1,29 @@ +REM First see if there is an environment variable set +if EXIST "%SPHINX_BIN%" ( +goto detect_sphinx_done +) + +REM Then see if inkscape is available in the path +for %%X in (sphinx-build.exe) do (set SPHINX_BIN=%%~$PATH:X) +if EXIST "%SPHINX_BIN%" ( +goto detect_sphinx_done +) + +REM Finally see if it is perhaps installed at the default location +set SPHINX_BIN=%ProgramFiles%\Inkscape\bin\inkscape.exe +if EXIST "%SPHINX_BIN%" ( +goto detect_sphinx_done +) + +echo.The 'sphinx-build' command was not found. Make sure you have Sphinx +echo.installed, then set the SPHINXBUILD environment variable to point +echo.to the full path of the 'sphinx-build' executable. Alternatively you +echo.may add the Sphinx directory to PATH. +echo. +echo.If you don't have Sphinx installed, grab it from +echo.http://sphinx-doc.org/ + +REM If still not found clear the variable +set SPHINX_BIN= + +:detect_sphinx_done diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index c71093f2394..c63f062dfef 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -113,6 +113,9 @@ if NOT "%1" == "" ( ) else if "%1" == "icons_geom" ( set ICONS_GEOM=1 goto EOF + ) else if "%1" == "doc_py" ( + set DOC_PY=1 + goto EOF ) else ( echo Command "%1" unknown, aborting! goto ERR diff --git a/build_files/windows/reset_variables.cmd b/build_files/windows/reset_variables.cmd index 590d4ca246a..8ba7b4d3307 100644 --- a/build_files/windows/reset_variables.cmd +++ b/build_files/windows/reset_variables.cmd @@ -32,4 +32,5 @@ set FORMAT= set TEST= set BUILD_WITH_SCCACHE= set ICONS= -set ICONS_GEOM= \ No newline at end of file +set ICONS_GEOM= +set DOC_PY= diff --git a/build_files/windows/show_help.cmd b/build_files/windows/show_help.cmd index ee5e9d9dbbd..45fbbefc6d0 100644 --- a/build_files/windows/show_help.cmd +++ b/build_files/windows/show_help.cmd @@ -31,6 +31,10 @@ echo - 2019 ^(build with visual studio 2019^) echo - 2019pre ^(build with visual studio 2019 pre-release^) echo - 2019b ^(build with visual studio 2019 Build Tools^) +echo. +echo Documentation Targets ^(Not associated with building^) +echo -doc_py ^(Generate sphinx python api docs^) + echo. echo Experimental options echo - with_opengl_tests ^(enable both the render and draw opengl test suites^) diff --git a/make.bat b/make.bat index 75d424202ae..7768091ca77 100644 --- a/make.bat +++ b/make.bat @@ -68,6 +68,11 @@ if "%ICONS_GEOM%" == "1" ( goto EOF ) +if "%DOC_PY%" == "1" ( + call "%BLENDER_DIR%\build_files\windows\doc_py.cmd" + goto EOF +) + echo Building blender with VS%BUILD_VS_YEAR% for %BUILD_ARCH% in %BUILD_DIR% call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd" ___ 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] [983e84322ac] refactor-idprop-ui-data: Write to a temporary local copy of the UI data
Commit: 983e84322acbd0bbc42becac7fb126637d7d8836 Author: Hans Goudey Date: Thu Aug 5 13:34:19 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB983e84322acbd0bbc42becac7fb126637d7d8836 Write to a temporary local copy of the UI data === M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index ab34844c776..51f9e33fb04 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -59,21 +59,21 @@ static bool args_contain_key(PyObject *kwargs, const char *name) /** * \return False when parsing fails, in which case caller should return NULL. */ -static bool idprop_ui_data_update_base(IDProperty *idprop, +static bool idprop_ui_data_update_base(IDPropertyUIData *ui_data, const char *rna_subtype, const char *description) { if (rna_subtype != NULL) { if (pyrna_enum_value_from_id(rna_enum_property_subtype_items, rna_subtype, - &idprop->ui_data->rna_subtype, + &ui_data->rna_subtype, "IDPropertyUIManager.update") == -1) { return false; } } if (description != NULL) { -idprop->ui_data->description = BLI_strdup(description); +ui_data->description = BLI_strdup(description); } return true; @@ -144,42 +144,45 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje return false; } - if (!idprop_ui_data_update_base(idprop, rna_subtype, description)) { + /* Write to a temporary copy of the UI data in case some part of the parsing fails. */ + IDPropertyUIDataInt ui_data = *(IDPropertyUIDataInt *)idprop->ui_data; + + if (!idprop_ui_data_update_base((IDPropertyUIData *)&ui_data, rna_subtype, description)) { return false; } - IDPropertyUIDataInt *ui_data = (IDPropertyUIDataInt *)idprop->ui_data; - if (args_contain_key(kwargs, "min")) { -ui_data->min = min; -ui_data->soft_min = MAX2(ui_data->soft_min, ui_data->min); -ui_data->max = MAX2(ui_data->min, ui_data->max); +ui_data.min = min; +ui_data.soft_min = MAX2(ui_data.soft_min, ui_data.min); +ui_data.max = MAX2(ui_data.min, ui_data.max); } if (args_contain_key(kwargs, "max")) { -ui_data->max = max; -ui_data->soft_max = MIN2(ui_data->soft_max, ui_data->max); -ui_data->min = MIN2(ui_data->min, ui_data->max); +ui_data.max = max; +ui_data.soft_max = MIN2(ui_data.soft_max, ui_data.max); +ui_data.min = MIN2(ui_data.min, ui_data.max); } if (args_contain_key(kwargs, "soft_min")) { -ui_data->soft_min = soft_min; -ui_data->soft_min = MAX2(ui_data->soft_min, ui_data->min); -ui_data->soft_max = MAX2(ui_data->soft_min, ui_data->soft_max); +ui_data.soft_min = soft_min; +ui_data.soft_min = MAX2(ui_data.soft_min, ui_data.min); +ui_data.soft_max = MAX2(ui_data.soft_min, ui_data.soft_max); } if (args_contain_key(kwargs, "soft_max")) { -ui_data->soft_max = soft_max; -ui_data->soft_max = MIN2(ui_data->soft_max, ui_data->max); -ui_data->soft_min = MIN2(ui_data->soft_min, ui_data->soft_max); +ui_data.soft_max = soft_max; +ui_data.soft_max = MIN2(ui_data.soft_max, ui_data.max); +ui_data.soft_min = MIN2(ui_data.soft_min, ui_data.soft_max); } if (args_contain_key(kwargs, "step")) { -ui_data->step = step; +ui_data.step = step; } if (!ELEM(default_value, NULL, Py_None)) { -if (!idprop_ui_data_update_int_default(idprop, ui_data, default_value)) { +if (!idprop_ui_data_update_int_default(idprop, &ui_data, default_value)) { return false; } } + /* Write back to the proeprty's UI data. */ + *(IDPropertyUIDataInt *)idprop->ui_data = ui_data; return true; } @@ -257,48 +260,50 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb return false; } - IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)idprop->ui_data; - IDPropertyUIDataFloat ui_data_local; + /* Write to a temporary copy of the UI data in case some part of the parsing fails. */ + IDPropertyUIDataFloat ui_data = *(IDPropertyUIDataFloat *)idprop->ui_data; - if (!idprop_ui_data_update_base(idprop, rna_subtype, description)) { + if (!idprop_ui_data_update_base((IDPropertyUIData *)&ui_data, rna_subtype, description)) { return false; } if (args_contain_key(kwargs, "min")) { -ui_data->min = min; -ui_data->soft_min = MAX2(ui_data->soft_min, ui_data->min); -ui_data->max = MAX2(ui_data->min, ui_data->max); +ui_data.min = min; +ui_data.soft_min = MAX2(ui_data
[Bf-blender-cvs] [8473bee9090] refactor-idprop-ui-data: Free unused result in failure cases
Commit: 8473bee9090afac37270e54065ee522f8a1c63ad Author: Hans Goudey Date: Thu Aug 5 13:52:28 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB8473bee9090afac37270e54065ee522f8a1c63ad Free unused result in failure cases === M source/blender/blenkernel/BKE_idprop.h M source/blender/blenkernel/intern/idprop.c M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 63da6e429a5..a6372cc490c 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -230,6 +230,7 @@ typedef enum eIDPropertyUIDataType { bool IDP_ui_data_supported(const struct IDProperty *prop); eIDPropertyUIDataType IDP_ui_data_type(const struct IDProperty *prop); void IDP_ui_data_free(struct IDProperty *prop); +void IDP_ui_data_free_contents(struct IDPropertyUIData *ui_data, const eIDPropertyUIDataType type); struct IDPropertyUIData *IDP_ui_data_ensure(struct IDProperty *prop); struct IDPropertyUIData *IDP_ui_data_copy(const struct IDProperty *prop); diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index e5a48127d01..777effca003 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -1096,25 +1096,25 @@ IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char * return prop; } -void IDP_ui_data_free(IDProperty *prop) +void IDP_ui_data_free_contents(IDPropertyUIData *ui_data, const eIDPropertyUIDataType type) { - switch (IDP_ui_data_type(prop)) { + switch (type) { case IDP_UI_DATA_TYPE_STRING: { - IDPropertyUIDataString *ui_data = (IDPropertyUIDataString *)prop->ui_data; - MEM_SAFE_FREE(ui_data->default_value); + IDPropertyUIDataString *ui_data_string = (IDPropertyUIDataString *)ui_data; + MEM_SAFE_FREE(ui_data_string->default_value); break; } case IDP_UI_DATA_TYPE_ID: { break; } case IDP_UI_DATA_TYPE_INT: { - IDPropertyUIDataInt *ui_data = (IDPropertyUIDataInt *)prop->ui_data; - MEM_SAFE_FREE(ui_data->default_array); + IDPropertyUIDataInt *ui_data_int = (IDPropertyUIDataInt *)ui_data; + MEM_SAFE_FREE(ui_data_int->default_array); break; } case IDP_UI_DATA_TYPE_FLOAT: { - IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)prop->ui_data; - MEM_SAFE_FREE(ui_data->default_array); + IDPropertyUIDataFloat *ui_data_float = (IDPropertyUIDataFloat *)ui_data; + MEM_SAFE_FREE(ui_data_float->default_array); break; } case IDP_UI_DATA_TYPE_UNSUPPORTED: { @@ -1122,7 +1122,13 @@ void IDP_ui_data_free(IDProperty *prop) } } - MEM_SAFE_FREE(prop->ui_data->description); + MEM_SAFE_FREE(ui_data->description); +} + +void IDP_ui_data_free(IDProperty *prop) +{ + IDP_ui_data_free_contents(prop->ui_data, IDP_ui_data_type(prop)); + MEM_freeN(prop->ui_data); prop->ui_data = NULL; } diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index 51f9e33fb04..c43d2067f8e 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -148,6 +148,7 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje IDPropertyUIDataInt ui_data = *(IDPropertyUIDataInt *)idprop->ui_data; if (!idprop_ui_data_update_base((IDPropertyUIData *)&ui_data, rna_subtype, description)) { +IDP_ui_data_free_contents((IDPropertyUIData *)&ui_data, IDP_UI_DATA_TYPE_INT); return false; } @@ -177,6 +178,7 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje if (!ELEM(default_value, NULL, Py_None)) { if (!idprop_ui_data_update_int_default(idprop, &ui_data, default_value)) { + IDP_ui_data_free_contents((IDPropertyUIData *)&ui_data, IDP_UI_DATA_TYPE_INT); return false; } } @@ -264,6 +266,7 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb IDPropertyUIDataFloat ui_data = *(IDPropertyUIDataFloat *)idprop->ui_data; if (!idprop_ui_data_update_base((IDPropertyUIData *)&ui_data, rna_subtype, description)) { +IDP_ui_data_free_contents((IDPropertyUIData *)&ui_data, IDP_UI_DATA_TYPE_FLOAT); return false; } @@ -298,6 +301,7 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb * value or an array, but for non-array properties it can only be a value. */ if (!ELEM(default_value, NULL, Py_None)) { if (!idprop_ui_data_update_float_default(idprop, &ui_data, default_value)) { + IDP_ui_data_free_contents((IDPropertyUIData *)&ui_data, IDP_UI_DATA_TYPE_FLOAT); return false;
[Bf-blender-cvs] [1bbc4ccbd22] refactor-idprop-ui-data: Remove more curly braces
Commit: 1bbc4ccbd2211356425d09e0a9251cdfe8356fc7 Author: Hans Goudey Date: Thu Aug 5 13:56:39 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB1bbc4ccbd2211356425d09e0a9251cdfe8356fc7 Remove more curly braces === M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index c43d2067f8e..cf84fde8145 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -397,38 +397,33 @@ static PyObject *BPy_IDPropertyUIManager_update(BPy_IDPropertyUIManager *self, BLI_assert(IDP_ui_data_supported(property)); switch (IDP_ui_data_type(property)) { -case IDP_UI_DATA_TYPE_INT: { +case IDP_UI_DATA_TYPE_INT: IDP_ui_data_ensure(property); if (!idprop_ui_data_update_int(property, args, kwargs)) { return NULL; } Py_RETURN_NONE; -} -case IDP_UI_DATA_TYPE_FLOAT: { +case IDP_UI_DATA_TYPE_FLOAT: IDP_ui_data_ensure(property); if (!idprop_ui_data_update_float(property, args, kwargs)) { return NULL; } Py_RETURN_NONE; -} -case IDP_UI_DATA_TYPE_STRING: { +case IDP_UI_DATA_TYPE_STRING: IDP_ui_data_ensure(property); if (!idprop_ui_data_update_string(property, args, kwargs)) { return NULL; } Py_RETURN_NONE; -} -case IDP_UI_DATA_TYPE_ID: { +case IDP_UI_DATA_TYPE_ID: IDP_ui_data_ensure(property); if (!idprop_ui_data_update_id(property, args, kwargs)) { return NULL; } Py_RETURN_NONE; -} -case IDP_UI_DATA_TYPE_UNSUPPORTED: { +case IDP_UI_DATA_TYPE_UNSUPPORTED: PyErr_Format(PyExc_TypeError, "IDProperty \"%s\" does not support RNA data", property->name); return NULL; -} } BLI_assert_unreachable(); ___ 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] [1681d099194] refactor-idprop-ui-data: Put "\n" on newline
Commit: 1681d099194afb847de36794671b00c6f99ed028 Author: Hans Goudey Date: Thu Aug 5 13:57:35 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB1681d099194afb847de36794671b00c6f99ed028 Put "\n" on newline === M source/blender/python/intern/bpy_rna.c === diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 027eb3f1ec5..93741d5d9e7 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4328,7 +4328,8 @@ static PyObject *pyrna_struct_id_properties_ensure(BPy_StructRNA *self) } PyDoc_STRVAR(pyrna_struct_id_properties_ui_doc, - ".. method:: id_properties_ui(key)\n\n" + ".. method:: id_properties_ui(key)\n" + "\n" " :return: Return an object used to manage an IDProperty's UI data.\n" " :arg key: String name of the property.\n" " :rtype: :class:`bpy.types.IDPropertyUIManager`\n"); ___ 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] [ed351f2784f] refactor-idprop-ui-data: Split setting defaults to a separate function for int and float
Commit: ed351f2784fc41a4cb5c4e8de16131ea45758afc Author: Hans Goudey Date: Thu Aug 5 13:16:59 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rBed351f2784fc41a4cb5c4e8de16131ea45758afc Split setting defaults to a separate function for int and float === M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index c9852ec1a38..2b63a9bf6ad 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -79,6 +79,45 @@ static bool idprop_ui_data_update_base(IDProperty *idprop, return true; } +/** + * \note The default value needs special handling because for array IDProperties it can + * be a single value or an array, but for non-array properties it can only be a value. + */ +static bool idprop_ui_data_update_int_default(IDProperty *idprop, + IDPropertyUIDataInt *ui_data, + PyObject *default_value) +{ + if (PySequence_Check(default_value)) { +if (idprop->type != IDP_ARRAY) { + PyErr_SetString(PyExc_TypeError, "Only array properties can have array default values"); + return false; +} + +Py_ssize_t len = PySequence_Size(default_value); +int *new_default_array = (int *)MEM_malloc_arrayN(len, sizeof(int), __func__); +if (PyC_AsArray( +new_default_array, sizeof(int), default_value, len, &PyLong_Type, "ui_data_update") == +-1) { + MEM_freeN(new_default_array); + return false; +} + +ui_data->default_array_len = len; +MEM_SAFE_FREE(ui_data->default_array); +ui_data->default_array = new_default_array; + } + else { +const int value = PyC_Long_AsI32(default_value); +if ((value == -1) && PyErr_Occurred()) { + PyErr_SetString(PyExc_ValueError, "Error converting \"default\" argument to integer"); + return false; +} +ui_data->default_value = value; + } + + return true; +} + /** * \return False when parsing fails, in which case caller should return NULL. */ @@ -135,39 +174,48 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje ui_data->step = step; } - /* The default value needs special handling because for array IDProperties it can be a single - * value or an array, but for non-array properties it can only be a value. */ if (!ELEM(default_value, NULL, Py_None)) { -if (PySequence_Check(default_value)) { - if (idprop->type != IDP_ARRAY) { -PyErr_SetString(PyExc_TypeError, "Only array properties can have array default values"); -return false; - } +if (!idprop_ui_data_update_int_default(idprop, ui_data, default_value)) { + return false; +} + } - Py_ssize_t len = PySequence_Size(default_value); - int *new_default_array = (int *)MEM_malloc_arrayN(len, sizeof(int), __func__); - if (PyC_AsArray(new_default_array, - sizeof(int), - default_value, - len, - &PyLong_Type, - "ui_data_update") == -1) { -MEM_freeN(new_default_array); -return false; - } + return true; +} - ui_data->default_array_len = len; - MEM_SAFE_FREE(ui_data->default_array); - ui_data->default_array = new_default_array; +static bool idprop_ui_data_update_float_default(IDProperty *idprop, +IDPropertyUIDataFloat *ui_data, +PyObject *default_value) +{ + if (PySequence_Check(default_value)) { +if (idprop->type != IDP_ARRAY) { + PyErr_SetString(PyExc_TypeError, "Only array properties can have array default values"); + return false; } -else { - const int value = PyC_Long_AsI32(default_value); - if ((value == -1) && PyErr_Occurred()) { -PyErr_SetString(PyExc_ValueError, "Error converting \"default\" argument to integer"); -return false; - } - ui_data->default_value = value; + +Py_ssize_t len = PySequence_Size(default_value); +double *new_default_array = (double *)MEM_malloc_arrayN(len, sizeof(double), __func__); +if (PyC_AsArray(new_default_array, +sizeof(double), +default_value, +len, +&PyFloat_Type, +"ui_data_update") == -1) { + MEM_freeN(new_default_array); + return false; +} + +ui_data->default_array_len = len; +MEM_SAFE_FREE(ui_data->default_array); +ui_data->default_array = new_default_array; + } + else { +const double value = PyFloat_AsDouble(default_value); +if ((value == -1
[Bf-blender-cvs] [c85397ad51c] refactor-idprop-ui-data: Rename IDP_free_ui_data -> IDP_ui_data_free
Commit: c85397ad51cae622be09fc88082fd24fad0bdd22 Author: Hans Goudey Date: Thu Aug 5 13:19:36 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rBc85397ad51cae622be09fc88082fd24fad0bdd22 Rename IDP_free_ui_data -> IDP_ui_data_free === M source/blender/blenkernel/BKE_idprop.h M source/blender/blenkernel/intern/idprop.c M source/blender/modifiers/intern/MOD_nodes.cc M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 925b289e56f..63da6e429a5 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -229,7 +229,7 @@ typedef enum eIDPropertyUIDataType { bool IDP_ui_data_supported(const struct IDProperty *prop); eIDPropertyUIDataType IDP_ui_data_type(const struct IDProperty *prop); -void IDP_free_ui_data(struct IDProperty *prop); +void IDP_ui_data_free(struct IDProperty *prop); struct IDPropertyUIData *IDP_ui_data_ensure(struct IDProperty *prop); struct IDPropertyUIData *IDP_ui_data_copy(const struct IDProperty *prop); diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index b52ce1198e6..e5a48127d01 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -1096,7 +1096,7 @@ IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char * return prop; } -void IDP_free_ui_data(IDProperty *prop) +void IDP_ui_data_free(IDProperty *prop) { switch (IDP_ui_data_type(prop)) { case IDP_UI_DATA_TYPE_STRING: { @@ -1154,7 +1154,7 @@ void IDP_FreePropertyContent_ex(IDProperty *prop, const bool do_id_user) } if (prop->ui_data != NULL) { -IDP_free_ui_data(prop); +IDP_ui_data_free(prop); } } diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 463bf07bb06..c13a0e9c940 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -506,7 +506,7 @@ void MOD_nodes_update_interface(Object *object, NodesModifierData *nmd) new_prop->ui_data = nullptr; IDP_CopyPropertyContent(new_prop, old_prop); if (new_prop->ui_data != nullptr) { - IDP_free_ui_data(new_prop); + IDP_ui_data_free(new_prop); } new_prop->ui_data = ui_data; } diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index 2b63a9bf6ad..ab34844c776 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -257,12 +257,13 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb return false; } + IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)idprop->ui_data; + IDPropertyUIDataFloat ui_data_local; + if (!idprop_ui_data_update_base(idprop, rna_subtype, description)) { return false; } - IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)idprop->ui_data; - if (args_contain_key(kwargs, "min")) { ui_data->min = min; ui_data->soft_min = MAX2(ui_data->soft_min, ui_data->min); @@ -565,7 +566,7 @@ static PyObject *BPy_IDPropertyUIManager_clear(BPy_IDPropertyUIManager *self) } if (property->ui_data != NULL) { -IDP_free_ui_data(property); +IDP_ui_data_free(property); } Py_RETURN_NONE; @@ -596,7 +597,7 @@ static PyObject *BPy_IDPropertyUIManager_update_from(BPy_IDPropertyUIManager *se } if (property->ui_data != NULL) { -IDP_free_ui_data(property); +IDP_ui_data_free(property); } property->ui_data = IDP_ui_data_copy(ui_manager_src->property); ___ 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] [6b944e8dc03] refactor-idprop-ui-data: Add key arg to id_properties_ui doc
Commit: 6b944e8dc03f2d0dba2db0e2c78efd5339ade2c9 Author: Hans Goudey Date: Thu Aug 5 13:54:29 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB6b944e8dc03f2d0dba2db0e2c78efd5339ade2c9 Add key arg to id_properties_ui doc === M source/blender/python/intern/bpy_rna.c === diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0f5c92217c6..027eb3f1ec5 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4328,8 +4328,9 @@ static PyObject *pyrna_struct_id_properties_ensure(BPy_StructRNA *self) } PyDoc_STRVAR(pyrna_struct_id_properties_ui_doc, - ".. method:: id_properties_ui()\n\n" + ".. method:: id_properties_ui(key)\n\n" " :return: Return an object used to manage an IDProperty's UI data.\n" + " :arg key: String name of the property.\n" " :rtype: :class:`bpy.types.IDPropertyUIManager`\n"); static PyObject *pyrna_struct_id_properties_ui(BPy_StructRNA *self, PyObject *args) { ___ 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] [fb4b5c72359] refactor-idprop-ui-data: Add back curly braces in one place
Commit: fb4b5c723596f11adcb9c50825102d8c41c965ae Author: Hans Goudey Date: Thu Aug 5 13:14:53 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rBfb4b5c723596f11adcb9c50825102d8c41c965ae Add back curly braces in one place === M source/blender/modifiers/intern/MOD_nodes.cc === diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index f6283dd44f7..463bf07bb06 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -408,7 +408,7 @@ static void init_socket_cpp_value_from_property(const IDProperty &property, void *r_value) { switch (socket_value_type) { -case SOCK_FLOAT: +case SOCK_FLOAT: { if (property.type == IDP_FLOAT) { *(float *)r_value = IDP_Float(&property); } @@ -416,41 +416,51 @@ static void init_socket_cpp_value_from_property(const IDProperty &property, *(float *)r_value = (float)IDP_Double(&property); } break; -case SOCK_INT: +} +case SOCK_INT: { *(int *)r_value = IDP_Int(&property); break; -case SOCK_VECTOR: +} +case SOCK_VECTOR: { copy_v3_v3((float *)r_value, (const float *)IDP_Array(&property)); break; -case SOCK_BOOLEAN: +} +case SOCK_BOOLEAN: { *(bool *)r_value = IDP_Int(&property) != 0; break; -case SOCK_STRING: +} +case SOCK_STRING: { new (r_value) std::string(IDP_String(&property)); break; -case SOCK_OBJECT: +} +case SOCK_OBJECT: { ID *id = IDP_Id(&property); Object *object = (id && GS(id->name) == ID_OB) ? (Object *)id : nullptr; *(Object **)r_value = object; break; -case SOCK_COLLECTION: +} +case SOCK_COLLECTION: { ID *id = IDP_Id(&property); Collection *collection = (id && GS(id->name) == ID_GR) ? (Collection *)id : nullptr; *(Collection **)r_value = collection; break; -case SOCK_TEXTURE: +} +case SOCK_TEXTURE: { ID *id = IDP_Id(&property); Tex *texture = (id && GS(id->name) == ID_TE) ? (Tex *)id : nullptr; *(Tex **)r_value = texture; break; -case SOCK_MATERIAL: +} +case SOCK_MATERIAL: { ID *id = IDP_Id(&property); Material *material = (id && GS(id->name) == ID_MA) ? (Material *)id : nullptr; *(Material **)r_value = material; break; -default: +} +default: { BLI_assert_unreachable(); 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] [95538552a8b] refactor-idprop-ui-data: Remove curly braces
Commit: 95538552a8b9344550f06cd0c292994609d1a130 Author: Hans Goudey Date: Thu Aug 5 12:55:19 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB95538552a8b9344550f06cd0c292994609d1a130 Remove curly braces === M source/blender/modifiers/intern/MOD_nodes.cc === diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 9707cf01fa4..f6283dd44f7 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -383,27 +383,21 @@ static IDProperty *id_property_create_from_socket(const bNodeSocket &socket) static bool id_property_type_matches_socket(const bNodeSocket &socket, const IDProperty &property) { switch (socket.type) { -case SOCK_FLOAT: { +case SOCK_FLOAT: return ELEM(property.type, IDP_FLOAT, IDP_DOUBLE); -} -case SOCK_INT: { +case SOCK_INT: return property.type == IDP_INT; -} -case SOCK_VECTOR: { +case SOCK_VECTOR: return property.type == IDP_ARRAY && property.subtype == IDP_FLOAT && property.len == 3; -} -case SOCK_BOOLEAN: { +case SOCK_BOOLEAN: return property.type == IDP_INT; -} -case SOCK_STRING: { +case SOCK_STRING: return property.type == IDP_STRING; -} case SOCK_OBJECT: case SOCK_COLLECTION: case SOCK_TEXTURE: -case SOCK_MATERIAL: { +case SOCK_MATERIAL: return property.type == IDP_ID; -} } BLI_assert_unreachable(); return false; @@ -414,7 +408,7 @@ static void init_socket_cpp_value_from_property(const IDProperty &property, void *r_value) { switch (socket_value_type) { -case SOCK_FLOAT: { +case SOCK_FLOAT: if (property.type == IDP_FLOAT) { *(float *)r_value = IDP_Float(&property); } @@ -422,47 +416,38 @@ static void init_socket_cpp_value_from_property(const IDProperty &property, *(float *)r_value = (float)IDP_Double(&property); } break; -} -case SOCK_INT: { +case SOCK_INT: *(int *)r_value = IDP_Int(&property); break; -} -case SOCK_VECTOR: { +case SOCK_VECTOR: copy_v3_v3((float *)r_value, (const float *)IDP_Array(&property)); break; -} -case SOCK_BOOLEAN: { +case SOCK_BOOLEAN: *(bool *)r_value = IDP_Int(&property) != 0; break; -} -case SOCK_STRING: { +case SOCK_STRING: new (r_value) std::string(IDP_String(&property)); break; -} -case SOCK_OBJECT: { +case SOCK_OBJECT: ID *id = IDP_Id(&property); Object *object = (id && GS(id->name) == ID_OB) ? (Object *)id : nullptr; *(Object **)r_value = object; break; -} -case SOCK_COLLECTION: { +case SOCK_COLLECTION: ID *id = IDP_Id(&property); Collection *collection = (id && GS(id->name) == ID_GR) ? (Collection *)id : nullptr; *(Collection **)r_value = collection; break; -} -case SOCK_TEXTURE: { +case SOCK_TEXTURE: ID *id = IDP_Id(&property); Tex *texture = (id && GS(id->name) == ID_TE) ? (Tex *)id : nullptr; *(Tex **)r_value = texture; break; -} -case SOCK_MATERIAL: { +case SOCK_MATERIAL: ID *id = IDP_Id(&property); Material *material = (id && GS(id->name) == ID_MA) ? (Material *)id : nullptr; *(Material **)r_value = material; break; -} default: BLI_assert_unreachable(); 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] [442236d9ea9] refactor-idprop-ui-data: Add function to fill default array from doubles, simplify a bit
Commit: 442236d9ea938ae387ed49a17a118b318a7c178f Author: Hans Goudey Date: Thu Aug 5 12:47:10 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB442236d9ea938ae387ed49a17a118b318a7c178f Add function to fill default array from doubles, simplify a bit === M source/blender/makesrna/intern/rna_access.c === diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c820398dc1b..4daa2e09ff1 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2897,6 +2897,26 @@ static void rna_property_float_fill_default_array_values( } } +/** + * The same logic as #rna_property_float_fill_default_array_values for a double array. + */ +static void rna_property_float_fill_default_array_values_double(const double *default_array, +const int default_array_len, +const double default_value, +const int out_length, +float *r_values) +{ + const int array_copy_len = MIN2(out_length, default_array_len); + + for (int i = 0; i < array_copy_len; i++) { +r_values[i] = (float)default_array[i]; + } + + for (int i = array_copy_len; i < out_length; i++) { +r_values[i] = (float)default_value; + } +} + static void rna_property_float_get_default_array_values(PointerRNA *ptr, FloatPropertyRNA *fprop, float *r_values) @@ -3139,18 +3159,11 @@ void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, fl BLI_assert(idprop->type == IDP_ARRAY); BLI_assert(ELEM(idprop->subtype, IDP_FLOAT, IDP_DOUBLE)); const IDPropertyUIDataFloat *ui_data = (const IDPropertyUIDataFloat *)idprop->ui_data; - if (ui_data->default_array) { -/* A version of #rna_property_float_fill_default_array_values for a double array. */ -const double *default_array = ui_data->default_array; -for (int i = 0; i < length; i++) { - values[i] = (i < ui_data->default_array_len) ? (float)default_array[i] : - (float)ui_data->default_value; -} - } - else { -rna_property_float_fill_default_array_values( -NULL, 0, (float)ui_data->default_value, length, values); - } + rna_property_float_fill_default_array_values_double(ui_data->default_array, + ui_data->default_array_len, + ui_data->default_value, + length, + values); } } else if (prop->arraydimension == 0) { ___ 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] [cc005670612] refactor-idprop-ui-data: Remove const from int argument in header
Commit: cc005670612712289894514a0d99df6a4ff736f0 Author: Hans Goudey Date: Thu Aug 5 12:55:41 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rBcc005670612712289894514a0d99df6a4ff736f0 Remove const from int argument in header === M source/blender/makesrna/RNA_access.h === diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index cc5f7a73a8a..a4e56652620 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1026,7 +1026,7 @@ char *RNA_property_string_get_alloc( void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value); void RNA_property_string_set_bytes(PointerRNA *ptr, PropertyRNA *prop, const char *value, int len); int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop); -void RNA_property_string_get_default(PropertyRNA *prop, char *value, const int max_len); +void RNA_property_string_get_default(PropertyRNA *prop, char *value, int max_len); char *RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, ___ 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] [ecd8bdafbb5] refactor-idprop-ui-data: Use IDP_ui_data_type instead of more specific checks
Commit: ecd8bdafbb54ae64948af887847f526ea28add79 Author: Hans Goudey Date: Thu Aug 5 12:02:17 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rBecd8bdafbb54ae64948af887847f526ea28add79 Use IDP_ui_data_type instead of more specific checks === M source/blender/blenkernel/intern/idprop.c === diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index c85fb8badc2..b52ce1198e6 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -280,20 +280,31 @@ IDPropertyUIData *IDP_ui_data_copy(const IDProperty *prop) IDPropertyUIData *data_new = MEM_dupallocN(prop->ui_data); /* Copy extra type specific data. */ - if (prop->type == IDP_STRING) { -IDPropertyUIDataString *ui_data = (IDPropertyUIDataString *)prop->ui_data; -IDPropertyUIDataString *ui_data_new = (IDPropertyUIDataString *)data_new; -ui_data_new->default_value = MEM_dupallocN(ui_data->default_value); - } - else if (prop->type == IDP_ARRAY && prop->subtype == IDP_INT) { -IDPropertyUIDataInt *ui_data = (IDPropertyUIDataInt *)prop->ui_data; -IDPropertyUIDataInt *ui_data_new = (IDPropertyUIDataInt *)data_new; -ui_data_new->default_array = MEM_dupallocN(ui_data->default_array); - } - else if (prop->type == IDP_ARRAY && ELEM(prop->subtype, IDP_FLOAT, IDP_DOUBLE)) { -IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)prop->ui_data; -IDPropertyUIDataFloat *ui_data_new = (IDPropertyUIDataFloat *)data_new; -ui_data_new->default_array = MEM_dupallocN(ui_data->default_array); + switch (IDP_ui_data_type(prop)) { +case IDP_UI_DATA_TYPE_STRING: { + IDPropertyUIDataString *ui_data = (IDPropertyUIDataString *)prop->ui_data; + IDPropertyUIDataString *ui_data_new = (IDPropertyUIDataString *)data_new; + ui_data_new->default_value = MEM_dupallocN(ui_data->default_value); + break; +} +case IDP_UI_DATA_TYPE_ID: { + break; +} +case IDP_UI_DATA_TYPE_INT: { + IDPropertyUIDataInt *ui_data = (IDPropertyUIDataInt *)prop->ui_data; + IDPropertyUIDataInt *ui_data_new = (IDPropertyUIDataInt *)data_new; + ui_data_new->default_array = MEM_dupallocN(ui_data->default_array); + break; +} +case IDP_UI_DATA_TYPE_FLOAT: { + IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)prop->ui_data; + IDPropertyUIDataFloat *ui_data_new = (IDPropertyUIDataFloat *)data_new; + ui_data_new->default_array = MEM_dupallocN(ui_data->default_array); + break; +} +case IDP_UI_DATA_TYPE_UNSUPPORTED: { + break; +} } data_new->description = MEM_dupallocN(prop->ui_data->description); ___ 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] [11d7619e22d] refactor-idprop-ui-data: Revert "Use pyrna_enum_value_parse_string"
Commit: 11d7619e22d73429bd966d87f42f52e6f6d138c9 Author: Hans Goudey Date: Thu Aug 5 11:23:51 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB11d7619e22d73429bd966d87f42f52e6f6d138c9 Revert "Use pyrna_enum_value_parse_string" This reverts commit 1cf574dc39b9f10ba7cd43625c28d86d3cdbe0dc. === M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index 98452457115..4563abd5daa 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -34,8 +34,6 @@ #include "RNA_access.h" #include "RNA_enum_types.h" -#include "../intern/bpy_rna.h" - #define USE_STRING_COERCE #ifdef USE_STRING_COERCE @@ -60,11 +58,16 @@ static bool args_contain_key(PyObject *kwargs, const char *name) * \return False when parsing fails, in which case caller should return NULL. */ static bool idprop_ui_data_update_base(IDProperty *idprop, - const struct BPy_EnumProperty_Parse *rna_subtype, + const char *rna_subtype, const char *description) { - if (rna_subtype->is_set) { -idprop->ui_data->rna_subtype = rna_subtype->value; + if (rna_subtype != NULL) { +int result = PROP_NONE; +if (!RNA_enum_value_from_id(rna_enum_property_subtype_items, rna_subtype, &result)) { + PyErr_SetString(PyExc_KeyError, "RNA subtype not found"); + return false; +} +idprop->ui_data->rna_subtype = result; } if (description != NULL) { @@ -79,8 +82,7 @@ static bool idprop_ui_data_update_base(IDProperty *idprop, */ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObject *kwargs) { - struct BPy_EnumProperty_Parse rna_subtype = {.items = rna_enum_property_subtype_items, - .value = PROP_NONE}; + const char *rna_subtype = NULL; const char *description = NULL; int min, max, soft_min, soft_max, step; PyObject *default_value = NULL; @@ -88,7 +90,7 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje "min", "max", "soft_min", "soft_max", "step", "default", "subtype", "description", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|$iOO&z:update", + "|$iOzz:update", (char **)kwlist, &min, &max, @@ -96,13 +98,12 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje &soft_max, &step, &default_value, - pyrna_enum_value_parse_string, &rna_subtype, &description)) { return false; } - if (!idprop_ui_data_update_base(idprop, &rna_subtype, description)) { + if (!idprop_ui_data_update_base(idprop, rna_subtype, description)) { return false; } @@ -175,8 +176,7 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje */ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyObject *kwargs) { - struct BPy_EnumProperty_Parse rna_subtype = {.items = rna_enum_property_subtype_items, - .value = PROP_NONE}; + const char *rna_subtype = NULL; const char *description = NULL; int precision; double min, max, soft_min, soft_max, step; @@ -193,7 +193,7 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|$diOO&z:update", + "|$diOzz:update", (char **)kwlist, &min, &max, @@ -202,13 +202,12 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb &step, &precision, &default_value, - pyrna_enum_value_parse_string, &rna_subtype, &description)) { return false; } - if (!idprop_ui_data_update_base(idprop, &rna_subtype, description)) { + if (!idprop_ui_data_update_base(idprop, rna_subtype, descripti
[Bf-blender-cvs] [c41c3784285] refactor-idprop-ui-data: Merge branch 'master' into refactor-idprop-ui-data
Commit: c41c3784285e960e7edb451283e5774a7fa6570f Author: Hans Goudey Date: Thu Aug 5 10:46:12 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rBc41c3784285e960e7edb451283e5774a7fa6570f Merge branch 'master' into refactor-idprop-ui-data === === ___ 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] [71164a826d7] refactor-idprop-ui-data: Use pyrna_enum_value_from_id to parse enum items (fix bug creating custom property)
Commit: 71164a826d715eeea9485949e8fe861669f2e667 Author: Hans Goudey Date: Thu Aug 5 11:44:41 2021 -0500 Branches: refactor-idprop-ui-data https://developer.blender.org/rB71164a826d715eeea9485949e8fe861669f2e667 Use pyrna_enum_value_from_id to parse enum items (fix bug creating custom property) === M source/blender/python/generic/idprop_py_ui_api.c === diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index 4563abd5daa..c9852ec1a38 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -34,6 +34,8 @@ #include "RNA_access.h" #include "RNA_enum_types.h" +#include "../intern/bpy_rna.h" + #define USE_STRING_COERCE #ifdef USE_STRING_COERCE @@ -62,12 +64,12 @@ static bool idprop_ui_data_update_base(IDProperty *idprop, const char *description) { if (rna_subtype != NULL) { -int result = PROP_NONE; -if (!RNA_enum_value_from_id(rna_enum_property_subtype_items, rna_subtype, &result)) { - PyErr_SetString(PyExc_KeyError, "RNA subtype not found"); +if (pyrna_enum_value_from_id(rna_enum_property_subtype_items, + rna_subtype, + &idprop->ui_data->rna_subtype, + "IDPropertyUIManager.update") == -1) { return false; } -idprop->ui_data->rna_subtype = result; } if (description != NULL) { ___ 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] [92edf37997c] master: Add custom data comparison for generic attributes
Commit: 92edf37997c25444fc2628c8057a87b7e87c5eff Author: Himanshi Kalra Date: Fri Aug 6 00:03:16 2021 +0530 Branches: master https://developer.blender.org/rB92edf37997c25444fc2628c8057a87b7e87c5eff Add custom data comparison for generic attributes Generic attributes CD_PROP_* comparison is added in customdata_compare Checks for built-in as well as user created attributes. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12137 === M source/blender/blenkernel/intern/mesh.c === diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 8d74002ad79..b00670aad4c 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -389,6 +389,7 @@ enum { MESHCMP_EDGEUNKNOWN, MESHCMP_VERTCOMISMATCH, MESHCMP_CDLAYERS_MISMATCH, + MESHCMP_ATTRIBUTE_VALUE_MISMATCH, }; static const char *cmpcode_to_str(int code) @@ -416,6 +417,8 @@ static const char *cmpcode_to_str(int code) return "Vertex Coordinate Mismatch"; case MESHCMP_CDLAYERS_MISMATCH: return "CustomData Layer Count Mismatch"; +case MESHCMP_ATTRIBUTE_VALUE_MISMATCH: + return "Attribute Value Mismatch"; default: return "Mesh Comparison Code Unknown"; } @@ -423,13 +426,13 @@ static const char *cmpcode_to_str(int code) /** Thresh is threshold for comparing vertices, UV's, vertex colors, weights, etc. */ static int customdata_compare( -CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2, const float thresh) +CustomData *c1, CustomData *c2, const int total_length, Mesh *m1, Mesh *m2, const float thresh) { const float thresh_sq = thresh * thresh; CustomDataLayer *l1, *l2; - int i, i1 = 0, i2 = 0, tot, j; + int i1 = 0, i2 = 0, tot, j; - for (i = 0; i < c1->totlayer; i++) { + for (int i = 0; i < c1->totlayer; i++) { if (ELEM(c1->layers[i].type, CD_MVERT, CD_MEDGE, @@ -441,7 +444,7 @@ static int customdata_compare( } } - for (i = 0; i < c2->totlayer; i++) { + for (int i = 0; i < c2->totlayer; i++) { if (ELEM(c2->layers[i].type, CD_MVERT, CD_MEDGE, @@ -457,12 +460,86 @@ static int customdata_compare( return MESHCMP_CDLAYERS_MISMATCH; } + l1 = c1->layers; + l2 = c2->layers; + + for (i1 = 0; i1 < c1->totlayer; i1++) { +l1 = c1->layers + i1; +if ((CD_TYPE_AS_MASK(l1->type) & CD_MASK_PROP_ALL) == 0) { + /* Skip non generic attribute layers. */ + continue; +} + +bool found_corresponding_layer = false; +for (i2 = 0; i2 < c2->totlayer; i2++) { + l2 = c2->layers + i2; + if (l1->type != l2->type || !STREQ(l1->name, l2->name)) { +continue; + } + found_corresponding_layer = true; + /* At this point `l1` and `l2` have the same name and type, so they should be compared. */ + + switch (l1->type) { + +case CD_PROP_FLOAT: { + const float *l1_data = l1->data; + const float *l2_data = l2->data; + + for (int i = 0; i < total_length; i++) { +if (fabsf(l1_data[i] - l2_data[i]) > thresh) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} +case CD_PROP_FLOAT2: { + const float(*l1_data)[2] = l1->data; + const float(*l2_data)[2] = l2->data; + + for (int i = 0; i < total_length; i++) { +if (len_squared_v2v2(l1_data[i], l2_data[i]) > thresh_sq) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} +case CD_PROP_FLOAT3: { + const float(*l1_data)[3] = l1->data; + const float(*l2_data)[3] = l2->data; + + for (int i = 0; i < total_length; i++) { +if (len_squared_v3v3(l1_data[i], l2_data[i]) > thresh_sq) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} +default: { + int element_size = CustomData_sizeof(l1->type); + for (int i = 0; i < total_length; i++) { +int offset = element_size * i; +if (!CustomData_data_equals(l1->type, +POINTER_OFFSET(l1->data, offset), +POINTER_OFFSET(l2->data, offset))) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} + } +} + +if (!found_corresponding_layer) { + return MESHCMP_CDLAYERS_MISMATCH; +} + } + l1 = c1->layers; l2 = c2->layers; tot = i1; i1 = 0; i2 = 0; - for (i = 0; i < tot; i++) { + for (int i = 0; i < tot; i++) { while ( i1 < c1->totlayer && !ELEM(l1->type, CD_MVERT, CD_MEDGE, CD_MPOLY, CD_MLOOPUV, C
[Bf-blender-cvs] [89014b51f12] master: Xcode: support cmake options for grouping in folders
Commit: 89014b51f12779efbd9499f91a86b96c7407b2f7 Author: Germano Cavalcante Date: Thu Aug 5 12:49:55 2021 -0300 Branches: master https://developer.blender.org/rB89014b51f12779efbd9499f91a86b96c7407b2f7 Xcode: support cmake options for grouping in folders The Xcode IDE can also benefit from the options: - WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS - WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS So add suport to these options and also renames them as they are no longer limited to just Windows and Visual Studio. Reviewed By: brecht, ankitm Differential Revision: https://developer.blender.org/D12132 === M CMakeLists.txt M build_files/cmake/macros.cmake M build_files/cmake/platform/platform_win32.cmake M intern/cycles/cmake/macros.cmake === diff --git a/CMakeLists.txt b/CMakeLists.txt index 3baebba4678..2868324bf46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -612,12 +612,6 @@ if(WIN32) option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF) mark_as_advanced(WITH_WINDOWS_FIND_MODULES) - option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON) - mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS) - - option(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS "Organize the source files in filters matching the source folders." ON) - mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS) - option(WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF) mark_as_advanced(WINDOWS_PYTHON_DEBUG) @@ -635,6 +629,18 @@ if(WIN32) endif() +if(WIN32 OR XCODE) + option(IDE_GROUP_SOURCES_IN_FOLDERS "Organize the source files in filters matching the source folders." ON) + mark_as_advanced(IDE_GROUP_SOURCES_IN_FOLDERS) + + option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON) + mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS) + + if (IDE_GROUP_PROJECTS_IN_FOLDERS) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +endif() + if(UNIX) # See WITH_WINDOWS_SCCACHE for Windows. option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 8ad3f77c7d3..1471aa21505 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -208,7 +208,7 @@ function(blender_source_group ) # if enabled, use the sources directories as filters. - if(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS) + if(IDE_GROUP_SOURCES_IN_FOLDERS) foreach(_SRC ${sources}) # remove ../'s get_filename_component(_SRC_DIR ${_SRC} REALPATH) @@ -240,8 +240,8 @@ function(blender_source_group endforeach() endif() - # if enabled, set the FOLDER property for visual studio projects - if(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS) + # if enabled, set the FOLDER property for the projects + if(IDE_GROUP_PROJECTS_IN_FOLDERS) get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir}) set_target_properties(${name} PROPERTIES FOLDER ${FolderDir}) diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 113c41c545b..3773aaaffed 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -57,8 +57,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") endif() endif() -set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS}) - if(NOT WITH_PYTHON_MODULE) set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT blender) endif() diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake index ff62b816e6c..47196dfd1ce 100644 --- a/intern/cycles/cmake/macros.cmake +++ b/intern/cycles/cmake/macros.cmake @@ -13,7 +13,7 @@ # limitations under the License. function(cycles_set_solution_folder target) - if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS) + if(IDE_GROUP_PROJECTS_IN_FOLDERS) get_filename_component(folderdir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) string(REPLACE ${CMAKE_SOURCE_DIR} "" folderdir ${folderdir}) set_target_properties(${target} PROPERTIES FOLDER ${folderdir}) ___ 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] [cf10eb54cc4] master: Action Constraint: add Split Channels Mix choices from Copy Transforms
Commit: cf10eb54cc4bc89e763dc48644c402f7578fa6b2 Author: Alexander Gavrilov Date: Mon Aug 2 19:08:12 2021 +0300 Branches: master https://developer.blender.org/rBcf10eb54cc4bc89e763dc48644c402f7578fa6b2 Action Constraint: add Split Channels Mix choices from Copy Transforms Practice shows that when combining actions and direct animation it is usually best to combine location, rotation and scale separately, which is implemented by the Split Channels modes recently introduced in D9469 for Copy Transforms. This completes the same set of 6 choices for the Action Constraint. The default for new constraints is changed to the newly added Before Original (Split Channels) mode. The original patch is motivated by Loic Pinsard, who created an addon that does the equivalent of this feature by splitting the action into two, separating location and rotation+scale. Differential Revision: https://developer.blender.org/D7547 === M source/blender/blenkernel/intern/constraint.c M source/blender/editors/transform/transform_convert.c M source/blender/makesdna/DNA_constraint_types.h M source/blender/makesrna/intern/rna_constraint.c === diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index b7e02f06571..0da29ded13d 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2982,6 +2982,16 @@ static void actcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targ if (VALID_CONS_TARGET(ct) || data->flag & ACTCON_USE_EVAL_TIME) { switch (data->mix_mode) { + /* Simple matrix multiplication. */ + case ACTCON_MIX_BEFORE_FULL: +mul_m4_m4m4(cob->matrix, ct->matrix, cob->matrix); +break; + + case ACTCON_MIX_AFTER_FULL: +mul_m4_m4m4(cob->matrix, cob->matrix, ct->matrix); +break; + + /* Aligned Inherit Scale emulation. */ case ACTCON_MIX_BEFORE: mul_m4_m4m4_aligned_scale(cob->matrix, ct->matrix, cob->matrix); break; @@ -2990,8 +3000,13 @@ static void actcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targ mul_m4_m4m4_aligned_scale(cob->matrix, cob->matrix, ct->matrix); break; - case ACTCON_MIX_AFTER_FULL: -mul_m4_m4m4(cob->matrix, cob->matrix, ct->matrix); + /* Fully separate handling of channels. */ + case ACTCON_MIX_BEFORE_SPLIT: +mul_m4_m4m4_split_channels(cob->matrix, ct->matrix, cob->matrix); +break; + + case ACTCON_MIX_AFTER_SPLIT: +mul_m4_m4m4_split_channels(cob->matrix, cob->matrix, ct->matrix); break; default: @@ -5767,6 +5782,17 @@ static bConstraint *add_new_constraint(Object *ob, } break; } +case CONSTRAINT_TYPE_ACTION: { + /* The Before or Split modes require computing in local space, but + * for objects the Local space doesn't make sense (T78462, D6095 etc). + * So only default to Before (Split) if the constraint is on a bone. */ + if (pchan) { +bActionConstraint *data = con->data; +data->mix_mode = ACTCON_MIX_BEFORE_SPLIT; +con->ownspace = CONSTRAINT_SPACE_LOCAL; + } + break; +} } return con; diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 00fd008151d..e77fedfe143 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -861,10 +861,13 @@ bool constraints_list_needinv(TransInfo *t, ListBase *list) /* The Action constraint only does this in the Before mode. */ bActionConstraint *data = (bActionConstraint *)con->data; - if (ELEM(data->mix_mode, ACTCON_MIX_BEFORE) && + if (ELEM(data->mix_mode, ACTCON_MIX_BEFORE, ACTCON_MIX_BEFORE_FULL) && ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION)) { return true; } + if (ELEM(data->mix_mode, ACTCON_MIX_BEFORE_SPLIT) && ELEM(t->mode, TFM_ROTATION)) { +return true; + } } else if (con->type == CONSTRAINT_TYPE_TRANSFORM) { /* Transform constraint needs it for rotation at least (r.57309), diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index a77fbc9e45e..822b8705c9b 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -901,10 +901,16 @@ typedef enum eActionConstraint_Flags { typedef enum eActionConstraint_MixMode { /* Multiply the action transformation on the right. */ ACTCON_MIX_AFTER_FULL = 0, + /* Multiply the action transformation on the left. */ + ACTCON_MIX_BEFORE_FULL = 3, /* Multiply the action transformation
[Bf-blender-cvs] [d01781129fa] master: Fix T90235: Smooth Brush not working with interior vertices with two adjacent edges
Commit: d01781129fab7846a6a03815b0c0b48b2a809c39 Author: Pablo Dobarro Date: Tue Jul 27 20:26:38 2021 +0200 Branches: master https://developer.blender.org/rBd01781129fab7846a6a03815b0c0b48b2a809c39 Fix T90235: Smooth Brush not working with interior vertices with two adjacent edges The exception to automatically pin vertices of grid corners also has to take into account that the vertex is in a boundary. Reviewed By: JacquesLucke Maniphest Tasks: T90235 Differential Revision: https://developer.blender.org/D12044 === M source/blender/editors/sculpt_paint/sculpt_smooth.c === diff --git a/source/blender/editors/sculpt_paint/sculpt_smooth.c b/source/blender/editors/sculpt_paint/sculpt_smooth.c index eabbfe43e03..38165b7622f 100644 --- a/source/blender/editors/sculpt_paint/sculpt_smooth.c +++ b/source/blender/editors/sculpt_paint/sculpt_smooth.c @@ -88,7 +88,7 @@ void SCULPT_neighbor_coords_average_interior(SculptSession *ss, float result[3], SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); /* Do not modify corner vertices. */ - if (neighbor_count <= 2) { + if (neighbor_count <= 2 && is_boundary) { copy_v3_v3(result, SCULPT_vertex_co_get(ss, index)); return; } ___ 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] [4dd6c9ad450] master: Fix T90236: Sculpt automasking failing when the stroke does not start over the mesh
Commit: 4dd6c9ad450f773a4bfaaad2d54feee815399ce4 Author: Pablo Dobarro Date: Tue Jul 27 20:50:26 2021 +0200 Branches: master https://developer.blender.org/rB4dd6c9ad450f773a4bfaaad2d54feee815399ce4 Fix T90236: Sculpt automasking failing when the stroke does not start over the mesh The active geometry element are usually updated by the cursor drawing code (as they are needed for the cursor preview) and when an sculpt operator starts. For brushes, this was not happening. This was making brushes rely by default on the last cursor drawing update, which can be incorrect if the mouse moved after starting the stroke without hovering the active geometry. Reviewed By: JacquesLucke Maniphest Tasks: T90236 Differential Revision: https://developer.blender.org/D12045 === M source/blender/editors/sculpt_paint/sculpt.c === diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 83388c1aef2..8264affc465 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -7887,6 +7887,9 @@ static bool sculpt_stroke_test_start(bContext *C, struct wmOperator *op, const f sculpt_update_cache_invariants(C, sd, ss, op, mouse); +SculptCursorGeometryInfo sgi; +SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false); + SCULPT_undo_push_begin(ob, sculpt_tool_name(sd)); return true; ___ 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] [6844f7bedb7] master: PyDoc: document how parameter are used for 3D and 2D textures
Commit: 6844f7bedb71883f383bdeff130fd2200750cc54 Author: Aaron Carlisle Date: Thu Aug 5 13:04:59 2021 -0400 Branches: master https://developer.blender.org/rB6844f7bedb71883f383bdeff130fd2200750cc54 PyDoc: document how parameter are used for 3D and 2D textures Improves on rB171433e841379e7efad069bbda9880fb271e2fc4 === M source/blender/makesrna/intern/rna_texture_api.c === diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index c46b9acf986..83c1efd55bc 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -59,19 +59,23 @@ void RNA_api_texture(StructRNA *srna) PropertyRNA *parm; func = RNA_def_function(srna, "evaluate", "texture_evaluate"); - RNA_def_function_ui_description(func, "Evaluate the texture at the coordinates given"); - - parm = RNA_def_float_vector(func, - "value", - 3, - NULL, - -FLT_MAX, - FLT_MAX, - "The object coordinates (x,y,z) used to generate/map the texture", - "", - -1e4, - 1e4); + RNA_def_function_ui_description( + func, "Evaluate the texture at the a given coordinate and returns the result"); + + parm = RNA_def_float_vector( + func, + "value", + 3, + NULL, + -FLT_MAX, + FLT_MAX, + "The coordinates (x,y,z) of the texture, in case of a 3D texture, the z value is the slice " + "of the texture that is evaluated. For 2D textures such as images, the z value is ignored", + "", + -1e4, + 1e4); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + /* return location and normal */ parm = RNA_def_float_vector( func, ___ 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] [a31a0380be6] cycles-x: Tests: run render tests for fixed 10s, and measure time per sample
Commit: a31a0380be6dff2c5bdde3aed8fecdcc0d2f5304 Author: Brecht Van Lommel Date: Wed Jul 21 16:56:22 2021 +0200 Branches: cycles-x https://developer.blender.org/rBa31a0380be6dff2c5bdde3aed8fecdcc0d2f5304 Tests: run render tests for fixed 10s, and measure time per sample Taking advantage of the new time limit rendering to make the benchmark runtime the same on all devices. For scenes with adaptive sampling it still uses the samples specified in the file, since that makes time per sample an unreliable metric. === M tests/performance/tests/animation.py M tests/performance/tests/cycles.py === diff --git a/tests/performance/tests/animation.py b/tests/performance/tests/animation.py index 1a92f1a9718..614876bbbd3 100644 --- a/tests/performance/tests/animation.py +++ b/tests/performance/tests/animation.py @@ -9,14 +9,20 @@ def _run(args): import time start_time = time.time() +elapsed_time = 0.0 +num_frames = 0 -scene = bpy.context.scene -for i in range(scene.frame_start, scene.frame_end): -scene.frame_set(scene.frame_start) +while elapsed_time < 10.0: +scene = bpy.context.scene +for i in range(scene.frame_start, scene.frame_end + 1): +scene.frame_set(scene.frame_start) -elapsed_time = time.time() - start_time +num_frames += scene.frame_end + 1 - scene.frame_start +elapsed_time = time.time() - start_time -result = {'time': elapsed_time} +time_per_frame = elapsed_time / num_frames + +result = {'time': time_per_frame} return result diff --git a/tests/performance/tests/cycles.py b/tests/performance/tests/cycles.py index bac6b8a7ceb..78e3c4bb19d 100644 --- a/tests/performance/tests/cycles.py +++ b/tests/performance/tests/cycles.py @@ -17,6 +17,16 @@ def _run(args): scene.render.image_settings.file_format = 'PNG' scene.cycles.device = 'CPU' if device_type == 'CPU' else 'GPU' +if scene.cycles.use_adaptive_sampling: +# Render samples specified in file, no other way to measure +# adaptive sampling performance reliably. +scene.cycles.time_limit = 0.0 +else: +# Render for fixed amount of time so it's adaptive to the +# machine and devices. +scene.cycles.samples = 16384 +scene.cycles.time_limit = 10.0 + if scene.cycles.device == 'GPU': # Enable specified GPU in preferences. prefs = bpy.context.preferences @@ -62,12 +72,14 @@ class CyclesTest(api.Test): 'device_index': device_index, 'render_filepath': str(env.log_file.parent / (env.log_file.stem + '.png'))} -_, lines = env.run_in_blender(_run, args, ['--debug-cycles', '--verbose', '1', self.filepath]) +_, lines = env.run_in_blender(_run, args, ['--debug-cycles', '--verbose', '2', self.filepath]) # Parse render time from output prefix_time = "Render time (without synchronization): " prefix_memory = "Peak: " +prefix_time_per_sample = "Average time per sample: " time = None +time_per_sample = None memory = None for line in lines: line = line.strip() @@ -75,12 +87,20 @@ class CyclesTest(api.Test): if offset != -1: time = line[offset + len(prefix_time):] time = float(time) +offset = line.find(prefix_time_per_sample) +if offset != -1: +time_per_sample = line[offset + len(prefix_time_per_sample):] +time_per_sample = time_per_sample.split()[0] +time_per_sample = float(time_per_sample) offset = line.find(prefix_memory) if offset != -1: memory = line[offset + len(prefix_memory):] memory = memory.split()[0].replace(',', '') memory = float(memory) +if time_per_sample: +time = time_per_sample + if not (time and memory): raise Exception("Error parsing render time output") ___ 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] [6548752986b] cycles-x: Merge branch 'master' into cycles-x
Commit: 6548752986bde2ee805d49031952a7ff9da130fe Author: Brecht Van Lommel Date: Thu Aug 5 17:57:16 2021 +0200 Branches: cycles-x https://developer.blender.org/rB6548752986bde2ee805d49031952a7ff9da130fe Merge branch 'master' into cycles-x === === diff --cc source/blender/blenloader/intern/versioning_cycles.c index 0e2e6705524,90e6b43f02e..5795448118c --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@@ -1602,16 -1607,34 +1608,47 @@@ void do_versions_after_linking_cycles(M } } + if (!MAIN_VERSION_ATLEAST(bmain, 300, 0)) { +/* Removal of NLM denoiser. */ +for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { + IDProperty *cscene = cycles_properties_from_ID(&scene->id); + + if (cscene) { +if (cycles_property_int(cscene, "denoiser", DENOISER_NLM) == DENOISER_NLM) { + cycles_property_int_set(cscene, "denoiser", DENOISER_OPENIMAGEDENOISE); +} + } +} + } ++ + /* Move visibility from Cycles to Blender. */ + if (!MAIN_VERSION_ATLEAST(bmain, 300, 17)) { + LISTBASE_FOREACH (Object *, object, &bmain->objects) { + IDProperty *cvisibility = cycles_visibility_properties_from_ID(&object->id); + int flag = 0; + + if (cvisibility) { + flag |= cycles_property_boolean(cvisibility, "camera", true) ? 0 : OB_HIDE_CAMERA; + flag |= cycles_property_boolean(cvisibility, "diffuse", true) ? 0 : OB_HIDE_DIFFUSE; + flag |= cycles_property_boolean(cvisibility, "glossy", true) ? 0 : OB_HIDE_GLOSSY; + flag |= cycles_property_boolean(cvisibility, "transmission", true) ? 0 : + OB_HIDE_TRANSMISSION; + flag |= cycles_property_boolean(cvisibility, "scatter", true) ? 0 : OB_HIDE_VOLUME_SCATTER; + flag |= cycles_property_boolean(cvisibility, "shadow", true) ? 0 : OB_HIDE_SHADOW; + } + + IDProperty *cobject = cycles_properties_from_ID(&object->id); + if (cobject) { + flag |= cycles_property_boolean(cobject, "is_holdout", false) ? OB_HOLDOUT : 0; + flag |= cycles_property_boolean(cobject, "is_shadow_catcher", false) ? OB_SHADOW_CATCHER : + 0; + } + + if (object->type == OB_LAMP) { + flag |= OB_HIDE_CAMERA | OB_SHADOW_CATCHER; + } + + object->visibility_flag |= flag; + } + } } ___ 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] [bd44e82b255] master: Geometry Nodes: Add more warnings for out of bounds parameters
Commit: bd44e82b255a231242a1b7ddd59cee7830af20ea Author: Eitan Date: Thu Aug 5 10:44:59 2021 -0500 Branches: master https://developer.blender.org/rBbd44e82b255a231242a1b7ddd59cee7830af20ea Geometry Nodes: Add more warnings for out of bounds parameters Add warning(info) to nodes that don't work when an input value is out of range. For example, the grid node doesn't work with Vertices X or Verices Y less than 2. These are purposefully added as "Info" warnings, because they don't show in the modifier and they aren't printed to the terminal. Differential Revision: https://developer.blender.org/D11923 === M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc === diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc index 667e1c931bd..96c6f073ab3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc @@ -211,6 +211,7 @@ static void geo_node_mesh_primitive_circle_exec(GeoNodeExecParams params) const float radius = params.extract_input("Radius"); const int verts_num = params.extract_input("Vertices"); if (verts_num < 3) { +params.error_message_add(NodeWarningType::Info, TIP_("Vertices must be at least 3")); params.set_output("Geometry", GeometrySet()); return; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc index d46ea2d2050..790a518e584 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc @@ -551,6 +551,7 @@ static void geo_node_mesh_primitive_cone_exec(GeoNodeExecParams params) const int verts_num = params.extract_input("Vertices"); if (verts_num < 3) { +params.error_message_add(NodeWarningType::Info, TIP_("Vertices must be at least 3")); params.set_output("Geometry", GeometrySet()); return; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc index 1767f765da4..b40cb478b03 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc @@ -70,6 +70,7 @@ static void geo_node_mesh_primitive_cylinder_exec(GeoNodeExecParams params) const float depth = params.extract_input("Depth"); const int verts_num = params.extract_input("Vertices"); if (verts_num < 3) { +params.error_message_add(NodeWarningType::Info, TIP_("Vertices must be at least 3")); params.set_output("Geometry", GeometrySet()); return; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc index ac2f5a23a4d..7a97ae8e318 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc @@ -162,6 +162,12 @@ static void geo_node_mesh_primitive_grid_exec(GeoNodeExecParams params) const int verts_x = params.extract_input("Vertices X"); const int verts_y = params.extract_input("Vertices Y"); if (verts_x < 2 || verts_y < 2) { +if (verts_x < 2) { + params.error_message_add(NodeWarningType::Info, TIP_("Vertices X must be at least 2")); +} +if (verts_y < 2) { + params.error_message_add(NodeWarningType::Info, TIP_("Vertices Y must be at least 2")); +} params.set_output("Geometry", GeometrySet()); return; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc index 599c59e4a2e..fe456dc4564 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc @@ -291,6 +291,12 @@ static void geo_node_mesh_primitive_uv_sphere_exec(GeoNodeExecParams params) const int segments_num = params.extract_input("Segments"); const int rings_num = params.extract_input("Rings"); if (segments_num < 3 || rings_num < 2) { +if (segments_num < 3) { + params.error_message_add(NodeWarningType::Info, TIP_("Segments must be at least 3")); +} +if (rings_num < 3) { +
[Bf-blender-cvs] [04c24bec07c] master: Cleanup: replace short with boolean for zero area array
Commit: 04c24bec07c1671b78d94bfd530230ec533fae8e Author: Campbell Barton Date: Fri Aug 6 01:42:01 2021 +1000 Branches: master https://developer.blender.org/rB04c24bec07c1671b78d94bfd530230ec533fae8e Cleanup: replace short with boolean for zero area array Also remove redundant fabsf on the area of a quad/tri & reduce indentation using continue in for loop. === M source/blender/bmesh/operators/bmo_smooth_laplacian.c M source/blender/modifiers/intern/MOD_laplaciansmooth.c === diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index 1d72bb893b2..eb25923d1d1 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -44,7 +44,7 @@ struct BLaplacianSystem { int numEdges; /* Number of edges. */ int numFaces; /* Number of faces. */ int numVerts; /* Number of verts. */ - short *zerola;/* Is zero area or length. */ + bool *zerola; /* Is zero area or length. */ /* Pointers to data. */ BMesh *bm; @@ -98,7 +98,7 @@ static void memset_laplacian_system(LaplacianSystem *sys, int val) memset(sys->ring_areas, val, sizeof(float) * sys->numVerts); memset(sys->vlengths, val, sizeof(float) * sys->numVerts); memset(sys->vweights, val, sizeof(float) * sys->numVerts); - memset(sys->zerola, val, sizeof(short) * sys->numVerts); + memset(sys->zerola, val, sizeof(bool) * sys->numVerts); } static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, int a_numVerts) @@ -139,7 +139,7 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in return NULL; } - sys->zerola = MEM_callocN(sizeof(short) * sys->numVerts, "ModLaplSmoothZeloa"); + sys->zerola = MEM_callocN(sizeof(bool) * sys->numVerts, "ModLaplSmoothZeloa"); if (!sys->zerola) { delete_laplacian_system(sys); return NULL; @@ -181,104 +181,107 @@ static void init_laplacian_matrix(LaplacianSystem *sys) BMVert *vf[4]; BM_ITER_MESH_INDEX (e, &eiter, sys->bm, BM_EDGES_OF_MESH, i) { -if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e)) { - v1 = e->v1->co; - v2 = e->v2->co; - idv1 = BM_elem_index_get(e->v1); - idv2 = BM_elem_index_get(e->v2); - - w1 = len_v3v3(v1, v2); - if (w1 > sys->min_area) { -w1 = 1.0f / w1; -sys->eweights[i] = w1; -sys->vlengths[idv1] += w1; -sys->vlengths[idv2] += w1; - } - else { -sys->zerola[idv1] = 1; -sys->zerola[idv2] = 1; - } +if (BM_elem_flag_test(e, BM_ELEM_SELECT) || !BM_edge_is_boundary(e)) { + continue; +} + +v1 = e->v1->co; +v2 = e->v2->co; +idv1 = BM_elem_index_get(e->v1); +idv2 = BM_elem_index_get(e->v2); + +w1 = len_v3v3(v1, v2); +if (w1 > sys->min_area) { + w1 = 1.0f / w1; + sys->eweights[i] = w1; + sys->vlengths[idv1] += w1; + sys->vlengths[idv2] += w1; +} +else { + sys->zerola[idv1] = true; + sys->zerola[idv2] = true; } } BM_ITER_MESH_INDEX (f, &fiter, sys->bm, BM_FACES_OF_MESH, i) { -if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { - - BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, j) { -vf[j] = vn; - } - has_4_vert = (j == 4) ? 1 : 0; - idv1 = BM_elem_index_get(vf[0]); - idv2 = BM_elem_index_get(vf[1]); - idv3 = BM_elem_index_get(vf[2]); - idv4 = has_4_vert ? BM_elem_index_get(vf[3]) : 0; +if (!BM_elem_flag_test(f, BM_ELEM_SELECT)) { + continue; +} - v1 = vf[0]->co; - v2 = vf[1]->co; - v3 = vf[2]->co; - v4 = has_4_vert ? vf[3]->co : NULL; +BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, j) { + vf[j] = vn; +} +has_4_vert = (j == 4) ? 1 : 0; +idv1 = BM_elem_index_get(vf[0]); +idv2 = BM_elem_index_get(vf[1]); +idv3 = BM_elem_index_get(vf[2]); +idv4 = has_4_vert ? BM_elem_index_get(vf[3]) : 0; + +v1 = vf[0]->co; +v2 = vf[1]->co; +v3 = vf[2]->co; +v4 = has_4_vert ? vf[3]->co : NULL; + +if (has_4_vert) { + areaf = area_quad_v3(v1, v2, v3, v4); +} +else { + areaf = area_tri_v3(v1, v2, v3); +} +if (areaf < sys->min_area) { + sys->zerola[idv1] = true; + sys->zerola[idv2] = true; + sys->zerola[idv3] = true; if (has_4_vert) { -areaf = area_quad_v3(v1, v2, v3, v4); - } - else { -areaf = area_tri_v3(v1, v2, v3); - } - - if (fabsf(areaf) < sys->min_area) { -sys->zerola[idv1] = 1; -sys->zerola[idv2] = 1; -sys->zerola[idv3] = 1; -if (has_4_vert) { - sys->zerola[idv4] = 1; -} +sys->zerola[idv4] = true; } +} - sys->ring_areas[idv1] += are
[Bf-blender-cvs] [c15635bd8d5] master: BMesh: support laplacian smooth for n-gons
Commit: c15635bd8d5483a56107b5c31d8dc0b6a691a767 Author: Campbell Barton Date: Fri Aug 6 01:42:02 2021 +1000 Branches: master https://developer.blender.org/rBc15635bd8d5483a56107b5c31d8dc0b6a691a767 BMesh: support laplacian smooth for n-gons Follow the same logic already used by the modifier. === M source/blender/bmesh/operators/bmo_smooth_laplacian.c M source/blender/editors/mesh/editmesh_tools.c === diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index eb25923d1d1..94856701e72 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -37,12 +37,12 @@ struct BLaplacianSystem { float *eweights; /* Length weights per Edge. */ - float (*fweights)[3]; /* Cotangent weights per face. */ + float (*fweights)[3]; /* Cotangent weights per loop. */ float *ring_areas;/* Total area per ring. */ float *vlengths; /* Total sum of lengths(edges) per vertex. */ float *vweights; /* Total sum of weights per vertex. */ int numEdges; /* Number of edges. */ - int numFaces; /* Number of faces. */ + int numLoops; /* Number of loops. */ int numVerts; /* Number of verts. */ bool *zerola; /* Is zero area or length. */ @@ -57,7 +57,7 @@ struct BLaplacianSystem { typedef struct BLaplacianSystem LaplacianSystem; static bool vert_is_boundary(BMVert *v); -static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, int a_numVerts); +static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numLoops, int a_numVerts); static void init_laplacian_matrix(LaplacianSystem *sys); static void delete_laplacian_system(LaplacianSystem *sys); static void delete_void_pointer(void *data); @@ -94,19 +94,19 @@ static void delete_laplacian_system(LaplacianSystem *sys) static void memset_laplacian_system(LaplacianSystem *sys, int val) { memset(sys->eweights, val, sizeof(float) * sys->numEdges); - memset(sys->fweights, val, sizeof(float) * sys->numFaces * 3); + memset(sys->fweights, val, sizeof(float[3]) * sys->numLoops); memset(sys->ring_areas, val, sizeof(float) * sys->numVerts); memset(sys->vlengths, val, sizeof(float) * sys->numVerts); memset(sys->vweights, val, sizeof(float) * sys->numVerts); memset(sys->zerola, val, sizeof(bool) * sys->numVerts); } -static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, int a_numVerts) +static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numLoops, int a_numVerts) { LaplacianSystem *sys; sys = MEM_callocN(sizeof(LaplacianSystem), "ModLaplSmoothSystem"); sys->numEdges = a_numEdges; - sys->numFaces = a_numFaces; + sys->numLoops = a_numLoops; sys->numVerts = a_numVerts; sys->eweights = MEM_callocN(sizeof(float) * sys->numEdges, "ModLaplSmoothEWeight"); @@ -115,7 +115,7 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in return NULL; } - sys->fweights = MEM_callocN(sizeof(float[3]) * sys->numFaces, "ModLaplSmoothFWeight"); + sys->fweights = MEM_callocN(sizeof(float[3]) * sys->numLoops, "ModLaplSmoothFWeight"); if (!sys->fweights) { delete_laplacian_system(sys); return NULL; @@ -166,31 +166,23 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in static void init_laplacian_matrix(LaplacianSystem *sys) { - float areaf; - float *v1, *v2, *v3, *v4; - float w1, w2, w3, w4; - int i, j; - bool has_4_vert; - uint idv1, idv2, idv3, idv4, idv[4]; BMEdge *e; BMFace *f; BMIter eiter; BMIter fiter; - BMIter vi; - BMVert *vn; - BMVert *vf[4]; + uint i; BM_ITER_MESH_INDEX (e, &eiter, sys->bm, BM_EDGES_OF_MESH, i) { if (BM_elem_flag_test(e, BM_ELEM_SELECT) || !BM_edge_is_boundary(e)) { continue; } -v1 = e->v1->co; -v2 = e->v2->co; -idv1 = BM_elem_index_get(e->v1); -idv2 = BM_elem_index_get(e->v2); +const float *v1 = e->v1->co; +const float *v2 = e->v2->co; +const int idv1 = BM_elem_index_get(e->v1); +const int idv2 = BM_elem_index_get(e->v2); -w1 = len_v3v3(v1, v2); +float w1 = len_v3v3(v1, v2); if (w1 > sys->min_area) { w1 = 1.0f / w1; sys->eweights[i] = w1; @@ -203,176 +195,126 @@ static void init_laplacian_matrix(LaplacianSystem *sys) } } - BM_ITER_MESH_INDEX (f, &fiter, sys->bm, BM_FACES_OF_MESH, i) { + uint l_curr_index = 0; + + BM_ITER_MESH (f, &fiter, sys->bm, BM_FACES_OF_MESH) { if (!BM_elem_flag_test(f, BM_ELEM_SELECT)) { + l_curr_index += f->len; continue; } -BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, j) { - vf[j] = vn; -} -has_4_vert = (j == 4) ? 1 : 0; -idv1 = BM_elem_i
[Bf-blender-cvs] [24458a1e7a0] cycles-x: Fix dead-lock when cancelling viewport render in Cycles X
Commit: 24458a1e7a044d1a1c23658fa05aa91c61abefc3 Author: Sergey Sharybin Date: Thu Aug 5 17:34:16 2021 +0200 Branches: cycles-x https://developer.blender.org/rB24458a1e7a044d1a1c23658fa05aa91c61abefc3 Fix dead-lock when cancelling viewport render in Cycles X This change is supposed to fix a hard-to-reproduce bug when Blender gets stuck when quitting while viewport render ins going. Ensure consistency in the check for the pause, so that it is checked before asking to wait the condition variable. Otherwise it was possible to miss the notification and not react to the pause state properly. === M intern/cycles/render/session.cpp === diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 30e4a8953e8..75ca2bc79e9 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -317,7 +317,7 @@ bool Session::run_wait_for_work(const RenderWork &render_work) update_status_time(pause, no_work); - while (true) { + while (pause) { scoped_timer pause_timer; pause_cond.wait(pause_lock); if (pause) { @@ -326,10 +326,6 @@ bool Session::run_wait_for_work(const RenderWork &render_work) update_status_time(pause, no_work); progress.set_update(); - -if (!pause) { - break; -} } return no_work; ___ 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] [ff2265f0a92] master: Cleanup: comment blocks & spelling
Commit: ff2265f0a9269ad5e95f77ded3c9692d656955c7 Author: Campbell Barton Date: Fri Aug 6 01:36:43 2021 +1000 Branches: master https://developer.blender.org/rBff2265f0a9269ad5e95f77ded3c9692d656955c7 Cleanup: comment blocks & spelling === M intern/ghost/intern/GHOST_XrAction.h M source/blender/compositor/operations/COM_DilateErodeOperation.cc M source/blender/depsgraph/intern/builder/deg_builder_rna.cc M source/blender/makesdna/DNA_xr_types.h === diff --git a/intern/ghost/intern/GHOST_XrAction.h b/intern/ghost/intern/GHOST_XrAction.h index 73a1cd9cd6a..70eaa694ae9 100644 --- a/intern/ghost/intern/GHOST_XrAction.h +++ b/intern/ghost/intern/GHOST_XrAction.h @@ -18,8 +18,8 @@ * \ingroup GHOST */ -/* Note: Requires OpenXR headers to be included before this one for OpenXR types (XrSpace, XrPath, - * etc.). */ +/* NOTE: Requires OpenXR headers to be included before this one for OpenXR types + * (XrSpace, XrPath, etc.). */ #pragma once @@ -78,9 +78,9 @@ class GHOST_XrActionProfile { private: XrPath m_profile = XR_NULL_PATH; - /** Subaction data identified by user (subaction) path. */ + /** Sub-action data identified by user `subaction` path. */ std::map m_subaction_data; - /** Bindings identified by interaction (user (subaction) + component) path. */ + /** Bindings identified by interaction (user `subaction` + component) path. */ std::map m_bindings; }; diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cc b/source/blender/compositor/operations/COM_DilateErodeOperation.cc index e9305e0e192..c67a35b686c 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.cc +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cc @@ -370,7 +370,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect) int bwidth = rect->xmax - rect->xmin; int bheight = rect->ymax - rect->ymin; - /* NOTE: Cache buffer has original tilesize width, but new height. + /* NOTE: Cache buffer has original tile-size width, but new height. * We have to calculate the additional rows in the first pass, * to have valid data available for the second pass. */ tile_info *result = create_cache(rect->xmin, rect->xmax, ymin, ymax); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index bdabd67cc07..40e59875832 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -400,8 +400,8 @@ RNANodeQueryIDData *RNANodeQuery::ensure_id_data(const ID *id) bool rna_prop_affects_parameters_node(const PointerRNA *ptr, const PropertyRNA *prop) { return prop != nullptr && RNA_property_is_idprop(prop) && - /* ID properties in the geometry nodes modifier don't affect that parameters node. Instead -they affect the modifier and therefore the geometry node directly. */ + /* ID properties in the geometry nodes modifier don't affect that parameters node. + * Instead they affect the modifier and therefore the geometry node directly. */ !RNA_struct_is_a(ptr->type, &RNA_NodesModifier); } diff --git a/source/blender/makesdna/DNA_xr_types.h b/source/blender/makesdna/DNA_xr_types.h index 2e348ce6855..a9d42f7 100644 --- a/source/blender/makesdna/DNA_xr_types.h +++ b/source/blender/makesdna/DNA_xr_types.h @@ -34,7 +34,7 @@ typedef struct XrSessionSettings { char _pad[7]; - char base_pose_type; /* eXRSessionBasePoseType */ + char base_pose_type; /* #eXRSessionBasePoseType */ /** Object to take the location and rotation as base position from. */ Object *base_pose_object; float base_pose_location[3]; @@ -78,22 +78,26 @@ typedef enum eXrOpFlag { } eXrOpFlag; typedef enum eXrActionFlag { - /** Action depends on two subaction paths (i.e. two-handed/bimanual action). */ + /** Action depends on two sub-action paths (i.e. two-handed/bi-manual action). */ XR_ACTION_BIMANUAL = (1 << 0), } eXrActionFlag; typedef enum eXrHapticFlag { /** Whether to apply haptics to corresponding user paths for an action and its haptic action. */ XR_HAPTIC_MATCHUSERPATHS = (1 << 0), - /** Determines how haptics will be applied ("repeat" is mutually exclusive with - "press"/"release"). */ + /** + * Determines how haptics will be applied + * ("repeat" is mutually exclusive with "press"/"release"). + */ XR_HAPTIC_PRESS = (1 << 1), XR_HAPTIC_RELEASE = (1 << 2), XR_HAPTIC_REPEAT = (1 << 3), } eXrHapticFlag; -/** For axis-based inputs (thumbstick/trackpad/etc). Determines the region for action execution - * (mutually exclusive per axis). */ +/** + * For axis-based inputs (thumb-stick/track-pad/etc). + * Determines the region for action execution (mutually exclus
[Bf-blender-cvs] [8158211198b] master: Cleanup: quiet array-parameter warning
Commit: 8158211198b7a27812ddf90bf0d1df0cd9e55afb Author: Campbell Barton Date: Fri Aug 6 01:32:04 2021 +1000 Branches: master https://developer.blender.org/rB8158211198b7a27812ddf90bf0d1df0cd9e55afb Cleanup: quiet array-parameter warning === M source/blender/makesrna/intern/rna_xr.c === diff --git a/source/blender/makesrna/intern/rna_xr.c b/source/blender/makesrna/intern/rna_xr.c index 57133ebe1c1..9a512e351cb 100644 --- a/source/blender/makesrna/intern/rna_xr.c +++ b/source/blender/makesrna/intern/rna_xr.c @@ -829,7 +829,7 @@ void rna_XrSessionState_haptic_action_stop(bContext *C, static void rna_XrSessionState_controller_grip_location_get(bContext *C, int *index, -float *r_values) +float r_values[3]) { # ifdef WITH_XR_OPENXR const wmWindowManager *wm = CTX_wm_manager(C); @@ -842,7 +842,7 @@ static void rna_XrSessionState_controller_grip_location_get(bContext *C, static void rna_XrSessionState_controller_grip_rotation_get(bContext *C, int index, -float *r_values) +float r_values[4]) { # ifdef WITH_XR_OPENXR const wmWindowManager *wm = CTX_wm_manager(C); @@ -855,7 +855,7 @@ static void rna_XrSessionState_controller_grip_rotation_get(bContext *C, static void rna_XrSessionState_controller_aim_location_get(bContext *C, int *index, - float *r_values) + float r_values[3]) { # ifdef WITH_XR_OPENXR const wmWindowManager *wm = CTX_wm_manager(C); @@ -866,7 +866,9 @@ static void rna_XrSessionState_controller_aim_location_get(bContext *C, # endif } -static void rna_XrSessionState_controller_aim_rotation_get(bContext *C, int index, float *r_values) +static void rna_XrSessionState_controller_aim_rotation_get(bContext *C, + int index, + float r_values[4]) { # ifdef WITH_XR_OPENXR const wmWindowManager *wm = CTX_wm_manager(C); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6343cd913da] temp-geometry-nodes-expandable-geometry-socket-prototype: support execution geometry expander
Commit: 6343cd913da35925cb6673813f1ad69043f6deb8 Author: Jacques Lucke Date: Thu Aug 5 17:27:00 2021 +0200 Branches: temp-geometry-nodes-expandable-geometry-socket-prototype https://developer.blender.org/rB6343cd913da35925cb6673813f1ad69043f6deb8 support execution geometry expander === M source/blender/editors/space_node/node_edit.cc M source/blender/makesdna/DNA_node_types.h M source/blender/makesrna/intern/rna_nodetree.c M source/blender/nodes/NOD_geometry_exec.hh M source/blender/nodes/geometry/node_geometry_util.hh M source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc M source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc === diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index dd053367eff..f35318f2ad1 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -2999,7 +2999,7 @@ static void foreach_available_attribute( if (ELEM(group_input->type, SOCK_INT, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_BOOLEAN)) { GeometryExpanderOutput attribute; attribute.type = GEOMETRY_EXPANDER_OUTPUT_TYPE_INPUT; - attribute.domain = ATTR_DOMAIN_POINT; + attribute.array_source = GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_VERTICES; attribute.socket_type = (eNodeSocketDatatype)group_input->type; STRNCPY(attribute.input_identifier, group_input->identifier); callback(attribute); @@ -3012,7 +3012,7 @@ static void foreach_available_attribute( GeometryExpanderOutput attribute; attribute.type = GEOMETRY_EXPANDER_OUTPUT_TYPE_LOCAL; attribute.socket_type = (eNodeSocketDatatype)node_output->type; -attribute.domain = ATTR_DOMAIN_POINT; +attribute.array_source = GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_VERTICES; STRNCPY(attribute.local_node_name, node->name); STRNCPY(attribute.local_socket_identifier, node_output->identifier); callback(attribute); @@ -3023,7 +3023,7 @@ static void foreach_available_attribute( GeometryExpanderOutput attribute; attribute.type = GEOMETRY_EXPANDER_OUTPUT_TYPE_BUILTIN; attribute.socket_type = SOCK_VECTOR; -attribute.domain = ATTR_DOMAIN_POINT; +attribute.array_source = GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_VERTICES; STRNCPY(attribute.builtin_identifier, "position"); callback(attribute); } @@ -3031,7 +3031,7 @@ static void foreach_available_attribute( GeometryExpanderOutput attribute; attribute.type = GEOMETRY_EXPANDER_OUTPUT_TYPE_BUILTIN; attribute.socket_type = SOCK_INT; -attribute.domain = ATTR_DOMAIN_FACE; +attribute.array_source = GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_VERTICES; STRNCPY(attribute.builtin_identifier, "material_index"); callback(attribute); } diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 62a09719904..d79721cdeca 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1431,6 +1431,16 @@ typedef enum eGeometryExpanderOutputType { GEOMETRY_EXPANDER_OUTPUT_TYPE_BUILTIN, } eGeometryExpanderOutputType; +typedef enum eGeometryExpanderArraySource { + GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_VERTICES = 0, + GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_EDGES = 1, + GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_FACES = 2, + GEOMETRY_EXPANDER_ARRAY_SOURCE_MESH_FACE_CORNERS = 3, + GEOMETRY_EXPANDER_ARRAY_SOURCE_POINT_CLOUD_POINTS = 4, + GEOMETRY_EXPANDER_ARRAY_SOURCE_CURVE_POINTS = 5, + GEOMETRY_EXPANDER_ARRAY_SOURCE_CURVE_SPLINES = 6, +} AttributeArraySource; + typedef struct GeometryExpanderOutput { struct GeometryExpanderOutput *next, *prev; @@ -1445,13 +1455,11 @@ typedef struct GeometryExpanderOutput { /* Derived from the other data. */ char display_name_cache[64]; - /* AttributeDomain. */ - int8_t domain; - /* GeometryComponentType. */ - int8_t component_type; + /* eGeometryExpanderAttributeSource. */ + int8_t array_source; /* eNodeSocketDatatype. */ int8_t socket_type; - char _pad2[5]; + char _pad2[6]; /* Local attribute data. */ char local_node_name[64]; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 310f04e54cc..95495022c13 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -39,6 +39,7 @@ #include "BKE_animsys.h" #include "BKE_attribute.h" #include "BKE_cryptomatte.h" +#include "BKE_geometry_set.h" #include "BKE_image.h" #include "BKE_node.h" #include "BKE_texture.h" @@ -10260,13 +10261,35 @@ static void def_geo_geometry_expander_output(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static const EnumPropertyItem array_s
[Bf-blender-cvs] [fa37d090402] temp-geometry-nodes-expandable-geometry-socket-prototype: reuse GeometryExpanderOutput struct
Commit: fa37d09040214858cce516792afaec5b1555ad6a Author: Jacques Lucke Date: Thu Aug 5 15:53:48 2021 +0200 Branches: temp-geometry-nodes-expandable-geometry-socket-prototype https://developer.blender.org/rBfa37d09040214858cce516792afaec5b1555ad6a reuse GeometryExpanderOutput struct === M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/intern/node.cc M source/blender/editors/space_node/node_edit.cc M source/blender/makesdna/DNA_node_types.h M source/blender/makesrna/intern/rna_nodetree.c M source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc === diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 0f50a7bc1f6..4c4231877bf 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -735,6 +735,9 @@ void nodeSetSocketAvailability(struct bNodeSocket *sock, bool is_available); int nodeSocketLinkLimit(const struct bNodeSocket *sock); +void nodeGeometryExpanderUpdateOutputNameCache(struct GeometryExpanderOutput *expander_output, + const bNodeTree *ntree); + /* Node Clipboard */ void BKE_node_clipboard_init(const struct bNodeTree *ntree); void BKE_node_clipboard_clear(void); diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 625973d8a92..03ade8b0cc1 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -71,7 +71,9 @@ #include "BKE_node.h" #include "BLI_ghash.h" +#include "BLI_string_ref.hh" #include "BLI_threads.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -90,6 +92,8 @@ #include "MOD_nodes.h" +using blender::StringRef; + #define NODE_DEFAULT_MAX_WIDTH 700 /* Fallback types for undefined tree, nodes, sockets */ @@ -3926,6 +3930,36 @@ int nodeSocketLinkLimit(const bNodeSocket *sock) return sock->limit; } +static std::string expander_output_to_name(const GeometryExpanderOutput &expander_output, + const bNodeTree &ntree) +{ + switch (expander_output.type) { +case GEOMETRY_EXPANDER_OUTPUT_TYPE_LOCAL: { + return expander_output.local_node_name + StringRef(" ▶ ") + + expander_output.local_socket_identifier; +} +case GEOMETRY_EXPANDER_OUTPUT_TYPE_INPUT: { + LISTBASE_FOREACH (const bNodeSocket *, socket, &ntree.inputs) { +if (socket->identifier == StringRef(expander_output.input_identifier)) { + return StringRef("Input ▶ ") + socket->name; +} + } + return "Unkown input"; +} +case GEOMETRY_EXPANDER_OUTPUT_TYPE_BUILTIN: { + return StringRef("Built-in ▶ ") + expander_output.builtin_identifier; +} + } + return ""; +} + +void nodeGeometryExpanderUpdateOutputNameCache(struct GeometryExpanderOutput *expander_output, + const bNodeTree *ntree) +{ + const std::string name = expander_output_to_name(*expander_output, *ntree); + STRNCPY(expander_output->display_name_cache, name.c_str()); +} + /* ** Node Clipboard *** */ #define USE_NODE_CB_VALIDATE diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 8039c79fcc2..8a22199986a 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -82,6 +82,7 @@ #include "node_intern.h" /* own include */ using blender::FunctionRef; +using blender::MutableSpan; using blender::Span; using blender::StringRef; using blender::StringRefNull; @@ -2989,35 +2990,18 @@ void NODE_OT_cryptomatte_layer_remove(wmOperatorType *ot) /* ** Geometry Expander Add Output *** */ -namespace { -struct AvailableAttribute { - eGeometryExpanderOutputType type; - eNodeSocketDatatype socket_type = SOCK_FLOAT; - std::string socket_name; - - std::string local_node_name; - std::string local_socket_identifier; - - std::string input_identifier; - std::string input_name; - - std::string builtin_identifier; -}; -} // namespace - static void foreach_available_attribute( bNodeTree *ntree, bNode *UNUSED(current_node), -FunctionRef callback) +FunctionRef callback) { LISTBASE_FOREACH (bNodeSocket *, group_input, &ntree->inputs) { if (ELEM(group_input->type, SOCK_INT, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_BOOLEAN)) { - AvailableAttribute attribute; + GeometryExpanderOutput attribute; attribute.type = GEOMETRY_EXPANDER_OUTPUT_TYPE_INPUT; - attribute.input_identifier = group_input->identifier; - attribute.input_name = group_input->name; + attribute.domain = ATTR_DOMAIN_POINT; attribute.socket_type = (eNodeSocketDatatype)group_input->t
[Bf-blender-cvs] [d5dc3501b55] temp-geometry-nodes-expandable-geometry-socket-prototype: show warning when expander output is not available
Commit: d5dc3501b550dd1ebf90e290ac80b30c82797b54 Author: Jacques Lucke Date: Thu Aug 5 16:14:51 2021 +0200 Branches: temp-geometry-nodes-expandable-geometry-socket-prototype https://developer.blender.org/rBd5dc3501b550dd1ebf90e290ac80b30c82797b54 show warning when expander output is not available === M source/blender/editors/space_node/node_edit.cc M source/blender/makesdna/DNA_node_types.h M source/blender/makesrna/intern/rna_nodetree.c M source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc === diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 8a22199986a..dd053367eff 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -3108,6 +3108,7 @@ static int node_geometry_expander_output_add_exec(bContext *C, wmOperator *op) sizeof(GeometryExpanderOutput), __func__); *expander_output = attribute; STRNCPY(expander_output->socket_identifier, identifier.c_str()); + expander_output->is_outdated = false; BLI_addtail(&storage->outputs, expander_output); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 671e6da4e56..62a09719904 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1436,7 +1436,8 @@ typedef struct GeometryExpanderOutput { /* eGeometryExpanderOutputType. */ int type; - char _pad[4]; + uint8_t is_outdated; + char _pad[3]; /* Identifier of the corresponding socket in the geometry expander. */ char socket_identifier[64]; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 81e11e93fcd..310f04e54cc 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2443,9 +2443,6 @@ static void rna_Node_select_set(PointerRNA *ptr, bool value) nodeSetSelected(node, value); } -void nodeGeometryExpanderUpdateOutputNameCache(GeometryExpanderOutput *expander_output, - const bNodeTree *ntree); - static void rna_Node_name_set(PointerRNA *ptr, const char *value) { bNodeTree *ntree = (bNodeTree *)ptr->owner_id; @@ -2479,6 +2476,36 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value) BKE_animdata_fix_paths_rename_all(NULL, "nodes", oldname, node->name); } +void rna_NodeSocket_add_to_geometry_set(PointerRNA *ptr, const bool value) +{ + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; + bNodeSocket *socket = (bNodeSocket *)ptr->data; + bNode *node; + nodeFindNode(ntree, socket, &node, NULL); + if (value) { +socket->flag |= SOCK_ADD_ATTRIBUTE_TO_GEOMETRY; + } + else { +socket->flag &= ~SOCK_ADD_ATTRIBUTE_TO_GEOMETRY; + } + + LISTBASE_FOREACH (bNode *, other_node, &ntree->nodes) { +if (other_node->type != GEO_NODE_GEOMETRY_EXPANDER) { + continue; +} +NodeGeometryGeometryExpander *storage = (NodeGeometryGeometryExpander *)other_node->storage; +LISTBASE_FOREACH (GeometryExpanderOutput *, expander_output, &storage->outputs) { + if (expander_output->type != GEOMETRY_EXPANDER_OUTPUT_TYPE_LOCAL) { +continue; + } + if (STREQ(expander_output->local_node_name, node->name) && + STREQ(expander_output->local_socket_identifier, socket->identifier)) { +expander_output->is_outdated = !value; + } +} + } +} + static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, Main *bmain, @@ -10404,6 +10431,7 @@ static void rna_def_node_socket(BlenderRNA *brna) prop = RNA_def_property(srna, "add_to_geometry", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_ADD_ATTRIBUTE_TO_GEOMETRY); + RNA_def_property_boolean_funcs(prop, NULL, "rna_NodeSocket_add_to_geometry_set"); RNA_def_property_ui_text( prop, "Add to Geometry", diff --git a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc index 54fc1b46652..647dcf6520a 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_geometry_expander.cc @@ -63,7 +63,12 @@ static bool geo_node_geometry_expander_socket_layout(const bContext *UNUSED(C), uiLayout *row = uiLayoutRow(layout, true); uiLayout *split = uiLayoutSplit(row, 0.7, false); uiItemL(split, expander_output->display_name_cache, ICON_NONE); - uiItemR(split, &expander_output_ptr, "domain", 0, "", ICON_NONE); + if (expander_output->is_outdated) { +uiItemL(split, "", ICON_ERROR); + } + else { +uiItemR(split, &expander_output_
[Bf-blender-cvs] [0ce5b5be3b3] temp-geometry-nodes-expandable-geometry-socket-prototype: Merge branch 'master' into temp-geometry-nodes-expandable-geometry-socket-prototype
Commit: 0ce5b5be3b3dc693aca2e092223ffa59522b69a5 Author: Jacques Lucke Date: Thu Aug 5 14:24:26 2021 +0200 Branches: temp-geometry-nodes-expandable-geometry-socket-prototype https://developer.blender.org/rB0ce5b5be3b3dc693aca2e092223ffa59522b69a5 Merge branch 'master' into temp-geometry-nodes-expandable-geometry-socket-prototype === === ___ 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] [d3b41c6b670] asset-greasepencil: Merge branch 'master' into asset-greasepencil
Commit: d3b41c6b670e4c95934bcb865bcad087acb6e914 Author: Antonio Vazquez Date: Thu Aug 5 17:23:43 2021 +0200 Branches: asset-greasepencil https://developer.blender.org/rBd3b41c6b670e4c95934bcb865bcad087acb6e914 Merge branch 'master' into asset-greasepencil === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ca64bd0aacd] master: Render: move Cycles visibility, holdout and shadow catcher properties to Blender
Commit: ca64bd0aacdaa9fcf75d693321d4d73c4a6a991a Author: Brecht Van Lommel Date: Wed Aug 4 19:43:40 2021 +0200 Branches: master https://developer.blender.org/rBca64bd0aacdaa9fcf75d693321d4d73c4a6a991a Render: move Cycles visibility, holdout and shadow catcher properties to Blender The immediate reason for this is that we want to be able to initialize them to different defaults for light objects, which is hard with Python properties. But in general it is useful to be able to share these with other renderers. As a side effect, Eevee now supports a per-object holdout instead of only per-collection. Differential Revision: https://developer.blender.org/D12133 === M intern/cycles/blender/addon/properties.py M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_object.cpp M intern/cycles/blender/blender_util.h M release/scripts/startup/bl_ui/properties_object.py M source/blender/blenkernel/intern/layer.c M source/blender/blenkernel/intern/object.c M source/blender/blenloader/intern/versioning_cycles.c M source/blender/makesdna/DNA_object_types.h M source/blender/makesrna/intern/rna_object.c === diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 70efb1054a2..124223635d1 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1164,12 +1164,6 @@ class CyclesVisibilitySettings(bpy.types.PropertyGroup): @classmethod def register(cls): -bpy.types.Object.cycles_visibility = PointerProperty( -name="Cycles Visibility Settings", -description="Cycles visibility settings", -type=cls, -) - bpy.types.World.cycles_visibility = PointerProperty( name="Cycles Visibility Settings", description="Cycles visibility settings", @@ -1178,7 +1172,6 @@ class CyclesVisibilitySettings(bpy.types.PropertyGroup): @classmethod def unregister(cls): -del bpy.types.Object.cycles_visibility del bpy.types.World.cycles_visibility @@ -1276,20 +1269,6 @@ class CyclesObjectSettings(bpy.types.PropertyGroup): subtype='DISTANCE', ) -is_shadow_catcher: BoolProperty( -name="Shadow Catcher", -description="Only render shadows on this object, for compositing renders into real footage", -default=False, -) - -is_holdout: BoolProperty( -name="Holdout", -description="Render objects as a holdout or matte, creating a " -"hole in the image with zero alpha, to fill out in " -"compositing with real footage or another render", -default=False, -) - @classmethod def register(cls): bpy.types.Object.cycles = PointerProperty( diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index e804f697571..47f7b4c6d73 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1270,10 +1270,9 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel): col.prop(ob, "hide_render", text="Renders", invert_checkbox=True, toggle=False) if has_geometry_visibility(ob): -cob = ob.cycles col = layout.column(heading="Mask") -col.prop(cob, "is_shadow_catcher") -col.prop(cob, "is_holdout") +col.prop(ob, "is_shadow_catcher") +col.prop(ob, "is_holdout") class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel): @@ -1293,19 +1292,17 @@ class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel): scene = context.scene ob = context.object -cob = ob.cycles -visibility = ob.cycles_visibility col = layout.column() -col.prop(visibility, "camera") -col.prop(visibility, "diffuse") -col.prop(visibility, "glossy") -col.prop(visibility, "transmission") -col.prop(visibility, "scatter") +col.prop(ob, "visible_camera", text="Camera") +col.prop(ob, "visible_diffuse", text="Diffuse") +col.prop(ob, "visible_glossy", text="Glossy") +col.prop(ob, "visible_transmission", text="Transmission") +col.prop(ob, "visible_volume_scatter", text="Volume Scatter") if ob.type != 'LIGHT': sub = col.column() -sub.prop(visibility, "shadow") +sub.prop(ob, "visible_shadow", text="Shadow") class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel): diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 65b5ac2c58f..4711e0cbe76 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -199,8 +199,7 @@ Object
[Bf-blender-cvs] [899691e9f47] greasepencil-object: Merge branch 'master' into greasepencil-object
Commit: 899691e9f47b74906763d75ffca2e5390d8dd41a Author: Antonio Vazquez Date: Thu Aug 5 17:23:09 2021 +0200 Branches: greasepencil-object https://developer.blender.org/rB899691e9f47b74906763d75ffca2e5390d8dd41a Merge branch 'master' into greasepencil-object === === ___ 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] [6c326ba0a24] master: Fix T83164: Spline IK `joint_bindings` parameter is broken.
Commit: 6c326ba0a24f24763b751483a0ee0cc98abdd921 Author: Bastien Montagne Date: Thu Aug 5 17:17:15 2021 +0200 Branches: master https://developer.blender.org/rB6c326ba0a24f24763b751483a0ee0cc98abdd921 Fix T83164: Spline IK `joint_bindings` parameter is broken. Code freeing the array would not properly reset its length value to zero. Note that this corrupted data could also be saved in .blend files, so had to bump fileversion and add some doversion code too. Fix T90166: crash when creating a liboverride. === M source/blender/blenkernel/BKE_blender_version.h M source/blender/blenkernel/intern/constraint.c M source/blender/blenloader/intern/versioning_300.c M source/blender/editors/object/object_constraint.c === diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 0d5835a5eed..5ef56fab9cb 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 16 +#define BLENDER_FILE_SUBVERSION 17 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 022073b0f12..b7e02f06571 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -4616,9 +4616,7 @@ static void splineik_free(bConstraint *con) bSplineIKConstraint *data = con->data; /* binding array */ - if (data->points) { -MEM_freeN(data->points); - } + MEM_SAFE_FREE(data->points); } static void splineik_copy(bConstraint *con, bConstraint *srccon) diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 7df4d2d93ec..42af8f4bda2 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -29,6 +29,7 @@ #include "DNA_armature_types.h" #include "DNA_brush_types.h" #include "DNA_collection_types.h" +#include "DNA_constraint_types.h" #include "DNA_curve_types.h" #include "DNA_genfile.h" #include "DNA_listBase.h" @@ -383,6 +384,19 @@ static void do_version_bones_bbone_len_scale(ListBase *lb) } } +static void do_version_constraints_spline_ik_joint_bindings(ListBase *lb) +{ + /* Binding array data could be freed without properly resetting its size data. */ + LISTBASE_FOREACH (bConstraint *, con, lb) { +if (con->type == CONSTRAINT_TYPE_SPLINEIK) { + bSplineIKConstraint *data = (bSplineIKConstraint *)con->data; + if (data->points == NULL) { +data->numpoints = 0; + } +} + } +} + /* NOLINTNEXTLINE: readability-function-size */ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) { @@ -697,18 +711,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) BKE_main_id_repair_duplicate_names_listbase(lb); } - /** - * Versioning code until next subversion bump goes here. - * - * \note Be sure to check when bumping the version: - * - "versioning_userdef.c", #blo_do_versions_userdef - * - "versioning_userdef.c", #do_versions_theme - * - * \note Keep this message at the bottom of the function. - */ - { -/* Keep this block, even when empty. */ - + if (!MAIN_VERSION_ATLEAST(bmain, 300, 17)) { if (!DNA_struct_elem_find( fd->filesdna, "View3DOverlay", "float", "normals_constant_screen_size")) { LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { @@ -722,5 +725,29 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + +/* Fix SplineIK constraint's inconsistency between binding points array and its stored size. */ +LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + /* NOTE: Objects should never have SplineIK constraint, so no need to apply this fix on + * their constraints. */ + if (ob->pose) { +LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { + do_version_constraints_spline_ik_joint_bindings(&pchan->constraints); +} + } +} + } + + /** + * Versioning code until next subversion bump goes here. + * + * \note Be sure to check when bumping the version: + * - "versioning_userdef.c", #blo_do_versions_userdef + * - "versioning_userdef.c", #do_versions_theme + * + * \note Keep this message at the bottom of the function. + */ + { +/* Keep this block, even when empty. */ } } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/edito
[Bf-blender-cvs] [834523e2391] master: Cleanup/Fix RNA array length accessors returning non-zero values in invalid cases.
Commit: 834523e2391b3c8dab393daa040e135d7b729f86 Author: Bastien Montagne Date: Thu Aug 5 16:48:16 2021 +0200 Branches: master https://developer.blender.org/rB834523e2391b3c8dab393daa040e135d7b729f86 Cleanup/Fix RNA array length accessors returning non-zero values in invalid cases. This was apparently done in two places only, with a very cryptic comment (`/* for raw_access, untested */`), and... I cannot see how returning a non-zero length value for an array that does not exist or is not accessible at least, would be anything but an obvious source of issues. Note that both commits adding those lines are from stone ages (2009): rBcbc2c1886dee and rB50e3bb7f5f34. === M source/blender/makesrna/intern/rna_constraint.c M source/blender/makesrna/intern/rna_fcurve.c === diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 3064703b02e..a0a0a41b58d 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -715,7 +715,7 @@ static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr, length[0] = ikData->numpoints; } else { -length[0] = 256; /* for raw_access, untested */ +length[0] = 0; } return length[0]; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 1f187382980..a38bbd3d6d2 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -809,7 +809,7 @@ static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr, length[0] = gen->arraysize; } else { -length[0] = 100; /* for raw_access, untested */ +length[0] = 0; } return length[0]; ___ 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] [f346cb5b473] cycles-x: Cycles X: Silence OIDN denoising cancel message
Commit: f346cb5b4732384c4c0622054f8ae7349e09ea9b Author: Sergey Sharybin Date: Thu Aug 5 17:16:17 2021 +0200 Branches: cycles-x https://developer.blender.org/rBf346cb5b4732384c4c0622054f8ae7349e09ea9b Cycles X: Silence OIDN denoising cancel message Cancel is considered to be an error by the OIDN library, but we do cancel to keep viewport interactive and this is not an error as far as we are concerned. === M intern/cycles/integrator/denoiser_oidn.cpp === diff --git a/intern/cycles/integrator/denoiser_oidn.cpp b/intern/cycles/integrator/denoiser_oidn.cpp index 2726baaebe8..12bf6425e06 100644 --- a/intern/cycles/integrator/denoiser_oidn.cpp +++ b/intern/cycles/integrator/denoiser_oidn.cpp @@ -199,7 +199,8 @@ class OIDNDenoiseContext { /* Check for errors. */ const char *error_message; -if (oidn_device.getError(error_message) != oidn::Error::None) { +const oidn::Error error = oidn_device.getError(error_message); +if (error != oidn::Error::None && error != oidn::Error::Cancelled) { LOG(ERROR) << "OpenImageDenoise error: " << error_message; } ___ 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] [7440807beb9] cycles-x: Cycles X: refactor passes to work like other nodes in the scene
Commit: 7440807beb9eb1e65b9285fd005ae11a6a4ecf71 Author: Brecht Van Lommel Date: Thu Jul 29 17:56:34 2021 +0200 Branches: cycles-x https://developer.blender.org/rB7440807beb9eb1e65b9285fd005ae11a6a4ecf71 Cycles X: refactor passes to work like other nodes in the scene * Alloc through create_node() instead of Pass::add(). * Handle auto adding of passes, duplicate removal and other validation in update_pass(), afterwards. * Centralize pass logic from scene.cpp and pass.cpp into film.cpp. * Move logic for which passes are read/written or noisy/denoised out of Blender sync. * Eliminate or change DENOISED to NOISY passes when denoising is disabled, rather than using is_written(). This makes some upcoming changes easier, and is also a step towards a better Cycles public API. Differential Revision: https://developer.blender.org/D12118 === M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_sync.cpp M intern/cycles/graph/node.cpp M intern/cycles/graph/node.h M intern/cycles/integrator/pass_accessor.cpp M intern/cycles/integrator/pass_accessor.h M intern/cycles/render/bake.cpp M intern/cycles/render/bake.h M intern/cycles/render/buffers.cpp M intern/cycles/render/buffers.h M intern/cycles/render/film.cpp M intern/cycles/render/film.h M intern/cycles/render/pass.cpp M intern/cycles/render/pass.h M intern/cycles/render/scene.cpp M intern/cycles/render/scene.h M intern/cycles/render/session.cpp === diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index c44812b436f..99236f20464 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -631,7 +631,9 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_, /* Add render pass that we want to bake, and name it Combined so that it is * used as that on the Blender side. */ const PassType pass_type = bake_type_to_pass(bake_type, bake_filter); - Pass::add(scene->passes, pass_type, "Combined"); + Pass *pass = scene->create_node(); + pass->type = pass_type; + pass->name = "Combined"; session->read_render_tile_cb = [&]() { read_render_tile(); }; session->write_render_tile_cb = [&]() { write_render_tile(); }; diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 83aa3c1a79f..9d3daf6fb2e 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -495,29 +495,18 @@ void BlenderSync::sync_images() /* Passes */ -class BlenderPassInfo { - public: - explicit BlenderPassInfo(PassType type = PASS_NONE, PassMode mode = PassMode::NOISY) - : type(type), mode(mode) - { - } - - PassType type = PASS_NONE; - PassMode mode = PassMode::NOISY; -}; - -static BlenderPassInfo get_blender_pass_info(BL::RenderPass &b_pass) +static PassType get_blender_pass_type(BL::RenderPass &b_pass) { string name = b_pass.name(); -#define MAP_PASS(passname, ...) \ +#define MAP_PASS(passname, passtype) \ if (name == passname) { \ -return BlenderPassInfo(__VA_ARGS__); \ +return passtype; \ } \ ((void)0) /* NOTE: Keep in sync with defined names from DNA_scene_types.h */ - MAP_PASS("Combined", PASS_COMBINED, PassMode::DENOISED); + MAP_PASS("Combined", PASS_COMBINED); MAP_PASS("Noisy Image", PASS_COMBINED); MAP_PASS("Depth", PASS_DEPTH); @@ -553,7 +542,7 @@ static BlenderPassInfo get_blender_pass_info(BL::RenderPass &b_pass) MAP_PASS("Denoising Normal", PASS_DENOISING_NORMAL); MAP_PASS("Denoising Albedo", PASS_DENOISING_ALBEDO); - MAP_PASS("Shadow Catcher", PASS_SHADOW_CATCHER, PassMode::DENOISED); + MAP_PASS("Shadow Catcher", PASS_SHADOW_CATCHER); MAP_PASS("Noisy Shadow Catcher", PASS_SHADOW_CATCHER); MAP_PASS("Debug Render Time", PASS_RENDER_TIME); @@ -562,12 +551,26 @@ static BlenderPassInfo get_blender_pass_info(BL::RenderPass &b_pass) MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT); if (string_startswith(name, cryptomatte_prefix)) { -return BlenderPassInfo(PASS_CRYPTOMATTE); +return PASS_CRYPTOMATTE; } #undef MAP_PASS - return BlenderPassInfo(PASS_NONE); + return PASS_NONE; +} + +static Pass *pass_add(Scene *scene, + PassType type, + const char *name, + PassMode mode = PassMode::DENOISED) +{ + Pass *pass = scene->create_node(); + + pass->type = type; + pass->name = name; + pass->mode = mode; + + return pass; } void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_view_layer) @@ -576,28 +579,28 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v bool add_denoised_passes = false; - vector passes; + /* Delete all e
[Bf-blender-cvs] [1a6b4807857] cycles-x: Cycles X: More flexible OIDN prefiltering settings
Commit: 1a6b48078570e746aab6412a955a8b6b87149e7b Author: Sergey Sharybin Date: Thu Aug 5 15:50:51 2021 +0200 Branches: cycles-x https://developer.blender.org/rB1a6b48078570e746aab6412a955a8b6b87149e7b Cycles X: More flexible OIDN prefiltering settings Allows to bring back old behavior when color and guiding passes are denoised at the same time. Exposed as a single enum, so that we only expose combinations which makes sense from configuration perspective. Possibilities are: - None. Assumes that the guiding passes are clean. Gives best results without extra processing time (in expense of requiring to have enough samples rendered to give clean guiding passes). Corresponds to OIDN cleanAux=true and no prefiltering done on the guiding passes. - Fast. Old behavior, color and guiiding passes are denoised together. This is fastest way of giving denoised result, in the expense of possible loss of details. Corresponds to OIDN cleanAux=false and no prefiltering. - Accurate. Use special guiding passes prefilteringbefore denoising color passes. Gives best results in the expense of extra time needed to perform prefiltering. Avoids over-blurring details. Corresponds to OIDN cleanAux=true and prefiltering performed on the guiding passes. Differential Revision: https://developer.blender.org/D12140 === M intern/cycles/blender/addon/properties.py M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_sync.cpp M intern/cycles/device/device_denoise.h M intern/cycles/integrator/denoiser_oidn.cpp M intern/cycles/render/integrator.cpp M intern/cycles/render/integrator.h === diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 6a3c439182c..175e6983012 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -205,6 +205,11 @@ enum_denoising_input_passes = ( ('RGB_ALBEDO_NORMAL', "Color + Albedo + Normal", "Use color, albedo and normal data as input", 3), ) +enum_denoising_prefilter = ( +('NONE', "None", "No prefiltering, use when guiding passes are noise-free", 1), +('FAST', "Fast", "Denoise color and guiding passes together. Improves quality when guiding passes are noisy using least amount of extra processing time", 2), +('ACCURATE', "Accurate", "Prefilter noisy guiding passes before denoising color. Improves quality when guiding passes are noisy using extra processing time", 3), +) def update_render_passes(self, context): scene = context.scene @@ -248,10 +253,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): description="Denoise the image in the 3D viewport", default=False, ) -use_preview_denoising_prefilter: BoolProperty( -name="Use Denoising Prefilter", +preview_denoising_prefilter: EnumProperty( +name="Denoising Prefilter", description="Prefilter noisy guiding (albedo and normal) passes to improve denoising quality when using OpenImageDenoiser", -default=False, +items=enum_denoising_prefilter, +default=2, ) denoiser: EnumProperty( @@ -1222,10 +1228,11 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): items=enum_denoising_input_passes, default='RGB_ALBEDO_NORMAL', ) -use_denoising_prefilter: BoolProperty( -name="Use Denoising Prefilter", +denoising_prefilter: EnumProperty( +name="Denoising Prefilter", description="Prefilter noisy guiding (albedo and normal) passes to improve denoising quality when using OpenImageDenoiser", -default=True, +items=enum_denoising_prefilter, +default=1, ) @classmethod diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index c30deb52bd9..b5b3d08e66d 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -183,7 +183,7 @@ class CYCLES_RENDER_PT_sampling_viewport(CyclesButtonsPanel, Panel): effective_preview_denoiser = get_effective_preview_denoiser(context) if effective_preview_denoiser == 'OPENIMAGEDENOISE': -sub_row.prop(cscene, "use_preview_denoising_prefilter", text="Prefilter") +sub_row.prop(cscene, "preview_denoising_prefilter", text="Prefilter") class CYCLES_RENDER_PT_sampling_render(CyclesButtonsPanel, Panel): @@ -846,7 +846,7 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel): col.prop(cycles_view_layer, "denoising_optix_input_passes") elif denoiser == 'OPENIMAGEDENOISE': col.prop(cycles_view_layer, "denoising_openimagedenoise_input_passes") -col.prop(cycles_view_layer, "use_denoising_prefilter", text="Prefilter") +col.prop(cycles_view_layer, "denoisi
[Bf-blender-cvs] [27b9cb7a1e6] master: GPencil: New Merge Layer keymap: Shift+Ctrl+M
Commit: 27b9cb7a1e675930d348300fb11446a0c6d35fde Author: Antonio Vazquez Date: Thu Aug 5 17:12:11 2021 +0200 Branches: master https://developer.blender.org/rB27b9cb7a1e675930d348300fb11446a0c6d35fde GPencil: New Merge Layer keymap: Shift+Ctrl+M The keymap is available in: Draw, Edit, Sculpt, Weight Paint and Vertex Paint modes. The keymap is not available in Object mode to avoid any conflict. Reviewed By: pepeland Differential Revision: https://developer.blender.org/D12128 === M release/scripts/presets/keyconfig/keymap_data/blender_default.py === diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index a37577e898b..a67c5244611 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -3329,6 +3329,8 @@ def km_grease_pencil_stroke_edit_mode(params): ("gpencil.layer_isolate", {"type": 'NUMPAD_ASTERIX', "value": 'PRESS'}, None), # Move to layer op_menu("GPENCIL_MT_move_to_layer", {"type": 'M', "value": 'PRESS'}), +# Merge Layer +("gpencil.layer_merge", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), # Transform tools ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), ("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None), @@ -3427,6 +3429,8 @@ def km_grease_pencil_stroke_paint_mode(params): {"properties": [("unselected", True)]}), # Active layer op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}), +# Merge Layer +("gpencil.layer_merge", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), # Active material op_menu("GPENCIL_MT_material_active", {"type": 'U', "value": 'PRESS'}), # Keyframe menu @@ -3592,6 +3596,8 @@ def km_grease_pencil_stroke_sculpt_mode(params): ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', "shift": True}, None), # Active layer op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}), +# Merge Layer +("gpencil.layer_merge", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), # Keyframe menu op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}), # Context menu @@ -3809,6 +3815,8 @@ def km_grease_pencil_stroke_weight_mode(params): ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', "shift": True}, None), # Active layer op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}), +# Merge Layer +("gpencil.layer_merge", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), # Keyframe menu op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}), # Context menu @@ -3873,6 +3881,8 @@ def km_grease_pencil_stroke_vertex_mode(params): ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', "shift": True}, None), # Active layer op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}), +# Merge Layer +("gpencil.layer_merge", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), # Keyframe menu op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}), # Vertex Paint context menu ___ 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] [03d7561708c] master: Fix build error when WITH_XR_OPENXR not defined
Commit: 03d7561708ce3b4b3810fe53e837fa14259c42ef Author: Peter Kim Date: Fri Aug 6 00:08:56 2021 +0900 Branches: master https://developer.blender.org/rB03d7561708ce3b4b3810fe53e837fa14259c42ef Fix build error when WITH_XR_OPENXR not defined === M source/blender/makesrna/intern/rna_xr.c === diff --git a/source/blender/makesrna/intern/rna_xr.c b/source/blender/makesrna/intern/rna_xr.c index 358db14c298..57133ebe1c1 100644 --- a/source/blender/makesrna/intern/rna_xr.c +++ b/source/blender/makesrna/intern/rna_xr.c @@ -901,9 +901,13 @@ static void rna_XrSessionState_viewer_pose_rotation_get(PointerRNA *ptr, float * static void rna_XrSessionState_actionmaps_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { +# ifdef WITH_XR_OPENXR wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr); ListBase *lb = WM_xr_actionmaps_get(xr->runtime); rna_iterator_listbase_begin(iter, lb, NULL); +# else + UNUSED_VARS(iter, ptr); +# endif } static int rna_XrSessionState_active_actionmap_get(PointerRNA *ptr) ___ 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] [b4f950cbbe5] master: GPencil: New Caps icons
Commit: b4f950cbbe5d1306f7bdcff6a288381759e04aeb Author: Antonio Vazquez Date: Thu Aug 5 17:06:21 2021 +0200 Branches: master https://developer.blender.org/rBb4f950cbbe5d1306f7bdcff6a288381759e04aeb GPencil: New Caps icons These icons are used to define the type of caps. Designed by: Matias Mendiola Reviewed by: Pablo Vazquez === M release/datafiles/blender_icons.svg A release/datafiles/blender_icons16/icon16_gp_caps_flat.dat A release/datafiles/blender_icons16/icon16_gp_caps_round.dat A release/datafiles/blender_icons32/icon32_gp_caps_flat.dat A release/datafiles/blender_icons32/icon32_gp_caps_round.dat M source/blender/editors/datafiles/CMakeLists.txt M source/blender/editors/include/UI_icons.h M source/blender/makesrna/intern/rna_brush.c === diff --git a/release/datafiles/blender_icons.svg b/release/datafiles/blender_icons.svg index 54357550847..c3461fd1bea 100644 --- a/release/datafiles/blender_icons.svg +++ b/release/datafiles/blender_icons.svg @@ -17306,6 +17306,21 @@ d="m 418.85321,140.04954 -2.82,-2.82 a 0.62,0.62 0 0 0 -0.4,-0.18 0.6,0.6 0 0 0 -0.6,0.6 0.62,0.62 0 0 0 0.18,0.43 l 1,1 -9.18,9.12 -1,-1 a 0.62,0.62 0 0 0 -0.4,-0.15 0.6,0.6 0 0 0 -0.6,0.6 0.62,0.62 0 0 0 0.18,0.4 l 2.82,2.82 a 0.6,0.6 0 0 0 0.82,-0.82 l -1,-1 9.18,-9.15 1,1 a 0.6,0.6 0 0 0 0.82,-0.85 z" id="path3261" inkscape:connector-curvature="0" /> + + + + https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c1d30dbfe3a] cycles-x: Cycles X: Bring back per-object GI approximation AO distance
Commit: c1d30dbfe3a431b90ddcac6ae62481d8e57a08e5 Author: Sergey Sharybin Date: Thu Aug 5 12:30:56 2021 +0200 Branches: cycles-x https://developer.blender.org/rBc1d30dbfe3a431b90ddcac6ae62481d8e57a08e5 Cycles X: Bring back per-object GI approximation AO distance Measure no performance impact beyond noise deviation on RTX6000: ``` cycles-x new barbershop_interior 14.4251s 14.2849s bmw279.5182s 9.1225s classroom17.1786s 17.1967s junkshop 18.3849s 18.8356s monster 9.9017s 9.5428s pabellon 8.0902s 8.1711s ``` Differential Revision: https://developer.blender.org/D12138 === M intern/cycles/kernel/integrator/integrator_intersect_closest.h === diff --git a/intern/cycles/kernel/integrator/integrator_intersect_closest.h b/intern/cycles/kernel/integrator/integrator_intersect_closest.h index 493e1bfc5f5..d92e097e783 100644 --- a/intern/cycles/kernel/integrator/integrator_intersect_closest.h +++ b/intern/cycles/kernel/integrator/integrator_intersect_closest.h @@ -152,11 +152,21 @@ ccl_device void integrator_intersect_closest(INTEGRATOR_STATE_ARGS) integrator_state_read_ray(INTEGRATOR_STATE_PASS, &ray); kernel_assert(ray.t != 0.0f); - uint visibility = path_state_ray_visibility(INTEGRATOR_STATE_PASS); + const uint visibility = path_state_ray_visibility(INTEGRATOR_STATE_PASS); + const int last_isect_prim = INTEGRATOR_STATE(isect, prim); + const int last_isect_object = INTEGRATOR_STATE(isect, object); /* Trick to use short AO rays to approximate indirect light at the end of the path. */ if (path_state_ao_bounce(INTEGRATOR_STATE_PASS)) { ray.t = kernel_data.integrator.ao_bounces_distance; + +const int last_object = last_isect_object != OBJECT_NONE ? +last_isect_object : +kernel_tex_fetch(__prim_object, last_isect_prim); +const float object_ao_distance = kernel_tex_fetch(__objects, last_object).ao_distance; +if (object_ao_distance != 0.0f) { + ray.t = object_ao_distance; +} } /* Scene Intersection. */ @@ -172,11 +182,9 @@ ccl_device void integrator_intersect_closest(INTEGRATOR_STATE_ARGS) if (kernel_data.integrator.use_lamp_mis && !(INTEGRATOR_STATE(path, flag) & PATH_RAY_CAMERA)) { /* NOTE: if we make lights visible to camera rays, we'll need to initialize * these in the path_state_init. */ -const int last_prim = INTEGRATOR_STATE(isect, prim); -const int last_object = INTEGRATOR_STATE(isect, object); const int last_type = INTEGRATOR_STATE(isect, type); -hit = lights_intersect(kg, &ray, &isect, last_prim, last_object, last_type) || hit; +hit = lights_intersect(kg, &ray, &isect, last_isect_prim, last_isect_object, last_type) || hit; } /* Write intersection result into global integrator state memory. */ ___ 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] [cc4e674e41f] master: DRW: New Select Debug Engine
Commit: cc4e674e41f9ddca9d3b6aee8c21ddcb3fdfea26 Author: Germano Cavalcante Date: Tue Aug 3 13:39:30 2021 -0300 Branches: master https://developer.blender.org/rBcc4e674e41f9ddca9d3b6aee8c21ddcb3fdfea26 DRW: New Select Debug Engine This is a simple engine used only to debug the texture of select ids. It is only used when the `WITH_DRAW_DEBUG` option is enabled and the debug value is 31. Reviewed By: fclem Differential Revision: https://developer.blender.org/D5490 === M CMakeLists.txt M source/blender/blenkernel/BKE_global.h M source/blender/draw/CMakeLists.txt A source/blender/draw/engines/select/select_debug_engine.c M source/blender/draw/engines/select/select_engine.h M source/blender/draw/intern/draw_manager.c === diff --git a/CMakeLists.txt b/CMakeLists.txt index b7dfb56ff02..3baebba4678 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,6 +428,10 @@ mark_as_advanced(WITH_CYCLES_NETWORK) option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON) mark_as_advanced(WITH_CUDA_DYNLOAD) +# Draw Manager +option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF) +mark_as_advanced(WITH_DRAW_DEBUG) + # LLVM option(WITH_LLVM"Use LLVM" OFF) if(APPLE) diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 69c950a86dc..31928b5e80a 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -70,6 +70,7 @@ typedef struct Global { * * -16384 and below: Reserved for python (add-ons) usage. * * -1: Disable faster motion paths computation (since 08/2018). * * 1 - 30: EEVEE debug/stats values (01/2018). + * * 31: Enable the Select Debug Engine. Only available with #WITH_DRAW_DEBUG (08/2021). * *101: Enable UI debug drawing of fullscreen area's corner widget (10/2014). * *666: Use quicker batch delete for outliners' delete hierarchy (01/2019). * *777: Enable UI node panel's sockets polling (11/2011). diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index 930d82fa225..257eb80ae0b 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -483,6 +483,13 @@ data_to_c_simple(engines/image/shaders/engine_image_vert.glsl SRC) list(APPEND INC ) +if(WITH_DRAW_DEBUG) + list(APPEND SRC +engines/select/select_debug_engine.c + ) + add_definitions(-DWITH_DRAW_DEBUG) +endif() + if(WITH_MOD_FLUID) list(APPEND INC ../../../intern/mantaflow/extern diff --git a/source/blender/draw/engines/select/select_debug_engine.c b/source/blender/draw/engines/select/select_debug_engine.c new file mode 100644 index 000..ded96be23f3 --- /dev/null +++ b/source/blender/draw/engines/select/select_debug_engine.c @@ -0,0 +1,135 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright 2019, Blender Foundation. + */ + +/** \file + * \ingroup draw_engine + * + * Engine for debuging the selection map drawing. + */ + +#include "DNA_ID.h" +#include "DNA_vec_types.h" + +#include "DRW_engine.h" +#include "DRW_select_buffer.h" + +#include "draw_cache.h" +#include "draw_manager.h" + +#include "select_engine.h" + +#define SELECT_DEBUG_ENGINE "SELECT_DEBUG_ENGINE" + +/* */ +/** \name Structs and static variables + * \{ */ + +typedef struct SELECTIDDEBUG_PassList { + struct DRWPass *debug_pass; +} SELECTIDDEBUG_PassList; + +typedef struct SELECTIDDEBUG_Data { + void *engine_type; + DRWViewportEmptyList *fbl; + DRWViewportEmptyList *txl; + SELECTIDDEBUG_PassList *psl; + DRWViewportEmptyList *stl; +} SELECTIDDEBUG_Data; + +static struct { + struct GPUShader *select_debug_sh; +} e_data = {{NULL}}; /* Engine data */ + +/** \} */ + +/* */ +/** \name Engine Functions + * \{ */ + +static void select_debug_engine_init(void *vedata) +{ + SELECTIDDEBUG_PassList *psl = ((SELECTIDDEBUG_Data *)vedata)->psl; + + if (!e_data.select_debug_sh) { +e_data.select_debug_sh = DRW_shad
[Bf-blender-cvs] [e844e9e8f3b] master: XR Controller Support Step 2: Action Maps
Commit: e844e9e8f3bb6814e24749316003814156e2e2ce Author: Peter Kim Date: Thu Aug 5 23:40:17 2021 +0900 Branches: master https://developer.blender.org/rBe844e9e8f3bb6814e24749316003814156e2e2ce XR Controller Support Step 2: Action Maps Addresses the remaining portions of T77137 (Python API for Controller Interaction), which was partially completed by D10942. Adds an XR "action maps" system for loading XR action data from a Python script. Action maps are accessible via the Python API, and are used to pass default actions to the VR session during the xr_session_start_pre() callback. Since action maps are stored only as runtime data, they will be cleaned up with the rest of the VR runtime data on file read or exit. Reviewed By: Julian Eisel, Hans Goudey Differential Revision: https://developer.blender.org/D10943 === M intern/ghost/GHOST_C-api.h M intern/ghost/intern/GHOST_C-api.cpp M intern/ghost/intern/GHOST_XrAction.cpp M intern/ghost/intern/GHOST_XrAction.h M intern/ghost/intern/GHOST_XrSession.cpp M intern/ghost/intern/GHOST_XrSession.h M source/blender/makesdna/DNA_xr_types.h M source/blender/makesrna/intern/rna_xr.c M source/blender/windowmanager/CMakeLists.txt M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/xr/intern/wm_xr.c M source/blender/windowmanager/xr/intern/wm_xr_action.c A source/blender/windowmanager/xr/intern/wm_xr_actionmap.c M source/blender/windowmanager/xr/intern/wm_xr_intern.h === diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index fea5a545807..83c67f83908 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -1102,6 +1102,7 @@ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_context, const char *action_set int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context, const char *action_set_name, const char *action_name, + const char **subaction_path, const int64_t *duration, const float *frequency, const float *amplitude); @@ -,7 +1112,8 @@ int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context, */ void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_context, const char *action_set_name, - const char *action_name); + const char *action_name, + const char **subaction_path); /** * Get action set custom data (owned by Blender, not GHOST). @@ -1126,6 +1128,18 @@ void *GHOST_XrGetActionCustomdata(GHOST_XrContextHandle xr_context, const char *action_set_name, const char *action_name); +/** + * Get the number of actions in an action set. + */ +unsigned int GHOST_XrGetActionCount(GHOST_XrContextHandle xr_context, const char *action_set_name); + +/** + * Get custom data for all actions in an action set. + */ +void GHOST_XrGetActionCustomdataArray(GHOST_XrContextHandle xr_context, + const char *action_set_name, + void **r_customdata_array); + #endif /* WITH_XR_OPENXR */ #ifdef __cplusplus diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index 0bc9be26eb1..b1af5c131ab 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -1005,25 +1005,29 @@ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_contexthandle, const char *acti int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name, const char *action_name, + const char **subaction_path, const int64_t *duration, const float *frequency, const float *amplitude) { GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_XrSession *xr_session = xr_context->getSession(); - GHOST_XR_CAPI_CALL_RET(xr_session->applyHapticAction( - action_set_name, action_name, *duration, *frequency, *amplitude), - xr_context); + GHOST_XR_CAPI_CALL_RET( + xr_session->applyHapticAction( + action_set_name, action_name, subaction_path, *duration, *frequency, *amplitude), + xr_context); return 0; } void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name, - const char *action_name) + const c
[Bf-blender-cvs] [1ab1d6665c7] temp-geometry-nodes-fields-prototype: Merge branch 'master' into temp-geometry-nodes-fields-prototype
Commit: 1ab1d6665c7cea89389c7b1baf5ccf684ceee07a Author: Hans Goudey Date: Wed Aug 4 18:10:13 2021 -0500 Branches: temp-geometry-nodes-fields-prototype https://developer.blender.org/rB1ab1d6665c7cea89389c7b1baf5ccf684ceee07a Merge branch 'master' into temp-geometry-nodes-fields-prototype === === diff --cc source/blender/blenkernel/BKE_node.h index 7d23bf59909,084ec20c172..077c6095452 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@@ -1475,9 -1475,7 +1475,10 @@@ int ntreeTexExecTree(struct bNodeTree * #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070 #define GEO_NODE_CURVE_TRIM 1071 #define GEO_NODE_CURVE_SET_HANDLES 1072 -#define GEO_NODE_CURVE_SPLINE_TYPE 1073 +#define GEO_NODE_ATTRIBUTE 1073 +#define GEO_NODE_INDEX 1074 +#define GEO_NODE_EXTRUDE 1075 ++#define GEO_NODE_CURVE_SPLINE_TYPE 1076 /** \} */ diff --cc source/blender/nodes/NOD_static_types.h index fa2c128692c,6c3f91df434..4bc9da6a19c --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@@ -267,12 -267,8 +267,11 @@@ DefNode(FunctionNode, FN_NODE_FLOAT_TO_ DefNode(FunctionNode, FN_NODE_INPUT_STRING, def_fn_input_string, "INPUT_STRING", InputString, "String", "") DefNode(FunctionNode, FN_NODE_INPUT_VECTOR, def_fn_input_vector, "INPUT_VECTOR", InputVector, "Vector", "") DefNode(FunctionNode, FN_NODE_RANDOM_FLOAT, 0, "RANDOM_FLOAT", RandomFloat, "Random Float", "") +DefNode(FunctionNode, FN_NODE_ALIGN_ROTATION_TO_VECTOR, def_fn_align_rotation_to_vector, "ALIGN_ROTATION_TO_VECTOR", AlignRotationToVector, "Align Rotation to Vector", "") + + +DefNode(GeometryNode, GEO_NODE_EXTRUDE, 0, "EXTRUDE", Extrude, "Mesh Extrude", "") - DefNode(GeometryNode, GEO_NODE_ATTRIBUTE, def_geo_attribute, "ATTRIBUTE", Attribute, "Attribute", "") -DefNode(GeometryNode, GEO_NODE_ALIGN_ROTATION_TO_VECTOR, def_geo_align_rotation_to_vector, "ALIGN_ROTATION_TO_VECTOR", AlignRotationToVector, "Align Rotation to Vector", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_CLAMP, def_geo_attribute_clamp, "ATTRIBUTE_CLAMP", AttributeClamp, "Attribute Clamp", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COLOR_RAMP, def_geo_attribute_color_ramp, "ATTRIBUTE_COLOR_RAMP", AttributeColorRamp, "Attribute Color Ramp", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COMBINE_XYZ, def_geo_attribute_combine_xyz, "ATTRIBUTE_COMBINE_XYZ", AttributeCombineXYZ, "Attribute Combine XYZ", "") @@@ -291,6 -287,6 +290,7 @@@ DefNode(GeometryNode, GEO_NODE_ATTRIBUT DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_TRANSFER, def_geo_attribute_transfer, "ATTRIBUTE_TRANSFER", AttributeTransfer, "Attribute Transfer", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_VECTOR_MATH, def_geo_attribute_vector_math, "ATTRIBUTE_VECTOR_MATH", AttributeVectorMath, "Attribute Vector Math", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_VECTOR_ROTATE, def_geo_attribute_vector_rotate, "ATTRIBUTE_VECTOR_ROTATE", AttributeVectorRotate, "Attribute Vector Rotate", "") ++DefNode(GeometryNode, GEO_NODE_ATTRIBUTE, def_geo_attribute, "ATTRIBUTE", Attribute, "Attribute", "") DefNode(GeometryNode, GEO_NODE_BOOLEAN, def_geo_boolean, "BOOLEAN", Boolean, "Boolean", "") DefNode(GeometryNode, GEO_NODE_BOUNDING_BOX, 0, "BOUNDING_BOX", BoundBox, "Bounding Box", "") DefNode(GeometryNode, GEO_NODE_COLLECTION_INFO, def_geo_collection_info, "COLLECTION_INFO", CollectionInfo, "Collection Info", "") @@@ -307,7 -303,8 +307,8 @@@ DefNode(GeometryNode, GEO_NODE_CURVE_PR DefNode(GeometryNode, GEO_NODE_CURVE_RESAMPLE, def_geo_curve_resample, "CURVE_RESAMPLE", CurveResample, "Resample Curve", "") DefNode(GeometryNode, GEO_NODE_CURVE_REVERSE, 0, "CURVE_REVERSE", CurveReverse, "Curve Reverse", "") DefNode(GeometryNode, GEO_NODE_CURVE_SET_HANDLES, def_geo_curve_set_handles, "CURVE_SET_HANDLES", CurveSetHandles, "Set Handle Type", "") + DefNode(GeometryNode, GEO_NODE_CURVE_SPLINE_TYPE, def_geo_curve_spline_type, "CURVE_SPLINE_TYPE", CurveSplineType, "Set Spline Type", "") -DefNode(GeometryNode, GEO_NODE_CURVE_SUBDIVIDE, def_geo_curve_subdivide, "CURVE_SUBDIVIDE", CurveSubdivide, "Curve Subdivide", "") +DefNode(GeometryNode, GEO_NODE_CURVE_SUBDIVIDE, 0, "CURVE_SUBDIVIDE", CurveSubdivide, "Curve Subdivide", "") DefNode(GeometryNode, GEO_NODE_CURVE_TO_MESH, 0, "CURVE_TO_MESH", CurveToMesh, "Curve to Mesh", "") DefNode(GeometryNode, GEO_NODE_CURVE_TO_POINTS, def_geo_curve_to_points, "CURVE_TO_POINTS", CurveToPoints, "Curve to Points", "") DefNode(GeometryNode, GEO_NODE_CURVE_TRIM, def_geo_curve_trim, "CURVE_TRIM", CurveTrim, "Curve Trim", "") ___ 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] [720ea8a67df] master: Fix T89963: crash when library override is applied to an object from a linked scene.
Commit: 720ea8a67df06ba2242e7771b349cefd753f7ea5 Author: Bastien Montagne Date: Thu Aug 5 14:59:31 2021 +0200 Branches: master https://developer.blender.org/rB720ea8a67df06ba2242e7771b349cefd753f7ea5 Fix T89963: crash when library override is applied to an object from a linked scene. LibOverride of scenes is not really supported currently, there are many issues with it. Will disable most user-accessible ways to create such overrides in a following commit. === M source/blender/blenkernel/intern/lib_override.c === diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 072304566e5..67ed7d1b394 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1599,6 +1599,17 @@ static void lib_override_library_main_resync_on_library_indirect_level( (!ID_IS_LINKED(id) && library_indirect_level != 0)) { continue; } + +/* We cannot resync a scene that is currently active. */ +if (id == &scene->id) { + id->tag &= ~LIB_TAG_LIB_OVERRIDE_NEED_RESYNC; + BKE_reportf(reports->reports, + RPT_WARNING, + "Scene '%s' was not resynced as it is the currently active one", + scene->id.name + 2); + continue; +} + Library *library = id->lib; int level = 0; ___ 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] [0cff7c2a228] master: LibOverride: Make it reasonably impossible for users to create overrides of scenes.
Commit: 0cff7c2a228589505bd2d66e966e5e84613b2786 Author: Bastien Montagne Date: Thu Aug 5 15:24:46 2021 +0200 Branches: master https://developer.blender.org/rB0cff7c2a228589505bd2d66e966e5e84613b2786 LibOverride: Make it reasonably impossible for users to create overrides of scenes. This is not supported currently,doing so through RNA API remains possible, but from regular UI operations it should not be doable anymore. Ref. T90459. === M source/blender/editors/space_outliner/outliner_tools.c M source/blender/makesdna/DNA_ID.h === diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 3edb12c5503..e3aec572bd3 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -845,8 +845,20 @@ static void id_override_library_create_fn(bContext *C, if (!ID_IS_LINKED(te->store_elem->id)) { break; } +/* If we'd need to override that arent ID, but it is not overridable, abort. */ +if (!ID_IS_OVERRIDABLE_LIBRARY(te->store_elem->id)) { + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); + BKE_reportf(reports, + RPT_WARNING, + "Could not create library override from data-block '%s', one of its parents " + "is not overridable ('%s')", + id_root->name, + te->store_elem->id->name); + return; +} te->store_elem->id->tag |= LIB_TAG_DOIT; } + success = BKE_lib_override_library_create( bmain, CTX_data_scene(C), CTX_data_view_layer(C), id_root, id_reference, NULL); } diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index c9d652ad03d..f7f4b0e6104 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -429,7 +429,8 @@ typedef struct PreviewImage { * BKE_library_override typically (especially due to the check on LIB_TAG_EXTERN). */ #define ID_IS_OVERRIDABLE_LIBRARY(_id) \ (ID_IS_LINKED(_id) && !ID_MISSING(_id) && (((const ID *)(_id))->tag & LIB_TAG_EXTERN) != 0 && \ - (BKE_idtype_get_info_from_id((const ID *)(_id))->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0) + (BKE_idtype_get_info_from_id((const ID *)(_id))->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0 && \ + !ELEM(GS(((ID *)(_id))->name), ID_SCE)) /* NOTE: The three checks below do not take into account whether given ID is linked or not (when * chaining overrides over several libraries). User must ensure the ID is not linked itself ___ 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] [be6409a7485] master: Fix fix invalid index use for edit-mesh laplacian smooth
Commit: be6409a74850054d53b6c2f965e03e64e00a622f Author: Campbell Barton Date: Thu Aug 5 22:32:18 2021 +1000 Branches: master https://developer.blender.org/rBbe6409a74850054d53b6c2f965e03e64e00a622f Fix fix invalid index use for edit-mesh laplacian smooth Only vertex indices were ensured to be correct. === M source/blender/bmesh/operators/bmo_smooth_laplacian.c === diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index 31f66ad952f..1d72bb893b2 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -180,7 +180,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys) BMVert *vn; BMVert *vf[4]; - BM_ITER_MESH_INDEX (e, &eiter, sys->bm, BM_EDGES_OF_MESH, j) { + BM_ITER_MESH_INDEX (e, &eiter, sys->bm, BM_EDGES_OF_MESH, i) { if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e)) { v1 = e->v1->co; v2 = e->v2->co; @@ -190,7 +190,6 @@ static void init_laplacian_matrix(LaplacianSystem *sys) w1 = len_v3v3(v1, v2); if (w1 > sys->min_area) { w1 = 1.0f / w1; -i = BM_elem_index_get(e); sys->eweights[i] = w1; sys->vlengths[idv1] += w1; sys->vlengths[idv2] += w1; @@ -202,13 +201,13 @@ static void init_laplacian_matrix(LaplacianSystem *sys) } } - BM_ITER_MESH (f, &fiter, sys->bm, BM_FACES_OF_MESH) { + BM_ITER_MESH_INDEX (f, &fiter, sys->bm, BM_FACES_OF_MESH, i) { if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { - BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, i) { -vf[i] = vn; + BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, j) { +vf[j] = vn; } - has_4_vert = (i == 4) ? 1 : 0; + has_4_vert = (j == 4) ? 1 : 0; idv1 = BM_elem_index_get(vf[0]); idv2 = BM_elem_index_get(vf[1]); idv3 = BM_elem_index_get(vf[2]); @@ -268,8 +267,6 @@ static void init_laplacian_matrix(LaplacianSystem *sys) } } else { -i = BM_elem_index_get(f); - w1 = cotangent_tri_weight_v3(v1, v2, v3); w2 = cotangent_tri_weight_v3(v2, v3, v1); w3 = cotangent_tri_weight_v3(v3, v1, v2); @@ -302,12 +299,12 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) BMVert *vn; BMVert *vf[4]; - BM_ITER_MESH (f, &fiter, sys->bm, BM_FACES_OF_MESH) { + BM_ITER_MESH_INDEX (f, &fiter, sys->bm, BM_FACES_OF_MESH, i) { if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { - BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, i) { -vf[i] = vn; + BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, j) { +vf[j] = vn; } - has_4_vert = (i == 4) ? 1 : 0; + has_4_vert = (j == 4) ? 1 : 0; if (has_4_vert) { idv[0] = BM_elem_index_get(vf[0]); idv[1] = BM_elem_index_get(vf[1]); @@ -344,7 +341,6 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) idv2 = BM_elem_index_get(vf[1]); idv3 = BM_elem_index_get(vf[2]); /* Is ring if number of faces == number of edges around vertice. */ -i = BM_elem_index_get(f); if (!vert_is_boundary(vf[0]) && sys->zerola[idv1] == 0) { EIG_linear_solver_matrix_add( sys->context, idv1, idv2, sys->fweights[i][2] * sys->vweights[idv1]); @@ -366,14 +362,13 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) } } } - BM_ITER_MESH (e, &eiter, sys->bm, BM_EDGES_OF_MESH) { + BM_ITER_MESH_INDEX (e, &eiter, sys->bm, BM_EDGES_OF_MESH, i) { if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e)) { v1 = e->v1->co; v2 = e->v2->co; idv1 = BM_elem_index_get(e->v1); idv2 = BM_elem_index_get(e->v2); if (sys->zerola[idv1] == 0 && sys->zerola[idv2] == 0) { -i = BM_elem_index_get(e); EIG_linear_solver_matrix_add( sys->context, idv1, idv2, sys->eweights[i] * sys->vlengths[idv1]); EIG_linear_solver_matrix_add( ___ 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] [fb1822ddeb2] master: XR: Controller Data Improvements
Commit: fb1822ddeb28037544e94862112aa7338a0c278b Author: Peter Kim Date: Thu Aug 5 21:11:01 2021 +0900 Branches: master https://developer.blender.org/rBfb1822ddeb28037544e94862112aa7338a0c278b XR: Controller Data Improvements Provides two key improvements to runtime controller data. 1. Separates controller poses into two components, "grip" and "aim", which are both required to accurately represent the controllers without manual offsets. Following their OpenXR definitions, the grip pose represents the user's hand when holding the controller, and the aim pose represents the controller's aiming source. 2. Runtime controller data is now stored as a dynamic array instead of a fixed array. This makes the API/functionality more adaptable to different systems. Does not bring about any changes for users since only internal runtime functionality is currently affected. Reviewed By: Julian Eisel Differential Revision: http://developer.blender.org/D12073 === M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/xr/intern/wm_xr_action.c M source/blender/windowmanager/xr/intern/wm_xr_draw.c M source/blender/windowmanager/xr/intern/wm_xr_intern.h M source/blender/windowmanager/xr/intern/wm_xr_session.c === diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 8c1511fd152..7e26d921bd7 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -962,12 +962,18 @@ bool WM_xr_session_state_viewer_pose_rotation_get(const wmXrData *xr, float r_ro bool WM_xr_session_state_viewer_pose_matrix_info_get(const wmXrData *xr, float r_viewmat[4][4], float *r_focal_len); -bool WM_xr_session_state_controller_pose_location_get(const wmXrData *xr, +bool WM_xr_session_state_controller_grip_location_get(const wmXrData *xr, unsigned int subaction_idx, float r_location[3]); -bool WM_xr_session_state_controller_pose_rotation_get(const wmXrData *xr, +bool WM_xr_session_state_controller_grip_rotation_get(const wmXrData *xr, unsigned int subaction_idx, float r_rotation[4]); +bool WM_xr_session_state_controller_aim_location_get(const wmXrData *xr, + unsigned int subaction_idx, + float r_location[3]); +bool WM_xr_session_state_controller_aim_rotation_get(const wmXrData *xr, + unsigned int subaction_idx, + float r_rotation[4]); /* wm_xr_actions.c */ /* XR action functions to be called pre-XR session start. @@ -1002,9 +1008,10 @@ void WM_xr_action_binding_destroy(wmXrData *xr, /* If action_set_name is NULL, then all action sets will be treated as active. */ bool WM_xr_active_action_set_set(wmXrData *xr, const char *action_set_name); -bool WM_xr_controller_pose_action_set(wmXrData *xr, - const char *action_set_name, - const char *action_name); +bool WM_xr_controller_pose_actions_set(wmXrData *xr, + const char *action_set_name, + const char *grip_action_name, + const char *aim_action_name); /* XR action functions to be called post-XR session start. */ bool WM_xr_action_state_get(const wmXrData *xr, diff --git a/source/blender/windowmanager/xr/intern/wm_xr_action.c b/source/blender/windowmanager/xr/intern/wm_xr_action.c index ee4cfcccaa7..8f2de4bbbad 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_action.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_action.c @@ -112,11 +112,11 @@ static wmXrAction *action_create(const char *action_name, const bool is_button_action = (is_float_action || type == XR_BOOLEAN_INPUT); if (is_float_action) { action->float_thresholds = MEM_calloc_arrayN( - count, sizeof(*action->float_thresholds), "XrAction_FloatThresholds"); +count, sizeof(*action->float_thresholds), "XrAction_FloatThresholds"); } if (is_button_action) { action->axis_flags = MEM_calloc_arrayN( - count, sizeof(*action->axis_flags), "XrAction_AxisFlags"); +count, sizeof(*action->axis_flags), "XrAction_AxisFlags"); } action->ot = ot; @@ -186,9 +186,9 @@ void WM_xr_action_set_destroy(wmXrData *xr, const char *action_set_name) wmXrSessionState *session_state = &xr->runtime->session_state; if
[Bf-blender-cvs] [e88563e4722] soc-2021-uv-editor-improvements-edge-selection: Merge branch 'master' into soc-2021-uv-editor-improvements-edge-selection
Commit: e88563e472218555ee709cb2bd32079f8a5ac23f Author: Siddhartha Jejurkar Date: Thu Aug 5 16:42:53 2021 +0530 Branches: soc-2021-uv-editor-improvements-edge-selection https://developer.blender.org/rBe88563e472218555ee709cb2bd32079f8a5ac23f Merge branch 'master' into soc-2021-uv-editor-improvements-edge-selection === === ___ 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] [db821af1729] soc-2021-uv-editor-improvements-edge-selection: Fix: Invert selection and free unreleased memory
Commit: db821af1729d2b1b1037fe9b4f72b8029452ff65 Author: Siddhartha Jejurkar Date: Tue Aug 3 17:02:11 2021 +0530 Branches: soc-2021-uv-editor-improvements-edge-selection https://developer.blender.org/rBdb821af1729d2b1b1037fe9b4f72b8029452ff65 Fix: Invert selection and free unreleased memory - Free unreleased memory from vertex map - Select Invert operator now works with UV face select mode as well === M source/blender/editors/uvedit/uvedit_intern.h M source/blender/editors/uvedit/uvedit_select.c === diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index b0ab34b6b02..2d516e3f677 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -132,6 +132,9 @@ void uv_flush_vert_to_edge(struct Scene *scene, void uv_flush_edge_to_vert(struct Scene *scene, struct Object *obedit, const int cd_loop_uv_offset); +void uv_flush_edge_to_vert_with_sticky_loc(Scene *scene, + Object *obedit, + const int cd_loop_uv_offset); /* utility tool functions */ diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index 0e8022b0289..8c2e38f8359 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -70,14 +70,24 @@ #include "uvedit_intern.h" -static void uv_select_all_perform(Scene *scene, Object *obedit, int action); +static void uv_select_all_perform(Scene *scene, SpaceImage *sima, Object *obedit, int action); -static void uv_select_all_perform_multi_ex( -Scene *scene, Object **objects, const uint objects_len, int action, const Object *ob_exclude); -static void uv_select_all_perform_multi(Scene *scene, -Object **objects, -const uint objects_len, -int action); +static void uv_select_all_perform_multi_ex(Scene *scene, + SpaceImage *sima, + Object **objects, + const uint objects_len, + int action, + const Object *ob_exclude); +static void uv_select_all_perform_multi( +Scene *scene, SpaceImage *sima, Object **objects, const uint objects_len, int action); + +static void uv_select_flush_from_tag_sticky_loc_internal(Scene *scene, + BMEditMesh *em, + UvVertMap *vmap, + const uint efa_index, + BMLoop *l, + const bool select, + const int cd_loop_uv_offset); static void uv_select_flush_from_tag_face(SpaceImage *sima, Scene *scene, @@ -1333,6 +1343,47 @@ void uv_flush_edge_to_vert(Scene *scene, Object *obedit, const int cd_loop_uv_of } } +/** + * Select shared vertices (vertex selection with sticky location) for all edges that are marked + * using MLOOPUV_EDGESEL flag as a tag + */ +void uv_flush_edge_to_vert_with_sticky_loc(Scene *scene, + Object *obedit, + const int cd_loop_uv_offset) +{ + BMEditMesh *em = BKE_editmesh_from_object(obedit); + BMFace *efa; + BMLoop *l; + BMIter iter, liter; + struct UvVertMap *vmap; + uint efa_index; + + vmap = BM_uv_vert_map_create(em->bm, false, false); + if (vmap == NULL) { +return; + } + + BM_ITER_MESH_INDEX (efa, &iter, em->bm, BM_FACES_OF_MESH, efa_index) { +if (!uvedit_face_visible_test(scene, efa)) { + continue; +} + +BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { + MLoopUV *luv; + luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); + + if (luv->flag & MLOOPUV_EDGESEL) { +uv_select_flush_from_tag_sticky_loc_internal( +scene, em, vmap, efa_index, l, true, cd_loop_uv_offset); +uv_select_flush_from_tag_sticky_loc_internal( +scene, em, vmap, efa_index, l->next, true, cd_loop_uv_offset); + } +} + } + + BM_uv_vert_map_free(vmap); +} + /** \} */ /* NOTE : UV Selection mode flushing NOT implemented for now @@ -1618,7 +1669,7 @@ static int uv_select_edgeloop( /* Apply the selection. */ if (!extend) { -uv_select_all_perform(scene, obedit, SEL_DESELECT); +uv_select_all_perform(sc
[Bf-blender-cvs] [d6e02d92e13] soc-2021-uv-editor-improvements-edge-selection: UV: Extend edge selection support
Commit: d6e02d92e13383b73f305cd7cd2162143f647507 Author: Siddhartha Jejurkar Date: Mon Aug 2 09:50:50 2021 +0530 Branches: soc-2021-uv-editor-improvements-edge-selection https://developer.blender.org/rBd6e02d92e13383b73f305cd7cd2162143f647507 UV: Extend edge selection support - Add edge selection support for operators: mouse select, box select, circle select, lasso select, (de)select all, invert selection and select more/less - Flush selections between UV verts and edges - Fix: prevent deselection of neighbouring edges when deselecting an edge in sticky location + edge select mode === M source/blender/editors/uvedit/uvedit_intern.h M source/blender/editors/uvedit/uvedit_select.c === diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index ea72b859f7c..b0ab34b6b02 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -125,6 +125,14 @@ BMLoop *uv_find_nearest_loop_from_edge(struct Scene *scene, struct BMEdge *e, const float co[2]); +/* flush uv selection */ +void uv_flush_vert_to_edge(struct Scene *scene, + struct Object *obedit, + const int cd_loop_uv_offset); +void uv_flush_edge_to_vert(struct Scene *scene, + struct Object *obedit, + const int cd_loop_uv_offset); + /* utility tool functions */ void uvedit_live_unwrap_update(struct SpaceImage *sima, diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index fe505f865b6..0e8022b0289 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -91,6 +91,18 @@ static void uv_select_tag_update_for_object(Depsgraph *depsgraph, const ToolSettings *ts, Object *obedit); +static bool uvedit_vert_is_any_other_edge_selected(const Scene *scene, + BMLoop *l, + const int cd_loop_uv_offset); +static bool uvedit_vert_is_any_other_face_selected(const Scene *scene, + BMLoop *l, + BMVert *v, + const int cd_loop_uv_offset); +static bool uvedit_vert_is_any_other_not_face_selected(const Scene *scene, + BMLoop *l, + BMVert *v, + const int cd_loop_uv_offset); + /* */ /** \name Active Selection Tracking * @@ -469,17 +481,37 @@ void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, default: { /* SI_STICKY_LOC * Fallback to SI_STICKY_LOC, in case sima->sticky is invalid */ - uvedit_edge_select_shared_location( - scene, em, l, select, false, do_history, cd_loop_uv_offset); - - /* NOTE (Design tradeoff): This is a case where we deviate from the logic of: "EDGE - * SELECTION MODE SHOULD IMPLY ONLY EDGES MUST BE SELECTED". The UV vertex selections done - * below are to avoid the cases of edge selections breaking away (/become separate - * entities) from the vertices/edges they were connected to */ - uvedit_uv_select_shared_location(scene, em, l, select, false, do_history, cd_loop_uv_offset); - uvedit_uv_select_shared_location( - scene, em, l->next, select, false, do_history, cd_loop_uv_offset); + if (select) { +uvedit_edge_select_shared_location( +scene, em, l, select, false, do_history, cd_loop_uv_offset); + +/* NOTE (Design tradeoff): This is a case where we deviate from the logic of: "EDGE + * SELECTION MODE SHOULD IMPLY ONLY EDGES MUST BE SELECTED". The UV vertex selections done + * below are to avoid the cases of edge selections breaking away (/become separate + * entities) from the vertices/edges they were connected to */ +uvedit_uv_select_shared_location( +scene, em, l, select, false, do_history, cd_loop_uv_offset); +uvedit_uv_select_shared_location( +scene, em, l->next, select, false, do_history, cd_loop_uv_offset); + } + else { +BMLoop *l_radial_iter = l; +do { + if (BM_loop_uv_share_edge_check(l, l_radial_iter, cd_loop_uv_offset)) { +MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l_radial_iter, cd_loop_uv_offset); +
[Bf-blender-cvs] [035fa7985d2] soc-2021-uv-editor-improvements-edge-selection: UV: Edge selection support - Initial
Commit: 035fa7985d270fae197dfd155c7937b24e16e244 Author: Siddhartha Jejurkar Date: Mon Jul 26 09:22:32 2021 +0530 Branches: soc-2021-uv-editor-improvements-edge-selection https://developer.blender.org/rB035fa7985d270fae197dfd155c7937b24e16e244 UV: Edge selection support - Initial * Add UV edge selection flag - MLOOPUV_EDGESEL * Refactor existing UV element selection functions to use the edge selection flag wherever required * Refactor existing UV element check functions to ensure proper selection states using the edge selection flag * Refactor UV select all operator to use edge selection flag * New functions for selecting vertices or edges that share the same location, either on 3D mesh or in UV space. * Add small penalty for finding the nearest UV edge. Ensures that UV edge selection will select other edges sharing the same location in successive selection attempts. * Expose UV edge selection flag as boolean in Python Differential Revision: https://developer.blender.org/D12028 === M source/blender/editors/include/ED_uvedit.h M source/blender/editors/uvedit/uvedit_intern.h M source/blender/editors/uvedit/uvedit_path.c M source/blender/editors/uvedit/uvedit_select.c M source/blender/editors/uvedit/uvedit_smart_stitch.c M source/blender/makesdna/DNA_meshdata_types.h M source/blender/makesrna/intern/rna_mesh.c M source/blender/python/bmesh/bmesh_py_types_meshdata.c === diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index ea3d921f2c5..157fc450e70 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -145,6 +145,13 @@ void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, const bool select, const bool do_history, const uint cd_loop_uv_offset); +void uvedit_edge_select_shared_location(const struct Scene *scene, +struct BMEditMesh *em, +struct BMLoop *l, +const bool select, +const bool use_mesh_location, +const bool do_history, +const uint cd_loop_uv_offset); void uvedit_edge_select_set(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, @@ -168,6 +175,13 @@ void uvedit_uv_select_set_with_sticky(const struct SpaceImage *sima, const bool select, const bool do_history, const uint cd_loop_uv_offset); +void uvedit_uv_select_shared_location(const struct Scene *scene, + struct BMEditMesh *em, + struct BMLoop *l, + const bool select, + const bool use_mesh_location, + const bool do_history, + const uint cd_loop_uv_offset); void uvedit_uv_select_set(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index cd8fbd00316..ea72b859f7c 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -86,11 +86,13 @@ bool uv_find_nearest_vert_multi(struct Scene *scene, bool uv_find_nearest_edge(struct Scene *scene, struct Object *obedit, const float co[2], + const float penalty, struct UvNearestHit *hit); bool uv_find_nearest_edge_multi(struct Scene *scene, struct Object **objects, const uint objects_len, const float co[2], +const float penalty, struct UvNearestHit *hit); bool uv_find_nearest_face_ex(struct Scene *scene, diff --git a/source/blender/editors/uvedit/uvedit_path.c b/source/blender/editors/uvedit/uvedit_path.c index 2613c5b23a0..1f3ba206103 100644 --- a/source/blender/editors/uvedit/uvedit_path.c +++ b/source/blender/editors/uvedit/uvedit_path.c @@ -627,7 +627,7 @@ static int uv_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEve else if (uv_selectmode & UV_SELECT_EDGE) { UvNearestHit hit = UV_NEAREST_HIT_INIT_MAX(®ion
[Bf-blender-cvs] [8b3b353cafd] soc-2021-uv-editor-improvements-edge-selection: Fix: Prevent deselection of surrounding UV faces
Commit: 8b3b353cafd151fc6236fe8fab417fd446d5ec03 Author: Siddhartha Jejurkar Date: Thu Jul 29 20:02:29 2021 +0530 Branches: soc-2021-uv-editor-improvements-edge-selection https://developer.blender.org/rB8b3b353cafd151fc6236fe8fab417fd446d5ec03 Fix: Prevent deselection of surrounding UV faces With face + sticky loc/vertex mode, trying to deselect UV faces would sometimes result in surrounding UV faces being deselected as well. This commit fixes that allowing conditional deselection of shared UV vertices based on the selection state of surrounding UV faces. === 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 aac9b8a419d..fe505f865b6 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -282,19 +282,53 @@ void uvedit_face_select_set_with_sticky(const SpaceImage *sima, case SI_STICKY_LOC: case SI_STICKY_VERTEX: default: { - /* Sticky location and vertex modes. */ - /* Fallback, in case sima->sticky is invalid */ - BMLoop *l_iter, *l_first; - l_iter = l_first = BM_FACE_FIRST_LOOP(efa); - do { -uvedit_edge_select_shared_location( -scene, em, l_iter, select, false, do_history, cd_loop_uv_offset); - -uvedit_uv_select_shared_location( -scene, em, l_iter, select, false, do_history, cd_loop_uv_offset); -uvedit_uv_select_shared_location( -scene, em, l_iter->next, select, false, do_history, cd_loop_uv_offset); - } while ((l_iter = l_iter->next) != l_first); + if (uvedit_face_visible_test(scene, efa)) { +/* Sticky location and vertex modes. */ +/* Fallback, in case sima->sticky is invalid */ +BMLoop *l_iter, *l_first; +l_iter = l_first = BM_FACE_FIRST_LOOP(efa); +do { + MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l_iter, cd_loop_uv_offset); + if (select) { +/* Set selection flag for the internal edges of the face that is being selected */ +luv->flag |= MLOOPUV_EDGESEL; +/* Select all shared vertices */ +uvedit_uv_select_shared_location( +scene, em, l_iter, select, false, do_history, cd_loop_uv_offset); + } + else { +luv->flag &= ~MLOOPUV_EDGESEL; + +bool do_vert_deselect = true; +BMEdge *e_first = l_iter->e, *e_iter; +e_iter = e_first; +do { + /* If any surrounding UV face is selected then don't deselect the shared UV vertices + * Deselcting the shared UV vertices could deselect the surrounding UV faces as + * well*/ + BMLoop *l_radial_iter = e_iter->l; + do { +MLoopUV *luv_radial_other = BM_ELEM_CD_GET_VOID_P(l_radial_iter, + cd_loop_uv_offset); +if ((l_radial_iter->f != l_iter->f) && +uvedit_face_select_test(scene, l_radial_iter->f, cd_loop_uv_offset) && +equals_v2v2(luv->uv, luv_radial_other->uv)) { + do_vert_deselect = false; + break; +} + } while ((l_radial_iter = l_radial_iter->radial_next) != e_iter->l); + if (!do_vert_deselect) { +break; + } +} while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, l_iter->v)) != e_first); + +if (do_vert_deselect) { + uvedit_uv_select_shared_location( + scene, em, l_iter, select, false, do_history, cd_loop_uv_offset); +} + } +} while ((l_iter = l_iter->next) != l_first); + } break; } } @@ -438,10 +472,10 @@ void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, uvedit_edge_select_shared_location( scene, em, l, select, false, do_history, cd_loop_uv_offset); - /* NOTE: This is a case where we deviate from the logic of: "EDGE SELECTION MODE SHOULD - * IMPLY ONLY EDGES MUST BE SELECTED". - * The UV vertex selections done below are to avoid the cases of edge selections breaking - * away (/become separate entities) from the vertices/edges they were connected to */ + /* NOTE (Design tradeoff): This is a case where we deviate from the logic of: "EDGE + * SELECTION MODE SHOULD IMPLY ONLY EDGES MUST BE SELECTED". The UV vertex selections done + * below are to avoid the cases of edge selections breaking away (/become separate + * entities) from the vertices/edges they were connected to */ uvedit_uv_select_shared_location(scene, em, l, select, false, do_history, cd_loop_uv_offset)
[Bf-blender-cvs] [f45860fba9c] master: Cleanup: Remove unused members in FileSelectParams
Commit: f45860fba9c47466a18d92c1621c153aaef7be05 Author: Julian Eisel Date: Thu Aug 5 12:52:12 2021 +0200 Branches: master https://developer.blender.org/rBf45860fba9c47466a18d92c1621c153aaef7be05 Cleanup: Remove unused members in FileSelectParams === M source/blender/makesdna/DNA_space_types.h === diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 7290647dbc6..27d5d83c7cb 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -754,13 +754,7 @@ typedef struct FileSelectParams { /** Max number of levels in dirtree to show at once, 0 to disable recursion. */ short recursion_level; - /* XXX --- still unused -- */ - /** Show font preview. */ - short f_fp; - /** String to use for font preview. */ - char fp_str[8]; - - /* XXX --- end unused -- */ + char _pad4[2]; } FileSelectParams; /** ___ 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] [ed9759349b3] master: Fix T89214: Smooth Vertices (Laplacian) produces NaN coordinates
Commit: ed9759349b3da090d22bd34bc066b72025679dc4 Author: Campbell Barton Date: Thu Aug 5 20:41:23 2021 +1000 Branches: master https://developer.blender.org/rBed9759349b3da090d22bd34bc066b72025679dc4 Fix T89214: Smooth Vertices (Laplacian) produces NaN coordinates Vertices with no connected faces would attempt to divide by the combined face area causing a divide by zero. Use the same weight for wire vertices as vertices connected to zero area faces. === M source/blender/bmesh/operators/bmo_smooth_laplacian.c === diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index b2b93bfd003..31f66ad952f 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -533,7 +533,10 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op) EIG_linear_solver_right_hand_side_add(sys->context, 1, m_vertex_id, v->co[1]); EIG_linear_solver_right_hand_side_add(sys->context, 2, m_vertex_id, v->co[2]); i = m_vertex_id; -if (sys->zerola[i] == 0) { +if ((sys->zerola[i] == 0) && +/* Non zero check is to account for vertices that aren't connected to a selected face. + * Without this wire edges become `nan`, see T89214. */ +(sys->ring_areas[i] != 0.0f)) { w = sys->vweights[i] * sys->ring_areas[i]; sys->vweights[i] = (w == 0.0f) ? 0.0f : -lambda_factor / (4.0f * w); w = sys->vlengths[i]; ___ 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] [37e3d7a66ac] temp-VSE-fixes: Fix audaspace not reading ffmpeg files with start offset correctly
Commit: 37e3d7a66acc8f7140b3126e039aee6c5d0c4063 Author: Sebastian Parborg Date: Tue Jul 6 19:48:06 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rB37e3d7a66acc8f7140b3126e039aee6c5d0c4063 Fix audaspace not reading ffmpeg files with start offset correctly === M extern/audaspace/bindings/C/AUD_Special.cpp M extern/audaspace/bindings/C/AUD_Types.h M extern/audaspace/include/IReader.h M extern/audaspace/include/fx/EffectReader.h M extern/audaspace/include/fx/ModulatorReader.h M extern/audaspace/include/fx/MutableReader.h M extern/audaspace/include/fx/VolumeReader.h M extern/audaspace/include/generator/SawtoothReader.h M extern/audaspace/include/generator/SilenceReader.h M extern/audaspace/include/generator/SineReader.h M extern/audaspace/include/generator/SquareReader.h M extern/audaspace/include/generator/TriangleReader.h M extern/audaspace/include/sequence/DoubleReader.h M extern/audaspace/include/sequence/SequenceReader.h M extern/audaspace/include/sequence/SuperposeReader.h M extern/audaspace/include/util/BufferReader.h M extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp M extern/audaspace/plugins/ffmpeg/FFMPEGReader.h M extern/audaspace/plugins/libsndfile/SndFileReader.cpp M extern/audaspace/plugins/libsndfile/SndFileReader.h M extern/audaspace/src/fx/EffectReader.cpp M extern/audaspace/src/fx/ModulatorReader.cpp M extern/audaspace/src/fx/MutableReader.cpp M extern/audaspace/src/fx/VolumeReader.cpp M extern/audaspace/src/generator/SawtoothReader.cpp M extern/audaspace/src/generator/SilenceReader.cpp M extern/audaspace/src/generator/SineReader.cpp M extern/audaspace/src/generator/SquareReader.cpp M extern/audaspace/src/generator/TriangleReader.cpp M extern/audaspace/src/sequence/DoubleReader.cpp M extern/audaspace/src/sequence/SequenceReader.cpp M extern/audaspace/src/sequence/SuperposeReader.cpp M extern/audaspace/src/util/BufferReader.cpp M source/blender/blenkernel/BKE_sound.h M source/blender/blenkernel/intern/sound.c M source/blender/editors/space_sequencer/sequencer_add.c M source/blender/editors/space_sequencer/sequencer_draw.c M source/blender/imbuf/IMB_imbuf.h M source/blender/imbuf/intern/IMB_anim.h M source/blender/imbuf/intern/anim_movie.c M source/blender/makesdna/DNA_sound_types.h M source/blender/makesrna/intern/rna_sequencer_api.c M source/blender/sequencer/SEQ_add.h M source/blender/sequencer/intern/sound.c M source/blender/sequencer/intern/strip_add.c M source/blender/sequencer/intern/strip_time.c === diff --git a/extern/audaspace/bindings/C/AUD_Special.cpp b/extern/audaspace/bindings/C/AUD_Special.cpp index f2398bf0efb..5cc33525d1d 100644 --- a/extern/audaspace/bindings/C/AUD_Special.cpp +++ b/extern/audaspace/bindings/C/AUD_Special.cpp @@ -86,6 +86,7 @@ AUD_API AUD_SoundInfo AUD_getInfo(AUD_Sound* sound) info.specs.channels = AUD_CHANNELS_INVALID; info.specs.rate = AUD_RATE_INVALID; info.length = 0.0f; + info.start_offset = 0.0f; try { @@ -95,6 +96,7 @@ AUD_API AUD_SoundInfo AUD_getInfo(AUD_Sound* sound) { info.specs = convSpecToC(reader->getSpecs()); info.length = reader->getLength() / (float) info.specs.rate; + info.start_offset = reader->getStartOffset(); } } catch(Exception&) diff --git a/extern/audaspace/bindings/C/AUD_Types.h b/extern/audaspace/bindings/C/AUD_Types.h index 75e4ffae18c..c6a96d30d3f 100644 --- a/extern/audaspace/bindings/C/AUD_Types.h +++ b/extern/audaspace/bindings/C/AUD_Types.h @@ -176,4 +176,5 @@ typedef struct { AUD_Specs specs; float length; + double start_offset; } AUD_SoundInfo; diff --git a/extern/audaspace/include/IReader.h b/extern/audaspace/include/IReader.h index c29900ca579..7de9a5c6d81 100644 --- a/extern/audaspace/include/IReader.h +++ b/extern/audaspace/include/IReader.h @@ -70,6 +70,12 @@ public: */ virtual int getPosition() const=0; + /** +* Returns the start offset the sound should have to line up with related sources. +* \return The required start offset in seconds. +*/ + virtual double getStartOffset() const=0; + /** * Returns the specification of the reader. * \return The Specs structure. diff --git a/extern/audaspace/include/fx/EffectReader.h b/extern/audaspace/include/fx/EffectReader.h index 85eff6a8ab9..f21001c1f86 100644 --- a/extern/audaspace/include/fx/EffectReader.h +++ b/extern/audaspace/include/fx/EffectReader.h @@ -61,6 +61,7 @@ public:
[Bf-blender-cvs] [236f93f7b7d] temp-VSE-fixes: Fix VSE seeking issues.
Commit: 236f93f7b7d01a6e13a5b43814811f4577042d7f Author: Sebastian Parborg Date: Mon Jul 12 19:13:15 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rB236f93f7b7d01a6e13a5b43814811f4577042d7f Fix VSE seeking issues. The seek pts was not correctly calculated. In addition to that we were not seeking in the video pts time base. === M source/blender/imbuf/intern/anim_movie.c M source/blender/imbuf/intern/indexer.c === diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index c08df2889de..fd96110b59e 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -1059,33 +1059,21 @@ static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx) return false; } -static int64_t ffmpeg_get_seek_pos(struct anim *anim, int position) +static int64_t ffmpeg_get_seek_pts(struct anim *anim, int64_t pts_to_search) { AVStream *v_st = anim->pFormatCtx->streams[anim->videoStream]; - double frame_rate = av_q2d(av_guess_frame_rate(anim->pFormatCtx, v_st, NULL)); - int64_t st_time = anim->pFormatCtx->start_time; - int64_t pos = (int64_t)(position)*AV_TIME_BASE; - /* Step back half a time base position to make sure that we get the requested - * frame and not the one after it. + AVRational frame_rate = v_st->r_frame_rate; + AVRational time_base = v_st->time_base; + double steps_per_frame = (double)(frame_rate.den * time_base.den) / + (double)(frame_rate.num * time_base.num); + /* Step back half a frame position to make sure that we get the requested + * frame and not the one after it. This is a workaround as ffmpeg will + * sometimes not seek to a frame after the requested pts even if + * AVSEEK_FLAG_BACKWARD is specified. */ - pos -= (AV_TIME_BASE / 2); - pos /= frame_rate; + int64_t pts = pts_to_search - (steps_per_frame / 2); - av_log(anim->pFormatCtx, - AV_LOG_DEBUG, - "NO INDEX seek pos = %" PRId64 ", st_time = %" PRId64 "\n", - pos, - (st_time != AV_NOPTS_VALUE) ? st_time : 0); - - if (pos < 0) { -pos = 0; - } - - if (st_time != AV_NOPTS_VALUE) { -pos += st_time; - } - - return pos; + return pts; } /* This gives us an estimate of which pts our requested frame will have. @@ -1102,17 +1090,18 @@ static int64_t ffmpeg_get_pts_to_search(struct anim *anim, pts_to_search = IMB_indexer_get_pts(tc_index, new_frame_index); } else { -int64_t st_time = anim->pFormatCtx->start_time; AVStream *v_st = anim->pFormatCtx->streams[anim->videoStream]; -AVRational frame_rate = av_guess_frame_rate(anim->pFormatCtx, v_st, NULL); +int64_t start_pts = v_st->start_time; +AVRational frame_rate = v_st->r_frame_rate; AVRational time_base = v_st->time_base; -int64_t steps_per_frame = (frame_rate.den * time_base.den) / (frame_rate.num * time_base.num); -pts_to_search = position * steps_per_frame; +double steps_per_frame = (double)(frame_rate.den * time_base.den) / + (double)(frame_rate.num * time_base.num); + +pts_to_search = round(position * steps_per_frame); -if (st_time != AV_NOPTS_VALUE && st_time != 0) { - int64_t start_frame = (double)st_time / AV_TIME_BASE * av_q2d(frame_rate); - pts_to_search += start_frame * steps_per_frame; +if (start_pts != AV_NOPTS_VALUE) { + pts_to_search += start_pts; } } return pts_to_search; @@ -1196,23 +1185,29 @@ static void ffmpeg_decode_video_frame_scan(struct anim *anim, int64_t pts_to_sea * decoded will be read. See https://trac.ffmpeg.org/ticket/1607 and * https://developer.blender.org/T86944. */ static int ffmpeg_generic_seek_workaround(struct anim *anim, - int64_t *requested_pos, + int64_t *requested_pts, int64_t pts_to_search) { AVStream *v_st = anim->pFormatCtx->streams[anim->videoStream]; - double frame_rate = av_q2d(av_guess_frame_rate(anim->pFormatCtx, v_st, NULL)); - int64_t current_pos = *requested_pos; + AVRational frame_rate = v_st->r_frame_rate; + AVRational time_base = v_st->time_base; + + double steps_per_frame = (double)(frame_rate.den * time_base.den) / + (double)(frame_rate.num * time_base.num); + + int64_t current_pts = *requested_pts; int64_t offset = 0; int64_t cur_pts, prev_pts = -1; /* Step backward frame by frame until we find the key frame we are looking for. */ - while (current_pos != 0) { -current_pos = *requested_pos - ((int64_t)(offset)*AV_TIME_BASE / frame_rate); -current_pos = max_ii(current_pos, 0); + while (current_pts != 0) { +current_pts = *requested_pts - (int64_t)round(offset * steps_per_frame); +current
[Bf-blender-cvs] [b0435853d70] temp-VSE-fixes: Fix memory leak when adding bad VSE image/movie strips
Commit: b0435853d70f22360c5b6971a3eff95f6b801747 Author: Sebastian Parborg Date: Mon Jul 12 15:38:25 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rBb0435853d70f22360c5b6971a3eff95f6b801747 Fix memory leak when adding bad VSE image/movie strips === M source/blender/editors/space_sequencer/sequencer_add.c === diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 1239286d4da..e8fcf53c001 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -710,13 +710,13 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) } else { if (!sequencer_add_movie_single_strip(C, op, &load_data)) { + sequencer_add_cancel(C, op); return OPERATOR_CANCELLED; } } - if (op->customdata) { -MEM_freeN(op->customdata); - } + /* Free custom data. */ + sequencer_add_cancel(C, op); DEG_relations_tag_update(bmain); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); @@ -1043,6 +1043,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) load_data.image.len = sequencer_add_image_strip_calculate_length( op, load_data.start_frame, &minframe, &numdigits); if (load_data.image.len == 0) { +sequencer_add_cancel(C, op); return OPERATOR_CANCELLED; } @@ -1065,9 +1066,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - if (op->customdata) { -MEM_freeN(op->customdata); - } + /* Free custom data. */ + sequencer_add_cancel(C, op); return OPERATOR_FINISHED; } ___ 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] [d921978bda2] temp-VSE-fixes: Fix VSE video strip duration calculation
Commit: d921978bda209e8bcdad94c2079f6d07deb3fe6e Author: Sebastian Parborg Date: Mon Jul 12 16:00:43 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rBd921978bda209e8bcdad94c2079f6d07deb3fe6e Fix VSE video strip duration calculation === M source/blender/imbuf/intern/anim_movie.c === diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 47514308ae4..c08df2889de 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -616,10 +616,50 @@ static int startffmpeg(struct anim *anim) } } } - /* Fall back to the container. */ + /* Fall back to manually estimating the video stream duration. + * This is because the video stream duration can be shorter than the pFormatCtx->duration. + */ if (anim->duration_in_frames == 0) { -anim->duration_in_frames = (int)(pFormatCtx->duration * av_q2d(frame_rate) / AV_TIME_BASE + - 0.5f); +double pts_time_base = av_q2d(video_stream->time_base); +double stream_dur; + +if (video_stream->duration != AV_NOPTS_VALUE) { + stream_dur = video_stream->duration * pts_time_base; +} +else { + double video_start = 0; + double audio_start = 0; + + if (video_stream->start_time != AV_NOPTS_VALUE) { +video_start = video_stream->start_time * pts_time_base; + } + + /* Find audio stream to guess the duration of the video. + * Sometimes the audio AND the video stream have a start offset. + * The difference between these is the offset we want to use to + * calculate the video duration. + */ + for (i = 0; i < pFormatCtx->nb_streams; i++) { +if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { + AVStream *audio_stream = pFormatCtx->streams[i]; + if (audio_stream->start_time != AV_NOPTS_VALUE) { +audio_start = audio_stream->start_time * av_q2d(audio_stream->time_base); + } + break; +} + } + + if (video_start > audio_start) { +stream_dur = (double)pFormatCtx->duration / AV_TIME_BASE - (video_start - audio_start); + } + else { +/* The video stream starts before or at the same time as the audio stream! + * We have to assume that the video stream is as long as the full pFormatCtx->duration. + */ +stream_dur = (double)pFormatCtx->duration / AV_TIME_BASE; + } +} +anim->duration_in_frames = (int)(stream_dur * av_q2d(frame_rate) + 0.5f); } frs_num = frame_rate.num; ___ 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] [733ce65f1cd] temp-VSE-fixes: Fix "off by one" error when encoding audio
Commit: 733ce65f1cdfb49989c2b3f838c1ffe85794facf Author: Sebastian Parborg Date: Fri Jul 9 15:06:06 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rB733ce65f1cdfb49989c2b3f838c1ffe85794facf Fix "off by one" error when encoding audio === M source/blender/blenkernel/intern/writeffmpeg.c === diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 07342d2cc7f..1955d12272a 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1435,8 +1435,9 @@ int BKE_ffmpeg_append(void *context_v, } # ifdef WITH_AUDASPACE - write_audio_frames(context, - (frame - start_frame) / (((double)rd->frs_sec) / (double)rd->frs_sec_base)); + /* Add +1 frame because we want to encode audio up until the next video frame. */ + write_audio_frames( + context, (frame - start_frame + 1) / (((double)rd->frs_sec) / (double)rd->frs_sec_base)); # endif return success; } ___ 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] [03f6f507a45] temp-VSE-fixes: Draw seq waveforms better
Commit: 03f6f507a454eed74257d2356db5375a099320de Author: Sebastian Parborg Date: Thu Jul 1 18:51:26 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rB03f6f507a454eed74257d2356db5375a099320de Draw seq waveforms better === M extern/audaspace/bindings/C/AUD_Special.cpp M source/blender/editors/space_sequencer/sequencer_draw.c === diff --git a/extern/audaspace/bindings/C/AUD_Special.cpp b/extern/audaspace/bindings/C/AUD_Special.cpp index ac876a01eb3..f2398bf0efb 100644 --- a/extern/audaspace/bindings/C/AUD_Special.cpp +++ b/extern/audaspace/bindings/C/AUD_Special.cpp @@ -245,7 +245,7 @@ AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int sampl buffer[i * 3] = min; buffer[i * 3 + 1] = max; - buffer[i * 3 + 2] = sqrt(power) / len; + buffer[i * 3 + 2] = sqrt(power / len); // RMS if(overallmax < max) overallmax = max; diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index cdbe5bc63ce..52065643c0e 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -232,6 +232,78 @@ void color3ubv_from_seq(Scene *curscene, Sequence *seq, uchar col[3]) } } +typedef struct WaveVizData { + float pos[2]; + float rms_pos; + bool clip; + bool end; +} WaveVizData; + +static int get_section_len(WaveVizData *start, WaveVizData *end) +{ + int len = 0; + while (start != end) { +len++; +if (start->end) { + return len; +} +start++; + } + return len; +} + +static void draw_waveform(WaveVizData *iter, WaveVizData *end, GPUPrimType prim_type, bool use_rms) +{ + int strip_len = get_section_len(iter, end); + if (strip_len != 0) { +GPU_blend(GPU_BLEND_ALPHA); +GPUVertFormat *format = immVertexFormat(); +uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); +uint col = GPU_vertformat_attr_add(format, "color", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); + +immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); +immBegin(prim_type, strip_len); + +while (iter != end) { + if (iter->clip) { +immAttr4f(col, 1.0f, 0.0f, 0.0f, 0.5f); + } + else if (use_rms) { +immAttr4f(col, 1.0f, 1.0f, 1.0f, 0.8f); + } + else { +immAttr4f(col, 1.0f, 1.0f, 1.0f, 0.5f); + } + + if (use_rms) { +immVertex2f(pos, iter->pos[0], iter->rms_pos); + } + else { +immVertex2f(pos, iter->pos[0], iter->pos[1]); + } + + if (iter->end) { +/* End of line. */ +iter++; +strip_len = get_section_len(iter, end); +if (strip_len != 0) { + immEnd(); + immUnbindProgram(); + immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); + immBegin(prim_type, strip_len); +} + } + else { +iter++; + } +} +immEnd(); +immUnbindProgram(); + +GPU_blend(GPU_BLEND_NONE); + } +} + /** * \param x1, x2, y1, y2: The starting and end X value to draw the wave, same for y1 and y2. * \param stepsize: The width of a pixel. @@ -248,8 +320,8 @@ static void draw_seq_waveform_overlay(View2D *v2d, float stepsize) { /* Offset x1 and x2 values, to match view min/max, if strip is out of bounds. */ - int x1_offset = max_ff(v2d->cur.xmin, x1); - int x2_offset = min_ff(v2d->cur.xmax + 1.0f, x2); + float x1_offset = max_ff(v2d->cur.xmin, x1); + float x2_offset = min_ff(v2d->cur.xmax + 1.0f, x2); if (seq->sound && ((sseq->flag & SEQ_ALL_WAVEFORMS) || (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM))) { int length = floor((x2_offset - x1_offset) / stepsize) + 1; @@ -258,7 +330,7 @@ static void draw_seq_waveform_overlay(View2D *v2d, float samplestep; float startsample, endsample; float volume = seq->volume; -float value1, value2; +float value_min, value_max, rms; bSound *sound = seq->sound; SoundWaveform *waveform; @@ -288,10 +360,9 @@ static void draw_seq_waveform_overlay(View2D *v2d, return; } -startsample = floor((seq->startofs + seq->anim_startofs) / FPS * -SOUND_WAVE_SAMPLES_PER_SECOND); -endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp) / FPS * - SOUND_WAVE_SAMPLES_PER_SECOND); +startsample = (seq->startofs + seq->anim_startofs) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND; +endsample = (seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp) / FPS * +SOUND_WAVE_SAMPLES_PER_SECOND; samplestep = (endsample - startsample) * stepsize / (x2 - x1); length = min_ii( @@ -305,36 +376
[Bf-blender-cvs] [69bace93194] temp-VSE-fixes: Flush audio encode after finishing video export
Commit: 69bace931948bdc1a9bffeb59a8fae5a49f19112 Author: Sebastian Parborg Date: Mon Jul 5 14:16:02 2021 +0200 Branches: temp-VSE-fixes https://developer.blender.org/rB69bace931948bdc1a9bffeb59a8fae5a49f19112 Flush audio encode after finishing video export === M source/blender/blenkernel/intern/writeffmpeg.c === diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 9b3103a638b..07342d2cc7f 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -149,7 +149,6 @@ static int write_audio_frame(FFMpegContext *context) AUD_Device_read( context->audio_mixdown_device, context->audio_input_buffer, context->audio_input_samples); - context->audio_time += (double)context->audio_input_samples / (double)c->sample_rate; frame = av_frame_alloc(); frame->pts = context->audio_time / av_q2d(c->time_base); @@ -184,7 +183,7 @@ static int write_audio_frame(FFMpegContext *context) context->audio_input_samples * c->channels * context->audio_sample_size, 1); - int success = 0; + int success = 1; int ret = avcodec_send_frame(c, frame); if (ret < 0) { @@ -369,7 +368,7 @@ static int write_video_frame(FFMpegContext *context, int cfra, AVFrame *frame, R return success; } -/* read and encode a frame of audio from the buffer */ +/* read and encode a frame of video from the buffer */ static AVFrame *generate_video_frame(FFMpegContext *context, const uint8_t *pixels) { AVCodecParameters *codec = context->video_stream->codecpar; @@ -1226,9 +1225,8 @@ fail: * parameter. * */ -static void flush_ffmpeg(FFMpegContext *context) +static void flush_ffmpeg(AVCodecContext *c, AVStream *stream, AVFormatContext *outfile) { - AVCodecContext *c = context->video_codec; AVPacket *packet = av_packet_alloc(); avcodec_send_frame(c, NULL); @@ -1247,13 +1245,13 @@ static void flush_ffmpeg(FFMpegContext *context) break; } -packet->stream_index = context->video_stream->index; -av_packet_rescale_ts(packet, c->time_base, context->video_stream->time_base); +packet->stream_index = stream->index; +av_packet_rescale_ts(packet, c->time_base, stream->time_base); # ifdef FFMPEG_USE_DURATION_WORKAROUND -my_guess_pkt_duration(context->outfile, context->video_stream, packet); +my_guess_pkt_duration(context->outfile, stream, packet); # endif -int write_ret = av_interleaved_write_frame(context->outfile, packet); +int write_ret = av_interleaved_write_frame(outfile, packet); if (write_ret != 0) { fprintf(stderr, "Error writing delayed frame: %s\n", av_err2str(write_ret)); break; @@ -1396,12 +1394,13 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit); # ifdef WITH_AUDASPACE static void write_audio_frames(FFMpegContext *context, double to_pts) { - int finished = 0; + AVCodecContext *c = context->audio_codec; - while (context->audio_stream && !finished) { -if ((context->audio_time >= to_pts) || (write_audio_frame(context))) { - finished = 1; + while (context->audio_stream) { +if ((context->audio_time >= to_pts) || !write_audio_frame(context)) { + break; } +context->audio_time += (double)context->audio_input_samples / (double)c->sample_rate; } } # endif @@ -1422,9 +1421,6 @@ int BKE_ffmpeg_append(void *context_v, PRINT("Writing frame %i, render width=%d, render height=%d\n", frame, rectx, recty); - /* why is this done before writing the video frame and again at end_ffmpeg? */ - // write_audio_frames(frame / (((double)rd->frs_sec) / rd->frs_sec_base)); - if (context->video_stream) { avframe = generate_video_frame(context, (unsigned char *)pixels); success = (avframe && write_video_frame(context, frame - start_frame, avframe, reports)); @@ -1461,8 +1457,13 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit) # endif if (context->video_stream) { -PRINT("Flushing delayed frames...\n"); -flush_ffmpeg(context); +PRINT("Flushing delayed video frames...\n"); +flush_ffmpeg(context->video_codec, context->video_stream, context->outfile); + } + + if (context->audio_stream) { +PRINT("Flushing delayed audio frames...\n"); +flush_ffmpeg(context->audio_codec, context->audio_stream, context->outfile); } if (context->outfile) { ___ 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