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

Method createDefaultReadNode

Engine/ReadNode.cpp:555–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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