Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_gpencil.h
| Show All 27 Lines | |||||
| struct ViewLayer; | struct ViewLayer; | ||||
| struct bDeformGroup; | struct bDeformGroup; | ||||
| struct bGPDcurve; | struct bGPDcurve; | ||||
| struct bGPDframe; | struct bGPDframe; | ||||
| struct bGPDlayer; | struct bGPDlayer; | ||||
| struct bGPDlayer_Mask; | struct bGPDlayer_Mask; | ||||
| struct bGPDstroke; | struct bGPDstroke; | ||||
| struct bGPdata; | struct bGPdata; | ||||
| struct GPencilUpdateCache; | |||||
| #define GPENCIL_SIMPLIFY(scene) (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ENABLE) | #define GPENCIL_SIMPLIFY(scene) (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ENABLE) | ||||
| #define GPENCIL_SIMPLIFY_ONPLAY(playing) \ | #define GPENCIL_SIMPLIFY_ONPLAY(playing) \ | ||||
| (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || \ | (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || \ | ||||
| ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0)) | ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0)) | ||||
| #define GPENCIL_SIMPLIFY_FILL(scene, playing) \ | #define GPENCIL_SIMPLIFY_FILL(scene, playing) \ | ||||
| ((GPENCIL_SIMPLIFY_ONPLAY(playing) && GPENCIL_SIMPLIFY(scene) && \ | ((GPENCIL_SIMPLIFY_ONPLAY(playing) && GPENCIL_SIMPLIFY(scene) && \ | ||||
| (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL))) | (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL))) | ||||
| ▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | |||||
| * \return Pointer to new stroke. | * \return Pointer to new stroke. | ||||
| */ | */ | ||||
| struct bGPDstroke *BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, | struct bGPDstroke *BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, | ||||
| bool dup_points, | bool dup_points, | ||||
| bool dup_curve); | bool dup_curve); | ||||
| /** | /** | ||||
| * Make a copy of a given gpencil data-block. | * Make a copy of a given gpencil data-block. | ||||
| * | * \param bmain: Main structure. Can be NULL which will make a localized copy of the data-block | ||||
| * XXX: Should this be deprecated? | * outside of bmain. | ||||
| * \param gpd: The grease pencil data-block to duplicate. | |||||
campbellbarton: A summary of how `gpd_dst` is used would be useful, even after reading the code it's not so… | |||||
| */ | */ | ||||
| struct bGPdata *BKE_gpencil_data_duplicate(struct Main *bmain, | void BKE_gpencil_data_duplicate(struct Main *bmain, | ||||
| const struct bGPdata *gpd, | const struct bGPdata *gpd, | ||||
campbellbartonUnsubmitted Not Done Inline ActionsShould be gpd_src matching the implementation. campbellbarton: Should be `gpd_src` matching the implementation. | |||||
| bool internal_copy); | struct bGPdata **gpd_dst); | ||||
| /** | /** | ||||
| * Delete the last stroke of the given frame. | * Delete the last stroke of the given frame. | ||||
| * \param gpl: Grease pencil layer | * \param gpl: Grease pencil layer | ||||
| * \param gpf: Grease pencil frame | * \param gpf: Grease pencil frame | ||||
| */ | */ | ||||
| void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe *gpf); | void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe *gpf); | ||||
| ▲ Show 20 Lines • Show All 513 Lines • Show Last 20 Lines | |||||
A summary of how gpd_dst is used would be useful, even after reading the code it's not so clear what the intention is with this exactly.
The destination is read from but may be NULL, in that case a zeroed struct is used.
The doc-string should elaborate on the purpose of passing in an existing destination which may be used as a copy & why a caller want to pass this in.
bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, const bGPdata *gpd_dst_reference).
This way the API reads better (returning a duplicate instead of writing to a pointer argument), and it's clear the gpd_dst_reference is an argument that can be used to initialize the destination struct.