Setters/Getters for indexed properties
- Dominant language
- Rust
- Stars
- 5.2k
- Forks
- 312
- Avg merge
- 11h 10m
- Merged PRs (30d)
- 10
Description
See https://github.com/godot-rust/gdnative/pull/970.
Example APIs:
| Property | Current API | Short API |
|---|---|---|
| [`BaseMaterial3D::albedo_texture`](https://docs.godotengine.org/en/stable/classes/class_basematerial3d.html#class-basematerial3d-property-albedo-texture) | `set_texture(TextureParam::ALBEDO, tex)` | `set_albedo_texture(tex)` |
| [`BaseMaterial3D::uv1_triplanar`](https://docs.godotengine.org/en/stable/classes/class_basematerial3d.html#class-basematerial3d-property-uv1-triplanar) | `set_flag(Flags::UV1_USE_TRIPLANAR, true)` | `set_uv1_triplanar(true)` |
| [`Light3D::light_energy`](https://docs.godotengine.org/en/stable/classes/class_light3d.html#class-light3d-property-light-energy) | `set_param(Param::ENERGY, 1.5)` | `set_light_energy(1.5)` |
The question is to which degree we can automate this. While there is a relation between property and getter/setter names in the JSON, the flag/enum name is missing. We could of course try to use heuristics, but not sure how accurately that would work.
In some cases, enumerators contain the reference in their docs -- but that's not really something we can/should rely on:
> [Param](https://docs.godotengine.org/en/stable/classes/class_light3d.html#enum-light3d-param) **PARAM_ENERGY** = 0
>
> Constant for accessing [light_energy](https://docs.godotengine.org/en/stable/classes/class_light3d.html#class-light3d-property-light-energy).
Contributor guide
Research direction
Start by reading the linked pull request 970 and the indexed-property examples in this issue. Inspect the JSON relationship between properties and getter/setter names, then determine how missing flag or enum mappings could be handled; done would require a documented, reliable automation approach and its resulting APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot, rust
- Domain
- game-dev, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100