Skip to the page
Tutorial areas

Add a render engine with the plug-in API

Write a small plug-in that adds an engine to Render Image, turn it on, and see the engine listed beside Rodeo's own.

How-toIntermediate6 minMenu: Tools › Plug-ins › Plug-in Manager…Tool: Plug-in editor

A plug-in can add an engine to Render Image: a bridge to another renderer, a render farm or a service on your computer. The engine is listed beside Rodeo's own engines while the plug-in is turned on. This page writes a small one, which passes the picture to a server, and shows where it is listed. The full reference is Help › Plug-in API….

Steps

  1. Choose Tools › Plug-ins › Plug-in Manager…, then click New Plug-in…. The editor opens with a starter plug-in in it.

  2. Click in the code, press ⌘A, and type this plug-in in its place:

    // @name Local Render Server
    // @description Adds a render engine to Render that sends the picture to a server on this computer.
    // @version 1.0
    openvwx.render.engine({ name: "Local Server", takes: "picture", options: [
      { key: "samples", label: "Samples", kind: "number", initial: 128, min: 1, max: 4096 },
    ] }, async (job) => {
      const res = await openvwx.fetch("http://127.0.0.1:7416/render", { method: "POST", body: job.picture });
      return { bytes: res.bytes, type: "image/png" };
    });
    
    The plug-in editor with the Local Render Server code in it
  3. Click Save, then Close. In the Plug-ins window, tick the box beside Local Render Server. Its row says On. No menu items., because an engine adds no menu command.

    The Plug-ins window with Local Render Server ticked
  4. Choose File › Export › Render Image…. Render Studio opens at its Output tab. Under Engine, the plug-in's Local Server sits after Fast and Photoreal.

    The Render palette's Output tab with Local Server beside Fast and Photoreal

Tips

  • Choose Local Server and the engine's own options appear under Engine: here, Samples.
  • The engine gets the picture Rodeo has made, as PNG bytes in job.picture. Use job.scene instead to take the visible model as glTF, with the camera and the sun.
  • Only the first request to a web address asks you to allow it, and the answer is remembered for that plug-in.

Limits

  • The engine only passes the picture on. Nothing listens on 127.0.0.1:7416 in Rodeo, so the server has to be running for a render to come back.
  • A plug-in runs code you did not write, and it is not a security sandbox. Install only plug-ins you trust.