mango request
- highlight active mask layers. - remove keyframes when all layer data is removed.
This commit is contained in:
@@ -48,6 +48,7 @@ struct MaskLayer *BKE_mask_layer_active(struct Mask *mask);
|
|||||||
void BKE_mask_layer_active_set(struct Mask *mask, struct MaskLayer *masklay);
|
void BKE_mask_layer_active_set(struct Mask *mask, struct MaskLayer *masklay);
|
||||||
void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay);
|
void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay);
|
||||||
|
|
||||||
|
void BKE_mask_layer_free_shapes(struct MaskLayer *masklay);
|
||||||
void BKE_mask_layer_free(struct MaskLayer *masklay);
|
void BKE_mask_layer_free(struct MaskLayer *masklay);
|
||||||
void BKE_mask_spline_free(struct MaskSpline *spline);
|
void BKE_mask_spline_free(struct MaskSpline *spline);
|
||||||
struct MaskSpline *BKE_mask_spline_copy(struct MaskSpline *spline);
|
struct MaskSpline *BKE_mask_spline_copy(struct MaskSpline *spline);
|
||||||
|
@@ -1029,10 +1029,27 @@ void BKE_mask_layer_shape_free(MaskLayerShape *masklay_shape)
|
|||||||
MEM_freeN(masklay_shape);
|
MEM_freeN(masklay_shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Free all animation keys for a mask layer
|
||||||
|
*/
|
||||||
|
void BKE_mask_layer_free_shapes(MaskLayer *masklay)
|
||||||
|
{
|
||||||
|
MaskLayerShape *masklay_shape;
|
||||||
|
|
||||||
|
/* free animation data */
|
||||||
|
masklay_shape = masklay->splines_shapes.first;
|
||||||
|
while (masklay_shape) {
|
||||||
|
MaskLayerShape *next_masklay_shape = masklay_shape->next;
|
||||||
|
|
||||||
|
BLI_remlink(&masklay->splines_shapes, masklay_shape);
|
||||||
|
BKE_mask_layer_shape_free(masklay_shape);
|
||||||
|
|
||||||
|
masklay_shape = next_masklay_shape;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BKE_mask_layer_free(MaskLayer *masklay)
|
void BKE_mask_layer_free(MaskLayer *masklay)
|
||||||
{
|
{
|
||||||
MaskSpline *spline;
|
MaskSpline *spline;
|
||||||
MaskLayerShape *masklay_shape;
|
|
||||||
|
|
||||||
/* free splines */
|
/* free splines */
|
||||||
spline = masklay->splines.first;
|
spline = masklay->splines.first;
|
||||||
@@ -1046,15 +1063,7 @@ void BKE_mask_layer_free(MaskLayer *masklay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* free animation data */
|
/* free animation data */
|
||||||
masklay_shape = masklay->splines_shapes.first;
|
BKE_mask_layer_free_shapes(masklay);
|
||||||
while (masklay_shape) {
|
|
||||||
MaskLayerShape *next_masklay_shape = masklay_shape->next;
|
|
||||||
|
|
||||||
BLI_remlink(&masklay->splines_shapes, masklay_shape);
|
|
||||||
BKE_mask_layer_shape_free(masklay_shape);
|
|
||||||
|
|
||||||
masklay_shape = next_masklay_shape;
|
|
||||||
}
|
|
||||||
|
|
||||||
MEM_freeN(masklay);
|
MEM_freeN(masklay);
|
||||||
}
|
}
|
||||||
|
@@ -957,6 +957,12 @@ static int delete_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
spline = next_spline;
|
spline = next_spline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* not essential but confuses users when there are keys with no data!
|
||||||
|
* assume if they delete all data from the layer they also dont care about keys */
|
||||||
|
if (masklay->splines.first == NULL) {
|
||||||
|
BKE_mask_layer_free_shapes(masklay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: only update edited splines */
|
/* TODO: only update edited splines */
|
||||||
|
Reference in New Issue
Block a user