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

Method fixRelativeFilePaths

Engine/NodeGroup.cpp:837–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

835}
836
837void
838NodeCollection::fixRelativeFilePaths(const std::string& projectPathName,
839 const std::string& newProjectPath,
840 bool blockEval)
841{
842 NodesList nodes = getNodes();
843 AppInstancePtr appInst = getApplication();
844 if (!appInst) {
845 return;
846 }
847 ProjectPtr project = appInst->getProject();
848
849 for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) {
850 if ( (*it)->isActivated() ) {
851 (*it)->getEffectInstance()->beginChanges();
852
853 const KnobsVec& knobs = (*it)->getKnobs();
854 for (U32 j = 0; j < knobs.size(); ++j) {
855 KnobStringBase* isString = dynamic_cast< KnobStringBase* >( knobs[j].get() );
856 KnobString* isStringKnob = dynamic_cast<KnobString*>(isString);
857 if ( !isString || isStringKnob || ( knobs[j] == project->getEnvVarKnob() ) ) {
858 continue;
859 }
860
861 std::string filepath = isString->getValue();
862
863 if ( !filepath.empty() ) {
864 if ( project->fixFilePath(projectPathName, newProjectPath, filepath) ) {
865 isString->setValue(filepath);
866 }
867 }
868 }
869 (*it)->getEffectInstance()->endChanges(blockEval);
870
871
872 NodeGroup* isGrp = (*it)->isEffectGroup();
873 if (isGrp) {
874 isGrp->fixRelativeFilePaths(projectPathName, newProjectPath, blockEval);
875 }
876 }
877 }
878}
879
880void
881NodeCollection::fixPathName(const std::string& oldName,

Callers 3

entryRemovedMethod · 0.80
tableChangedMethod · 0.80

Calls 14

getProjectMethod · 0.80
getEffectInstanceMethod · 0.80
getEnvVarKnobMethod · 0.80
emptyMethod · 0.80
fixFilePathMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
isActivatedMethod · 0.45
beginChangesMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected