Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
252
Issues
252
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
83a4ab9a
Commit
83a4ab9a
authored
Sep 22, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
src/assets/keyframes/model/keyframemodel.cpp
src/assets/keyframes/model/keyframemodel.cpp
+1
-1
src/assets/keyframes/model/keyframemodellist.cpp
src/assets/keyframes/model/keyframemodellist.cpp
+23
-12
No files found.
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
Markdown
is supported
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