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
NativeClass
methods for manual implementors (#955)
godot_init
may not find some symbols (#954)
Transform2D::from_rotation_translation_scale()
constructor (#910)RefInstance
andTypedArray
type aliases (#955)
Last maintenance release for Godot 3.4.
globalscope::load()
function (#940, #941)Color
constructors 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
Transform2D
constructor (#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_return
to return reference-like objects (#870) - Classes
Rect2
andAabb
now have methods (#867) - Module
globalscope
with GDScript utility functions, e.g.lerp
,smoothstep
(#901, #906) Varargs
has new API for length checks, type conversions and errors (#892)- Method
Axis::to_unit_vector()
(#867)
StringName
traitsEq
andOrd
had a bug in GDNative API (#912)register_properties
naming collision (#888)- Outdated GDNative API checks prevented compilation of Godot 3.5 RC (#909)
- Android: allow usage of new NDK paths (#754)
- Use
ManuallyDrop
in ptrcalls to prevent drop reordering (#924) - Fix memory leaks in
as_arg
tests (#925) VariantArray
iterator 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)Ord
implementation 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)MapOwned
trait +Once<T>
user-data (#693)NoHint
for forward compatibility (#690)
- MSRV is now 1.56 (#833, #870)
- Rust edition is now 2021 (#870)
euclid
vector library replaced withglam
, no longer part of public API (#713)Variant
has now a redesigned conversion API (#819)- Type renames (#815, #828)
RefInstance
->TInstance
RefKind
->Memory
ThreadAccess
->Ownership
TypedArray
->PoolArray
Element
->PoolElement
SignalArgument
->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
Plane
invariants (#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
Dictionary
key bounds:ToVariant
->OwnedToVariant
(#809) #[inherit]
is now optional and defaults toReference
(#705)Instance
andTInstance
now useOwn=Shared
by default (#823)- Ergonomics improvements for
get_node_as()
& Co. (#837) - Separate trait for
NativeClass
static 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
master
docs (#786) - Issue templates (#807)
- Add
cargo-deny
to 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
Ref
s orTRef
s from instance IDs. -
Added a
Default
implementation forNodePath
. -
Added
Add
,AddAssign
,Ord
,PartialOrd
,Index
implementations 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
GodotString
vs. thestd
String
type.
-
Object::callv
is now correctly marked asunsafe
. -
Derive macro for
FromVariant
now correctly uses the actual variant name when reporting errors for enums. -
Derive macro for
OwnerToVariant
now correctly takes ownership ofself
.
-
Support for RPC modes using the
export
attribute, 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::new
is 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
TypeId
widening.
-
All public functions now have the
#[inline]
attribute, improving cross-crate inlining in builds without LTO. -
A curated
prelude
module is added ingdnative
crate, containing common types and traits. -
Added the
SubClass
trait, which allows for static up-casts and static validation of downcasts. -
Added the
OwnedToVariant
trait and derive macro which enabledVariant
conversion for more types. -
The
NativeScript
and#[methods]
proc-macros now report errors more accurately. -
Added the
godot_init
convenience macro that declares all three endpoints for common use cases. -
Added more extension methods for
Vector2
,Vector3
andColor
. -
Added wrappers for
GodotString::get_basename
andget_extensions
. -
Added a high-level interface to the Godot script profiler in the
gdnative::nativescript::profiling
module, 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. -
Dictionary
andVariantArray
now use the typestate pattern as well. -
The typed arrays are unified into a generic
TypedArray
type. The old names remain as type aliases. -
Moved generated bindings into the
gdnative::api
module, 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::new
now takes JSON input as an argument. -
Separated core wrappers and NativeScript support into the
core_types
andnativescript
modules. -
Cleaned up the public interface with regards to intended usage. The public API no longer uses
gdnative-sys
types. -
The
new_ref
method is now in aNewRef
trait. -
High-level wrappers are added for
godot_gdnative_init
andgodot_gdnative_terminate
callback arguments. -
Improved source links on docs.rs.
-
bindgen
is updated to 0.55.1. -
euclid
is updated to 0.22.1. -
Improved build time performance.
-
Removed deprecated items from the public interface in 0.8.1.
-
Removed
gdnative-sys
types from the public interface.gdnative-sys
is considered an internal dependency starting from 0.9. -
Removed the
Object
andReference
wrappers fromgdnative-core
. The same types are available ingdnative-bindings
. -
Removed generated bindings for virtual methods, since they cannot actually be called.
-
Removed
From
implementations forVariant
sinceToVariant
is much more comprehensive.
-
Fixed typos in variant names of
VariantOperator
andGodotError
. -
StringName::from_str
now returnsSelf
correctly. -
Fixed a case of undefined behavior that may manifest as crashes when some specific methods that return
VariantArray
are called. -
Fixed an issue with platform headers when building on Windows with the
gnu
toolchain that prevented compilation. -
Macros can now be used with qualified imports, removing the need for
#[macro_use]
. -
Fixed an issue where
Rid
arguments 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 usingDefault
if not provided by the caller. -
Added a
claim
method on theGodotObject
trait, 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_sys
andto_sys
) that are not actually intended to be part of the public API. -
Fields can now be skipped with the
#[variant(skip)]
attribute when derivingFromVariant
andToVariant
. -
Implemented various methods on
Basis
. -
Implemented
Display
forGodotString
. -
Implemented
Debug
for core typed arrays. -
Added
Aether<T>
, a specialUserData
wrapper for ZSTs. This type does not perform any allocation or synchronization at runtime, but produces a value usingDefault
each 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
ExportInfo
are now deprecated. They will become private in 0.9. Use one of the constructors orExport::export_info
instead. -
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
free
orqueue_free
manually instead. They will be removed in 0.9.
-
Fixed a problem where the build script for
gdnative-sys
will 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
NativeClass
withBase = Node2D
to aSpatial
node).
-
Field attribute
property
on derivedNativeClass
types, which can be used to quickly export simple properties. -
The behavior of derived
FromVariant
andToVariant
implementations can be customized with thevariant
field 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
FromVariant
trait now reports detailed information on failure. -
The API for property registration is reworked to provide better ergonomics and static type checking for editor hints.
-
LocalCellData
is now the default user-data wrapper type. This wrapper allows non-Send
types to be used asNativeClass
es, 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_parens
warning when using theNativeClass
derive macro. -
Fixed handling of unknown enums with duplicate values, which prevented code generation for Godot version
3.2
. -
Fixed a memory leak where a
Drop
implementation 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
methods
which can be applied toimpl
blocks and allows a more natural Rust syntax for creating script types and exporting functions using attributes. -
The
ToVariant
andFromVariant
traits, including derive macros. These traits can be used to define how custom types can be constructed fromVariant
s or be extracted from existingVariant
s. Any type implementingFromVariant
can be used as a parameter to an exported function. Any type implementingToVariant
can be returned from exported functions. -
Derive-macro for
NativeClass
trait. -
Every type implementing
NativeClass
provides 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 (implementsToVariant
andFromVariant
, 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.1
and now includes added GDNative extensions. -
The
NativeClass
trait has changed a lot and was split into two traits to allow themethods
procedural macro to generate a description of exported methods. -
The generated class bindings are stored in a single crate again and use the
Deref
trait 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.