[Bf-codereview] Normals baker from sculpt data (issue4518055)

brechtvanlommel at gmail.com brechtvanlommel at gmail.com
Tue May 17 16:15:53 CEST 2011


Great improvements, some comments on the updated patch below.


http://codereview.appspot.com/4518055/diff/5003/release/scripts/startup/bl_ui/properties_render.py
File release/scripts/startup/bl_ui/properties_render.py (right):

http://codereview.appspot.com/4518055/diff/5003/release/scripts/startup/bl_ui/properties_render.py#newcode651
release/scripts/startup/bl_ui/properties_render.py:651: layout.prop(rd,
"bake_margin")
I would wove bake clear below smooth heights option, since it's more
related to margin.

http://codereview.appspot.com/4518055/diff/5003/source/blender/editors/object/object_bake.c
File source/blender/editors/object/object_bake.c (right):

http://codereview.appspot.com/4518055/diff/5003/source/blender/editors/object/object_bake.c#newcode951
source/blender/editors/object/object_bake.c:951: if(!ima ||
!BKE_image_get_ibuf(ima, NULL)) {
This still isn't sufficient as a safety check, see baking in
rendercore.c. Need to check if rect/rect_float is actually there and has
the correct number of channels.

http://codereview.appspot.com/4518055/diff/5003/source/blender/imbuf/IMB_imbuf.h
File source/blender/imbuf/IMB_imbuf.h (right):

http://codereview.appspot.com/4518055/diff/5003/source/blender/imbuf/IMB_imbuf.h#newcode254
source/blender/imbuf/IMB_imbuf.h:254: void IMB_mask_clear(struct ImBuf
*ibuf, char *mask, int val);
I would use "bake" in the names here, in principle could be used for
other purposes. Maybe BAKE_MASK could be FILTER_MASK, and  functions
IMB_filter_mask_extend, and IMB_filter_mask_clear.

http://codereview.appspot.com/4518055/diff/5003/source/blender/makesrna/intern/rna_scene.c
File source/blender/makesrna/intern/rna_scene.c (right):

http://codereview.appspot.com/4518055/diff/5003/source/blender/makesrna/intern/rna_scene.c#newcode2816
source/blender/makesrna/intern/rna_scene.c:2816:
RNA_def_property_ui_text(prop, "Smooth Heights", "Calculate heights
against sub-divided lo-res mesh");
Regarding naming, maybe these properties could be enums, bake source and
target?

http://codereview.appspot.com/4518055/


More information about the Bf-codereview mailing list