made visual shader ports expandable by default if there is only one output port and it's of any vector type
Co-authored-by: QbieShay <cislaghi.ilaria@gmail.com>
This commit is contained in:
parent
fe5b1c8d49
commit
f248420a2b
|
@ -859,11 +859,11 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
|
|||
}
|
||||
|
||||
if (valid_right) {
|
||||
if (vsnode->is_output_port_expandable(i)) {
|
||||
if (expanded_port_counter == 0 && vsnode->is_output_port_expandable(i)) {
|
||||
TextureButton *expand = memnew(TextureButton);
|
||||
expand->set_toggle_mode(true);
|
||||
expand->set_texture_normal(editor->get_editor_theme_icon(SNAME("GuiTreeArrowDown")));
|
||||
expand->set_texture_pressed(editor->get_editor_theme_icon(SNAME("GuiTreeArrowRight")));
|
||||
expand->set_texture_normal(editor->get_editor_theme_icon(SNAME("GuiTreeArrowRight")));
|
||||
expand->set_texture_pressed(editor->get_editor_theme_icon(SNAME("GuiTreeArrowDown")));
|
||||
expand->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
|
||||
expand->set_pressed(vsnode->_is_output_port_expanded(i));
|
||||
expand->connect("pressed", callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED);
|
||||
|
@ -892,6 +892,9 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
|
|||
|
||||
if (!is_first_hbox) {
|
||||
node->add_child(hb);
|
||||
if (curve_xyz.is_valid()) {
|
||||
node->move_child(hb, 1 + expanded_port_counter);
|
||||
}
|
||||
}
|
||||
|
||||
if (expanded_type != VisualShaderNode::PORT_TYPE_SCALAR) {
|
||||
|
|
|
@ -251,6 +251,10 @@ bool VisualShaderNode::is_generate_input_var(int p_port) const {
|
|||
}
|
||||
|
||||
bool VisualShaderNode::is_output_port_expandable(int p_port) const {
|
||||
VisualShaderNode::PortType port = get_output_port_type(p_port);
|
||||
if (get_output_port_count() == 1 && (port == PORT_TYPE_VECTOR_2D || port == PORT_TYPE_VECTOR_3D || port == PORT_TYPE_VECTOR_4D)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,11 +51,11 @@ VisualShaderNodeVectorBase::PortType VisualShaderNodeVectorBase::get_input_port_
|
|||
VisualShaderNodeVectorBase::PortType VisualShaderNodeVectorBase::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 || get_output_port_count() > 1 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 || get_output_port_count() > 1 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 || get_output_port_count() > 1 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -379,13 +379,6 @@ String VisualShaderNodeColorConstant::get_output_port_name(int p_port) const {
|
|||
return "";
|
||||
}
|
||||
|
||||
bool VisualShaderNodeColorConstant::is_output_port_expandable(int p_port) const {
|
||||
if (p_port == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
String VisualShaderNodeColorConstant::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const {
|
||||
return " " + p_output_vars[0] + " = " + vformat("vec4(%.6f, %.6f, %.6f, %.6f)", constant.r, constant.g, constant.b, constant.a) + ";\n";
|
||||
}
|
||||
|
@ -441,7 +434,7 @@ int VisualShaderNodeVec2Constant::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeVec2Constant::PortType VisualShaderNodeVec2Constant::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeVec2Constant::get_output_port_name(int p_port) const {
|
||||
|
@ -503,7 +496,7 @@ int VisualShaderNodeVec3Constant::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeVec3Constant::PortType VisualShaderNodeVec3Constant::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeVec3Constant::get_output_port_name(int p_port) const {
|
||||
|
@ -565,7 +558,7 @@ int VisualShaderNodeVec4Constant::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeVec4Constant::PortType VisualShaderNodeVec4Constant::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeVec4Constant::get_output_port_name(int p_port) const {
|
||||
|
@ -715,12 +708,7 @@ int VisualShaderNodeTexture::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeTexture::PortType VisualShaderNodeTexture::get_output_port_type(int p_port) const {
|
||||
switch (p_port) {
|
||||
case 0:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
default:
|
||||
return PORT_TYPE_SCALAR;
|
||||
}
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeTexture::get_output_port_name(int p_port) const {
|
||||
|
@ -732,13 +720,6 @@ String VisualShaderNodeTexture::get_output_port_name(int p_port) const {
|
|||
}
|
||||
}
|
||||
|
||||
bool VisualShaderNodeTexture::is_output_port_expandable(int p_port) const {
|
||||
if (p_port == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VisualShaderNodeTexture::is_input_port_default(int p_port, Shader::Mode p_mode) const {
|
||||
if (p_mode == Shader::MODE_CANVAS_ITEM || p_mode == Shader::MODE_SPATIAL) {
|
||||
if (p_port == 0) {
|
||||
|
@ -1167,7 +1148,7 @@ int VisualShaderNodeCurveXYZTexture::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeCurveXYZTexture::PortType VisualShaderNodeCurveXYZTexture::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeCurveXYZTexture::get_output_port_name(int p_port) const {
|
||||
|
@ -1271,13 +1252,6 @@ String VisualShaderNodeSample3D::get_output_port_name(int p_port) const {
|
|||
return "color";
|
||||
}
|
||||
|
||||
bool VisualShaderNodeSample3D::is_output_port_expandable(int p_port) const {
|
||||
if (p_port == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VisualShaderNodeSample3D::is_input_port_default(int p_port, Shader::Mode p_mode) const {
|
||||
if (p_mode == Shader::MODE_CANVAS_ITEM || p_mode == Shader::MODE_SPATIAL) {
|
||||
if (p_port == 0) {
|
||||
|
@ -1505,20 +1479,13 @@ int VisualShaderNodeCubemap::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeCubemap::PortType VisualShaderNodeCubemap::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeCubemap::get_output_port_name(int p_port) const {
|
||||
return "color";
|
||||
}
|
||||
|
||||
bool VisualShaderNodeCubemap::is_output_port_expandable(int p_port) const {
|
||||
if (p_port == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Vector<VisualShader::DefaultTextureParam> VisualShaderNodeCubemap::get_default_texture_parameters(VisualShader::Type p_type, int p_id) const {
|
||||
VisualShader::DefaultTextureParam dtp;
|
||||
dtp.name = make_unique_id(p_type, p_id, "cube");
|
||||
|
@ -1757,7 +1724,7 @@ int VisualShaderNodeWorldPositionFromDepth::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeWorldPositionFromDepth::PortType VisualShaderNodeWorldPositionFromDepth::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeWorldPositionFromDepth::get_output_port_name(int p_port) const {
|
||||
|
@ -1824,7 +1791,7 @@ int VisualShaderNodeScreenNormalWorldSpace::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeScreenNormalWorldSpace::PortType VisualShaderNodeScreenNormalWorldSpace::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeScreenNormalWorldSpace::get_output_port_name(int p_port) const {
|
||||
|
@ -2407,7 +2374,7 @@ int VisualShaderNodeColorOp::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeColorOp::PortType VisualShaderNodeColorOp::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeColorOp::get_output_port_name(int p_port) const {
|
||||
|
@ -2680,7 +2647,7 @@ int VisualShaderNodeTransformVecMult::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeTransformVecMult::PortType VisualShaderNodeTransformVecMult::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeTransformVecMult::get_output_port_name(int p_port) const {
|
||||
|
@ -3228,7 +3195,7 @@ int VisualShaderNodeColorFunc::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeColorFunc::PortType VisualShaderNodeColorFunc::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeColorFunc::get_output_port_name(int p_port) const {
|
||||
|
@ -3454,7 +3421,7 @@ int VisualShaderNodeUVFunc::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeUVFunc::PortType VisualShaderNodeUVFunc::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeUVFunc::get_output_port_name(int p_port) const {
|
||||
|
@ -3590,7 +3557,7 @@ int VisualShaderNodeUVPolarCoord::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeUVPolarCoord::PortType VisualShaderNodeUVPolarCoord::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeUVPolarCoord::get_output_port_name(int p_port) const {
|
||||
|
@ -3807,11 +3774,11 @@ int VisualShaderNodeDerivativeFunc::get_output_port_count() const {
|
|||
VisualShaderNodeDerivativeFunc::PortType VisualShaderNodeDerivativeFunc::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4013,11 +3980,11 @@ VisualShaderNodeClamp::PortType VisualShaderNodeClamp::get_output_port_type(int
|
|||
case OP_TYPE_UINT:
|
||||
return PORT_TYPE_SCALAR_UINT;
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4277,17 +4244,14 @@ int VisualShaderNodeStep::get_output_port_count() const {
|
|||
VisualShaderNodeStep::PortType VisualShaderNodeStep::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
case OP_TYPE_VECTOR_2D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
case OP_TYPE_VECTOR_3D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
case OP_TYPE_VECTOR_4D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4436,17 +4400,14 @@ int VisualShaderNodeSmoothStep::get_output_port_count() const {
|
|||
VisualShaderNodeSmoothStep::PortType VisualShaderNodeSmoothStep::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
case OP_TYPE_VECTOR_2D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
case OP_TYPE_VECTOR_3D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
case OP_TYPE_VECTOR_4D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4728,17 +4689,14 @@ int VisualShaderNodeMix::get_output_port_count() const {
|
|||
VisualShaderNodeMix::PortType VisualShaderNodeMix::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
case OP_TYPE_VECTOR_2D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
case OP_TYPE_VECTOR_3D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
case OP_TYPE_VECTOR_4D_SCALAR:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -5811,13 +5769,6 @@ String VisualShaderNodeColorParameter::get_output_port_name(int p_port) const {
|
|||
return "color";
|
||||
}
|
||||
|
||||
bool VisualShaderNodeColorParameter::is_output_port_expandable(int p_port) const {
|
||||
if (p_port == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void VisualShaderNodeColorParameter::set_default_value_enabled(bool p_enabled) {
|
||||
if (default_value_enabled == p_enabled) {
|
||||
return;
|
||||
|
@ -5913,11 +5864,11 @@ int VisualShaderNodeVec2Parameter::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeVec2Parameter::PortType VisualShaderNodeVec2Parameter::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeVec2Parameter::get_output_port_name(int p_port) const {
|
||||
return String();
|
||||
return "vector";
|
||||
}
|
||||
|
||||
void VisualShaderNodeVec2Parameter::set_default_value_enabled(bool p_enabled) {
|
||||
|
@ -6013,11 +5964,11 @@ int VisualShaderNodeVec3Parameter::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeVec3Parameter::PortType VisualShaderNodeVec3Parameter::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeVec3Parameter::get_output_port_name(int p_port) const {
|
||||
return ""; //no output port means the editor will be used as port
|
||||
return "vector";
|
||||
}
|
||||
|
||||
void VisualShaderNodeVec3Parameter::set_default_value_enabled(bool p_enabled) {
|
||||
|
@ -6113,11 +6064,11 @@ int VisualShaderNodeVec4Parameter::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeVec4Parameter::PortType VisualShaderNodeVec4Parameter::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeVec4Parameter::get_output_port_name(int p_port) const {
|
||||
return ""; // No output port means the editor will be used as port.
|
||||
return "vector";
|
||||
}
|
||||
|
||||
void VisualShaderNodeVec4Parameter::set_default_value_enabled(bool p_enabled) {
|
||||
|
@ -6881,7 +6832,7 @@ int VisualShaderNodeIf::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeIf::PortType VisualShaderNodeIf::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeIf::get_output_port_name(int p_port) const {
|
||||
|
@ -6976,11 +6927,11 @@ VisualShaderNodeSwitch::PortType VisualShaderNodeSwitch::get_output_port_type(in
|
|||
case OP_TYPE_UINT:
|
||||
return PORT_TYPE_SCALAR_UINT;
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_BOOLEAN:
|
||||
return PORT_TYPE_BOOLEAN;
|
||||
case OP_TYPE_TRANSFORM:
|
||||
|
@ -7608,11 +7559,11 @@ int VisualShaderNodeMultiplyAdd::get_output_port_count() const {
|
|||
VisualShaderNodeMultiplyAdd::PortType VisualShaderNodeMultiplyAdd::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -241,7 +241,6 @@ public:
|
|||
virtual int get_output_port_count() const override;
|
||||
virtual PortType get_output_port_type(int p_port) const override;
|
||||
virtual String get_output_port_name(int p_port) const override;
|
||||
virtual bool is_output_port_expandable(int p_port) const override;
|
||||
|
||||
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
|
||||
|
||||
|
@ -418,7 +417,6 @@ public:
|
|||
virtual int get_output_port_count() const override;
|
||||
virtual PortType get_output_port_type(int p_port) const override;
|
||||
virtual String get_output_port_name(int p_port) const override;
|
||||
virtual bool is_output_port_expandable(int p_port) const override;
|
||||
|
||||
virtual bool is_input_port_default(int p_port, Shader::Mode p_mode) const override;
|
||||
|
||||
|
@ -537,7 +535,6 @@ public:
|
|||
virtual int get_output_port_count() const override;
|
||||
virtual PortType get_output_port_type(int p_port) const override;
|
||||
virtual String get_output_port_name(int p_port) const override;
|
||||
virtual bool is_output_port_expandable(int p_port) const override;
|
||||
|
||||
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
|
||||
|
||||
|
@ -633,7 +630,6 @@ public:
|
|||
virtual int get_output_port_count() const override;
|
||||
virtual PortType get_output_port_type(int p_port) const override;
|
||||
virtual String get_output_port_name(int p_port) const override;
|
||||
virtual bool is_output_port_expandable(int p_port) const override;
|
||||
|
||||
virtual Vector<VisualShader::DefaultTextureParam> get_default_texture_parameters(VisualShader::Type p_type, int p_id) const override;
|
||||
virtual String generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const override;
|
||||
|
@ -2196,8 +2192,6 @@ 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_output_port_expandable(int p_port) const override;
|
||||
|
||||
virtual String generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const override;
|
||||
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@ int VisualShaderNodeParticleEmitter::get_output_port_count() const {
|
|||
|
||||
VisualShaderNodeParticleEmitter::PortType VisualShaderNodeParticleEmitter::get_output_port_type(int p_port) const {
|
||||
if (mode_2d) {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeParticleEmitter::get_output_port_name(int p_port) const {
|
||||
|
@ -785,7 +785,7 @@ int VisualShaderNodeParticleMultiplyByAxisAngle::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeParticleMultiplyByAxisAngle::PortType VisualShaderNodeParticleMultiplyByAxisAngle::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeParticleMultiplyByAxisAngle::get_output_port_name(int p_port) const {
|
||||
|
@ -859,7 +859,7 @@ int VisualShaderNodeParticleConeVelocity::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeParticleConeVelocity::PortType VisualShaderNodeParticleConeVelocity::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeParticleConeVelocity::get_output_port_name(int p_port) const {
|
||||
|
@ -929,11 +929,11 @@ int VisualShaderNodeParticleRandomness::get_output_port_count() const {
|
|||
VisualShaderNodeParticleRandomness::PortType VisualShaderNodeParticleRandomness::get_output_port_type(int p_port) const {
|
||||
switch (op_type) {
|
||||
case OP_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case OP_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1079,7 +1079,7 @@ int VisualShaderNodeParticleAccelerator::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeParticleAccelerator::PortType VisualShaderNodeParticleAccelerator::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeParticleAccelerator::get_output_port_name(int p_port) const {
|
||||
|
|
|
@ -53,7 +53,7 @@ int VisualShaderNodeSDFToScreenUV::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeSDFToScreenUV::PortType VisualShaderNodeSDFToScreenUV::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeSDFToScreenUV::get_output_port_name(int p_port) const {
|
||||
|
@ -90,7 +90,7 @@ int VisualShaderNodeScreenUVToSDF::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeScreenUVToSDF::PortType VisualShaderNodeScreenUVToSDF::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeScreenUVToSDF::get_output_port_name(int p_port) const {
|
||||
|
@ -171,7 +171,7 @@ int VisualShaderNodeTextureSDFNormal::get_output_port_count() const {
|
|||
}
|
||||
|
||||
VisualShaderNodeTextureSDFNormal::PortType VisualShaderNodeTextureSDFNormal::get_output_port_type(int p_port) const {
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
}
|
||||
|
||||
String VisualShaderNodeTextureSDFNormal::get_output_port_name(int p_port) const {
|
||||
|
|
Loading…
Reference in New Issue