nukescripts.camera

Package nukescripts :: Module camera |
[hide private]
[frames] | no frames]

# Source Code for Module nukescripts.camera

     1  # Copyright (c) 2009 The Foundry Visionmongers Ltd.  All Rights Reserved.
     2
     3  import nuke
     4  import nukescripts
     5
     6
     7 -def camera_up():
     8    """All new camera_up that uses the version_get/set functions.
     9    This script takes the render camera up one in selected iread/writes.
    10    Camera may be _c# or _p# for previs camera number"""
    11
    12    n = nuke.selectedNodes()
    13    for i in n:
    14      _class = i.Class()
    15      if _class == "Read" or _class == "Write":
    16        name = nuke.filename(i)
    17        if name is not None:
    18          (prefix, v) = nukescripts.version_get(name, "[cp]")
    19          if v is not None:
    20                # use expression instead of expr so 0 prefix does not make octal
    21                # format result so it has 2 digits
    22            v = str("%(#)02d" % {"#":int(nuke.expression(v+"+1"))})
    23            i.knob("file").setValue(nukescripts.version_set(i.knob("file").value(), prefix, v))
    24            i.knob("proxy").setValue(nukescripts.version_set(i.knob("proxy").value(), prefix, v))
    25            nuke.modified(True)
    26
    27 -def camera_down():
    28    """All new camera_down that uses the version_get/set functions.
    29    This script takes the render camera up one in selected iread/writes.
    30    Camera may be _c# or _p# for previs camera number"""
    31
    32    camera_up()
    33