【问题标题】:The Foundry Nuke's Reformat node issueFoundry Nuke 的 Reformat 节点问题
【发布时间】:2018-03-19 02:41:20
【问题描述】:

我想跟踪我的镜头并将 CG 元素添加到我的 nuke 项目中。为此,我对素材进行了不失真处理并将其写入磁盘以加快处理速度。然而,当我试图重新扭曲书面素材(如附图所示)时,它并没有给我原始素材。我发现 Reformat5Reformat7 并没有给我相同的边界框尺寸,即使两个节点是相同的。

我的原始素材大小是 1920*1080。不失真后变成1928*1085。

因此我放置了一个尺寸为 1928*1085 的 Reformat4 节点并将其写入磁盘。在左侧,我再次放置重新格式化节点以将未失真的素材调整回 1920*1080,并保留大小为 1928*1085 的边界框,以便执行镜头失真以恢复我的原始素材。

它在左侧工作正常,但如果我在我的书面素材上做同样的事情,边界框尺寸就不一样了。

Reformat7 给出大小为 1924*1083 而不是 1928*1085 的边界框。我在这里想念什么?我在网上搜索,但找不到任何解决方案。请对这个问题有所了解。

我的nuke脚本如下:

set cut_paste_input [stack 0]
version 10.0 v3
push $cut_paste_input
LensDistortion {
 serializeKnob ""
 serialiseKnob "22 serialization::archive 9 0 0 0 0 0 0 0 0 0 0 0 0"
 distortion1 -0.007498324849
 distortion2 0.0008674863493
 distortionCenter {-0.002916968195 -0.001372990897}
 invertDistortion true
 cardScale {1.006676197 1.006676197 1}
 a 0.001508030226
 b -0.006750627421
 c -0.002457624534
 analysisStart 1
 analysisStop 329
 name LensDistortion2
 selected true
 xpos -451
 ypos 651
}
Reformat {
 format "1928 1085 0 0 1928 1085 1 undistortedFormat2"
 resize none
 name Reformat4
 selected true
 xpos -451
 ypos 684
}
set N6eafc00 [stack 0]
Reformat {
 resize none
 pbb true
 name Reformat5
 selected true
 xpos -451
 ypos 745
}
LensDistortion {
 serializeKnob ""
 serialiseKnob "22 serialization::archive 9 0 0 0 0 0 0 0 0 0 0 0 0"
 distortion1 -0.007498324849
 distortion2 0.0008674863493
 distortionCenter {-0.002916968195 -0.001372990897}
 cardScale {0.9934444427 0.9934444427 1}
 a -0.0004114751064
 b 0.004895505495
 c 0.002436506096
 analysisStart 1
 analysisStop 329
 name LensDistortion3
 selected true
 xpos -451
 ypos 782
}
push $N6eafc00
Write {
 file F:/Assignments/Nuke/CGComp/footages/undistortedFootage1080p/undistortedFootage1080p.####.exr
 file_type exr
 name Write7
 selected true
 xpos -269
 ypos 684
}
Reformat {
 resize none
 pbb true
 name Reformat7
 selected true
 xpos -269
 ypos 747
}
LensDistortion {
 serializeKnob ""
 serialiseKnob "22 serialization::archive 9 0 0 0 0 0 0 0 0 0 0 0 0"
 distortion1 -0.007498324849
 distortion2 0.0008674863493
 distortionCenter {-0.002916968195 -0.001372990897}
 cardScale {0.9934444427 0.9934444427 1}
 a -0.0004114751064
 b 0.004895505495
 c 0.002436506096
 analysisStart 1
 analysisStop 329
 name LensDistortion5
 selected true
 xpos -269
 ypos 783
}

【问题讨论】:

    标签: python nuke compositing


    【解决方案1】:

    您需要使用CopyBBox 节点来解决您的问题。此 Python 命令创建连接的CopyBBox 节点:

    import nuke
    nuke.createNode("CopyBBox")
    

    或者您可以使用以下命令创建一个与其他节点断开连接的节点:

    nuke.nodes.CopyBBox()
    

    CopyBBox 将边界框从 A 输入复制到 B 流。边界框定义了 Nuke 认为具有有效图像数据的帧区域。边界框越大,Nuke 处理和渲染图像的时间就越长。

    一些 NUKE 操作,例如 MergeBlurLensDistortion 可能会导致边界框区域扩大或缩小,因为 NUKE 不知道额外区域将是黑色还是其他常量颜色。通常,您可以通过将边界框从输入之一复制到结果图像来解决此问题,从而切断额外区域。

    nuke.nodes.Transform(scale=1.005, filter="Mitchell")
    

    如果您在右边距有“拉伸像素效果”,请在Transform 节点中使用scale=1.005 参数(就在您的LensDistortion5 节点之后)。另外,不要忘记使用过滤算法。

    【讨论】:

    • 抱歉,我不知道在镜头失真后添加 CopyBBox 将如何解决问题。我尝试了您的解决方案,但右侧仍然无法正常工作。我在边缘出现伪影。
    • 我尝试在重新格式化 7 后添加 copyBbox 以提供正确的边界框作为 LD5 的输入,但 LD5 的输出 bbox 仍然小于 1920*1080 :(
    • 通常,合成艺术家在脚本末尾使用 CopyBBox(就在最终的 Write 节点之前)。我有你需要的 BB 1920x1080。在你的脚本中。
    • 再次检查所有 Reformat 节点中的“输出格式”。
    • LD5 给了我一个 1918*1082 的 bbox(而不是 LD3 中的 1922*1084),所以一些外部像素丢失了。最后添加 copyBbox 给了我正确的 bbox 但丢失的像素仍然消失了。
    猜你喜欢
    • 2020-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-15
    • 1970-01-01
    • 1970-01-01
    • 2021-11-17
    • 1970-01-01
    相关资源
    最近更新 更多