pgraph: Fix bug passing non-tuple sequence to shader input

This commit is contained in:
rdb 2021-01-16 14:05:43 +01:00
parent 3a41db130b
commit f20d859fe2
2 changed files with 6 additions and 1 deletions

View File

@ -282,7 +282,7 @@ __init__(CPT_InternalName name, PyObject *value, int priority) {
return;
}
Py_ssize_t num_items = PySequence_Fast_GET_SIZE(value);
Py_ssize_t num_items = PySequence_Fast_GET_SIZE(fast);
if (num_items <= 0) {
// We can't determine the type of a list of size 0.
_this->_type = ShaderInput::M_numeric;

View File

@ -1,4 +1,9 @@
from panda3d.core import ShaderInput, Vec4
from array import array
def test_shaderinput_construct_sequence_int():
i = ShaderInput('test', array('I', [1, 2, 3, 4]))
def test_shaderinput_vector_compare():