Coming soon: Terragen RPC - a multi-layered API for remote, scriptable interaction with Terragen.
We're working on an RPC (remote procedure call) system for Terragen, so you can query a running instance of Terragen for information about the project, make changes to nodes, create nodes etc. It talks to Terragen over TCP (JSON-RPC 2.0 over TCP, to be exact). There is also a Python module which is a wrapper for this, with high-level calls such as root(), children(), delete(), save_project() and so on. Standalone Python programs, as well as scripts running in other applications, can import this module to interact with an instance of Terragen.
To quote the docs:
QuoteTerragen RPC is a remote procedure call system for certain versions of Terragen. A running instance of Terragen can act as a server, allowing other programs (or scripts within other programs) to make remote procedure calls (RPCs) to query the open project and modify its state.
A Terragen RPC system consists of:
- Server – a running instance of Terragen
- Client process(es) using any of the following APIs:
- High Level Python API
- Low Level Python API
- JSON-RPC 2.0 messages over TCP
Beta documentation is here:
https://planetside.co.uk/docs/terragen-rpc/You can even download beta versions of the terragen_rpc Python module if you like, but it won't be much use until we release a version of Terragen that supports it. You can expect that to happen pretty soon though. It has already been used in production for a film project, and we're ready to open it up to a wider audience as "beta".
I'd love to know what you all think of this idea.