MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / hasSingleKeyFrameTimeSelected

Method hasSingleKeyFrameTimeSelected

Gui/DopeSheet.cpp:1304–1328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1302}
1303
1304bool
1305DopeSheetSelectionModel::hasSingleKeyFrameTimeSelected(double* time) const
1306{
1307 bool timeSet = false;
1308 KnobGuiPtr knob;
1309
1310 if ( _imp->selectedKeyframes.empty() ) {
1311 return false;
1312 }
1313 for (DopeSheetKeyPtrList::iterator it = _imp->selectedKeyframes.begin(); it != _imp->selectedKeyframes.end(); ++it) {
1314 DSKnobPtr knobContext = (*it)->context.lock();
1315 assert(knobContext);
1316 if (!timeSet) {
1317 *time = (*it)->key.getTime();
1318 knob = knobContext->getKnobGui();
1319 timeSet = true;
1320 } else {
1321 if ( ( (*it)->key.getTime() != *time ) || (knobContext->getKnobGui() != knob) ) {
1322 return false;
1323 }
1324 }
1325 }
1326
1327 return true;
1328}
1329
1330int
1331DopeSheetSelectionModel::getSelectedKeyframesCount() const

Callers 1

drawKeyframesMethod · 0.80

Calls 6

emptyMethod · 0.80
getTimeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
lockMethod · 0.45
getKnobGuiMethod · 0.45

Tested by

no test coverage detected