Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
83a4ab9a
Commit
83a4ab9a
authored
Sep 22, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix keyframes not deleted when clip start is resized/cut.
Fixes
#355
parent
4cd6df70
Pipeline
#8122
passed with stage
in 21 minutes and 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/keyframes/model/keyframemodel.cpp
View file @
83a4ab9a
...
...
@@ -451,7 +451,7 @@ Fun KeyframeModel::deleteKeyframe_lambda(GenTime pos, bool notify)
qDebug
()
<<
"delete lambda"
<<
pos
.
frames
(
pCore
->
getCurrentFps
())
<<
notify
;
qDebug
()
<<
"before"
<<
getAnimProperty
();
Q_ASSERT
(
m_keyframeList
.
count
(
pos
)
>
0
);
Q_ASSERT
(
pos
!=
GenTime
());
// cannot delete initial point
//
Q_ASSERT(pos != GenTime()); // cannot delete initial point
int
row
=
static_cast
<
int
>
(
std
::
distance
(
m_keyframeList
.
begin
(),
m_keyframeList
.
find
(
pos
)));
if
(
notify
)
beginRemoveRows
(
QModelIndex
(),
row
,
row
);
m_keyframeList
.
erase
(
pos
);
...
...
src/assets/keyframes/model/keyframemodellist.cpp
View file @
83a4ab9a
...
...
@@ -391,25 +391,36 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
Keyframe
kf
=
getKeyframe
(
old_in
,
&
ok
);
KeyframeType
type
=
kf
.
second
;
getKeyframe
(
new_in
,
&
ok2
);
// Check keyframes after last position
if
(
ok
&&
!
ok2
&&
oldIn
!=
0
)
{
positions
<<
old_in
;
}
else
if
(
in
==
0
&&
oldIn
!=
0
&&
ok
&&
ok2
)
{
// We moved start to 0. As the 0 keyframe is always here, simply remove old position
if
(
!
ok2
)
{
// Add new in point
for
(
const
auto
&
param
:
m_parameters
)
{
param
.
second
->
removeKeyframe
(
old_in
,
undo
,
redo
);
QVariant
value
=
param
.
second
->
getInterpolatedValue
(
new_in
);
param
.
second
->
addKeyframe
(
new_in
,
type
,
value
,
true
,
undo
,
redo
);
}
}
// qDebug()<<"/// \n\nKEYS TO DELETE: "<<positions<<"\n------------------------";
if
(
ok
&&
!
ok2
)
{
if
(
ok
)
{
// Remove previous in point
for
(
const
auto
&
param
:
m_parameters
)
{
QVariant
value
=
param
.
second
->
getInterpolatedValue
(
new_in
);
param
.
second
->
addKeyframe
(
new_in
,
type
,
value
,
true
,
undo
,
redo
);
for
(
auto
frame
:
positions
)
{
param
.
second
->
removeKeyframe
(
frame
,
undo
,
redo
);
param
.
second
->
removeKeyframe
(
old_in
,
undo
,
redo
);
}
}
// Remove all keyframes before in
bool
nextOk
=
false
;
kf
=
m_parameters
.
begin
()
->
second
->
getNextKeyframe
(
GenTime
(
-
1
),
&
nextOk
);
GenTime
pos
;
while
(
nextOk
)
{
pos
=
kf
.
first
;
if
(
pos
<
new_in
)
{
for
(
const
auto
&
param
:
m_parameters
)
{
param
.
second
->
removeKeyframe
(
pos
,
undo
,
redo
);
}
kf
=
m_parameters
.
begin
()
->
second
->
getNextKeyframe
(
pos
,
&
nextOk
);
}
else
{
break
;
}
}
// qDebug()<<"/// \n\nKEYS TO DELETE: "<<positions<<"\n------------------------";
}
}
else
{
GenTime
old_out
(
oldOut
,
pCore
->
getCurrentFps
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment