[Bf-codereview] Support for Get/Set callbacks in bpy.props (issue 7027056)

ideasman42 at gmail.com ideasman42 at gmail.com
Sat Jan 5 14:32:07 CET 2013


LGTM, besides some minor suggestions


https://codereview.appspot.com/7027056/diff/1/source/blender/makesrna/intern/rna_access.c
File source/blender/makesrna/intern/rna_access.c (right):

https://codereview.appspot.com/7027056/diff/1/source/blender/makesrna/intern/rna_access.c#newcode995
source/blender/makesrna/intern/rna_access.c:995: +		*softmin =
MAX2(*softmin, hardmin);
picky, preference for min_ii, max_ii

https://codereview.appspot.com/7027056/diff/1/source/blender/makesrna/intern/rna_access.c#newcode995
source/blender/makesrna/intern/rna_access.c:995: +		*softmin =
MAX2(*softmin, hardmin);
picky, preference for min_ff, max_ff

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c
File source/blender/python/intern/bpy_props.c (right):

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode267
source/blender/python/intern/bpy_props.c:267: value = 0.0f;
float, should be true/false

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode364
source/blender/python/intern/bpy_props.c:364: PyObject *py_seq =
PySequence_Fast(ret, "the return value must be a sequence");
Think it'd be better to use: PyC_AsArray here

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode577
source/blender/python/intern/bpy_props.c:577: PyObject *py_seq =
PySequence_Fast(ret, "the return value must be a sequence");
Think it'd be better to use: PyC_AsArray here

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode639
source/blender/python/intern/bpy_props.c:639: py_values =
PyTuple_New(len);
Not so important but could have a util function - PyC_ToArray that works
like PyC_AsArray.

same goes for other types here.

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode789
source/blender/python/intern/bpy_props.c:789: else {
Think it'd be better to use: PyC_AsArray here

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode989
source/blender/python/intern/bpy_props.c:989: PyTuple_SET_ITEM(args, 1,
PyUnicode_FromString(value));
should error check that PyUnicode_FromString() isnt failing.

https://codereview.appspot.com/7027056/


More information about the Bf-codereview mailing list