diff options
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 4 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 3 | ||||
-rw-r--r-- | intern/cycles/render/integrator.h | 4 | ||||
-rw-r--r-- | intern/cycles/render/session.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 2 |
7 files changed, 19 insertions, 6 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 4933c849e0d..c6777bb32bf 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -192,13 +192,13 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): samples: IntProperty( name="Samples", description="Number of samples to render for each pixel", - min=1, max=2147483647, + min=1, max=(1 << 24), default=128, ) preview_samples: IntProperty( name="Preview Samples", description="Number of samples to render in the viewport, unlimited if 0", - min=0, max=2147483647, + min=0, max=(1 << 24), default=32, ) preview_pause: BoolProperty( diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index af936bbe7f6..91317cbb81b 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -769,6 +769,9 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine, } } + /* Clamp samples. */ + params.samples = min(params.samples, Integrator::MAX_SAMPLES); + /* tiles */ const bool is_cpu = (params.device.type == DEVICE_CPU); if(!is_cpu && !background) { diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h index 6a7e2056851..da4e61d8153 100644 --- a/intern/cycles/render/integrator.h +++ b/intern/cycles/render/integrator.h @@ -55,6 +55,10 @@ public: float sample_clamp_indirect; bool motion_blur; + /* Maximum number of samples, beyond which we are likely to run into + * precision issues for sampling patterns. */ + static const int MAX_SAMPLES = (1 << 24); + int aa_samples; int diffuse_samples; int glossy_samples; diff --git a/intern/cycles/render/session.h b/intern/cycles/render/session.h index e3cccbb9fcf..cbdfc75a905 100644 --- a/intern/cycles/render/session.h +++ b/intern/cycles/render/session.h @@ -84,7 +84,7 @@ public: progressive = false; experimental = false; - samples = INT_MAX; + samples = 1024; tile_size = make_int2(64, 64); start_resolution = INT_MAX; pixel_size = 1; diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f783c4a6906..1e079835ec5 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3191,7 +3191,7 @@ static void ui_but_build_drawstr_int(uiBut *but, int value) * \param validate: When set, this function may change the button value. * Otherwise treat the button value as read-only. */ -void ui_but_update_ex(uiBut *but, const bool validate) +static void ui_but_update_ex(uiBut *but, const bool validate) { /* if something changed in the button */ double value = UI_BUT_VALUE_UNSET; @@ -3199,7 +3199,7 @@ void ui_but_update_ex(uiBut *but, const bool validate) ui_but_update_select_flag(but, &value); /* only update soft range while not editing */ - if (!(but->editval || but->editstr || but->editvec)) { + if (!ui_but_is_editing(but)) { if ((but->rnaprop != NULL) || (but->poin && (but->pointype & UI_BUT_POIN_TYPES))) { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 498e2f07ea4..a52a9633729 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6979,6 +6979,12 @@ bool ui_but_is_active(ARegion *ar) return (ui_but_find_active_in_region(ar) != NULL); } +bool ui_but_is_editing(uiBut *but) +{ + uiHandleButtonData *data = but->active; + return (data && ELEM(data->state, BUTTON_STATE_TEXT_EDITING, BUTTON_STATE_NUM_EDITING)); +} + /* is called by notifier */ void UI_screen_free_active_but(const bContext *C, bScreen *screen) { diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 9d3f2088ab4..e5f6f09e2eb 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -523,7 +523,6 @@ extern uiButExtraIconType ui_but_icon_extra_get(uiBut *but); extern void ui_but_default_set(struct bContext *C, const bool all, const bool use_afterfunc); -extern void ui_but_update_ex(uiBut *but, const bool validate); extern void ui_but_update(uiBut *but); extern void ui_but_update_edited(uiBut *but); extern bool ui_but_is_float(const uiBut *but) ATTR_WARN_UNUSED_RESULT; @@ -728,6 +727,7 @@ extern void ui_but_execute_begin(struct bContext *C, struct ARegion *ar, uiBut * extern void ui_but_execute_end(struct bContext *C, struct ARegion *ar, uiBut *but, void *active_back); extern void ui_but_active_free(const struct bContext *C, uiBut *but); extern bool ui_but_is_active(struct ARegion *ar) ATTR_WARN_UNUSED_RESULT; +extern bool ui_but_is_editing(uiBut *but); extern int ui_but_menu_direction(uiBut *but); extern void ui_but_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but, const bool restore); extern uiBut *ui_but_find_select_in_enum(uiBut *but, int direction); |