Created
May 24, 2016 18:36
-
-
Save folkertdev/915f0694b9ce6b07fdecceeb3f5bbdf0 to your computer and use it in GitHub Desktop.
C++ iterator to Python tuple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from the Blender Freestyle code | |
static PyObject *Stroke_viewedges_begin(BPy_Stroke *self) | |
{ | |
PyObject *output = PyTuple_New(self->s->viewedges_size()); | |
std::vector<ViewEdge*>::iterator ve_it = self->s->viewedges_begin(), ve_end = self->s->viewedges_end(); | |
for (unsigned int i = 0; ve_it != ve_end; ++ve_it, ++i) { | |
PyTuple_SET_ITEM(output, i, BPy_ViewEdge_from_ViewEdge(*(*ve_it))); | |
} | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment