diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-09 00:40:44 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-09 00:40:44 +0400 |
commit | 1957a29c5af84b65402e9bea25f98ea6bffe3b3b (patch) | |
tree | bd4d15040f25f4014479219661e57663947a395a /source/blender/makesrna/intern | |
parent | c5664a86a030617cef63a771a39f7bf19a3ec66c (diff) | |
parent | 33bca3075f2cc8201b13a6f08b22d7a1288aab4d (diff) |
Merging r43952 through r43994 from trunk into soc-2011-tomato
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 24 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 33 |
3 files changed, 41 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index eed178b238d..de0cd6d9c59 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -232,7 +232,7 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports, /* note: it looks like there is no length limit on the srna id since its * just a char pointer, but take care here, also be careful that python - * owns the string pointer which it could potentually free while blender + * owns the string pointer which it could potentially free while blender * is running. */ if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) { BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 188ccccbfc4..9a90499d7df 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -80,7 +80,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings) { Mesh *tmpmesh; - Curve *tmpcu = NULL; + Curve *tmpcu = NULL, *copycu; Object *tmpobj = NULL; int render = settings == eModifierMode_Render, i; int cage = !apply_modifiers; @@ -101,22 +101,20 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ object_free_modifiers(tmpobj); /* copies the data */ - tmpobj->data = copy_curve( (Curve *) ob->data ); + copycu = tmpobj->data = copy_curve( (Curve *) ob->data ); -#if 0 - /* copy_curve() sets disp.first null, so currently not need */ - { - Curve *cu; - cu = (Curve *)tmpobj->data; - if( cu->disp.first ) - MEM_freeN( cu->disp.first ); - cu->disp.first = NULL; - } - -#endif + /* temporarily set edit so we get updates from edit mode, but + also because for text datablocks copying it while in edit + mode gives invalid data structures */ + copycu->editfont = tmpcu->editfont; + copycu->editnurb = tmpcu->editnurb; /* get updated display list, and convert to a mesh */ makeDispListCurveTypes( sce, tmpobj, 0 ); + + copycu->editfont = NULL; + copycu->editnurb = NULL; + nurbs_to_mesh( tmpobj ); /* nurbs_to_mesh changes the type to a mesh, check it worked */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 290552d394f..1060c1b52ac 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -710,7 +710,21 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *C, P * where 'BW' will force greyscale even if the output format writes * as RGBA, this is age old blender convention and not sure how useful * it really is but keep it for now - campbell */ - const char chan_flag= BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0); + char chan_flag= BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0); + +#ifdef WITH_FFMPEG + /* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support + * alpha channel. for example MPEG format with h264 codec can't do alpha channel, but + * the same MPEG format with QTRLE codec can easily handle alpga channel. + * not sure how to deal with such cases in a nicer way (sergey) */ + if(is_render) { + Scene *scene = ptr->id.data; + RenderData *rd = &scene->r; + + if (rd->ffcodecdata.codec == CODEC_ID_QTRLE) + chan_flag |= IMA_CHAN_FLAG_ALPHA; + } +#endif if (chan_flag == (IMA_CHAN_FLAG_BW|IMA_CHAN_FLAG_RGB|IMA_CHAN_FLAG_ALPHA)) { return image_color_mode_items; @@ -897,7 +911,16 @@ static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, int value) rd->ffcodecdata.flags |= FFMPEG_LOSSLESS_OUTPUT; else rd->ffcodecdata.flags &= ~FFMPEG_LOSSLESS_OUTPUT; - ffmpeg_verify_lossless_format(rd, &rd->im_format); + + ffmpeg_verify_codec_settings(rd); +} + +static void rna_FFmpegSettings_codec_settings_update(Main *UNUSED(bmain), Scene *UNUSED(scene_unused), PointerRNA *ptr) +{ + Scene *scene = (Scene *) ptr->id.data; + RenderData *rd = &scene->r; + + ffmpeg_verify_codec_settings(rd); } #endif @@ -2809,6 +2832,8 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna) {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""}, {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""}, {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""}, + {CODEC_ID_QTRLE, "QTRLE", 0, "QTRLE", ""}, + /* {CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},*/ /* disabled for after release */ {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem ffmpeg_audio_codec_items[] = { @@ -2840,13 +2865,13 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, ffmpeg_format_items); RNA_def_property_ui_text(prop, "Format", "Output file format"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_settings_update"); prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "codec"); RNA_def_property_enum_items(prop, ffmpeg_codec_items); RNA_def_property_ui_text(prop, "Codec", "FFmpeg codec to use"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_settings_update"); prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "video_bitrate"); |