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

lukas.toenne at gmail.com lukas.toenne at gmail.com
Sat Jan 5 15:39:45 CET 2013


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);
On 2013/01/05 13:32:07, ideasman42 wrote:
> picky, preference for min_ii, max_ii

I basically just copy/pasted this from the case above, guess that should
be changed too then.

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;
On 2013/01/05 13:32:07, ideasman42 wrote:
> float, should be true/false

Done.

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");
On 2013/01/05 13:32:07, ideasman42 wrote:
> Think it'd be better to use: PyC_AsArray here

Done.

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");
On 2013/01/05 13:32:07, ideasman42 wrote:
> Think it'd be better to use: PyC_AsArray here

Done.

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);
On 2013/01/05 13:32:07, ideasman42 wrote:
> Not so important but could have a util function - PyC_ToArray that
works like
> PyC_AsArray.

> same goes for other types here.

Done.

https://codereview.appspot.com/7027056/diff/1/source/blender/python/intern/bpy_props.c#newcode789
source/blender/python/intern/bpy_props.c:789: else {
On 2013/01/05 13:32:07, ideasman42 wrote:
> Think it'd be better to use: PyC_AsArray here

Done.

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));
On 2013/01/05 13:32:07, ideasman42 wrote:
> should error check that PyUnicode_FromString() isnt failing.

Done.

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


More information about the Bf-codereview mailing list