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

find_item_by_name.... not much info, on many functions what their default return value is (usually -1) #9219

Open
RichardEllicott opened this issue Apr 11, 2024 · 2 comments · May be fixed by godotengine/godot#92416
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@RichardEllicott
Copy link

RichardEllicott commented Apr 11, 2024

a lot of the docs do not give suffecient information, leading you to test things

this function "find_item_by_name" returns -1 if it does not find a result, this should be in reference docs

https://docs.godotengine.org/en/stable/classes/class_meshlibrary.html

is there an easy way for us to update docs in these instances? sorry if this is not the correct process but the docs link us here

@RichardEllicott RichardEllicott changed the title find_item_by_name, find_item_by_name.... not much info, on many functions what their default return value is (usually -1) Apr 11, 2024
@skyace65 skyace65 added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Apr 12, 2024
@mateuseap
Copy link
Contributor

Initially, I thought it wasn't necessary, but after looking around, I agree with the points raised in this issue.

I reviewed the MeshLibrary class documentation and found that the method descriptions indeed do not specify important nuances, such as the behavior of the find_item_by_name() method when a result is not found. In contrast, methods in other classes, like find_track() in the Animation class, find_animation() and find_animation_library() in the AnimationMixer class, and surface_find_by_name() in the ArrayMesh class, do specify details about what is returned when results are not found.

Therefore, I believe it is valid and useful to add such nuances to method descriptions. Even small details like these can be very helpful to other users.

@mateuseap
Copy link
Contributor

I've opened a PR to improve the description of the find_item_by_name() method in the MeshLibrary class. Many other tweaks can be made in other methods descriptions that misses nuances like this one did, but I believe this is a useful starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants