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

Method reloadProject

Engine/PrecompNode.cpp:396–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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