godot
godot copied to clipboard
Keep existing `VectorCompose` input values when setting vector type
VisualShaderNodeVectorCompose::set_op_type
would zero out input port default values for z and w when using vector 3D/4D, updated to keep values for all ports.
Zeroing out z and w would cause values for 4D vectors to be lost when loading the visual shader - 3D vectors were not affected by this, since 3D is the default op type, which caused this step to be skipped during loading. However, both 3D and 4D were affected when changing the op type from the drop down in editor. For example, changing from 3D (1, 2, 3) to 4D would result in (1, 2, 0, 0), and changing from 4D (1, 2, 3, 4) to 3D would result in (1, 2, 0), losing previously set values.
Fixes #97359