Skip to content

Commit

Permalink
Add an integration to render Houdini .ifd files.
Browse files Browse the repository at this point in the history
  • Loading branch information
tshead committed Aug 5, 2021
1 parent 8a1ec1b commit a1caa36
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/buildcat
Expand Up @@ -53,8 +53,15 @@ subparser.add_argument("--host", default="127.0.0.1", help="Server address. Defa
subparser.add_argument("--port", type=int, default=6379, help="Server port. Default: %(default)s")
subparser.add_argument("--queue", default="default", help="Server queue to ping. Default: %(default)s")

# houdini-ifd
subparser = subparsers.add_parser("houdini-render-ifd", help="Submit a Houdini .ifd render job.")
subparser.add_argument("--host", default="127.0.0.1", help="Server address. Default: %(default)s")
subparser.add_argument("--port", type=int, default=6379, help="Server port. Default: %(default)s")
subparser.add_argument("--queue", default="default", help="Server queue to use for rendering. Default: %(default)s")
subparser.add_argument("ifdfile", help="Houdini .ifd file to render with mantra.")

# houdini-render
subparser = subparsers.add_parser("houdini-render", help="Submit a Houdini render job.")
subparser = subparsers.add_parser("houdini-render", help="Submit a Houdini .hip render job.")
subparser.add_argument("--host", default="127.0.0.1", help="Server address. Default: %(default)s")
subparser.add_argument("--port", type=int, default=6379, help="Server port. Default: %(default)s")
subparser.add_argument("--queue", default="default", help="Server queue to use for rendering. Default: %(default)s")
Expand Down Expand Up @@ -234,6 +241,14 @@ if __name__ == "__main__":
pprint.pprint(buildcat.wait(connection=connection, job=job))


# houdini-render-ifd
if arguments.command == "houdini-render-ifd":
connection, queue = buildcat.queue(queue=arguments.queue, host=arguments.host, port=arguments.port)
ifdfile = buildcat.require_relative_path(arguments.ifdfile, "Houdini .ifd file must be a relative path.")
job = buildcat.submit(queue, "buildcat.hou.render_ifd", ifdfile)
print(f"Submitted job {job.id}")


# houdini-render
if arguments.command == "houdini-render":
connection, queue = buildcat.queue(queue=arguments.queue, host=arguments.host, port=arguments.port)
Expand Down
24 changes: 24 additions & 0 deletions buildcat/hou.py
Expand Up @@ -28,6 +28,10 @@ def _hython_executable():
return buildcat.executable("hython")


def _mantra_executable():
return buildcat.executable("mantra")


def info():
"""Return information describing the worker's local Houdini installation.
Expand Down Expand Up @@ -61,6 +65,26 @@ def info():
return result


def render_ifd(ifdfile):
"""Render a Houdini .ifd file.
Environment Variables
---------------------
PATH: required
Your PATH environment variable *must* be configured so that the worker
can run the `mantra` executable.
Parameters
----------
ifdfile: :class:`str`, required
Path to the file to be rendered.
"""
ifdfile = str(ifdfile)

command = [_mantra_executable(), "-f", ifdfile]
buildcat.check_call(command)


def render_frames(hipfile, rop, frames):
"""Render a range of frames from a Houdini .hip file.
Expand Down

0 comments on commit a1caa36

Please sign in to comment.