Check is the ref shader valid in visual shader's update_option_menu
(cherry picked from commit ff089f8cea
)
This commit is contained in:
parent
fddd0a5098
commit
7c162351c9
|
@ -1792,7 +1792,7 @@ void VisualShaderEditor::_update_options_menu() {
|
|||
}
|
||||
|
||||
Ref<VisualShaderNodeParameterRef> parameter_ref = Object::cast_to<VisualShaderNodeParameterRef>(vsn.ptr());
|
||||
if (parameter_ref.is_valid()) {
|
||||
if (parameter_ref.is_valid() && parameter_ref->is_shader_valid()) {
|
||||
check_result = -1;
|
||||
|
||||
if (members_input_port_type != VisualShaderNode::PORT_TYPE_MAX) {
|
||||
|
|
|
@ -3576,6 +3576,10 @@ String VisualShaderNodeParameterRef::get_output_port_name(int p_port) const {
|
|||
return "";
|
||||
}
|
||||
|
||||
bool VisualShaderNodeParameterRef::is_shader_valid() const {
|
||||
return shader_rid.is_valid();
|
||||
}
|
||||
|
||||
void VisualShaderNodeParameterRef::set_shader_rid(const RID &p_shader_rid) {
|
||||
shader_rid = p_shader_rid;
|
||||
}
|
||||
|
|
|
@ -639,6 +639,7 @@ public:
|
|||
virtual PortType get_output_port_type(int p_port) const override;
|
||||
virtual String get_output_port_name(int p_port) const override;
|
||||
|
||||
bool is_shader_valid() const;
|
||||
void set_shader_rid(const RID &p_shader);
|
||||
|
||||
void set_parameter_name(const String &p_name);
|
||||
|
|
Loading…
Reference in New Issue