static int pyShader_setConsts(pyShader* self, PyObject* value, void*) { if (value == NULL || value == Py_None) { self->fThis->setConsts(std::vector<plShaderConst>()); return 0; } else if (PyList_Check(value)) { size_t count = PyList_Size(value); std::vector<plShaderConst> constList(count); for (size_t i=0; i<count; i++) { if (!pyShaderConst_Check(PyList_GetItem(value, i))) { PyErr_SetString(PyExc_TypeError, "consts should be a list of strings"); return -1; } constList[i] = *((pyShaderConst*)(PyList_GetItem(value, i)))->fThis; } self->fThis->setConsts(constList); return 0; } else { PyErr_SetString(PyExc_TypeError, "consts should be a list of strings"); return -1; } }
ConstMotorList MotorFilter::motors() const { return constList(motors_); }