Merge branch 'blender2.7'
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 30 Jan 2019 17:36:54 +0000 (18:36 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 30 Jan 2019 17:36:54 +0000 (18:36 +0100)
1  2 
intern/cycles/blender/addon/properties.py
intern/cycles/blender/blender_python.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/device/device.cpp
intern/cycles/device/device.h

@@@ -741,27 -766,21 +741,21 @@@ SessionParams BlenderSync::get_session_
        /* Background */
        params.background = background;
  
-       /* device type */
-       vector<DeviceInfo>& devices = Device::available_devices();
-       /* device default CPU */
-       foreach(DeviceInfo& device, devices) {
-               if(device.type == DEVICE_CPU) {
-                       params.device = device;
-                       break;
-               }
-       }
+       /* Default to CPU device. */
+       params.device = Device::available_devices(DEVICE_MASK_CPU).front();
  
        if(get_enum(cscene, "device") == 2) {
-               /* find network device */
-               foreach(DeviceInfo& info, devices)
-                       if(info.type == DEVICE_NETWORK)
-                               params.device = info;
+               /* Find network device. */
+               vector<DeviceInfo> devices = Device::available_devices(DEVICE_MASK_NETWORK);
+               if(!devices.empty()) {
+                       params.device = devices.front();
+               }
        }
        else if(get_enum(cscene, "device") == 1) {
+               /* Find cycles preferences. */
                PointerRNA b_preferences;
  
 -              BL::UserPreferences::addons_iterator b_addon_iter;
 +              BL::Preferences::addons_iterator b_addon_iter;
                for(b_userpref.addons.begin(b_addon_iter); b_addon_iter != b_userpref.addons.end(); ++b_addon_iter) {
                        if(b_addon_iter->module() == "cycles") {
                                b_preferences = b_addon_iter->preferences().ptr;
Simple merge
Simple merge