| 622 | |
| 623 | |
| 624 | static Node::CanConnectInputReturnValue |
| 625 | checkCanConnectNoMultiRes(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 | |
| 678 | Node::CanConnectInputReturnValue |
| 679 | Node::canConnectInput(const NodePtr& input, |
no test coverage detected