Skip to main content

Code generator for Godot Engine

Project description

GDGen

Build Status

Version: 1.0-alpha

An advanced, configurable code generator which aims to automate some aspects of Godot Engine development, namely:

  • creating C++ modules;
  • creating GDNative plugins.

Currently only C++ module generation is supported, so most of the functionallity is revolving around modules.

Requirements

  • Python 3.6+
  • Git (optional)

Compatibility

  • Godot Engine 3.0+ (C++ modules generation)

Installation

pip install git+https://github.com/Xrayez/gdgen

Usage

gdgen [-n NAME] [-s INTERNAL_NAME] [-c CONFIG_PATH] [-o OUTPUT_PATH]

Examples

For most use cases, you can use a simple wizard. Here's an example output:

$ ~/src/godot/modules> gdgen

Module name: My awesome module
Internal module name (snake_case): my_module
Author name (default - You): Me
Engine version (default - latest): 3.1
C++ version (default - c++11): c++20
Number of classes to generate (default - 0): 1
(0) Class name: NewNode
(0) Class inherits: Node
(0) Class path (default - ):
Documentation path (default - docs): doc_classes
Icons path (default - editor/icons): icons
Thirdparty path (default - thirdparty):
Initialize README? (default - True):
License (default - MIT):
Version control system (default - git):
Will be included inside project? (default - False): True
Initialized empty Git repository in ~/src/godot/modules/my_module/.git/

You can also create your own configuration file:

gdgen -c tests/configs/sample.json -o ~/src/godot/modules/

Use default config file, but fill the required fields manually:

gdgen -n MyModule -s my_module

Config

Name Description
name (Required) Descriptive name of the module.
internal_name (Required) The name used by the engine for the module to compile. This name is used by default for any unnamed classes to be generated later (see below).
author The name that will be used to place inside license text. If not set explicitly, the generator is going to attempt to retrieve one with the help of supported version control provider. In case of git, it will use git config user.name value.
engine_version The engine target version used to generate compatible module.
cpp_version The C++ version to compile module-specific source files.
classes An optional array to generate Godot classes. Available fields: name - the class name; inherits - one of the base (Godot) core classes; path - relative base directory to generate classes in.
docs_path If set, configures the module to use module-specific documentation for classes.
icons_path If set, configures the module to use module-specific editor icons for classes.
thirdparty_path If set, configures the module to apply common operations on third-party code (disabling warnings etc).
readme If true, initializes a barebones README file with module installation instructions.
license If set, creates LICENSE file with current year and author substituted from available license templates.
version_control If set, attempts to initialize the module with version control provider of choice.
to_be_included_inside_project If true, creates .gdignore file so that the module can be included inside regular Godot project (for instance, prevents *.obj build files to be wrongly recognized and imported as 3D models).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdgen-1.0a0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gdgen-1.0a0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file gdgen-1.0a0.tar.gz.

File metadata

  • Download URL: gdgen-1.0a0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4

File hashes

Hashes for gdgen-1.0a0.tar.gz
Algorithm Hash digest
SHA256 97d68f9708d135fcfb9a9897ed47038ecbab65a54a1516ca22ccface41f64474
MD5 ea79a28447cc1eb879a6af4c3bbd3a48
BLAKE2b-256 6a6d210016612ee9a45086d1ffc45527015db89bca2222e99554c1a1eb00d805

See more details on using hashes here.

File details

Details for the file gdgen-1.0a0-py3-none-any.whl.

File metadata

  • Download URL: gdgen-1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4

File hashes

Hashes for gdgen-1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 df869c5f6394723824ce3c4feb27a172ed6c0193881f21c8278566334dba9d6d
MD5 fbe218850441850bac9abd1abc413554
BLAKE2b-256 b38932ca06da9c2c90fc0bac7bb938b806eacfbd9119d57998ee61f915190a0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page