Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPropertyValue and setPropertyValueSingle are missing the parameters in the documentation #3260

Open
engbergandreas opened this issue May 16, 2024 · 2 comments
Labels
Component: Documentation Creating or improving the user, builder, and developer facing documentation Feature: Lua Issues that deal with the Lua API

Comments

@engbergandreas
Copy link
Member

These functions are missing their parameters in the signature https://docs.openspaceproject.com/en/releases-v0.20.0/generated/scriptingApi/openspace.html#setpropertyvalue it seems to stem from the way they are exported in the luaLibrary

scripting::LuaLibrary Scene::luaLibrary() {
and the corresponding inline file
int propertySetValue(lua_State* L) {
Should we rewrite this so it follows other lua functions and so that the documentation is properly added?

@engbergandreas engbergandreas added Component: Documentation Creating or improving the user, builder, and developer facing documentation Feature: Lua Issues that deal with the Lua API labels May 16, 2024
@alexanderbock
Copy link
Member

A rewrite would require some additional feature for codegen first. The problem for setPropertyValue is that the "value" parameter can be anything as the state is passed to the property to extract the correct value. So at the time of the function call we don't actually know what a "correct" parameter type is as it depends on the property.

For example:
openspace.setPropertyValue("Scene.Earth.Scale.Scale", 1.0) is correct since Scale is a float property but openspace.setPropertyValue("Scene.Earth.Scale.Scale", "abc") would not be.

@alexanderbock
Copy link
Member

Adding a description for the argument into

and then having a type that can represent an "Any" type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Creating or improving the user, builder, and developer facing documentation Feature: Lua Issues that deal with the Lua API
Projects
None yet
Development

No branches or pull requests

2 participants