Revision: 23526 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23526 Author: campbellbarton Date: 2009-09-28 14:10:13 +0200 (Mon, 28 Sep 2009)
Log Message: ----------- jpeg2000 presets were broken. Modified Paths: -------------- trunk/blender/release/scripts/ui/buttons_scene.py trunk/blender/source/blender/makesrna/intern/rna_scene.c Modified: trunk/blender/release/scripts/ui/buttons_scene.py =================================================================== --- trunk/blender/release/scripts/ui/buttons_scene.py 2009-09-28 11:29:07 UTC (rev 23525) +++ trunk/blender/release/scripts/ui/buttons_scene.py 2009-09-28 12:10:13 UTC (rev 23526) @@ -254,12 +254,11 @@ split = layout.split() col = split.column() col.itemL(text="Depth:") - col.row().itemR(rd, "jpeg_depth", expand=True) + col.row().itemR(rd, "jpeg2k_depth", expand=True) col = split.column() - col.itemR(rd, "jpeg_preset", text="") - col.itemR(rd, "jpeg_ycc") - col.itemR(rd, "exr_preview") + col.itemR(rd, "jpeg2k_preset", text="") + col.itemR(rd, "jpeg2k_ycc") elif rd.file_format in ('CINEON', 'DPX'): split = layout.split() Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c =================================================================== --- trunk/blender/source/blender/makesrna/intern/rna_scene.c 2009-09-28 11:29:07 UTC (rev 23525) +++ trunk/blender/source/blender/makesrna/intern/rna_scene.c 2009-09-28 12:10:13 UTC (rev 23526) @@ -257,6 +257,41 @@ #endif } +void rna_SceneRenderData_jpeg2k_preset_update(RenderData *rd) +{ + rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS); + + switch(rd->jp2_depth) { + case 8: break; + case 12: rd->subimtype |= R_JPEG2K_12BIT; break; + case 16: rd->subimtype |= R_JPEG2K_16BIT; break; + } + + switch(rd->jp2_preset) { + case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break; + case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break; + case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break; + case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break; + case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break; + case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break; + case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break; + } +} + +static void rna_SceneRenderData_jpeg2k_preset_set(PointerRNA *ptr, int value) +{ + RenderData *rd= (RenderData*)ptr->data; + rd->jp2_preset= value; + rna_SceneRenderData_jpeg2k_preset_update(rd); +} + +static void rna_SceneRenderData_jpeg2k_depth_set(PointerRNA *ptr, int value) +{ + RenderData *rd= (RenderData*)ptr->data; + rd->jp2_depth= value; + rna_SceneRenderData_jpeg2k_preset_update(rd); +} + static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr) { RenderData *rd= (RenderData*)ptr->data; @@ -1229,19 +1264,19 @@ #ifdef WITH_OPENJPEG static EnumPropertyItem jp2_preset_items[] = { {0, "NO_PRESET", 0, "No Preset", ""}, - {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""}, - {2, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""}, - {3, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 4096x2160", ""}, - {4, "R_JPEG2K_CINE_PRESET", 0, "Cine-Scope 24fps 2048x858", ""}, - {5, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""}, - {6, "R_JPEG2K_CINE_PRESET", 0, "Cine-Flat 24fps 1998x1080", ""}, - {7, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""}, + {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""}, + {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""}, + {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""}, + {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""}, + {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""}, + {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""}, + {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem jp2_depth_items[] = { - {0, "8", 0, "8", ""}, - {R_JPEG2K_12BIT, "16", 0, "16", ""}, - {R_JPEG2K_16BIT, "32", 0, "32", ""}, + {8, "8", 0, "8", "8 bit color channels"}, + {12, "12", 0, "12", "12 bit color channels"}, + {16, "16", 0, "16", "16 bit color channels"}, {0, NULL, 0, NULL, NULL}}; #endif @@ -1414,19 +1449,21 @@ #ifdef WITH_OPENJPEG /* Jpeg 2000 */ - prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_preset"); + prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "jp2_preset"); RNA_def_property_enum_items(prop, jp2_preset_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_preset_set", NULL); RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "jpeg_depth", PROP_ENUM, PROP_NONE); + prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth"); RNA_def_property_enum_items(prop, jp2_depth_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_depth_set", NULL); RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "jpeg_ycc", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC); RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs