This is a C++ extension that creates 3D trails from a moving point.
Each frame, just update the new position and the trail (actually a bended cylinder) will follow it.
As few data as possible is modified every frame, so it runs with very nice performances.
Yes. I would have released my own extension a week ago, if I had been able to upload to my webspace, but they seem to have technical problems. Well, perhaps next week.
(1) Objects of a particular type, e.g. NodePath or Vec3 or my own extension types. This is what I do most of the time. Error messages get set automatically.
(2) Python methods, e.g. for callbacks, or any kind of sequences (list, tuples, …). These checks are not for one particular type, but for groups of types, like all callable objects, or all objects that support the sequence protocol.
if ( ! PyCallable_Check( _callback ) )
{
PyErr_SetString( PyExc_TypeError, "Callback must be a callable method" );
return NULL;
}
if ( ! PySequence_Check( _cloud ) ) {
PyErr_SetString( PyExc_TypeError, "Argument two must be a sequence!" );
return NULL;
}
(3) Well, and then there is PyObject_TypeCheck(PyObject* obj, PyTypeObject* type) too. But I have no need to use this way of type-checking in my code.