Merging r42442 through r42457 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Dec 2011 09:27:18 +0000 (09:27 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Dec 2011 09:27:18 +0000 (09:27 +0000)
12 files changed:
build_files/cmake/cmake_qtcreator_project.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_sync.cpp
intern/cycles/util/util_md5.cpp
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/startup/bl_operators/object_randomize_transform.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py
source/blender/editors/interface/interface_handlers.c
source/blender/editors/screen/screendump.c
source/blender/editors/space_view3d/drawobject.c

index 07ffa6594371d6295c19cdba4ba97c4f7401907a..8cabc75e42679b6756f5fd0204f2a41e59e1bfe6 100755 (executable)
@@ -47,6 +47,13 @@ import os
 import sys
 
 
+def quote_define(define):
+    if " " in define.strip():
+        return '"%s"' % define
+    else:
+        return define
+
+
 def create_qtc_project_main():
     files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
     files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
@@ -99,7 +106,7 @@ def create_qtc_project_main():
         qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
         f = open(qtc_cfg, 'w')
         f.write("// ADD PREDEFINED MACROS HERE!\n")
-        defines_final = [("#define %s %s" % item) for item in defines]
+        defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
         if sys.platform != "win32":
             defines_final += cmake_compiler_defines()
         f.write("\n".join(defines_final))
index d23347b937d2c234c0241db4c85ac43152eedd31..d631158f5eba29c1aa15f9b9615b4cf6ae6c4ecc 100644 (file)
@@ -725,6 +725,7 @@ def draw_device(self, context):
         if experimental and cscene.device == 'CPU' and engine.with_osl():
             layout.prop(cscene, "shading_system")
 
+
 def draw_pause(self, context):
     layout = self.layout
     scene = context.scene
index f7b1ca53fd3bc302701101abbc30f96548541a09..b89b7ebb9be8ffa50344acbe799631d47399a270 100644 (file)
@@ -264,7 +264,12 @@ SessionParams BlenderSync::get_session_params(BL::Scene b_scene, bool background
 
        if(RNA_enum_get(&cscene, "device") != 0) {
                vector<DeviceType> types = Device::available_types();
-               DeviceType dtype = (RNA_enum_get(&cscene, "gpu_type") == 0)? DEVICE_CUDA: DEVICE_OPENCL;
+               DeviceType dtype;
+               
+               if(!experimental || RNA_enum_get(&cscene, "gpu_type") == 0)
+                       dtype = DEVICE_CUDA;
+               else
+                       dtype = DEVICE_CUDA;
 
                if(device_type_available(types, dtype))
                        params.device_type = dtype;
index b871fad363646f91650ae1bc68d748103830e145..25a77f18d0247ff77c508b0e6bc12656197910d0 100644 (file)
@@ -361,14 +361,15 @@ void MD5Hash::finish(uint8_t digest[16])
 string MD5Hash::get_hex()
 {
        uint8_t digest[16];
-       char buf[16*2];
+       char buf[16*2+1];
 
        finish(digest);
 
        for(int i=0; i<16; i++)
                sprintf(buf + i*2, "%02X", digest[i]);
+       buf[sizeof(buf)-1] = '\0';
        
-       return string(buf, sizeof(buf));
+       return string(buf);
 }
 
 CCL_NAMESPACE_END
index 3d71feaf79ea919e593e8e86c5d25bbd5769423d..90f0d3f1c1daa4540c349191d82f28dda5468a86 100644 (file)
@@ -269,8 +269,6 @@ def axis_conversion_ensure(operator, forward_attr, up_attr):
 
         return axis_forward, axis_up
 
-    change = False
-
     axis = getattr(operator, forward_attr), getattr(operator, up_attr)
     axis_new = validate(*axis)
 
index 965231218a49fb4713b4f50e4ebdf2858c30a82a..f0d2448b508c725e99fca7cee4a6ed5420a474d2 100644 (file)
@@ -62,7 +62,9 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
             else:
                 org_sca_x, org_sca_y, org_sca_z = obj.scale
 
-            sca_x, sca_y, sca_z = uniform(-scale[0]+2, scale[0]), uniform(-scale[1]+2, scale[1]), uniform(-scale[2]+2, scale[2])
+            sca_x, sca_y, sca_z = (uniform(-scale[0] + 2.0, scale[0]),
+                                   uniform(-scale[1] + 2.0, scale[1]),
+                                   uniform(-scale[2] + 2.0, scale[2]))
 
             if scale_even:
                 aX = sca_x * org_sca_x
@@ -81,7 +83,9 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
             uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0)
 
 
-from bpy.props import IntProperty, BoolProperty, FloatProperty, FloatVectorProperty
+from bpy.props import (IntProperty,
+                       BoolProperty,
+                       FloatVectorProperty)
 
 
 class RandomizeLocRotSize(Operator):
index d5350e81a88a9fb033d5c0ded105edb72baae0e4..4b4c2d2b214cde5d2bd48678b5d7e03c9e7f392f 100644 (file)
@@ -453,7 +453,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
 
         rd = context.scene.render
         image_settings = rd.image_settings
-        file_format = rd.image_settings.file_format
+        file_format = image_settings.file_format
 
         layout.prop(rd, "filepath", text="")
 
@@ -462,7 +462,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
         flow.prop(rd, "use_placeholder")
         flow.prop(rd, "use_file_extension")
 
-        layout.template_image_settings(rd.image_settings)
+        layout.template_image_settings(image_settings)
 
         if file_format == 'QUICKTIME_CARBON':
             layout.operator("scene.render_data_set_quicktime_codec")
index d16b2f15f524cead811b46928601f1eeb51a8bbe..358f1e1223975ae5333ef4a147dc8cdde62d9191 100644 (file)
@@ -166,7 +166,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel, Panel):
             layout.template_preview(tex, parent=idblock, slot=slot)
         else:
             layout.template_preview(tex, slot=slot)
-            
+
         #Show Alpha Button for Brush Textures, see #29502
         if context.space_data.texture_context == 'BRUSH':
             layout.prop(tex, "use_preview_alpha")
index 623ac8dc13143f0a2dd8d5075055c29aebce66c1..139f674d6e80f02c043a8e1ffc61d275df82316b 100644 (file)
@@ -120,7 +120,7 @@ class CLIP_PT_tools_marker(Panel):
             row.menu('CLIP_MT_tracking_settings_presets', text=label)
             row.operator("clip.tracking_settings_preset_add",
                          text="", icon='ZOOMIN')
-            props = row.operator("clip.track_color_preset_add",
+            props = row.operator("clip.tracking_settings_preset_add",
                                  text="", icon='ZOOMOUT')
             props.remove_active = True
 
@@ -161,7 +161,7 @@ class CLIP_PT_tools_tracking(Panel):
 
     def draw(self, context):
         layout = self.layout
-        clip = context.space_data.clip
+        # clip = context.space_data.clip  # UNUSED
 
         row = layout.row(align=True)
 
index c24d07f73b99e31bcebca01915ee4d406419a7bd..c6159487145d0428ea03c9d0375c34b6e22fa7aa 100644 (file)
@@ -5241,9 +5241,10 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
 
        data->state= state;
 
-       if(state != BUTTON_STATE_EXIT) {
+       if(!ELEM(state, BUTTON_STATE_EXIT, BUTTON_STATE_HIGHLIGHT)) {
                /* When objects for eg. are removed, running ui_check_but()
-                * can access the removed data - so disable update on exit */
+                * can access the removed data - so disable update on exit
+                * or highlight */
                ui_check_but(but);
        }
 
index 7c76766affa789ede4bb650583241dab1e06dbb5..31aab95675498e33b5c3f1f89b8cdc63937ff534 100644 (file)
@@ -218,8 +218,6 @@ static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
 
 void SCREEN_OT_screenshot(wmOperatorType *ot)
 {
-       PropertyRNA *prop;
-
        ot->name= "Save Screenshot"; /* weak: opname starting with 'save' makes filewindow give save-over */
        ot->idname= "SCREEN_OT_screenshot";
        
@@ -231,7 +229,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
        ot->flag= 0;
        
        WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
-       prop= RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
+       RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
 }
 
 /* *************** screenshot movie job ************************* */
index a36f49a35d8f031e11ebc6192d75b3d5d9e3d0ac..3333149ec37fc45f0f0311982445ae0f13211969 100644 (file)
@@ -3018,7 +3018,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
        int /* totvert,*/ totedge, totface;
        DerivedMesh *dm= mesh_get_derived_final(scene, ob, scene->customdata_mask);
        ModifierData *md = NULL;
-       const short is_obact= (ob != NULL && ob == OBACT);
+       const short is_obact= (ob == OBACT);
        int draw_flags = (is_obact && paint_facesel_test(ob)) ? DRAW_FACE_SELECT : 0;
 
        if(!dm)
@@ -6140,7 +6140,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
        int /*sel, drawtype,*/ colindex= 0;
        int i, selstart, selend, empty_object=0;
        short dt, dtx, zbufoff= 0;
-       const short is_obact= (ob != NULL && ob == OBACT);
+       const short is_obact= (ob == OBACT);
 
        /* only once set now, will be removed too, should become a global standard */
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);