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

Method reloadProject

Engine/PrecompNode.cpp:397–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397void
398PrecompNodePrivate::reloadProject(bool setWriteNodeChoice)
399{
400 std::string filename = projectFileNameKnob.lock()->getValue();
401 QFileInfo file( QString::fromUtf8( filename.c_str() ) );
402
403 if ( !file.exists() ) {
404 Dialogs::errorDialog( tr("Pre-Comp").toStdString(), tr("Pre-comp file not found.").toStdString() );
405
406 return;
407 }
408 QString fileUnPathed = file.fileName();
409
410 subLabelKnob.lock()->setValue( fileUnPathed.toStdString() );
411
412 QString path = file.path() + QLatin1Char('/');
413
414 precompInputs.clear();
415
416 ProjectPtr project = app.lock()->getProject();
417 project->resetProject();
418 {
419 //Set a temporary timeline that will be used while loading the project.
420 //This is to avoid that the seekFrame call has an effect on this project since they share the same timeline
421 TimeLinePtr tmpTimeline( new TimeLine( project.get() ) );
422 project->setTimeLine(tmpTimeline);
423 }
424
425 bool ok = project->loadProject( path, fileUnPathed);
426 if (!ok) {
427 project->resetProject();
428 }
429
430 //Switch the timeline to this instance's timeline
431 project->setTimeLine( _publicInterface->getApp()->getTimeLine() );
432
433 populateWriteNodesChoice(true, setWriteNodeChoice);
434
435 if (ok) {
436 createReadNode();
437 }
438 refreshOutputNode();
439}
440
441void
442PrecompNodePrivate::populateWriteNodesChoice(bool setPartOfPrecomp,

Callers 2

onKnobsLoadedMethod · 0.45
knobChangedMethod · 0.45

Calls 13

toStdStringMethod · 0.80
getProjectMethod · 0.80
setTimeLineMethod · 0.80
getValueMethod · 0.45
lockMethod · 0.45
setValueMethod · 0.45
pathMethod · 0.45
clearMethod · 0.45
resetProjectMethod · 0.45
getMethod · 0.45
loadProjectMethod · 0.45
getTimeLineMethod · 0.45

Tested by

no test coverage detected