Merging r38733 through r38779 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 28 Jul 2011 11:01:38 +0000 (11:01 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 28 Jul 2011 11:01:38 +0000 (11:01 +0000)
28 files changed:
doc/python_api/sphinx_doc_gen.sh
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_operators/screen_play_rendered_anim.py
release/scripts/startup/bl_ui/space_text.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/text.c
source/blender/collada/MaterialExporter.cpp
source/blender/collada/MaterialExporter.h
source/blender/editors/armature/editarmature.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_material.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_scene.c

index 5f23ca395b6f7cafabd5e137d875b3e65892e523..a3befe1b7cb9d2928a177bed37a7299cd4364233 100755 (executable)
@@ -38,8 +38,11 @@ cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
 ssh $SSH_USER@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
 rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
 
-# symlink the dir to a static URL
-ssh $SSH_USER@emo.blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
+## symlink the dir to a static URL
+#ssh $SSH_USER@emo.blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
+
+# better redirect
+ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
 
 # pdf
 sphinx-build -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
index 9545e20b025cccee97da5fdeee5bcc03fb45d2cb..bd01897c639aeaabc8498936bd79dcbcda53f7ca 100644 (file)
@@ -203,7 +203,7 @@ def axis_conversion_ensure(operator, forward_attr, up_attr):
 
 # return a tuple (free, object list), free is True if memory should be freed later with free_derived_objects()
 def create_derived_objects(scene, ob):
-    if ob.parent and ob.parent.dupli_type != 'NONE':
+    if ob.parent and ob.parent.dupli_type in {'VERTS', 'FACES'}:
         return False, None
 
     if ob.dupli_type != 'NONE':
index 0f0491e249efc57e2d04ce75cec2f8a60e2ee36f..627a1530fe15657c1bcf3aad7a7f93bd446faa28 100644 (file)
@@ -16,7 +16,7 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# <pep8 compliant>
+# <pep8-80 compliant>
 
 import bpy
 from bpy.props import StringProperty, BoolProperty, EnumProperty, IntProperty
@@ -54,21 +54,35 @@ class SelectPattern(bpy.types.Operator):
         else:
             pattern_match = (lambda a, b:
                                  fnmatch.fnmatchcase(a.upper(), b.upper()))
-
+        is_ebone = False
         obj = context.object
         if obj and obj.mode == 'POSE':
             items = obj.data.bones
+            if not self.extend:
+                bpy.ops.pose.select_all(action='DESELECT')
         elif obj and obj.type == 'ARMATURE' and obj.mode == 'EDIT':
             items = obj.data.edit_bones
+            if not self.extend:
+                bpy.ops.armature.select_all(action='DESELECT')
+            is_ebone = True
         else:
             items = context.visible_objects
+            if not self.extend:
+                bpy.ops.object.select_all(action='DESELECT')
 
         # Can be pose bones or objects
         for item in items:
             if pattern_match(item.name, self.pattern):
                 item.select = True
-            elif not self.extend:
-                item.select = False
+
+                # hrmf, perhaps there should be a utility function for this.
+                if is_ebone:
+                    item.select_head = True
+                    item.select_tail = True
+                    if item.use_connect:
+                        item_parent = item.parent
+                        if item_parent is not None:
+                            item_parent.select_tail = True
 
         return {'FINISHED'}
 
@@ -107,7 +121,8 @@ class SelectCamera(bpy.types.Operator):
 
 
 class SelectHierarchy(bpy.types.Operator):
-    '''Select object relative to the active objects position in the hierarchy'''
+    '''Select object relative to the active objects position''' \
+    '''in the hierarchy'''
     bl_idname = "object.select_hierarchy"
     bl_label = "Select Hierarchy"
     bl_options = {'REGISTER', 'UNDO'}
@@ -332,53 +347,90 @@ class ShapeTransfer(bpy.types.Operator):
             ob_add_shape(ob_other, orig_key_name)
 
             # editing the final coords, only list that stores wrapped coords
-            target_shape_coords = [v.co for v in ob_other.active_shape_key.data]
+            target_shape_coords = [v.co for v in
+                                   ob_other.active_shape_key.data]
 
             median_coords = [[] for i in range(len(me.vertices))]
 
             # Method 1, edge
             if mode == 'OFFSET':
                 for i, vert_cos in enumerate(median_coords):
-                    vert_cos.append(target_coords[i] + (orig_shape_coords[i] - orig_coords[i]))
+                    vert_cos.append(target_coords[i] +
+                                    (orig_shape_coords[i] - orig_coords[i]))
 
             elif mode == 'RELATIVE_FACE':
                 for face in me.faces:
                     i1, i2, i3, i4 = face.vertices_raw
                     if i4 != 0:
                         pt = barycentric_transform(orig_shape_coords[i1],
-                            orig_coords[i4], orig_coords[i1], orig_coords[i2],
-                            target_coords[i4], target_coords[i1], target_coords[i2])
+                                                   orig_coords[i4],
+                                                   orig_coords[i1],
+                                                   orig_coords[i2],
+                                                   target_coords[i4],
+                                                   target_coords[i1],
+                                                   target_coords[i2],
+                                                   )
                         median_coords[i1].append(pt)
 
                         pt = barycentric_transform(orig_shape_coords[i2],
-                            orig_coords[i1], orig_coords[i2], orig_coords[i3],
-                            target_coords[i1], target_coords[i2], target_coords[i3])
+                                                   orig_coords[i1],
+                                                   orig_coords[i2],
+                                                   orig_coords[i3],
+                                                   target_coords[i1],
+                                                   target_coords[i2],
+                                                   target_coords[i3],
+                                                   )
                         median_coords[i2].append(pt)
 
                         pt = barycentric_transform(orig_shape_coords[i3],
-                            orig_coords[i2], orig_coords[i3], orig_coords[i4],
-                            target_coords[i2], target_coords[i3], target_coords[i4])
+                                                   orig_coords[i2],
+                                                   orig_coords[i3],
+                                                   orig_coords[i4],
+                                                   target_coords[i2],
+                                                   target_coords[i3],
+                                                   target_coords[i4],
+                                                   )
                         median_coords[i3].append(pt)
 
                         pt = barycentric_transform(orig_shape_coords[i4],
-                            orig_coords[i3], orig_coords[i4], orig_coords[i1],
-                            target_coords[i3], target_coords[i4], target_coords[i1])
+                                                   orig_coords[i3],
+                                                   orig_coords[i4],
+                                                   orig_coords[i1],
+                                                   target_coords[i3],
+                                                   target_coords[i4],
+                                                   target_coords[i1],
+                                                   )
                         median_coords[i4].append(pt)
 
                     else:
                         pt = barycentric_transform(orig_shape_coords[i1],
-                            orig_coords[i3], orig_coords[i1], orig_coords[i2],
-                            target_coords[i3], target_coords[i1], target_coords[i2])
+                                                   orig_coords[i3],
+                                                   orig_coords[i1],
+                                                   orig_coords[i2],
+                                                   target_coords[i3],
+                                                   target_coords[i1],
+                                                   target_coords[i2],
+                                                   )
                         median_coords[i1].append(pt)
 
                         pt = barycentric_transform(orig_shape_coords[i2],
-                            orig_coords[i1], orig_coords[i2], orig_coords[i3],
-                            target_coords[i1], target_coords[i2], target_coords[i3])
+                                                   orig_coords[i1],
+                                                   orig_coords[i2],
+                                                   orig_coords[i3],
+                                                   target_coords[i1],
+                                                   target_coords[i2],
+                                                   target_coords[i3],
+                                                   )
                         median_coords[i2].append(pt)
 
                         pt = barycentric_transform(orig_shape_coords[i3],
-                            orig_coords[i2], orig_coords[i3], orig_coords[i1],
-                            target_coords[i2], target_coords[i3], target_coords[i1])
+                                                   orig_coords[i2],
+                                                   orig_coords[i3],
+                                                   orig_coords[i1],
+                                                   target_coords[i2],
+                                                   target_coords[i3],
+                                                   target_coords[i1],
+                                                   )
                         median_coords[i3].append(pt)
 
             elif mode == 'RELATIVE_EDGE':
@@ -416,7 +468,8 @@ class ShapeTransfer(bpy.types.Operator):
                     if use_clamp:
                         # clamp to the same movement as the original
                         # breaks copy between different scaled meshes.
-                        len_from = (orig_shape_coords[i] - orig_coords[i]).length
+                        len_from = (orig_shape_coords[i] -
+                                    orig_coords[i]).length
                         ofs = co - target_coords[i]
                         ofs.length = len_from
                         co = target_coords[i] + ofs
@@ -498,7 +551,13 @@ class JoinUVs(bpy.types.Operator):
                             mesh_other.tag = True
 
                             if len(mesh_other.faces) != len_faces:
-                                self.report({'WARNING'}, "Object: %s, Mesh: '%s' has %d faces, expected %d\n" % (obj_other.name, mesh_other.name, len(mesh_other.faces), len_faces))
+                                self.report({'WARNING'}, "Object: %s, Mesh: "
+                                            "'%s' has %d faces, expected %d\n"
+                                            % (obj_other.name,
+                                               mesh_other.name,
+                                               len(mesh_other.faces),
+                                               len_faces),
+                                               )
                             else:
                                 uv_other = mesh_other.uv_textures.active
                                 if not uv_other:
index 4b3435eacbe410af02d0c49d86122ee591f7f19b..a38d817d738f281d9a99e4fe768afc79442f428c 100644 (file)
@@ -110,6 +110,31 @@ class PlayRenderedAnim(bpy.types.Operator):
         cmd = [player_path]
         # extra options, fps controls etc.
         if preset == 'BLENDER24':
+            # -----------------------------------------------------------------
+            # Check blender is not 2.5x until it supports playback again
+            try:
+                process = subprocess.Popen([player_path, '--version'],
+                                           stdout=subprocess.PIPE,
+                                           )
+            except:
+                # ignore and allow the main execution to catch the problem.
+                process = None
+
+            if process is not None:
+                process.wait()
+                out = process.stdout.read()
+                process.stdout.close()
+                out_split = out.strip().split()
+                if out_split[0] == b'Blender':
+                    if not out_split[1].startswith(b'2.4'):
+                        self.report({'ERROR'},
+                                    "Blender %s doesn't support playback: %r" %
+                                    (out_split[1].decode(), player_path))
+                        return {'CANCELLED'}
+                del out, out_split
+            del process
+            # -----------------------------------------------------------------
+
             opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), file]
             cmd.extend(opts)
         elif preset == 'DJV':
@@ -146,5 +171,6 @@ class PlayRenderedAnim(bpy.types.Operator):
             self.report({'ERROR'},
                         "Couldn't run external animation player with command "
                         "%r\n%s" % (" ".join(cmd), str(e)))
+            return {'CANCELLED'}
 
         return {'FINISHED'}
index 582c9442a4a2ce56273ab9fd169d0c17780eaf82..b787fc5cf75f26f197f6c3b79226b864d5ec1409 100644 (file)
@@ -33,22 +33,21 @@ class TEXT_HT_header(bpy.types.Header):
         row.template_header()
 
         if context.area.show_menus:
-            sub = row.row(align=True)
-            sub.menu("TEXT_MT_view")
-            sub.menu("TEXT_MT_text")
+            row.menu("TEXT_MT_view")
+            row.menu("TEXT_MT_text")
 
             if text:
-                sub.menu("TEXT_MT_edit")
-                sub.menu("TEXT_MT_format")
+                row.menu("TEXT_MT_edit")
+                row.menu("TEXT_MT_format")
 
-            sub.menu("TEXT_MT_templates")
+            row.menu("TEXT_MT_templates")
 
         if text and text.is_modified:
-            row = layout.row()
-            row.alert = True
-            row.operator("text.resolve_conflict", text="", icon='HELP')
+            sub = row.row()
+            sub.alert = True
+            sub.operator("text.resolve_conflict", text="", icon='HELP')
 
-        layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
+        row.template_ID(st, "text", new="text.new", unlink="text.unlink")
 
         row = layout.row(align=True)
         row.prop(st, "show_line_numbers", text="")
index 6f167416a917ba64fdb49ae72fff60a2f3121909..be410eaabed46ba583743e83545edbda634eb52f 100644 (file)
@@ -79,19 +79,22 @@ class VIEW3D_HT_header(bpy.types.Header):
                     row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
 
         # Snap
+        snap_element = toolsettings.snap_element
         row = layout.row(align=True)
         row.prop(toolsettings, "use_snap", text="")
         row.prop(toolsettings, "snap_element", text="", icon_only=True)
-        if toolsettings.snap_element != 'INCREMENT':
+        if snap_element != 'INCREMENT':
             row.prop(toolsettings, "snap_target", text="")
-            if obj and obj.mode == 'OBJECT':
-                row.prop(toolsettings, "use_snap_align_rotation", text="")
-        if toolsettings.snap_element == 'VOLUME':
+            if obj:
+                if obj.mode == 'OBJECT':
+                    row.prop(toolsettings, "use_snap_align_rotation", text="")
+                elif obj.mode == 'EDIT':
+                    row.prop(toolsettings, "use_snap_self", text="")
+
+        if snap_element == 'VOLUME':
             row.prop(toolsettings, "use_snap_peel_object", text="")
-        elif toolsettings.snap_element == 'FACE':
+        elif snap_element == 'FACE':
             row.prop(toolsettings, "use_snap_project", text="")
-            if toolsettings.use_snap_project and obj.mode == 'EDIT':
-                row.prop(toolsettings, "use_snap_project_self", text="")
 
         # OpenGL render
         row = layout.row(align=True)
index 3abfa05e1fd5bb6ff88f4f7b788fe58dd8c38aba..662c872b7f1cdf6a28c9bff287e2bfaa13a04257 100644 (file)
@@ -1287,6 +1287,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
                                                QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
                                                offset += sizeof(float)*4;
                                        }
+                                       (void)offset;
                                }
                                curface++;
                                if(mface->v4) {
@@ -1327,6 +1328,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
                                                        QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
                                                        offset += sizeof(float)*4;
                                                }
+                                               (void)offset;
                                        }
                                        curface++;
                                        i++;
index 45faba8439c728e72e16643cadf511d771edbb9f..8d19322c0db5b7355df04251fc6ef11fdbef3aaf 100644 (file)
@@ -466,7 +466,6 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
                        MDisps tris[2];
                        int vindex[4] = {0};
 
-                       S = 0;
                        for(i = 0; i < 2; i++)
                                for(y = 0; y < 4; y++)
                                        for(x = 0; x < 4; x++)
index 962c7fd5e863caf6b60aa7f80673b7d5304ce678..3f01c55e935bdba3be7115db0fd3556a7cc2bc24 100644 (file)
@@ -550,7 +550,7 @@ Material *material_pop_id(ID *id, int index)
                                Material **mat;
 
                                if(index + 1 != (*totcol))
-                                       memmove((*matar), (*matar) + 1, sizeof(void *) * ((*totcol) - (index + 1)));
+                                       memmove((*matar)+index, (*matar)+(index+1), sizeof(void *) * ((*totcol) - (index + 1)));
 
                                (*totcol)--;
                                
index fbb5a77fa0409bd013de4b6d2c754f8ff6501e3a..8c19b0c15c3f8cb2b0dab7fab245dde31312b406 100644 (file)
@@ -2373,7 +2373,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
        /*      Blancmange (bmange@airdmhor.gen.nz) */
 
        k = -1.0f/(2.0f*(float)M_PI*blur*blur);
-       fval=0;
+
        for (ix = 0;ix< halfWidth;ix++){
                weight = (float)exp(k*(ix*ix));
                filter[halfWidth - ix] = weight;
index 56723476251f6fc264b10e618377544c8fba9c2e..2c507370288a8d339ae7c0baa231eb7cac9299a6 100644 (file)
@@ -1423,6 +1423,8 @@ void txt_insert_buf(Text *text, const char *in_buffer)
        }
 
        undoing= u;
+
+       (void)count;
 }
 
 /******************/
index a44fa6802f20a3a460d2007455d69e1f84abfa5d..9d29177578dbedc9290aa9a598ee807426807a30 100644 (file)
@@ -37,12 +37,36 @@ MaterialsExporter::MaterialsExporter(COLLADASW::StreamWriter *sw): COLLADASW::Li
 
 void MaterialsExporter::exportMaterials(Scene *sce, bool export_selected)
 {
-       openLibrary();
+       if(hasMaterials(sce)) {
+               openLibrary();
 
-       MaterialFunctor mf;
-       mf.forEachMaterialInScene<MaterialsExporter>(sce, *this, export_selected);
+               MaterialFunctor mf;
+               mf.forEachMaterialInScene<MaterialsExporter>(sce, *this, export_selected);
 
-       closeLibrary();
+               closeLibrary();
+       }
+}
+
+
+bool MaterialsExporter::hasMaterials(Scene *sce)
+{
+       Base *base = (Base *)sce->base.first;
+       
+       while(base) {
+               Object *ob= base->object;
+               int a;
+               for(a = 0; a < ob->totcol; a++)
+               {
+                       Material *ma = give_current_material(ob, a+1);
+
+                       // no material, but check all of the slots
+                       if (!ma) continue;
+
+                       return true;
+               }
+               base= base->next;
+       }
+       return false;
 }
 
 void MaterialsExporter::operator()(Material *ma, Object *ob)
index 0a7a276d8576c5cde574c81f7edbfaaa97bc0fa5..c080e4b05965fed78c68eb5b44a30053ec020bba 100644 (file)
@@ -51,6 +51,9 @@ public:
        MaterialsExporter(COLLADASW::StreamWriter *sw);
        void exportMaterials(Scene *sce, bool export_selected);
        void operator()(Material *ma, Object *ob);
+
+private:
+       bool hasMaterials(Scene *sce);
 };
 
 // used in forEachMaterialInScene
index 2035220612197b9fd1e09819046788775d785fa1..628cdbf21e9d1373662e57444129b988330b10b5 100644 (file)
@@ -1478,10 +1478,8 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e
        bArmature *arm;
        EditBone *bone, *curBone, *next;
        int extend= RNA_boolean_get(op->ptr, "extend");
-       ARegion *ar;
        Object *obedit= CTX_data_edit_object(C);
        arm= obedit->data;
-       ar= CTX_wm_region(C);
 
        view3d_operator_needs_opengl(C);
 
index 3a3cd6d136b383c72df4b6d0cce01534c8ad2c0c..237db58f36896da689e07d421000fa375b9f7178 100644 (file)
@@ -1890,7 +1890,6 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
                                if(but->autocomplete_func || data->searchbox) {
                                        changed= ui_textedit_autocomplete(C, but, data);
                                        update= 1; /* do live update for tab key */
-                                       retval= WM_UI_HANDLER_BREAK;
                                }
                                /* the hotkey here is not well defined, was G.qual so we check all */
                                else if(event->shift || event->ctrl || event->alt || event->oskey) {
@@ -2336,8 +2335,8 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa
                if(fac != 1.0f) {
                        /* snap in unit-space */
                        tempf /= fac;
-                       softmin /= fac;
-                       softmax /= fac;
+                       /* softmin /= fac; */ /* UNUSED */
+                       /* softmax /= fac; */ /* UNUSED */
                        softrange /= fac;
                }
 
@@ -3480,13 +3479,13 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
        CurveMapping *cumap= (CurveMapping*)but->poin;
        CurveMap *cuma= cumap->cm+cumap->cur;
        CurveMapPoint *cmp= cuma->curve;
-       float fx, fy, zoomx, zoomy, offsx, offsy;
+       float fx, fy, zoomx, zoomy /*, offsx, offsy */ /* UNUSED */;
        int a, changed= 0;
 
        zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
        zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
-       offsx= cumap->curr.xmin;
-       offsy= cumap->curr.ymin;
+       /* offsx= cumap->curr.xmin; */
+       /* offsy= cumap->curr.ymin; */
 
        if(snap) {
                float d[2];
index 79a90fb9d1dd11fd70e8381149a66e7a42c40b21..2f0bcc9d5b423282f7b415383e5943313e242f21 100644 (file)
@@ -149,10 +149,10 @@ typedef struct uiLayoutItemBx {
        uiBut *roundbox;
 } uiLayoutItemBx;
 
-typedef struct uiLayoutItemSplt {
+typedef struct uiLayoutItemSplit {
        uiLayout litem;
        float percentage;
-} uiLayoutItemSplt;
+} uiLayoutItemSplit;
 
 typedef struct uiLayoutItemRoot {
        uiLayout litem;
@@ -1615,7 +1615,7 @@ static void ui_litem_layout_row(uiLayout *litem)
        int x, y, w, tot, totw, neww, itemw, minw, itemh, offset;
        int fixedw, freew, fixedx, freex, flag= 0, lastw= 0;
 
-       x= litem->x;
+       /* x= litem->x; */ /* UNUSED */
        y= litem->y;
        w= litem->w;
        totw= 0;
@@ -2020,7 +2020,7 @@ static void ui_litem_estimate_split(uiLayout *litem)
 
 static void ui_litem_layout_split(uiLayout *litem)
 {
-       uiLayoutItemSplt *split= (uiLayoutItemSplt*)litem;
+       uiLayoutItemSplit *split= (uiLayoutItemSplit*)litem;
        uiItem *item;
        float percentage;
        const int tot= BLI_countlist(&litem->items);
@@ -2242,9 +2242,9 @@ uiLayout *uiLayoutOverlap(uiLayout *layout)
 
 uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
 {
-       uiLayoutItemSplt *split;
+       uiLayoutItemSplit *split;
 
-       split= MEM_callocN(sizeof(uiLayoutItemSplt), "uiLayoutItemSplt");
+       split= MEM_callocN(sizeof(uiLayoutItemSplit), "uiLayoutItemSplit");
        split->litem.item.type= ITEM_LAYOUT_SPLIT;
        split->litem.root= layout->root;
        split->litem.align= align;
index 9ed3cabb4cb203b4bbabd9b82b9b45d51232d045..3b20533dcd4ab1989bfde490e5ed7915e72d8b8a 100644 (file)
@@ -575,8 +575,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
                ui_draw_tria_rect(&itemrect, 'h');
        else
                ui_draw_tria_rect(&itemrect, 'v');
-       
-       
+
+       (void)ofsx;
 }
 
 /************************** panel alignment *************************/
index 311684d5e7e99f3d1007183e56bf2744735ac2ab..b6e6bc1dfc2299a286c4d7b53d68099d03c03155 100644 (file)
@@ -2197,7 +2197,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
                        /* create list items */
                        RNA_PROP_BEGIN(ptr, itemptr, prop) {
                                /* create button */
-                               if(i == 9)
+                               if(!(i % 9))
                                        row= uiLayoutRow(col, 0);
 
                                icon= list_item_icon_get(C, &itemptr, rnaicon, 1);
@@ -2212,7 +2212,6 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
        }
        else if(listtype == 'c') {
                /* compact layout */
-               found= 0;
 
                row= uiLayoutRow(layout, 1);
 
index cd1fa5c16a7a731277791c5f8dd5bcae958eee4a..950b3c72fe74002fe1dc00428964e007bf604d8a 100644 (file)
@@ -781,14 +781,15 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
                                         iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
        }
        {       /* always hide/reveal unused sockets */ 
-               int shade;
-
-               iconofs-=iconbutw;
                // XXX re-enable
-               /*if(node_has_hidden_sockets(node))
+               /* int shade;
+               if(node_has_hidden_sockets(node))
                        shade= -40;
-               else*/
-                       shade= -90;
+               else
+                       shade= -90; */
+
+               iconofs-=iconbutw;
+
                uiDefIconBut(node->block, LABEL, B_REDR, ICON_PLUS, iconofs, rct->ymax-NODE_DY,
                                                  iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
        }
index 4230a43d2ecaaec618b401e74d4d443fe0a9322b..18d4d85e3ff44487f7139fa9ff5f6cb8e10355aa 100644 (file)
@@ -1101,7 +1101,7 @@ void NODE_OT_backimage_move(wmOperatorType *ot)
        ot->cancel= snode_bg_viewmove_cancel;
        
        /* flags */
-       ot->flag= OPTYPE_BLOCKING;
+       ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
 }
 
 static int backimage_zoom(bContext *C, wmOperator *op)
index f6e3dc3dd0a01d5f23a9d50e34181e10a854edc3..b105b2507ab8aaca0f63feec3f1bbe9dab58b189 100644 (file)
@@ -101,6 +101,8 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
        
        RNA_def_boolean(ot->srna, "replace_sel", 1, "Replace Selection", "replace the current selection");
 
+       RNA_def_boolean(ot->srna, "overlap", 0, "Allow Overlap", "Don't correct overlap on new sequence strips");
+
        if(flag & SEQPROP_FILES)
                RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", "");
 }
@@ -250,7 +252,11 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
                seq_active_set(scene, seq);
                seq->flag |= SELECT;
        }
-       
+
+       if(RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+               if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+       }
+
        WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
        
        return OPERATOR_FINISHED;
@@ -305,6 +311,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
        SeqLoadInfo seq_load;
        Sequence *seq;
        int tot_files;
+       const short overlap= RNA_boolean_get(op->ptr, "overlap");
 
        seq_load_operator_info(&seq_load, op);
 
@@ -325,12 +332,20 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
                        BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only);
 
                        seq= seq_load_func(C, ed->seqbasep, &seq_load);
+
+                       if(overlap == FALSE) {
+                               if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+                       }
                }
                RNA_END;
        }
        else {
                /* single file */
                seq= seq_load_func(C, ed->seqbasep, &seq_load);
+
+               if(overlap == FALSE) {
+                       if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+               }
        }
 
        if (seq_load.tot_success==0) {
@@ -506,7 +521,11 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
 
        /* last active name */
        strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR-1);
-       
+
+       if(RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+               if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+       }
+
        WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
 
        return OPERATOR_FINISHED;
@@ -656,7 +675,9 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
                }
        }
 
-       if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+       if(RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+               if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+       }
 
        update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */
 
index 2bd6bd624df7783fc659ddd81477a1a7c27aa8a0..13eb24ed1f29e40f35315fe8a81ea70f4fef9aea 100644 (file)
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <ctype.h> /* ispunct */
 #include <sys/stat.h>
+#include <errno.h>
 
 #include "MEM_guardedalloc.h"
 
@@ -449,15 +450,14 @@ static void txt_write_file(Text *text, ReportList *reports)
        FILE *fp;
        TextLine *tmp;
        struct stat st;
-       int res;
-       char file[FILE_MAXDIR+FILE_MAXFILE];
+       char filepath[FILE_MAXDIR+FILE_MAXFILE];
        
-       BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
-       BLI_path_abs(file, G.main->name);
+       BLI_strncpy(filepath, text->name, FILE_MAXDIR+FILE_MAXFILE);
+       BLI_path_abs(filepath, G.main->name);
        
-       fp= fopen(file, "w");
+       fp= fopen(filepath, "w");
        if(fp==NULL) {
-               BKE_report(reports, RPT_ERROR, "Unable to save file.");
+               BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error writing file");
                return;
        }
 
@@ -471,8 +471,13 @@ static void txt_write_file(Text *text, ReportList *reports)
        
        fclose (fp);
 
-       res= stat(file, &st);
-       text->mtime= st.st_mtime;
+       if(stat(filepath, &st) == 0) {
+               text->mtime= st.st_mtime;
+       }
+       else {
+               text->mtime= 0;
+               BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error starrng file");
+       }
        
        if(text->flags & TXT_ISDIRTY)
                text->flags ^= TXT_ISDIRTY;
index 1ce962a8713984c4039d15de38e31815684b9b95..4fa15ac85c4c4847e57d4a1b13fb4632e834384a 100644 (file)
@@ -96,7 +96,7 @@ typedef struct TransSnap {
        short   modeSelect;
        short   align;
        char    project;
-       char    project_self;
+       char    snap_self;
        short   peel;
        short   status;
        float   snapPoint[3]; /* snapping from this point */
index a4307ea336d324f2f6f79ce8945ef6db022bcf8a..ca89670dedb308d85ca4fb9e3c241319bf230e8c 100644 (file)
@@ -392,7 +392,7 @@ static void initSnappingMode(TransInfo *t)
                        }
                        else
                        {
-                               t->tsnap.modeSelect = t->tsnap.project_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
+                               t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
                        }
                }
                /* Particles edit mode*/
@@ -458,23 +458,26 @@ void initSnapping(TransInfo *t, wmOperator *op)
                                t->tsnap.project = RNA_boolean_get(op->ptr, "use_snap_project");
                        }
 
-                       if (RNA_struct_find_property(op->ptr, "use_snap_project_self"))
+                       if (RNA_struct_find_property(op->ptr, "use_snap_self"))
                        {
-                               t->tsnap.project = RNA_boolean_get(op->ptr, "use_snap_project_self");
+                               t->tsnap.snap_self = RNA_boolean_get(op->ptr, "use_snap_self");
                        }
                }
        }
        /* use scene defaults only when transform is modal */
        else if (t->flag & T_MODAL)
        {
-               if (ts->snap_flag & SCE_SNAP) {
-                       t->modifiers |= MOD_SNAP;
-               }
+               if(ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE))
+               {
+                       if (ts->snap_flag & SCE_SNAP) {
+                               t->modifiers |= MOD_SNAP;
+                       }
 
-               t->tsnap.align = ((t->settings->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE);
-               t->tsnap.project = ((t->settings->snap_flag & SCE_SNAP_PROJECT) == SCE_SNAP_PROJECT);
-               t->tsnap.project_self = !((t->settings->snap_flag & SCE_SNAP_PROJECT_NO_SELF) == SCE_SNAP_PROJECT_NO_SELF);
-               t->tsnap.peel = ((t->settings->snap_flag & SCE_SNAP_PROJECT) == SCE_SNAP_PROJECT);
+                       t->tsnap.align = ((t->settings->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE);
+                       t->tsnap.project = ((t->settings->snap_flag & SCE_SNAP_PROJECT) == SCE_SNAP_PROJECT);
+                       t->tsnap.snap_self = !((t->settings->snap_flag & SCE_SNAP_NO_SELF) == SCE_SNAP_NO_SELF);
+                       t->tsnap.peel = ((t->settings->snap_flag & SCE_SNAP_PROJECT) == SCE_SNAP_PROJECT);
+               }
        }
        
        t->tsnap.target = snap_target;
@@ -1944,9 +1947,9 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea
        int i;
        float asp[3] = {1.0f, 1.0f, 1.0f}; // TODO: Remove hard coded limit here (3)
 
-       if(max_index > 3) {
+       if(max_index > 2) {
                printf("applyGrid: invalid index %d, clamping\n", max_index);
-               max_index= 3;
+               max_index= 2;
        }
 
        // Early bailing out if no need to snap
index 3804aad6848c0bf7bcc5568e334c768c7a90f8d8..806c70d841fd5c07c929399a94226a526e86e71a 100644 (file)
@@ -671,7 +671,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
        i = is;
        GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
 
-       vn = shi->vn;
+
        /*if(ma->mode & MA_TANGENT_VN)
                GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/
 
index 21e001f9df1b5565f418ee0842c624d96be1c1cb..fdbbd441edaed532d0f3c41c09714a6695c292b5 100644 (file)
@@ -1078,7 +1078,7 @@ typedef struct Scene {
 #define SCE_SNAP_ROTATE                        2
 #define SCE_SNAP_PEEL_OBJECT   4
 #define SCE_SNAP_PROJECT               8
-#define SCE_SNAP_PROJECT_NO_SELF       16
+#define SCE_SNAP_NO_SELF               16
 /* toolsettings->snap_target */
 #define SCE_SNAP_TARGET_CLOSEST        0
 #define SCE_SNAP_TARGET_CENTER 1
index d9fbdd7caf2f2dd24155a4d4b62536b01394a13f..dcf2400b9badcc4fe69bc6dc2ff4500c5c7e847f 100644 (file)
@@ -4407,15 +4407,15 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE
                if(!(parm->flag & PROP_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) {
                        switch(parm->type) {
                                case PROP_BOOLEAN:
-                                       if(parm->arraydimension) memcpy(data, &((BooleanPropertyRNA*)parm)->defaultarray, size);
+                                       if(parm->arraydimension) memcpy(data, ((BooleanPropertyRNA*)parm)->defaultarray, size);
                                        else memcpy(data, &((BooleanPropertyRNA*)parm)->defaultvalue, size);
                                        break;
                                case PROP_INT:
-                                       if(parm->arraydimension) memcpy(data, &((IntPropertyRNA*)parm)->defaultarray, size);
+                                       if(parm->arraydimension) memcpy(data, ((IntPropertyRNA*)parm)->defaultarray, size);
                                        else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size);
                                        break;
                                case PROP_FLOAT:
-                                       if(parm->arraydimension) memcpy(data, &((FloatPropertyRNA*)parm)->defaultarray, size);
+                                       if(parm->arraydimension) memcpy(data, ((FloatPropertyRNA*)parm)->defaultarray, size);
                                        else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size);
                                        break;
                                case PROP_ENUM:
index 3625f321a024dd1b9a3dfd892bffdb4d5f321312..6c0228757488295a7093d8cf2cdec045b3abdfce 100644 (file)
@@ -1187,9 +1187,9 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
        RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
        RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
 
-       prop= RNA_def_property(srna, "use_snap_project_self", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT_NO_SELF);
-       RNA_def_property_ui_text(prop, "Project to Self", "Project into its self (editmode)");
+       prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
+       RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)");
        RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
        RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */