|
Blender
V2.93
|
Go to the source code of this file.
| void BKE_gpencil_convert_curve | ( | Main * | bmain, |
| Scene * | scene, | ||
| Object * | ob_gp, | ||
| Object * | ob_cu, | ||
| const bool | use_collections, | ||
| const float | scale_thickness, | ||
| const float | sample | ||
| ) |
Convert a curve object to grease pencil stroke.
| bmain | Main thread pointer |
| scene | Original scene. |
| ob_gp | Grease pencil object to add strokes. |
| ob_cu | Curve to convert. |
| use_collections | Create layers using collection names. |
| scale_thickness | Scale thickness factor. |
| sample | Sample distance, zero to disable. |
Definition at line 491 of file gpencil_curve.c.
References Object::actcol, BKE_gpencil_layer_active_get(), BKE_gpencil_layer_addnew(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_named_get(), BKE_gpencil_merge_materials(), BKE_object_material_slot_remove(), BKE_object_material_slot_used(), CFRA, Object::data, DATA_, DEG_id_tag_update(), ELEM, ListBase::first, GP_GETFRAME_ADD_COPY, gpencil_convert_spline(), gpencil_get_parent_collection(), Collection::id, Object::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, ID::name, NULL, Curve::nurb, OB_GPENCIL, blender::compositor::sample(), scene, Object::totcol, and Object::type.
Referenced by object_convert_exec().
| void BKE_gpencil_editcurve_recalculate_handles | ( | bGPDstroke * | gps | ) |
Recalculate the handles of the edit curve of a grease pencil stroke
Definition at line 1148 of file gpencil_curve.c.
References bGPDcurve_point::bezt, BKE_nurb_handle_calc(), bGPDcurve::curve_points, bGPDstroke::editcurve, bGPDcurve_point::flag, bGPDstroke::flag, GP_CURVE_POINT_SELECT, GP_STROKE_CYCLIC, GP_STROKE_NEEDS_CURVE_UPDATE, NULL, and bGPDcurve::tot_curve_points.
Referenced by BKE_gpencil_curve_delete_tagged_points(), createTransGPencil_curves(), gpencil_dissolve_selected_curve_points(), gpencil_editcurve_set_handle_type_exec(), gpencil_snap_to_grid(), gpencil_stroke_cyclical_set_exec(), gpencil_stroke_subdivide_exec(), and recalcData_gpencil_strokes().
| void BKE_gpencil_editcurve_stroke_sync_selection | ( | struct bGPdata * | gpd, |
| struct bGPDstroke * | gps, | ||
| struct bGPDcurve * | gpc | ||
| ) |
| void BKE_gpencil_editcurve_subdivide | ( | struct bGPDstroke * | gps, |
| const int | cuts | ||
| ) |
Definition at line 1274 of file gpencil_curve.c.
References bGPDcurve_point::bezt, BEZT_SEL_ALL, bGPDcurve::curve_points, bGPDstroke::editcurve, bGPDcurve_point::flag, bGPDstroke::flag, GP_CURVE_POINT_SELECT, GP_STROKE_CYCLIC, gpencil_editcurve_subdivide_count(), gpencil_editcurve_subdivide_curve_segment(), BezTriple::h1, BezTriple::h2, HD_ALIGN, MEM_callocN, MEM_freeN, NULL, and bGPDcurve::tot_curve_points.
Referenced by gpencil_stroke_subdivide_exec().
| struct bGPDcurve* BKE_gpencil_stroke_editcurve_generate | ( | bGPDstroke * | gps, |
| const float | error_threshold, | ||
| const float | corner_angle, | ||
| const float | stroke_radius | ||
| ) |
Creates a bGPDcurve by doing a cubic curve fitting on the grease pencil stroke points.
Definition at line 645 of file gpencil_curve.c.
References bGPDcurve_point::bezt, BKE_gpencil_stroke_editcurve_new(), bGPDstroke::boundbox_max, bGPDstroke::boundbox_min, COORD_FITTING_INFLUENCE, bGPDcurve::curve_points, bGPDstroke::flag, free(), GP_STROKE_CYCLIC, gpencil_stroke_editcurve_generate_edgecases(), BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_FREE, len_v3v3(), madd_v3_v3v3fl(), MEM_callocN, MEM_freeN, mul_v3_v3fl(), mul_v4_v4fl(), NULL, POINT_DIM, bGPDcurve_point::point_index, bGPDstroke::points, bGPDspoint::pressure, bGPDcurve_point::pressure, r, bGPDspoint::strength, bGPDcurve_point::strength, sub_v3_v3v3(), bGPDstroke::totpoints, BezTriple::vec, bGPDspoint::vert_color, bGPDcurve_point::vert_color, and bGPDspoint::x.
Referenced by BKE_gpencil_stroke_editcurve_update().
| void BKE_gpencil_stroke_editcurve_sync_selection | ( | bGPdata * | gpd, |
| bGPDstroke * | gps, | ||
| bGPDcurve * | gpc | ||
| ) |
Sync the selection from editcurve to stroke
Definition at line 813 of file gpencil_curve.c.
References BKE_gpencil_stroke_select_index_reset(), BKE_gpencil_stroke_select_index_set(), bGPDcurve::curve_points, bGPDspoint::flag, bGPDcurve_point::flag, bGPDcurve::flag, bGPDstroke::flag, GP_CURVE_POINT_SELECT, GP_CURVE_SELECT, GP_SPOINT_SELECT, GP_STROKE_CYCLIC, GP_STROKE_SELECT, bGPDcurve_point::point_index, bGPDstroke::points, bGPDcurve::tot_curve_points, and bGPDstroke::totpoints.
Referenced by BKE_gpencil_strokes_selected_sync_selection_editcurve().
| void BKE_gpencil_stroke_editcurve_update | ( | bGPdata * | gpd, |
| bGPDlayer * | gpl, | ||
| bGPDstroke * | gps | ||
| ) |
Updates the editcurve for a stroke. Frees the old curve if one exists and generates a new one.
Definition at line 759 of file gpencil_curve.c.
References BKE_gpencil_free_stroke_editcurve(), BKE_gpencil_stroke_editcurve_generate(), bGPdata::curve_edit_corner_angle, bGPdata::curve_edit_threshold, bGPDstroke::editcurve, bGPDlayer::line_change, NULL, bGPdata::pixfactor, bGPDstroke::thickness, and bGPDstroke::totpoints.
Referenced by BKE_gpencil_strokes_selected_update_editcurve(), ED_gpencil_select_curve_toggle_all(), gpencil_editmode_toggle_exec(), gpencil_generic_stroke_select(), gpencil_select_exec(), gpencil_stroke_do_circle_sel(), gpencil_stroke_enter_editcurve_mode_exec(), and gpencil_strokes_reproject_exec().
| void BKE_gpencil_stroke_update_geometry_from_editcurve | ( | bGPDstroke * | gps, |
| const uint | resolution, | ||
| const bool | adaptive | ||
| ) |
Recalculate stroke points with the editcurve of the stroke.
Definition at line 1061 of file gpencil_curve.c.
References bGPDcurve_point::bezt, BKE_gpencil_stroke_select_index_reset(), copy_v3_v3(), copy_v4_v4(), bGPDcurve::curve_points, bGPDstroke::dvert, bGPDstroke::editcurve, bGPDspoint::flag, bGPDstroke::flag, float(), GP_SPOINT_SELECT, GP_STROKE_CYCLIC, GP_STROKE_SELECT, gpencil_stroke_points_from_editcurve_adaptive_resolu(), gpencil_stroke_points_from_editcurve_fixed_resolu(), MEM_freeN, MEM_recallocN, NULL, bGPDstroke::points, bGPDspoint::pressure, bGPDcurve_point::pressure, bGPDspoint::strength, bGPDcurve_point::strength, bGPDcurve::tot_curve_points, bGPDstroke::totpoints, BezTriple::vec, bGPDspoint::vert_color, bGPDcurve_point::vert_color, and bGPDspoint::x.
Referenced by BKE_gpencil_stroke_geometry_update().
| void BKE_gpencil_strokes_selected_sync_selection_editcurve | ( | struct bGPdata * | gpd | ) |
Definition at line 1394 of file gpencil_curve.c.
References BKE_gpencil_layer_is_editable(), BKE_gpencil_stroke_editcurve_sync_selection(), GP_FRAME_SELECT, GPENCIL_MULTIEDIT_SESSIONS_ON, bGPdata::layers, LISTBASE_FOREACH, bGPDframe::next, and NULL.
| void BKE_gpencil_strokes_selected_update_editcurve | ( | struct bGPdata * | gpd | ) |
Definition at line 1355 of file gpencil_curve.c.
References BKE_gpencil_editcurve_stroke_sync_selection(), BKE_gpencil_layer_is_editable(), BKE_gpencil_stroke_editcurve_update(), BKE_gpencil_stroke_geometry_update(), GP_CURVE_NEEDS_STROKE_UPDATE, GP_FRAME_SELECT, GP_STROKE_NEEDS_CURVE_UPDATE, GP_STROKE_SELECT, GPENCIL_MULTIEDIT_SESSIONS_ON, bGPdata::layers, LISTBASE_FOREACH, bGPDframe::next, and NULL.