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

Method load

Engine/NodeMain.cpp:42–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41
42NATRON_NAMESPACE_ENTER
43
44void
45Node::load(const CreateNodeArgs& args)
46{
47 ///Called from the main thread. MT-safe
48 assert( QThread::currentThread() == qApp->thread() );
49
50 ///cannot load twice
51 assert(!_imp->effect);
52 _imp->isPartOfProject = !args.getProperty<bool>(kCreateNodeArgsPropOutOfProject);
53
54#ifdef NATRON_ENABLE_IO_META_NODES
55 _imp->ioContainer = args.getProperty<NodePtr>(kCreateNodeArgsPropMetaNodeContainer);
56#endif
57
58 NodeCollectionPtr group = getGroup();
59 std::string multiInstanceParentName = args.getProperty<std::string>(kCreateNodeArgsPropMultiInstanceParentName);
60 if ( !multiInstanceParentName.empty() ) {
61 _imp->multiInstanceParentName = multiInstanceParentName;
62 _imp->isMultiInstance = false;
63 fetchParentMultiInstancePointer();
64 }
65
66
67 _imp->wasCreatedSilently = args.getProperty<bool>(kCreateNodeArgsPropSilent);
68
69 NodePtr thisShared = shared_from_this();
70 LibraryBinary* binary = _imp->plugin->getLibraryBinary();
71 std::pair<bool, EffectBuilder> func;
72 if (binary) {
73 func = binary->findFunction<EffectBuilder>("BuildEffect");
74 }
75
76
77 NodeSerializationPtr serialization = args.getProperty<NodeSerializationPtr>(kCreateNodeArgsPropNodeSerialization);
78
79 bool isSilentCreation = args.getProperty<bool>(kCreateNodeArgsPropSilent);
80#ifndef NATRON_ENABLE_IO_META_NODES
81 bool hasUsedFileDialog = false;
82#endif
83
84 bool hasDefaultFilename = false;
85 {
86 std::vector<std::string> defaultParamValues = args.getPropertyN<std::string>(kCreateNodeArgsPropNodeInitialParamValues);
87 std::vector<std::string>::iterator foundFileName = std::find(defaultParamValues.begin(), defaultParamValues.end(), std::string(kOfxImageEffectFileParamName));
88 if (foundFileName != defaultParamValues.end()) {
89 std::string propName(kCreateNodeArgsPropParamValue);
90 propName += "_";
91 propName += kOfxImageEffectFileParamName;
92 hasDefaultFilename = !args.getProperty<std::string>(propName).empty();
93 }
94 }
95 bool canOpenFileDialog = !isSilentCreation && !serialization && _imp->isPartOfProject && !hasDefaultFilename && getGroup();
96
97 std::string argFixedName = args.getProperty<std::string>(kCreateNodeArgsPropNodeInitialName);
98
99

Callers

nothing calls this directly

Calls 15

getAppFunction · 0.85
isTrackerNodePluginFunction · 0.85
emptyMethod · 0.80
getLibraryBinaryMethod · 0.80
getEffectInstanceMethod · 0.80
setEmbeddedReaderMethod · 0.80
setEmbeddedWriterMethod · 0.80
initializeDataMethod · 0.80
setDefaultMetadataMethod · 0.80
canonicalizePathMethod · 0.80
getProjectMethod · 0.80

Tested by

no test coverage detected