[Bf-codereview] ColorBand structs as ID properties (issue4547071)

lukas.toenne at googlemail.com lukas.toenne at googlemail.com
Mon May 30 18:26:59 CEST 2011


Reviewers: bf-codereview_blender.org,

Description:
Adds a new ID property type for ColorBands. This feature is needed as
part of the new PyNodes development, since node types such as the
ColorRamp node have custom storage data in the form of a ColorBand
struct, which must be implemented as ID property in order to make the
type definition python-based. Other node data such as RGB curves could
be added in the same where when required.

The IDP_COLORBAND property maps to the PROP_POINTER rna type, like the
IDP_GROUP. A change to the way pointer rna properties are casted in
RNA_property_pointer_get (rna_access.c) is necessary: Previously the
PointerRNA data pointer could just be casted from the IDProperty pointer
directly, since groups were the only id prop type mapping to rna pointer
type.

Now the actual pointer to be used for a property depends on the id prop
type (IDProperty* for groups, ColorBand* for color bands). The solution
is to store the actual data pointer in the idprop->data.pointer. For
groups this is the id prop itself (idprop->data.pointer==idprop).

Please review this at http://codereview.appspot.com/4547071/

Affected files:
   source/blender/blenkernel/BKE_idprop.h
   source/blender/blenkernel/intern/idprop.c
   source/blender/blenloader/intern/readfile.c
   source/blender/blenloader/intern/writefile.c
   source/blender/makesdna/DNA_ID.h
   source/blender/makesrna/intern/rna_ID.c
   source/blender/makesrna/intern/rna_access.c
   source/blender/makesrna/intern/rna_internal.h
   source/blender/python/generic/CMakeLists.txt
   source/blender/python/generic/IDProp.c
   source/blender/python/intern/bpy_props.c




More information about the Bf-codereview mailing list