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

Method fixRelativeFilePaths

Engine/NodeGroup.cpp:835–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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