Пример #1
0
    def filterCamera(self):
        """Apply camera properties."""
        import mantra

        render_type = mantra.property("renderer:rendertype")[0]

        if not self.all_passes and render_type != "beauty":
            logger.warning("Not a beauty render, skipping deepresolver")
            return

        # Look for existing args.
        deep_args = mantra.property("image:deepresolver")

        # If deep rendering is not enabled the args will be emptry so we should
        # log an error and bail out.
        if not deep_args:
            logger.error(
                "Cannot set deepresolver: deepresolver is not enabled")

            return

        try:
            idx = deep_args.index("filename")

        # Somehow there is no filename arg so log an exception and print the
        # args list.
        except ValueError as inst:
            logger.exception(inst)
            logger.error("Deep args: {}".format(deep_args))

        else:
            deep_args[idx + 1] = self.filepath

            # Set the new list as the property value
            setProperty("image:deepresolver", deep_args)
Пример #2
0
    def filterCamera(self):
        """Apply camera properties."""
        import mantra

        render_type = mantra.property("renderer:rendertype")[0]

        if not self.all_passes and render_type != "beauty":
            logger.warning("Not a beauty render, skipping deepresolver")
            return

        # Look for existing args.
        deepresolver = mantra.property("image:deepresolver")

        if deepresolver == ['']:
            logger.error(
                "Cannot set deepresolver: deepresolver is not enabled")
            return

        if deepresolver:
            args = list(deepresolver[0].split())

            try:
                idx = args.index("filename")

            except ValueError as inst:
                logger.exception(inst)
                return

            else:
                args[idx + 1] = self.filepath

                # Set the new list as the property value
                setProperty("image:deepresolver", args)
Пример #3
0
    def filterCamera(self):
        """Apply camera properties."""
        import mantra

        render_type = mantra.property("renderer:rendertype")[0]

        if not self.all_passes and render_type != "beauty":
            logger.warning("Not a beauty render, skipping deepresolver")
            return

        # Look for existing args.
        deepresolver = mantra.property("image:deepresolver")

        if deepresolver == [""]:
            logger.error("Cannot set deepresolver: deepresolver is not enabled")
            return

        if deepresolver:
            args = list(deepresolver[0].split())

            try:
                idx = args.index("filename")

            except ValueError as inst:
                logger.exception(inst)
                return

            else:
                args[idx + 1] = self.filepath

                # Set the new list as the property value
                setProperty("image:deepresolver", args)
Пример #4
0
def buildPyFilterCommand(node):
    """Construct the mantra command with PyFilter."""
    import hou

    try:
        script_path = hou.findFile("pyfilter/customPyFilter.py")

    # If we can't find the script them log an error and return nothing.
    except hou.OperationFailed:
        logger.error("Could not find pyfilter/customPyFilter.py")

        return ""

    # Build the wrapped -P command with out script and arg string.
    cmd = '-P "{} {}"'.format(script_path, buildArgStringFromNode(node))

    return cmd
Пример #5
0
def buildPyFilterCommand(node):
    """Construct the mantra command with PyFilter."""
    import hou

    try:
        script_path = hou.findFile("pyfilter/customPyFilter.py")

    # If we can't find the script them log an error and return nothing.
    except hou.OperationFailed:
        logger.error("Could not find pyfilter/customPyFilter.py")

        return ""

    # Build the wrapped -P command with out script and arg string.
    cmd = '-P "{} {}"'.format(
        script_path,
        buildArgStringFromNode(node)
    )

    return cmd
Пример #6
0
    def filterCamera(self):
        """Apply camera properties."""
        render_type = getProperty("renderer:rendertype")

        if not self.all_passes and render_type != "beauty":
            logger.warning("Not a beauty render, skipping deepresolver")
            return

        if self.disable_deep_image:
            logger.info("Disabling deep resolver")
            setProperty("image:deepresolver", [])

        else:
            # Look for existing args.
            deep_args = getProperty("image:deepresolver")

            # If deep rendering is not enabled the args will be empty.
            if not deep_args:
                # If a resolver type and filename was passed then we will create
                # args for the resolver type to enable deep output.
                if self.deepresolver and self.filename:
                    deep_args = [self.deepresolver]

                # Log an error and abort.
                else:
                    logger.error(
                        "Cannot set deepresolver: deep output is not enabled")

                    return

            # Modify the args to include any passed along options.
            self._modifyDeepArgs(deep_args)

            logger.debug("Setting 'image:deepresolver': {}".format(" ".join(
                [str(arg) for arg in deep_args])))

            setProperty("image:deepresolver", deep_args)