-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Implement drop-down list properties to the custom visual shader nodes #81688
Implement drop-down list properties to the custom visual shader nodes #81688
Conversation
f050c74
to
c27d773
Compare
Okay it seems like after a little more testing that |
c27d773
to
9ecb8f0
Compare
@paddy-exe Try again - I think I've fixed it. |
9ecb8f0
to
7bbf5b9
Compare
Seems like it still doesn't work for the init method specifically for the |
7bbf5b9
to
3712921
Compare
@paddy-exe Ok, I did not manage to force
|
3712921
to
2b71bd4
Compare
Renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected now 👍🏻 thanks for your work on this!
Note about the video: Apparently you can't see the drop-down in the video but it's shown in the editor so just FYI
VS-OptionsDropDown-PRTest.mp4
1c2e417
to
a119db7
Compare
a119db7
to
4575cc0
Compare
Thanks! |
This PR adds user a possibility to define drop-down lists of options to their custom nodes in visual shaders.
Closes godotengine/godot-proposals#5075
To define those properties, the several new virtual methods were added to
VisualShaderNodeCustom
:int _get_property_count()
- override this to define the number of dropdown lists.int_get_property_default_index(int option_index)
- override this to define the default index of the specified property.String _get_property_name(int option_index)
- override this to define the property name, or leave it empty, so the text label will not been generatedPackedStringArray _get_property_options(int option_index)
- the options which are available for each propertyAlso added one non-virtual method:
int get_option_index(int option_index)
- you may need to call this function to define a specific behavior for each option in the_get_code
/_get_global_code
.Demo project: Test.zip
Please comment if something I need to change or improve.