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

Method createDefaultReadNode

Engine/ReadNode.cpp:565–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563} // ReadNodePrivate::destroyReadNode
564
565void
566ReadNodePrivate::createDefaultReadNode()
567{
568 CreateNodeArgs args(READ_NODE_DEFAULT_READER, NodeCollectionPtr() );
569
570 args.setProperty(kCreateNodeArgsPropNoNodeGUI, true);
571 args.setProperty(kCreateNodeArgsPropSilent, true);
572 args.setProperty(kCreateNodeArgsPropOutOfProject, true);
573 args.setProperty<std::string>(kCreateNodeArgsPropNodeInitialName, "defaultReadNodeReader");
574 args.setProperty<NodePtr>(kCreateNodeArgsPropMetaNodeContainer, _publicInterface->getNode());
575 args.setProperty<bool>(kCreateNodeArgsPropAllowNonUserCreatablePlugins, true);
576
577 // This will avoid throwing errors when creating the reader
578 args.addParamDefaultValue<bool>("ParamExistingInstance", true);
579
580
581 NodePtr node = _publicInterface->getApp()->createNode(args);
582
583 if (!node) {
584 QString error = tr("The IO.ofx.bundle OpenFX plug-in is required to use this node, make sure it is installed.");
585 throw std::runtime_error( error.toStdString() );
586 }
587
588 {
589 QMutexLocker k(&embeddedPluginMutex);
590 embeddedPlugin = node;
591 }
592
593 //We need to explcitly refresh the Python knobs since we attached the embedded node knobs into this node.
594 _publicInterface->getNode()->declarePythonFields();
595
596 //Destroy it to keep the default parameters
597 destroyReadNode();
598
599 separatorKnob.lock()->setSecret(true);
600}
601
602bool
603ReadNodePrivate::checkDecoderCreated(double time,

Callers

nothing calls this directly

Calls 8

setPropertyMethod · 0.80
toStdStringMethod · 0.80
getNodeMethod · 0.45
createNodeMethod · 0.45
getAppMethod · 0.45
declarePythonFieldsMethod · 0.45
setSecretMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected