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

[3.x]Expose visual script custom node type hints #48900

Conversation

Gallilus
Copy link
Contributor

Expose the minimal of new virtual methods to give the Node creator all tools needed to create full type hints for input and output ports.

Improves the default guess_output_type() for VisualScriptCustomNode class.

Fixes issues/2692

PS: When developing I have started to (re)create a advanced subcall pluggin as a fix by itself and as a test of the functionality

@Gallilus Gallilus requested a review from a team as a code owner May 20, 2021 18:26
@Gallilus
Copy link
Contributor Author

Redo of https://github.com/godotengine/godot/pull/48853/commits I messed up the merge

@Gallilus
Copy link
Contributor Author

Help? I do mot understand what the below mean.
image

@akien-mga
Copy link
Member

You should click it to see details about why it failed: https://github.com/godotengine/godot/runs/2633115286

Here it failed because you change the API but did not sync the documentation to match it:

Running --doctool to see if this changes the public API without updating the documentation.
If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.

diff --git a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
index 8b17acd..60c1c48 100644
--- a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
+++ b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
@@ -30,40 +30,40 @@
 				Return the count of input value ports.
 			</description>
 		</method>
-		<method name="_get_input_value_port_name" qualifiers="virtual">
-			<return type="String">
+		<method name="_get_input_value_port_hint" qualifiers="virtual">
+			<return type="int">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified input port's name.
+				Return the specified input port's hint. See the [enum @GlobalScope.PropertyHint] hints.
 			</description>
 		</method>
-		<method name="_get_input_value_port_type" qualifiers="virtual">
-			<return type="int">
+		<method name="_get_input_value_port_hint_string" qualifiers="virtual">
+			<return type="String">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified input port's type. See the [enum Variant.Type] values.
+				Return the specified input port's hint_string.
 			</description>
 		</method>
-		<method name="_get_input_value_port_hint" qualifiers="virtual">
-			<return type="int">
+		<method name="_get_input_value_port_name" qualifiers="virtual">
+			<return type="String">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified input port's hint. See the [enum @GlobalScope.PropertyHint] hints.
+				Return the specified input port's name.
 			</description>
 		</method>
-		<method name="_get_input_value_port_hint_string" qualifiers="virtual">
-			<return type="String">
+		<method name="_get_input_value_port_type" qualifiers="virtual">
+			<return type="int">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified input port's hint_string.
+				Return the specified input port's type. See the [enum Variant.Type] values.
 			</description>
 		</method>
 		<method name="_get_output_sequence_port_count" qualifiers="virtual">
@@ -89,40 +89,40 @@
 				Return the amount of output value ports.
 			</description>
 		</method>
-		<method name="_get_output_value_port_name" qualifiers="virtual">
-			<return type="String">
+		<method name="_get_output_value_port_hint" qualifiers="virtual">
+			<return type="int">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified output ports name.
+				Return the specified output ports hint. See the [enum @GlobalScope.PropertyHint] hints.
 			</description>
 		</method>
-		<method name="_get_output_value_port_type" qualifiers="virtual">
-			<return type="int">
+		<method name="_get_output_value_port_hint_string" qualifiers="virtual">
+			<return type="String">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified output ports type. See the [enum Variant.Type] values.
+				Return the specified output ports hint_string.
 			</description>
 		</method>
-		<method name="_get_output_value_port_hint" qualifiers="virtual">
-			<return type="int">
+		<method name="_get_output_value_port_name" qualifiers="virtual">
+			<return type="String">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified output ports hint. See the [enum @GlobalScope.PropertyHint] hints.
+				Return the specified output ports name.
 			</description>
 		</method>
-		<method name="_get_output_value_port_hint_string" qualifiers="virtual">
-			<return type="String">
+		<method name="_get_output_value_port_type" qualifiers="virtual">
+			<return type="int">
 			</return>
 			<argument index="0" name="idx" type="int">
 			</argument>
 			<description>
-				Return the specified output ports hint_string.
+				Return the specified output ports type. See the [enum Variant.Type] values.
 			</description>
 		</method>
 		<method name="_get_text" qualifiers="virtual">

@fire
Copy link
Member

fire commented Jun 17, 2021

Waiting for CICD to pass.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Paper review.

@Gallilus
Copy link
Contributor Author

Hi
Just want to give a example project implementing a addon using these changes change.
Stylized Planet Generator.zip
The best VS for the planet generator I was able to make. (3rd iteration)
befor
Using the changes I'm able to make clean functioning Custom Nodes With les effort then strait translation to VS while keeping all the design variables available to VS. And those variables have the best possible info for the property editor.
after

@Gallilus Gallilus changed the title Expose visual script custom node type hints [3.x]Expose visual script custom node type hints Jul 13, 2021
@Gallilus
Copy link
Contributor Author

Will make a mew backport from #48972 when that is merged

@Gallilus Gallilus closed this Jul 21, 2021
@Gallilus Gallilus deleted the Expose_VisualScriptCustomNode_TypeHints branch July 24, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants