All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Changed supported Godot version to 3.5.1 (#910)
- MSRV is now 1.63 (#910)
- Prefixed
NativeClassmethods for manual implementors (#955)
godot_initmay not find some symbols (#954)
Transform2D::from_rotation_translation_scale()constructor (#910)RefInstanceandTypedArraytype aliases (#955)
Last maintenance release for Godot 3.4.
globalscope::load()function (#940, #941)Colorconstructors from HTML string and integers (#939)- Version check to warn if Godot is not 3.4 (#942)
- Support for iOS simulator on Mac M1 (#944)
- During tests,
get_api()no longer aborts (#929) - Confusing
Transform2Dconstructor (#930) - Bug in
Rect2::intersects()(#948) - Bug in
Vector2::rotated()(#952)
This is a backwards-compatible release; thus no removals or breaking changes.
- New export API, allowing to omit owner (#872, #933)
- Export and Variant conversion for
Vec/HashMap/HashSet(#883) - Attribute
deref_returnto return reference-like objects (#870) - Classes
Rect2andAabbnow have methods (#867) - Module
globalscopewith GDScript utility functions, e.g.lerp,smoothstep(#901, #906) Varargshas new API for length checks, type conversions and errors (#892)- Method
Axis::to_unit_vector()(#867)
StringNametraitsEqandOrdhad a bug in GDNative API (#912)register_propertiesnaming collision (#888)- Outdated GDNative API checks prevented compilation of Godot 3.5 RC (#909)
- Android: allow usage of new NDK paths (#754)
- Use
ManuallyDropin ptrcalls to prevent drop reordering (#924) - Fix memory leaks in
as_argtests (#925) VariantArrayiterator skip (#936)- Proc-macros auto-import the macros they depend on (fixed earlier in #425).
- Stripped 6 unnecessary dependencies, detected by cargo-machete (#890)
- Doc CI: improved detection of unchanged code (#877)
- Tests for export APIs (#891)
godot_test!macro now used consistently (#896)Ordimplementation now used uniformly (#911)- Update Android NDK (21 -> 25), workaround Rust bug (#920)
- Automate NDK detection (#934)
- Refactorings in gdnative-derive crate (#922)
(Version 0.10.0-rc.0 has been integrated into this change set)
- Crate features
- New top-level modules
init,log,profiler,derive(#788, #800, #811) - Geometric types
- Other core types
- Exporting
#[property(get, set)]andProperty<T>for custom getters/setters (#841)- Array typehints (#639)
- Type-safe registration (
Method,Varargs,FromVarargs, ...) (#681) ClassBuilder::signal()+SignalBuilder(#828)#[export]now accepts a method name (#734)ArcData::into_inner()(#700)MapOwnedtrait +Once<T>user-data (#693)NoHintfor forward compatibility (#690)
- MSRV is now 1.56 (#833, #870)
- Rust edition is now 2021 (#870)
euclidvector library replaced withglam, no longer part of public API (#713)Varianthas now a redesigned conversion API (#819)- Type renames (#815, #828)
RefInstance->TInstanceRefKind->MemoryThreadAccess->OwnershipTypedArray->PoolArrayElement->PoolElementSignalArgument->SignalParam
- Simplified module structure
(#788,
#811)
- 1 module per symbol (+prelude), no symbols at root, lower nesting depth
- Rename
nativescript->export - Move
export::{Instance,RefInstance}->object - More details: see PR descriptions
- Geometric types API consistency (#827)
- Rename basis vectors
x, y, z->a, b, c - Pass by value/ref consistency
Planeinvariants (#874)- Other changes (see PRs)
- Rename basis vectors
- Method renames
{String,Variant}::forget()->leak()(#828)Color::{rgb,rgba}()->{from_rgb,from_rgba}()Rid::is_valid()->is_occupied()Basis::to_scale()->scale()Basis::from_elements()->from_rows()Transform2D::from_axis_origin()->from_basis_origin()StringName::get_name()->to_godot_string()(#874)Plane::intersects_*()->intersect_*()(#874)Plane::normalize()->normalized()Plane::has_point()->contains_point()+contains_point_eps()
- Relax
Dictionarykey bounds:ToVariant->OwnedToVariant(#809) #[inherit]is now optional and defaults toReference(#705)InstanceandTInstancenow useOwn=Sharedby default (#823)- Ergonomics improvements for
get_node_as()& Co. (#837) - Separate trait for
NativeClassstatic names (#847) - Generated docs: Godot BBCode translated to RustDoc, including intra-doc links (#779)
(Renames listed under Changed, safety removals under Fixed)
- Crate features
- All redundant or unnecessarily nested modules (see Changed)
- Deprecated symbols (#828)
Reference::init_ref()(unsound)ClassBuilder::add_method(),add_method_advanced(),add_method_with_rpc_mode()ScriptMethod,ScriptMethodFn,ScriptMethodAttributes
- Never functioning or misleading
- Redundant methods (cleaner API)
- Macros and attributes
#[property(before_get|before_set|after_get|after_set)], replaced with#[property(get|set)](#874)
- From
prelude- macros
godot_gdnative_init,godot_gdnative_terminate,godot_nativescript_init,godot_site(#811)
- macros
- Exports
- GDNative bindings
- Core
- Bugs in
Basis * Vector3+Vector3::rotated()(#760) VariantArray: bounds check, remove unsafe methods for VariantArray (#795)Variant::call()now unsafe, likeObject::call()(#795)Rid(#844):- GDNative APIs accepting it now unsafe
- Method
get_id()now unsafe and null-checked - Fix logic error in
PartialOrd
Dictionary:
- Bugs in
- Error messages conforming to Rust conventions (#731)
- Qualify identifiers in proc-macros, avoids potential naming conflicts (#835)
- Library logo (#801)
- CI overhaul: run for every PR, shorter runtime, cache (#783)
- Automatic publishing of
masterdocs (#786) - Issue templates (#807)
- Add
cargo-denyto CI (#849) - Add CI job which tests minimal dependencies (#856)
- The code now compiles on rustc versions not affected by rust-lang/rust#79904
-
Added
Instance::emplace, a constructor that moves an existing script struct onto a new object. -
Added
Ref::by_class_name, a method to construct Godot objects from class names. -
Added methods to recover
Refs orTRefs from instance IDs. -
Added a
Defaultimplementation forNodePath. -
Added
Add,AddAssign,Ord,PartialOrd,Indeximplementations forGodotString. -
Added convenience methods for getting typed nodes in
gdnative-bindings. -
Added examples for custom node plugins and Godot networking.
-
Added the
#[property(no_editor)]flag, which exports properties that can be accessed from other languages like GDScript, but aren't shown in the editor.
-
The minimum compatible engine version is now 3.2-stable.
-
Improved readability of generated documentation for the API methods.
-
Improved error messages for failed method calls.
-
Proc-macros now emit compile errors rather than panic, improving the development experience.
-
Documented the trade-offs of using
GodotStringvs. thestdStringtype.
-
Object::callvis now correctly marked asunsafe. -
Derive macro for
FromVariantnow correctly uses the actual variant name when reporting errors for enums. -
Derive macro for
OwnerToVariantnow correctly takes ownership ofself.
-
Support for RPC modes using the
exportattribute, e.g.#[export(rpc = "remote_sync")]. -
Added the convenience method
Vector2Godot::clamped. -
Added Godot-equivalent methods for
Plane.
-
Fixed a problem where incorrect documentation may be generated when building from case-insensitive file systems.
-
Fixed a case of undefined behavior when
Instance::newis called for non-tool scripts in the editor. -
Fixed a type mismatch problem that may prevent compilation on some target platforms.
-
Fixed potential compilation error in case of
TypeIdwidening.
-
All public functions now have the
#[inline]attribute, improving cross-crate inlining in builds without LTO. -
A curated
preludemodule is added ingdnativecrate, containing common types and traits. -
Added the
SubClasstrait, which allows for static up-casts and static validation of downcasts. -
Added the
OwnedToVarianttrait and derive macro which enabledVariantconversion for more types. -
The
NativeScriptand#[methods]proc-macros now report errors more accurately. -
Added the
godot_initconvenience macro that declares all three endpoints for common use cases. -
Added more extension methods for
Vector2,Vector3andColor. -
Added wrappers for
GodotString::get_basenameandget_extensions. -
Added a high-level interface to the Godot script profiler in the
gdnative::nativescript::profilingmodule, and in the#[gdnative::profiled]attribute. -
Added before/after hooks for the
#[property]attribute. -
API methods now have generated documentation according to Godot documentation XMLs. The Godot docs contain custom markup which isn't currently parsed. We expect to improve the generated docs in the following releases.
-
Added custom resource example.
-
The default API version is now Godot 3.2.3-stable.
-
The object reference system is revamped using the typestate pattern, with semantics that model Godot behavior more accurately, allowing for clearer boundaries between safe and unsafe code.
-
API methods are now generic over types that can be converted to
Variant,GodotString, or generated API types, removing the need for boilerplate code like&thing.into(). -
Enums in the API are now represented more accurately as newtypes around
i64. They are available in the same modules where their associated objects are defined. -
DictionaryandVariantArraynow use the typestate pattern as well. -
The typed arrays are unified into a generic
TypedArraytype. The old names remain as type aliases. -
Moved generated bindings into the
gdnative::apimodule, making the top-level namespace easier to navigate. -
It's now possible to crate custom binding crates without forking the repository using the generator, since
gdnative_bindings_generator::Api::newnow takes JSON input as an argument. -
Separated core wrappers and NativeScript support into the
core_typesandnativescriptmodules. -
Cleaned up the public interface with regards to intended usage. The public API no longer uses
gdnative-systypes. -
The
new_refmethod is now in aNewReftrait. -
High-level wrappers are added for
godot_gdnative_initandgodot_gdnative_terminatecallback arguments. -
Improved source links on docs.rs.
-
bindgenis updated to 0.55.1. -
euclidis updated to 0.22.1. -
Improved build time performance.
-
Removed deprecated items from the public interface in 0.8.1.
-
Removed
gdnative-systypes from the public interface.gdnative-sysis considered an internal dependency starting from 0.9. -
Removed the
ObjectandReferencewrappers fromgdnative-core. The same types are available ingdnative-bindings. -
Removed generated bindings for virtual methods, since they cannot actually be called.
-
Removed
Fromimplementations forVariantsinceToVariantis much more comprehensive.
-
Fixed typos in variant names of
VariantOperatorandGodotError. -
StringName::from_strnow returnsSelfcorrectly. -
Fixed a case of undefined behavior that may manifest as crashes when some specific methods that return
VariantArrayare called. -
Fixed an issue with platform headers when building on Windows with the
gnutoolchain that prevented compilation. -
Macros can now be used with qualified imports, removing the need for
#[macro_use]. -
Fixed an issue where
Ridarguments passed to API methods are incorrect due to use-after-free.
-
Exported methods can now have optional arguments. Arguments with the
#[opt]attribute are optional in the scripting API. Default values are obtained usingDefaultif not provided by the caller. -
Added a
claimmethod on theGodotObjecttrait, which clones the reference if the underlying type is reference-counted (extends fromReference), or aliases it if it isn't. This replaces theClass::from_sys(object.to_sys())"idiom" that relied on hidden public items (from_sysandto_sys) that are not actually intended to be part of the public API. -
Fields can now be skipped with the
#[variant(skip)]attribute when derivingFromVariantandToVariant. -
Implemented various methods on
Basis. -
Implemented
DisplayforGodotString. -
Implemented
Debugfor core typed arrays. -
Added
Aether<T>, a specialUserDatawrapper for ZSTs. This type does not perform any allocation or synchronization at runtime, but produces a value usingDefaulteach time it's mapped. -
Include paths for the Android SDK can now be inferred from environment variables.
-
A dodge-the-creeps example has been added to the repo.
-
Initialization errors are now reported using GDNative APIs, instead of panics. This includes situations where API struct versions mismatch, or if some API functions are unavailable.
-
Paths to SDKs for Apple platforms are now obtained using
xcrun. -
The public fields of
ExportInfoare now deprecated. They will become private in 0.9. Use one of the constructors orExport::export_infoinstead. -
Several public types that are unused in the current API have been deprecated.
-
Free-on-drop wrappers are now deprecated. Use of free-on-drop wrappers is no longer recommended due to upcoming changes in ownership semantics in 0.9. Users are suggested to call
freeorqueue_freemanually instead. They will be removed in 0.9.
-
Fixed a problem where the build script for
gdnative-syswill try to include macOS headers when building for mobile targets from a Mac, causing the build to fail. -
Fixed SDK include paths for the iOS Simulator, whose SDK was separate from the one for real iOS devices. This allows building for the iOS Simulator platform.
-
Fixed a case of undefined behavior (UB) when Rust scripts are attached to incompatible base classes in the Godot Editor (e.g. attaching a
NativeClasswithBase = Node2Dto aSpatialnode).
-
Field attribute
propertyon derivedNativeClasstypes, which can be used to quickly export simple properties. -
The behavior of derived
FromVariantandToVariantimplementations can be customized with thevariantfield attribute. -
New example projects.
-
A
godot_dbg!macro for quick and dirty debugging that works like the standarddbg!, but prints to the Godot debug console.
-
The default API version is now Godot 3.2-stable.
-
The
FromVarianttrait now reports detailed information on failure. -
The API for property registration is reworked to provide better ergonomics and static type checking for editor hints.
-
LocalCellDatais now the default user-data wrapper type. This wrapper allows non-Sendtypes to be used asNativeClasses, and produces a runtime error whenever a value is accessed from a different thread than where it was created.
- Removed the old-style
godot_class!macro.
-
Fixed an
unused_parenswarning when using theNativeClassderive macro. -
Fixed handling of unknown enums with duplicate values, which prevented code generation for Godot version
3.2. -
Fixed a memory leak where a
Dropimplementation wasn't generated for non-instanciable reference-counted types. -
Fixed a memory leak where reference-counted types get an extra reference count when returned from the engine.
-
Fixed bindings generation when building for iOS using
cargo-lipo.
-
Procedural-macro
methodswhich can be applied toimplblocks and allows a more natural Rust syntax for creating script types and exporting functions using attributes. -
The
ToVariantandFromVarianttraits, including derive macros. These traits can be used to define how custom types can be constructed fromVariants or be extracted from existingVariants. Any type implementingFromVariantcan be used as a parameter to an exported function. Any type implementingToVariantcan be returned from exported functions. -
Derive-macro for
NativeClasstrait. -
Every type implementing
NativeClassprovides a "user data" storage type which is used to control how the script data is stored internally. A default value is provided via the procedural macro. -
Iterators for Godot collection types.
-
Instance<T>type which contains the Godot owner object and the script data (implementsToVariantandFromVariant, so it can be used as a parameter or return type). -
Generated class wrappers now include associated constants for constants provided by Godot.
-
New example projects.
-
The code now uses the Rust 2018 edition.
-
The API description of Godot classes was updated to the stable Godot version
3.1.1. -
The GDNative API description was updated to the stable Godot version
3.1.1and now includes added GDNative extensions. -
The
NativeClasstrait has changed a lot and was split into two traits to allow themethodsprocedural macro to generate a description of exported methods. -
The generated class bindings are stored in a single crate again and use the
Dereftrait to implement inheritance.
- The "domain-grouped" crates for generated bindings are merged into a single crate, so the individual crates are no longer in use.
-
Fixed a memory safety issue where the strings used to register signals are dropped before the API call.
-
Fixed a correctness issue where the layout of method arguments is incorrectly assumed to be continuous, causing invalid memory access when calling methods with multiple arguments.