Houdini 20.0 Python scripting hou hou.webServer

hou.webServer.registerOpdefPath HOM function

Tells Houdini’s web server to use the specified prefix as a handler to serve opdef requests.

registerOpdefPath("/opdef")

When the server receives a request whose path starts with prefix, the server will respond with the corresponding opdef section data.

Call this function before you call hou.webServer.run(), not from a URL handler.

For example, if you do this:

hou.webServer.registerOpdefPath("/opdef")

…and the client requests this server path:

/opdef/obj/geo?Help

…then the server will automatically serve the section Help from the geo node.

Note

If a URL handler has a URL more specific (matches more path parts) than the opdef path prefix, the server will use the handler instead of opdef lookup.

For example, even if you registered the opdef from above, if the client requested /opdef/geo/foo.bgeo and you have a dynamic handler for /opdef/geo, the server would use the handler instead of using the opdef handler.

This might be useful if you need a few dynamically generated opdef handlers mixed in with the static opdef handler. However, it’s usually best to avoid the confusion and keep opdef resources separate from dynamic resources, such as by using the default /opdef prefix for opdef section requests.

See also

hou.webServer

Classes

Starting and Stopping

Handling Web Requests and Returning Responses

API Calls

  • hou.webServer.apiFunction()

    Decorator for functions that can be called through an API endpoint on Houdini’s web server, returning JSON or binary responses.

  • hou.webServer.APIError

    Raise this exception in apiFunction handlers to indicate an error.