Ejemplo n.º 1
0
def registerDriverTemplates():
    skipDrivers = ['exr', 'deepexr']
    # register driver templates
    for transName, arnoldNode in core.listTranslators("aiAOVDriver"):
        if not (transName in skipDrivers): # we want to use a custom ui for the EXR translator
            templates.registerAutoTranslatorUI(arnoldNode, "aiAOVDriver", transName, skipEmpty=True)

    templates.registerDefaultTranslator('aiAOVDriver', 'exr')
def registerFilterTemplates():
    # register driver templates
    for transName, arnoldNode in core.listTranslators("aiAOVFilter"):
        templates.registerAutoTranslatorUI(arnoldNode,
                                           "aiAOVFilter",
                                           transName,
                                           skipEmpty=True)

    templates.registerDefaultTranslator('aiAOVFilter', 'gaussian')
def registerDriverTemplates():
    skipDrivers = ['exr', 'deepexr']
    # register driver templates
    for transName, arnoldNode in core.listTranslators("aiAOVDriver"):
        if not (transName in skipDrivers
                ):  # we want to use a custom ui for the EXR translator
            templates.registerAutoTranslatorUI(arnoldNode,
                                               "aiAOVDriver",
                                               transName,
                                               skipEmpty=True)

    templates.registerDefaultTranslator('aiAOVDriver', 'exr')
Ejemplo n.º 4
0
def registerFilterTemplates():
    # register driver templates
    for transName, arnoldNode in core.listTranslators("aiAOVFilter"):
        templates.registerAutoTranslatorUI(arnoldNode, "aiAOVFilter", transName, skipEmpty=True)

    templates.registerDefaultTranslator('aiAOVFilter', 'gaussian')
Ejemplo n.º 5
0
    # where translators may have gotten out of sync
    if om.MFileIO.isOpeningFile():
        if isOrtho and currTrans != 'orthographic':
            orthoPlug.setBool(True)
    else:
        if not isOrtho and currTrans == 'orthographic':
            orthoPlug.setBool(True)
        elif isOrtho and currTrans != 'orthographic':
            orthoPlug.setBool(False)

def getCameraDefault(obj):
    isOrtho = pm.api.MFnDependencyNode(obj).findPlug("orthographic").asBool()
    default = 'orthographic' if isOrtho else 'perspective'
    return default

templates.registerDefaultTranslator('camera', getCameraDefault)
templates.registerDefaultTranslator('stereoRigCamera', getCameraDefault)

callbacks.addAttributeChangedCallbacks('camera',
                                       [('aiTranslator', cameraTranslatorChanged),
                                        ('orthographic', cameraOrthographicChanged)])

callbacks.addAttributeChangedCallbacks('stereoRigCamera',
                                       [('aiTranslator', cameraTranslatorChanged),
                                        ('orthographic', cameraOrthographicChanged)])

def registerDriverTemplates():
    skipDrivers = ['exr', 'deepexr']
    # register driver templates
    for transName, arnoldNode in core.listTranslators("aiAOVDriver"):
        if not (transName in skipDrivers): # we want to use a custom ui for the EXR translator
        self.addControl("lightVisible")
        
        self.addSeparator()
        
        self.addCommonParameters()

        self.addSeparator()

        self.commonLightAttributes(False)

        self.beginLayout('Subdivision', collapse=True)
        self.addControl("aiSubdivType", label="Type")
        self.addControl("aiSubdivIterations", label="Iterations")
        self.addControl("aiSubdivAdaptiveMetric", label="Adaptive Metric")
        self.addControl("aiSubdivPixelError", label="Pixel Error")
        # TODO: add dicing camera UI
        self.addControl("aiSubdivDicingCamera", label="Dicing Camera")
        self.addControl("aiSubdivUvSmoothing", label="UV Smoothing")
        self.addControl("aiSubdivSmoothDerivs", label="Smooth Tangents")
        self.endLayout()

        self.addControl("aiUserOptions", "User Options")


templates.registerAETemplate(templates.TranslatorControl, "aiAreaLight", label="Light Shape")
templates.registerTranslatorUI(QuadAreaLightTemplate, "aiAreaLight", "quad")
templates.registerTranslatorUI(BaseAreaLightTemplate, "aiAreaLight", "cylinder")
templates.registerTranslatorUI(BaseAreaLightTemplate, "aiAreaLight", "disk")
templates.registerDefaultTranslator('aiAreaLight', "quad")
templates.registerTranslatorUI(MeshLightTemplate, "mesh", "mesh_light")
        if isOrtho and currTrans != 'orthographic':
            orthoPlug.setBool(True)
    else:
        if not isOrtho and currTrans == 'orthographic':
            orthoPlug.setBool(True)
        elif isOrtho and currTrans != 'orthographic':
            orthoPlug.setBool(False)


def getCameraDefault(obj):
    isOrtho = pm.api.MFnDependencyNode(obj).findPlug("orthographic").asBool()
    default = 'orthographic' if isOrtho else 'perspective'
    return default


templates.registerDefaultTranslator('camera', getCameraDefault)
templates.registerDefaultTranslator('stereoRigCamera', getCameraDefault)

callbacks.addAttributeChangedCallbacks(
    'camera', [('aiTranslator', cameraTranslatorChanged),
               ('orthographic', cameraOrthographicChanged)])

callbacks.addAttributeChangedCallbacks(
    'stereoRigCamera', [('aiTranslator', cameraTranslatorChanged),
                        ('orthographic', cameraOrthographicChanged)])


def registerDriverTemplates():
    skipDrivers = ['exr', 'deepexr']
    # register driver templates
    for transName, arnoldNode in core.listTranslators("aiAOVDriver"):