Skip to content

Setters/Getters for indexed properties #1217

Open
@Bromeon

Description

@Bromeon

See godot-rust/gdnative#970.

Example APIs:

Property Current API Short API
BaseMaterial3D::albedo_texture set_texture(TextureParam::ALBEDO, tex) set_albedo_texture(tex)
BaseMaterial3D::uv1_triplanar set_flag(Flags::UV1_USE_TRIPLANAR, true) set_uv1_triplanar(true)
Light3D::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 PARAM_ENERGY = 0

Constant for accessing light_energy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: engineGodot classes (nodes, resources, ...)featureAdds functionality to the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions