svn merge ^/trunk/blender -r43381:43392
[blender.git] / source / blender / makesrna / intern / rna_scene.c
index 2d381b023cf5795d14b548e81cb466dcdfc546b0..0dbc0f63d4dc3084c2d79eb5feeba1dddf4bba5d 100644 (file)
@@ -246,6 +246,7 @@ EnumPropertyItem image_color_depth_items[] = {
 #include "BLI_threads.h"
 #include "BLI_editVert.h"
 
+#include "BKE_brush.h"
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
@@ -1290,6 +1291,25 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
        }
 }
 
+static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
+{
+       UnifiedPaintSettings* ups = ptr->data;
+
+       /* scale unprojected radius so it stays consistent with brush size */
+       brush_scale_unprojected_radius(&ups->unprojected_radius,
+                                                                  value, ups->size);
+       ups->size= value;
+}
+
+static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, float value)
+{
+       UnifiedPaintSettings* ups = ptr->data;
+
+       /* scale brush size so it stays consistent with unprojected_radius */
+       brush_scale_size(&ups->size, value, ups->unprojected_radius);
+       ups->unprojected_radius= value;
+}
+
 /* note: without this, when Multi-Paint is activated/deactivated, the colors
  * will not change right away when multiple bones are selected, this function
  * is not for general use and only for the few cases where changing scene
@@ -1656,11 +1676,13 @@ static void rna_def_unified_paint_settings(BlenderRNA  *brna)
        /* unified paint settings that override the equivalent settings
           from the active brush */
        prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+       RNA_def_property_int_funcs(prop, NULL, "rna_UnifiedPaintSettings_size_set", NULL);
        RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
        RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
        RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
 
        prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
+       RNA_def_property_float_funcs(prop, NULL, "rna_UnifiedPaintSettings_unprojected_radius_set", NULL);
        RNA_def_property_range(prop, 0.001, FLT_MAX);
        RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
        RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
@@ -2778,7 +2800,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
        prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flags", FFMPEG_LOSSLESS_OUTPUT);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_FFmpegSettings_lossless_output_set");
-       RNA_def_property_ui_text(prop, "Lossless Output", "Use losslecc output for video streams");
+       RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams");
        RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
 
        /* FFMPEG Audio*/