- modify the baking layout to be more compact and made a bit more sense.

- add back quad split order option.

note: tested displacement baking and found it matches 2.4x. there is still a missing check which ignores the active object when baking selected to active but Im not sure in what cases this is needed.
This commit is contained in:
Campbell Barton 2009-12-31 10:07:59 +00:00
parent bccda9857b
commit b800fbd13f
2 changed files with 23 additions and 14 deletions

@ -560,27 +560,29 @@ class RENDER_PT_bake(RenderButtonsPanel):
row = layout.row()
row.operator("object.bake_image", icon='RENDER_STILL')
row = layout.row(align=True)
row.prop(rd, "bake_type", text="")
if rd.bake_type == 'NORMALS':
row.prop(rd, "bake_normal_space", text="")
elif rd.bake_type in ('DISPLACEMENT', 'AO'):
row.prop(rd, "bake_normalized")
col = layout.column()
col.active = (rd.bake_type == 'NORMALS')
col.prop(rd, "bake_normal_space")
# col.prop(rd, "bake_aa_mode")
# col.prop(rd, "bake_enable_aa")
col = layout.column()
row = col.row(align=True)
row.prop(rd, "bake_active")
row.prop(rd, "bake_normalized")
row = col.row(align=True)
row.prop(rd, "bake_clear")
row.prop(rd, "bake_margin")
row.prop(rd, "bake_quad_split", text="Split")
row = col.row(align=True)
row.active = rd.bake_active
row.prop(rd, "bake_distance")
row.prop(rd, "bake_bias")
row = layout.row(align=True)
row.prop(rd, "bake_clear")
row.prop(rd, "bake_margin")
bpy.types.register(RENDER_MT_presets)
bpy.types.register(RENDER_PT_render)

@ -1454,6 +1454,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem bake_qyad_split_items[] ={
{0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
{1, "FIXED", 0, "Fixed", "Split quads pradictably (0,1,2) (0,2,3)"},
{2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads pradictably (1,2,3) (1,3,0)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem bake_aa_items[] ={
{5, "AA_5", 0, "5", ""},
{8, "AA_8", 0, "8", ""},
@ -2148,13 +2154,17 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
RNA_def_property_enum_items(prop, bake_mode_items);
RNA_def_property_ui_text(prop, "Bake Mode", "");
RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
RNA_def_property_enum_items(prop, bake_normal_space_items);
RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, bake_qyad_split_items);
RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
RNA_def_property_enum_items(prop, bake_aa_items);
@ -2166,10 +2176,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
RNA_def_property_ui_text(prop, "Normalized", "");
//"Bake ambient occlusion normalized, without taking into acount material settings"
//"Normalized displacement value to fit the 'Dist' range"
// XXX: Need 1 tooltip here...
RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings.");
prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);