-
-
Notifications
You must be signed in to change notification settings - Fork 571
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
Output parameters generated as const
references
#1471
Comments
This might be difficult to fix without breaking compatibility, but will look into it They would likely have to be passed as pointers instead as I don't think the interface supports non-const references, which would break compatibility quite significantly, unsure how to proceed Edit: This would likely be best solved by using the same method as |
@AThousandShips I'm also not sure if this is related (will make an issue in the main repository when I have done more tests) but thought it would be worth raising it here if it is - the Note that I godot::TypedArray<godot::String>& gen_files_writable = const_cast<godot::TypedArray<godot::String>&>(gen_files); I dropped some breakpoints in However other parameters that use Dictionary (i.e. the aforementioned Will do more testing to see if I can pinpoint it if I have time in the next week or so. |
If you can confirm it doesn't even work with |
Yes I can confirm it still doesn't work, will add it to the PR shortly! |
Typed array specific issues are likely the same issue as: Which could be fixed in Godot-cpp as well, but might still be problematic in other bindings making assumptions about the data etc. |
Godot version
4.2-stable
godot-cpp version
4.2-stable
System information
Godot v4.2.1.stable - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)
Issue description
The generated interface for both
EditorImportPlugin::_import
andEditorResourcePreviewGenerator::_generate
have const-qualified parameters that are actually intended to be modified.In the docs for
EditorImportPlugin::_import
, theplatform_variants
andgen_files
parameters are suppose to be lists that can be used to inform the editor of additional files related to the import. Because they're const-qualified in the godot-cpp interface they can't be updated without aconst_cast
.Same goes for
EditorResourcePreviewGenerator::_generate
'smetadata
parameter which is suppose to updated by the preview generator to provide any applicable metadata toEditorResourceTooltipPlugin::_make_tooltip_for_path
for the editor tooltip.Steps to reproduce
N/A
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: