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

Function checkCanConnectNoMultiRes

Engine/NodeInputs.cpp:624–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622
623
624static Node::CanConnectInputReturnValue
625checkCanConnectNoMultiRes(const Node* output,
626 const NodePtr& input)
627{
628 //http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#kOfxImageEffectPropSupportsMultiResolution
629 //Check that the input has the same RoD that another input and that its rod is set to 0,0
630 RenderScale scale(1.);
631 RectD rod;
632 bool isProjectFormat;
633 StatusEnum stat = input->getEffectInstance()->getRegionOfDefinition_public(input->getHashValue(),
634 output->getApp()->getTimeLine()->currentFrame(),
635 scale,
636 ViewIdx(0),
637 &rod, &isProjectFormat);
638
639 if ( (stat == eStatusFailed) && !rod.isNull() ) {
640 return Node::eCanConnectInput_givenNodeNotConnectable;
641 }
642 if ( (rod.x1 != 0) || (rod.y1 != 0) ) {
643 return Node::eCanConnectInput_multiResNotSupported;
644 }
645
646 // Commented-out: Some Furnace plug-ins from The Foundry (e.g F_Steadiness) are not supporting multi-resolution but actually produce an output
647 // with a RoD different from the input
648
649 /*RectD outputRod;
650 stat = output->getEffectInstance()->getRegionOfDefinition_public(output->getHashValue(), output->getApp()->getTimeLine()->currentFrame(), scale, ViewIdx(0), &outputRod, &isProjectFormat);
651 Q_UNUSED(stat);
652
653 if ( !outputRod.isNull() && (rod != outputRod) ) {
654 return Node::eCanConnectInput_multiResNotSupported;
655 }*/
656
657 for (int i = 0; i < output->getNInputs(); ++i) {
658 NodePtr inputNode = output->getInput(i);
659 if (inputNode) {
660 RectD inputRod;
661 stat = inputNode->getEffectInstance()->getRegionOfDefinition_public(inputNode->getHashValue(),
662 output->getApp()->getTimeLine()->currentFrame(),
663 scale,
664 ViewIdx(0),
665 &inputRod, &isProjectFormat);
666 if ( (stat == eStatusFailed) && !inputRod.isNull() ) {
667 return Node::eCanConnectInput_givenNodeNotConnectable;
668 }
669 if (inputRod != rod) {
670 return Node::eCanConnectInput_multiResNotSupported;
671 }
672 }
673 }
674
675 return Node::eCanConnectInput_ok;
676}
677
678Node::CanConnectInputReturnValue
679Node::canConnectInput(const NodePtr& input,

Callers 3

canConnectInputMethod · 0.85
connectInputMethod · 0.85
replaceInputInternalMethod · 0.85

Calls 10

getEffectInstanceMethod · 0.80
getHashValueMethod · 0.80
ViewIdxClass · 0.70
currentFrameMethod · 0.45
getTimeLineMethod · 0.45
getAppMethod · 0.45
isNullMethod · 0.45
getNInputsMethod · 0.45
getInputMethod · 0.45

Tested by

no test coverage detected