Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
bc647393
Commit
bc647393
authored
Feb 13, 2020
by
Yuri Roubinsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added virtual method to VisualShaderNodeCustom to enable high-end mark
parent
3bc7fe5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
VisualShaderNodeCustom.xml
doc/classes/VisualShaderNodeCustom.xml
+8
-0
visual_shader_editor_plugin.cpp
editor/plugins/visual_shader_editor_plugin.cpp
+9
-2
visual_shader_editor_plugin.h
editor/plugins/visual_shader_editor_plugin.h
+1
-1
visual_shader.cpp
scene/resources/visual_shader.cpp
+1
-0
No files found.
doc/classes/VisualShaderNodeCustom.xml
View file @
bc647393
...
...
@@ -143,6 +143,14 @@
Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the root of the main category (see [method _get_category]).
</description>
</method>
<method
name=
"_is_highend"
qualifiers=
"virtual"
>
<return
type=
"bool"
>
</return>
<description>
Override this method to enable high-end mark in the Visual Shader Editor's members dialog.
Defining this method is [b]optional[/b]. If not overridden, it's false.
</description>
</method>
</methods>
<constants>
</constants>
...
...
editor/plugins/visual_shader_editor_plugin.cpp
View file @
bc647393
...
...
@@ -116,7 +116,7 @@ void VisualShaderEditor::clear_custom_types() {
}
}
void
VisualShaderEditor
::
add_custom_type
(
const
String
&
p_name
,
const
Ref
<
Script
>
&
p_script
,
const
String
&
p_description
,
int
p_return_icon_type
,
const
String
&
p_category
,
const
String
&
p_subcategory
)
{
void
VisualShaderEditor
::
add_custom_type
(
const
String
&
p_name
,
const
Ref
<
Script
>
&
p_script
,
const
String
&
p_description
,
int
p_return_icon_type
,
const
String
&
p_category
,
const
String
&
p_subcategory
,
bool
p_highend
)
{
ERR_FAIL_COND
(
!
p_name
.
is_valid_identifier
());
ERR_FAIL_COND
(
!
p_script
.
is_valid
());
...
...
@@ -135,6 +135,7 @@ void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script>
ao
.
description
=
p_description
;
ao
.
category
=
p_category
;
ao
.
sub_category
=
p_subcategory
;
ao
.
highend
=
p_highend
;
ao
.
is_custom
=
true
;
bool
begin
=
false
;
...
...
@@ -247,6 +248,11 @@ void VisualShaderEditor::update_custom_nodes() {
subcategory
=
(
String
)
ref
->
call
(
"_get_subcategory"
);
}
bool
highend
=
false
;
if
(
ref
->
has_method
(
"_is_highend"
))
{
highend
=
(
bool
)
ref
->
call
(
"_is_highend"
);
}
Dictionary
dict
;
dict
[
"name"
]
=
name
;
dict
[
"script"
]
=
script
;
...
...
@@ -254,6 +260,7 @@ void VisualShaderEditor::update_custom_nodes() {
dict
[
"return_icon_type"
]
=
return_icon_type
;
dict
[
"category"
]
=
category
;
dict
[
"subcategory"
]
=
subcategory
;
dict
[
"highend"
]
=
highend
;
String
key
;
key
=
category
;
...
...
@@ -277,7 +284,7 @@ void VisualShaderEditor::update_custom_nodes() {
const
Dictionary
&
value
=
(
Dictionary
)
added
[
key
];
add_custom_type
(
value
[
"name"
],
value
[
"script"
],
value
[
"description"
],
value
[
"return_icon_type"
],
value
[
"category"
],
value
[
"subcategory"
]);
add_custom_type
(
value
[
"name"
],
value
[
"script"
],
value
[
"description"
],
value
[
"return_icon_type"
],
value
[
"category"
],
value
[
"subcategory"
]
,
value
[
"highend"
]
);
}
_update_options_menu
();
...
...
editor/plugins/visual_shader_editor_plugin.h
View file @
bc647393
...
...
@@ -265,7 +265,7 @@ public:
static
VisualShaderEditor
*
get_singleton
()
{
return
singleton
;
}
void
clear_custom_types
();
void
add_custom_type
(
const
String
&
p_name
,
const
Ref
<
Script
>
&
p_script
,
const
String
&
p_description
,
int
p_return_icon_type
,
const
String
&
p_category
,
const
String
&
p_subcategory
);
void
add_custom_type
(
const
String
&
p_name
,
const
Ref
<
Script
>
&
p_script
,
const
String
&
p_description
,
int
p_return_icon_type
,
const
String
&
p_category
,
const
String
&
p_subcategory
,
bool
p_highend
);
virtual
Size2
get_minimum_size
()
const
;
void
edit
(
VisualShader
*
p_visual_shader
);
...
...
scene/resources/visual_shader.cpp
View file @
bc647393
...
...
@@ -276,6 +276,7 @@ void VisualShaderNodeCustom::_bind_methods() {
BIND_VMETHOD
(
MethodInfo
(
Variant
::
STRING
,
"_get_output_port_name"
,
PropertyInfo
(
Variant
::
INT
,
"port"
)));
BIND_VMETHOD
(
MethodInfo
(
Variant
::
STRING
,
"_get_code"
,
PropertyInfo
(
Variant
::
ARRAY
,
"input_vars"
),
PropertyInfo
(
Variant
::
ARRAY
,
"output_vars"
),
PropertyInfo
(
Variant
::
INT
,
"mode"
),
PropertyInfo
(
Variant
::
INT
,
"type"
)));
BIND_VMETHOD
(
MethodInfo
(
Variant
::
STRING
,
"_get_global_code"
,
PropertyInfo
(
Variant
::
INT
,
"mode"
)));
BIND_VMETHOD
(
MethodInfo
(
Variant
::
BOOL
,
"_is_highend"
));
}
VisualShaderNodeCustom
::
VisualShaderNodeCustom
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment