diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-11-17 04:24:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-02-08 16:47:59 +0300 |
commit | fcdeee23b3ce58010692e949df65e4013279a499 (patch) | |
tree | d41104e6935478af838920cde6c6269a44ad546a | |
parent | 7431449db6bd37edb3458f4afbec9034fb1a324c (diff) |
Fix T50001: auto tile size addon broken after Cycles GPU device changes.v2.78bblender-v2.78b-release
Note the previous code to compute the number of GPU devices was wrong,
the number after MULTI_* did not indicate the number of devices.
-rw-r--r-- | render_auto_tile_size.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/render_auto_tile_size.py b/render_auto_tile_size.py index 8aef71dc..3625c0e1 100644 --- a/render_auto_tile_size.py +++ b/render_auto_tile_size.py @@ -146,7 +146,9 @@ def ats_poll(context): def engine_is_gpu(engine, device, userpref): - return engine == 'CYCLES' and device == 'GPU' and userpref.system.compute_device_type != 'NONE' + if engine == 'CYCLES' and device == 'GPU': + return userpref.addons['cycles'].preferences.has_active_device() + return False def get_tilesize_prop(engine, device, userpref): @@ -206,11 +208,7 @@ def get_threads(context, device): userpref = context.user_preferences if engine_is_gpu(engine, device, userpref): - gpu_device_str = userpref.system.compute_device - if 'MULTI' in gpu_device_str: - threads = int(gpu_device_str.split('_')[-1]) - else: - threads = 1 + threads = userpref.addons['cycles'].preferences.get_num_gpu_devices() else: threads = render.threads |