svn merge ^/trunk/blender -r43830:43864
authorCampbell Barton <ideasman42@gmail.com>
Fri, 3 Feb 2012 01:30:21 +0000 (01:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 3 Feb 2012 01:30:21 +0000 (01:30 +0000)
34 files changed:
CMakeLists.txt
doc/blender_file_format/BlendFileDnaExporter_25.py
doc/blender_file_format/BlendFileReader.py
intern/cycles/app/io_export_cycles_xml.py
release/scripts/modules/bpy_extras/object_utils.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_ui/properties_data_curve.py
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/navmesh_conversion.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/texture.c
source/blender/collada/GeometryExporter.cpp
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/transform/transform_conversions.c
source/blender/makesdna/DNA_curve_types.h
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_wm.c
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_Vector.c
source/blender/python/rna_dump.py
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/intern/wm_event_system.c
source/gameengine/Ketsji/KX_NavMeshObject.cpp
source/tests/bl_mesh_modifiers.py
source/tests/bl_run_operators.py

index e7becd06d5388a8d27246b15190fb4b88f45c110..4cd52245fefe2f4613eed2a9e90f95d1ad921f9c 100644 (file)
@@ -249,6 +249,12 @@ if(APPLE)
                "Choose the minimum OSX version required: 10.4 or 10.5"
                FORCE)
        endif()
+       if(${CMAKE_GENERATOR} MATCHES "Xcode" AND (${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4))
+               # Xcode 4 defaults to the Apple LLVM Compiler.
+               # Override the default compiler selection because Blender only compiles with gcc
+               set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
+               message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
+       endif()
        option(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
        option(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
        option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
index bc5b2e73c7e8681e0938c532de4c9f002f971e29..a201f618fbb0c1bc90f95dce0b4a25dcbff3af5a 100755 (executable)
@@ -206,13 +206,13 @@ class DNACatalogHTML:
                 <td>${size}</td>
             </tr>"""
         
-        if field.Type.Structure == None or field.Name.IsPointer():
+        if field.Type.Structure is None or field.Name.IsPointer():
 
             # ${reference}
             reference = field.Name.AsReference(parentReference)
 
             # ${struct}
-            if parentReference != None:
+            if parentReference is not None:
                 struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
             else:
                 struct = structure.Type.Name
@@ -240,7 +240,7 @@ class DNACatalogHTML:
             
             structure_field = Template(structure_field_template).substitute(d)
         
-        elif field.Type.Structure != None:
+        elif field.Type.Structure is not None:
             reference = field.Name.AsReference(parentReference)
             structure_field = self.StructureFields(field.Type.Structure, reference, offset) 
 
index 313c8c7ff5dfb26cb215279a24d9634ccb51db13..88eb71b3ce250482400cabce80d3fa82391ad325 100644 (file)
@@ -329,7 +329,7 @@ class DNAName:
         self.Name = name
         
     def AsReference(self, parent):
-        if parent == None:
+        if parent is None:
             result = ""
         else:
             result = parent+"."
index 2314d935214df1e0ac35aec1a3b8da169ae02a50..3ba9e201d11c42698f0f7eaa25ae7dc6e953b91b 100644 (file)
@@ -93,7 +93,7 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return (context.active_object is not None)
 
     def execute(self, context):
         filepath = bpy.path.ensure_ext(self.filepath, ".xml")
index c9c1dc05476461eef078397ad417e505c54d4831..66b774e63016423b63e66f7be33e8d70db0c88cc 100644 (file)
@@ -44,7 +44,7 @@ def add_object_align_init(context, operator):
     properties = operator.properties if operator is not None else None
 
     space_data = context.space_data
-    if space_data.type != 'VIEW_3D':
+    if space_data and space_data.type != 'VIEW_3D':
         space_data = None
 
     # location
index 2c329de36440fd4145a9d4962726e02104ea5952..923a259c69c65e798b8746728fd1f8ea682aee94 100644 (file)
 
 import bpy
 from bpy.types import Operator
-from bpy.props import StringProperty, BoolProperty, EnumProperty, IntProperty
+from bpy.props import (StringProperty,
+                       BoolProperty,
+                       EnumProperty,
+                       IntProperty)
 
 
 class SelectPattern(Operator):
@@ -54,7 +57,7 @@ class SelectPattern(Operator):
             pattern_match = fnmatch.fnmatchcase
         else:
             pattern_match = (lambda a, b:
-                                 fnmatch.fnmatchcase(a.upper(), b.upper()))
+                             fnmatch.fnmatchcase(a.upper(), b.upper()))
         is_ebone = False
         obj = context.object
         if obj and obj.mode == 'POSE':
@@ -490,7 +493,7 @@ class ShapeTransfer(Operator):
 
     def execute(self, context):
         ob_act = context.active_object
-        objects = [ob for ob in C.selected_editable_objects if ob != ob_act]
+        objects = [ob for ob in context.selected_editable_objects if ob != ob_act]
 
         if 1:  # swap from/to, means we cant copy to many at once.
             if len(objects) != 1:
index 79d722eb19d9d1b45bd42df59d63851d442cb9ea..3aa995353b2e649c17b5aadda8be78cdb2169ac5 100644 (file)
@@ -111,7 +111,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
             sub = col.column()
             sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
             sub.prop(curve, "fill_mode", text="")
-            col.prop(curve, "use_fill_deform", text="Fill Deformed")
+            col.prop(curve, "use_fill_deform")
 
 
 class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
@@ -165,6 +165,10 @@ class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
         col.label(text="Bevel Object:")
         col.prop(curve, "bevel_object", text="")
 
+        row = col.row()
+        row.active = (curve.bevel_object is not None)
+        row.prop(curve, "use_fill_caps")
+
 
 class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
     bl_label = "Path Animation"
index 7f321abf48e5fd10d97c0f2b7c44ced7ffc8180c..a67a06ef9fbdeff7805152e742fd56acee196f02 100644 (file)
@@ -69,9 +69,9 @@ void init_colorband(struct ColorBand *coba, int rangetype);
 struct ColorBand *add_colorband(int rangetype);
 int do_colorband(const struct ColorBand *coba, float in, float out[4]);
 void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
-int vergcband(const void *a1, const void *a2);
 struct CBData *colorband_element_add(struct ColorBand *coba, float position);
 int colorband_element_remove(struct ColorBand *coba, int index);
+void colorband_update_sort(struct ColorBand *coba);
 
 void default_tex(struct Tex *tex);
 struct Tex *add_texture(const char *name);
index efeacabdba9be320fcef934be0135a4231b5f6a3..4c2c05e473fbc214deca11eb48948955b99bfdb6 100644 (file)
@@ -224,6 +224,50 @@ void constraints_clear_evalob (bConstraintOb *cob)
 
 /* -------------- Space-Conversion API -------------- */
 
+static void constraint_pchan_diff_mat(bPoseChannel *pchan, float diff_mat[4][4])
+{
+       if (pchan->parent) {
+               float offs_bone[4][4];
+
+               /* construct offs_bone the same way it is done in armature.c */
+               copy_m4_m3(offs_bone, pchan->bone->bone_mat);
+               copy_v3_v3(offs_bone[3], pchan->bone->head);
+               offs_bone[3][1] += pchan->bone->parent->length;
+
+               if (pchan->bone->flag & BONE_HINGE) {
+                       /* pose_mat = par_pose-space_location * chan_mat */
+                       float tmat[4][4];
+
+                       /* the rotation of the parent restposition */
+                       copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
+
+                       /* the location of actual parent transform */
+                       copy_v3_v3(tmat[3], offs_bone[3]);
+                       zero_v3(offs_bone[3]);
+                       mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
+
+                       mult_m4_m4m4(diff_mat, tmat, offs_bone);
+               }
+               else {
+                       /* pose_mat = par_pose_mat * bone_mat * chan_mat */
+                       if (pchan->bone->flag & BONE_NO_SCALE) {
+                               float tmat[4][4];
+                               copy_m4_m4(tmat, pchan->parent->pose_mat);
+                               normalize_m4(tmat);
+                               mult_m4_m4m4(diff_mat, tmat, offs_bone);
+                       }
+                       else {
+                               mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone);
+                       }
+               }
+       }
+       else {
+               /* pose_mat = chan_mat * arm_mat */
+               copy_m4_m4(diff_mat, pchan->bone->arm_mat);
+       }
+}
+
+
 /* This function is responsible for the correct transformations/conversions 
  * of a matrix from one space to another for constraint evaluation.
  * For now, this is only implemented for Objects and PoseChannels.
@@ -267,40 +311,10 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
                                /* pose to local */
                                else if (to == CONSTRAINT_SPACE_LOCAL) {
                                        if (pchan->bone) {
-                                               if (pchan->parent) {
-                                                       float offs_bone[4][4];
-                                                               
-                                                       /* construct offs_bone the same way it is done in armature.c */
-                                                       copy_m4_m3(offs_bone, pchan->bone->bone_mat);
-                                                       copy_v3_v3(offs_bone[3], pchan->bone->head);
-                                                       offs_bone[3][1]+= pchan->bone->parent->length;
-                                                       
-                                                       if (pchan->bone->flag & BONE_HINGE) {
-                                                               /* pose_mat = par_pose-space_location * chan_mat */
-                                                               float tmat[4][4];
-                                                               
-                                                               /* the rotation of the parent restposition */
-                                                               copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
-                                                               
-                                                               /* the location of actual parent transform */
-                                                               copy_v3_v3(tmat[3], offs_bone[3]);
-                                                               offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
-                                                               mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
-                                                               
-                                                               mult_m4_m4m4(diff_mat, tmat, offs_bone);
-                                                               invert_m4_m4(imat, diff_mat);
-                                                       }
-                                                       else {
-                                                               /* pose_mat = par_pose_mat * bone_mat * chan_mat */
-                                                               mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone);
-                                                               invert_m4_m4(imat, diff_mat);
-                                                       }
-                                               }
-                                               else {
-                                                       /* pose_mat = chan_mat * arm_mat */
-                                                       invert_m4_m4(imat, pchan->bone->arm_mat);
-                                               }
-                                               
+                                               constraint_pchan_diff_mat(pchan, diff_mat);
+
+                                               invert_m4_m4(imat, diff_mat);
+
                                                copy_m4_m4(tempmat, mat);
                                                mult_m4_m4m4(mat, imat, tempmat);
 
@@ -325,44 +339,11 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
                        {
                                /* local to pose - do inverse procedure that was done for pose to local */
                                if (pchan->bone) {
-                                       /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */                                         
-                                       if (pchan->parent) {
-                                               float offs_bone[4][4];
-                                               
-                                               /* construct offs_bone the same way it is done in armature.c */
-                                               copy_m4_m3(offs_bone, pchan->bone->bone_mat);
-                                               copy_v3_v3(offs_bone[3], pchan->bone->head);
-                                               offs_bone[3][1]+= pchan->bone->parent->length;
-                                               
-                                               if (pchan->bone->flag & BONE_HINGE) {
-                                                       /* pose_mat = par_pose-space_location * chan_mat */
-                                                       float tmat[4][4];
-                                                       
-                                                       /* the rotation of the parent restposition */
-                                                       copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
-                                                       
-                                                       /* the location of actual parent transform */
-                                                       copy_v3_v3(tmat[3], offs_bone[3]);
-                                                       zero_v3(offs_bone[3]);
-                                                       mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
-                                                       
-                                                       mult_m4_m4m4(diff_mat, tmat, offs_bone);
-                                                       copy_m4_m4(tempmat, mat);
-                                                       mult_m4_m4m4(mat, diff_mat, tempmat);
-                                               }
-                                               else {
-                                                       /* pose_mat = par_pose_mat * bone_mat * chan_mat */
-                                                       mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone);
-                                                       copy_m4_m4(tempmat, mat);
-                                                       mult_m4_m4m4(mat, diff_mat, tempmat);
-                                               }
-                                       }
-                                       else {
-                                               copy_m4_m4(diff_mat, pchan->bone->arm_mat);
-                                               
-                                               copy_m4_m4(tempmat, mat);
-                                               mult_m4_m4m4(mat, diff_mat, tempmat);
-                                       }
+                                       /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
+                                       constraint_pchan_diff_mat(pchan, diff_mat);
+
+                                       copy_m4_m4(tempmat, mat);
+                                       mult_m4_m4m4(mat, diff_mat, tempmat);
                                }
                                
                                /* use pose-space as stepping stone for other spaces */
index c2c6f8d5b921278d44f24cc05189b21da789ad13..5661ab63f1a3d1f6412b9fee5c86c1ff64ed8a0a 100644 (file)
@@ -1181,6 +1181,60 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
                        forRender, originalVerts, deformedVerts);
 }
 
+static void rotateBevelPiece(Curve *cu, BevPoint *bevp, DispList *dlb, float widfac, float fac, float **data_r)
+{
+       float *fp, *data = *data_r;
+       int b;
+
+       fp = dlb->verts;
+       for (b = 0; b<dlb->nr; b++,fp += 3,data += 3) {
+               if(cu->flag & CU_3D) {
+                       float vec[3];
+
+                       vec[0] = fp[1]+widfac;
+                       vec[1] = fp[2];
+                       vec[2 ]= 0.0;
+
+                       mul_qt_v3(bevp->quat, vec);
+
+                       data[0] = bevp->vec[0] + fac*vec[0];
+                       data[1] = bevp->vec[1] + fac*vec[1];
+                       data[2] = bevp->vec[2] + fac*vec[2];
+               }
+               else {
+                       data[0] = bevp->vec[0] + fac*(widfac+fp[1])*bevp->sina;
+                       data[1] = bevp->vec[1] + fac*(widfac+fp[1])*bevp->cosa;
+                       data[2] = bevp->vec[2] + fac*fp[2];
+               }
+       }
+
+       *data_r = data;
+}
+
+static void fillBevelCap(Curve *cu, Nurb *nu, BevPoint *bevp, DispList *dlb, float fac, float widfac, ListBase *dispbase)
+{
+       DispList *dl;
+       float *data;
+
+       dl= MEM_callocN(sizeof(DispList), "makeDispListbev2");
+       dl->verts= data= MEM_callocN(3*sizeof(float)*dlb->nr, "dlverts");
+
+       dl->type= DL_POLY;
+
+       dl->parts= 1;
+       dl->nr= dlb->nr;
+       dl->col= nu->mat_nr;
+       dl->charidx= nu->charidx;
+
+       /* dl->rt will be used as flag for render face and */
+       /* CU_2D conflicts with R_NOPUNOFLIP */
+       dl->rt= nu->flag & ~CU_2D;
+
+       rotateBevelPiece(cu, bevp, dlb, widfac, fac, &data);
+
+       BLI_addtail(dispbase, dl);
+}
+
 static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispbase,
        DerivedMesh **derivedFinal, int forRender, int forOrco)
 {
@@ -1225,9 +1279,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
 
                        for (; bl && nu; bl=bl->next,nu=nu->next) {
                                DispList *dl;
-                               float *fp1, *data;
+                               float *data;
                                BevPoint *bevp;
-                               int a,b;
+                               int a;
 
                                if (bl->nr) { /* blank bevel lists can happen */
 
@@ -1264,9 +1318,10 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                        }
                                        else {
                                                DispList *dlb;
+                                               ListBase bottom_capbase = {NULL, NULL};
+                                               ListBase top_capbase = {NULL, NULL};
 
                                                for (dlb=dlbev.first; dlb; dlb=dlb->next) {
-       
                                                        /* for each part of the bevel use a separate displblock */
                                                        dl= MEM_callocN(sizeof(DispList), "makeDispListbev1");
                                                        dl->verts= data= MEM_callocN(3*sizeof(float)*dlb->nr*bl->nr, "dlverts");
@@ -1304,33 +1359,27 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                                        dl->bevelSplitFlag[a>>5] |= 1<<(a&0x1F);
                                                                }
        
-                                                                       /* rotate bevel piece and write in data */
-                                                               fp1= dlb->verts;
-                                                               for (b=0; b<dlb->nr; b++,fp1+=3,data+=3) {
-                                                                       if(cu->flag & CU_3D) {
-                                                                               float vec[3];
-       
-                                                                               vec[0]= fp1[1]+widfac;
-                                                                               vec[1]= fp1[2];
-                                                                               vec[2]= 0.0;
-
-                                                                               mul_qt_v3(bevp->quat, vec);
-
-                                                                               data[0]= bevp->vec[0] + fac*vec[0];
-                                                                               data[1]= bevp->vec[1] + fac*vec[1];
-                                                                               data[2]= bevp->vec[2] + fac*vec[2];
-                                                                       }
-                                                                       else {
-                                                                               data[0]= bevp->vec[0] + fac*(widfac+fp1[1])*bevp->sina;
-                                                                               data[1]= bevp->vec[1] + fac*(widfac+fp1[1])*bevp->cosa;
-                                                                               data[2]= bevp->vec[2] + fac*fp1[2];
-                                                                       }
+                                                               /* rotate bevel piece and write in data */
+                                                               rotateBevelPiece(cu, bevp, dlb, widfac, fac, &data);
+
+                                                               if (cu->bevobj && (cu->flag & CU_FILL_CAPS)) {
+                                                                       if (a == 0)
+                                                                               fillBevelCap(cu, nu, bevp, dlb, fac, widfac, &bottom_capbase);
+                                                                       else if (a == bl->nr - 1)
+                                                                               fillBevelCap(cu, nu, bevp, dlb, fac, widfac, &top_capbase);
                                                                }
                                                        }
-                                                       
+
                                                        /* gl array drawing: using indices */
                                                        displist_surf_indices(dl);
                                                }
+
+                                               if(bottom_capbase.first) {
+                                                       filldisplist(&bottom_capbase, dispbase, 1);
+                                                       filldisplist(&top_capbase, dispbase, 0);
+                                                       freedisplist(&bottom_capbase);
+                                                       freedisplist(&top_capbase);
+                                               }
                                        }
                                }
 
index 72523ae54e027f861b953c83a76b9bfb5a02efbf..4c9c0a3a1fc00aae2f022b0008d6733efeba8b35 100644 (file)
@@ -344,7 +344,7 @@ int buildNavMeshData(const int nverts, const float* verts,
                                                         int *vertsPerPoly_r, int **dtrisToPolysMap_r, int **dtrisToTrisMap_r)
 
 {
-       int *trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping");
+       int *trisMapping;
        int i;
        struct SortContext context;
        int validTriStart, prevPolyIdx, curPolyIdx, newPolyIdx, prevpolyidx;
@@ -360,6 +360,8 @@ int buildNavMeshData(const int nverts, const float* verts,
                return 0;
        }
 
+       trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping");
+
        //sort the triangles by polygon idx
        for (i=0; i<ntris; i++)
                trisMapping[i]=i;
index 08b531159193b8baf4a0ca3b4c1638aa4e9aab84..d18a71d3c551a17a907641cb7d1337a194a2de3f 100644 (file)
@@ -745,7 +745,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
                        seq->scene = sce;
                }
 
-               seq->len= seq->scene->r.efra - seq->scene->r.sfra + 1;
+               seq->len= (seq->scene)? seq->scene->r.efra - seq->scene->r.sfra + 1: 0;
                seq->len -= seq->anim_startofs;
                seq->len -= seq->anim_endofs;
                if (seq->len < 0) {
index 88858c9ff518136e6afb38f39b11931344d508b9..4c40dca3365948503d8a8f3dfebbedcccc8adeb3 100644 (file)
@@ -478,10 +478,28 @@ int vergcband(const void *a1, const void *a2)
        return 0;
 }
 
-CBData *colorband_element_add(struct ColorBand *coba, float position)
+void colorband_update_sort(ColorBand *coba)
 {
        int a;
+       
+       if(coba->tot<2)
+               return;
+       
+       for(a=0; a<coba->tot; a++)
+               coba->data[a].cur= a;
+
+       qsort(coba->data, coba->tot, sizeof(CBData), vergcband);
 
+       for(a=0; a<coba->tot; a++) {
+               if(coba->data[a].cur==coba->cur) {
+                       coba->cur= a;
+                       break;
+               }
+       }
+}
+
+CBData *colorband_element_add(struct ColorBand *coba, float position)
+{
        if(coba->tot==MAXCOLORBAND) {
                return NULL;
        }
@@ -503,17 +521,7 @@ CBData *colorband_element_add(struct ColorBand *coba, float position)
        coba->tot++;
        coba->cur = coba->tot-1;
 
-       for(a = 0; a < coba->tot; a++)
-               coba->data[a].cur = a;
-
-       qsort(coba->data, coba->tot, sizeof(CBData), vergcband);
-
-       for(a = 0; a < coba->tot; a++) {
-               if(coba->data[a].cur == coba->cur) {
-                       coba->cur = a;
-                       break;
-               }
-       }
+       colorband_update_sort(coba);
 
        return coba->data + coba->cur;
 }
index c4eacff11c58c76473649e7b73900e77cc097447..8dffb17a19fc05cafd9fffe029573aaf957972c8 100644 (file)
@@ -65,6 +65,7 @@ void GeometryExporter::operator()(Object *ob)
 #endif
        Mesh *me = (Mesh*)ob->data;
        std::string geom_id = get_geometry_id(ob);
+       std::string geom_name = id_name(ob->data);
        std::vector<Normal> nor;
        std::vector<Face> norind;
 
@@ -78,7 +79,7 @@ void GeometryExporter::operator()(Object *ob)
        create_normals(nor, norind, me);
 
        // openMesh(geoId, geoName, meshId)
-       openMesh(geom_id);
+       openMesh(geom_id, geom_name);
        
        // writes <source> for vertex coords
        createVertsSource(geom_id, me);
index a7c37d371e5dab28ff76003bd3b5d40455cd8131..8ac7406462d9a3b951e9fa07e4e081d66e7748ea 100644 (file)
@@ -1529,7 +1529,7 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-
+/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
 static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
 {
        /* identifiers */
@@ -1551,7 +1551,7 @@ static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
                /* setting to set */
        ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
 }
-
+/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
 static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
 {
        /* identifiers */
@@ -1574,28 +1574,6 @@ static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
        ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
 }
 
-static void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name= "Invert Channel Setting";
-       ot->idname= "ANIM_OT_channels_setting_toggle";
-       ot->description= "Invert specified setting on all selected animation channels";
-       
-       /* api callbacks */
-       ot->invoke= WM_menu_invoke;
-       ot->exec= animchannels_setflag_exec;
-       ot->poll= animedit_poll_channels_active;
-       
-       /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-       
-       /* props */
-               /* flag-setting mode */
-       RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_INVERT, "Mode", "");
-               /* setting to set */
-       ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
-}
-
 static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
 {
        /* identifiers */
@@ -2401,7 +2379,6 @@ void ED_operatortypes_animchannels(void)
        
        WM_operatortype_append(ANIM_OT_channels_setting_enable);
        WM_operatortype_append(ANIM_OT_channels_setting_disable);
-       WM_operatortype_append(ANIM_OT_channels_setting_invert);
        WM_operatortype_append(ANIM_OT_channels_setting_toggle);
        
        WM_operatortype_append(ANIM_OT_channels_delete);
index cfb375c25581af265689a7d8da77f75265aafe34..cadc57c9881c4304b0384ff8a8fa8bede0912fdf 100644 (file)
@@ -3607,31 +3607,6 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
 }
 
 
-static int verg_colorband(const void *a1, const void *a2)
-{
-       const CBData *x1=a1, *x2=a2;
-       
-       if( x1->pos > x2->pos ) return 1;
-       else if( x1->pos < x2->pos) return -1;
-       return WM_UI_HANDLER_CONTINUE;
-}
-
-static void ui_colorband_update(ColorBand *coba)
-{
-       int a;
-       
-       if(coba->tot<2) return;
-       
-       for(a=0; a<coba->tot; a++) coba->data[a].cur= a;
-               qsort(coba->data, coba->tot, sizeof(CBData), verg_colorband);
-       for(a=0; a<coba->tot; a++) {
-               if(coba->data[a].cur==coba->cur) {
-                       coba->cur= a;
-                       break;
-               }
-       }
-}
-
 static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx)
 {
        float dx;
@@ -3644,7 +3619,7 @@ static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx
        data->dragcbd->pos += dx;
        CLAMP(data->dragcbd->pos, 0.0f, 1.0f);
        
-       ui_colorband_update(data->coba);
+       colorband_update_sort(data->coba);
        data->dragcbd= data->coba->data + data->coba->cur;      /* because qsort */
        
        data->draglastx= mx;
index 3093a4d40f9fe7e081eef40200746db36ea74670..55e89ea44289377c634048ccf21e2258a4d03b69 100644 (file)
@@ -1305,6 +1305,16 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
        rna_update_cb(C, cb_v, NULL);
 }
 
+static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v)
+{
+       uiBut *bt= bt_v;
+       ColorBand *coba= coba_v;
+
+       /* sneaky update here, we need to sort the colorband points to be in order,
+          however the RNA pointer then is wrong, so we update it */
+       colorband_update_sort(coba);
+       bt->rnapoin.data = coba->data + coba->cur;
+}
 
 /* offset aligns from bottom, standard width 300, height 115 */
 static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb)
@@ -1348,7 +1358,11 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
                PointerRNA ptr;
                RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
                row= uiLayoutRow(layout, 0);
+
                uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
+               bt= block->buttons.last;
+               uiButSetFunc(bt, colorband_update_cb, bt, coba);
+
                uiItemR(row, &ptr, "color", 0, "", ICON_NONE);
        }
 
index b1a25d093d2cebc6d45e0d4d9dfdfbadeeeb3479..26516bcda990626c3fc96ab6084fce964bfadadc 100644 (file)
@@ -43,6 +43,7 @@
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
+#include "BKE_report.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -160,6 +161,11 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
        FileBrowseOp *fbo;
        char *str;
 
+       if (CTX_wm_space_file(C)) {
+               BKE_report(op->reports, RPT_ERROR, "Can't activate a file selector, one already open");
+               return OPERATOR_CANCELLED;
+       }
+
        uiFileBrowseContextProperty(C, &ptr, &prop);
 
        if(!prop)
index 935dda864bf91b9f7927143b472bec595cab479a..6a9c2755330bab5fe0b09a068a75f42f7abcb20a 100644 (file)
@@ -3417,15 +3417,15 @@ static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
 {
        SpaceClip *sc= CTX_wm_space_clip(C);
        MovieClip *clip= ED_space_clip(sc);
-       int frames= RNA_int_get(op->ptr, "frames");
-       float error= RNA_float_get(op->ptr, "error");
-       int action= RNA_enum_get(op->ptr, "action");
 
-       if(frames==0 && error==0 && action==0) {
+       if(!RNA_struct_property_is_set(op->ptr, "frames"))
                RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames);
+
+       if(!RNA_struct_property_is_set(op->ptr, "error"))
                RNA_float_set(op->ptr, "error", clip->tracking.settings.clean_error);
+
+       if(!RNA_struct_property_is_set(op->ptr, "action"))
                RNA_enum_set(op->ptr, "action", clip->tracking.settings.clean_action);
-       }
 
        return clean_tracks_exec(C, op);
 }
index 776cad6d89c07d172c1589ba233e9c4570b12177..416fbd58a30a9092cdaa33a4517dad73bab88aac 100644 (file)
@@ -2361,12 +2361,17 @@ void flushTransSeq(TransInfo *t)
 
        if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { /* originally TFM_TIME_EXTEND, transform changes */
                /* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */
-               seq= seqbasep->first;
 
-               while(seq) {
-                       if (seq->type == SEQ_META && seq->flag & SELECT)
+               /* calc all meta's then effects [#27953] */
+               for (seq = seqbasep->first; seq; seq = seq->next) {
+                       if (seq->type == SEQ_META && seq->flag & SELECT) {
                                calc_sequence(t->scene, seq);
-                       seq= seq->next;
+                       }
+               }
+               for (seq = seqbasep->first; seq; seq = seq->next) {
+                       if (seq->seq1 || seq->seq2 || seq->seq3) {
+                               calc_sequence(t->scene, seq);
+                       }
                }
        }
 
index ffcc516f393a6388e3123609f3d90292f99f8a47..455738c840b6edcd1e6b8e45eb0ac750d6cde6f6 100644 (file)
@@ -260,6 +260,7 @@ typedef struct Curve {
 #define CU_DS_EXPAND   2048
 #define CU_PATH_RADIUS 4096 /* make use of the path radius if this is enabled (default for new curves) */
 #define CU_DEFORM_FILL 8192 /* fill 2d curve after deformation */
+#define CU_FILL_CAPS   16384 /* fill bevel caps */
 
 /* twist mode */
 #define CU_TWIST_Z_UP                  0
index a3825531b19255b124dcc35bc44fca415a1fdd2e..8a1c56abedf74a14fe299d7a8e5949d99a6ea8ad 100644 (file)
@@ -78,24 +78,24 @@ EnumPropertyItem constraint_type_items[] ={
        {0, NULL, 0, NULL, NULL}};
 
 static EnumPropertyItem target_space_pchan_items[] = {
-       {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"},
-       {2, "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"},
-       {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"},
-       {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"},
+       {CONSTRAINT_SPACE_WORLD,    "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"},
+       {CONSTRAINT_SPACE_POSE,     "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"},
+       {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"},
+       {CONSTRAINT_SPACE_LOCAL,    "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"},
        {0, NULL, 0, NULL, NULL}};
 
 static EnumPropertyItem owner_space_pchan_items[] = {
-       {0, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"},
-       {2, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"},
-       {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"},
-       {1, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"},
+       {CONSTRAINT_SPACE_WORLD,    "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"},
+       {CONSTRAINT_SPACE_POSE,     "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"},
+       {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"},
+       {CONSTRAINT_SPACE_LOCAL,    "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"},
        {0, NULL, 0, NULL, NULL}};
 
 #ifdef RNA_RUNTIME
 
 static EnumPropertyItem space_object_items[] = {
-       {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"},
-       {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"},
+       {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"},
+       {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"},
        {0, NULL, 0, NULL, NULL}};
 
 #include "BKE_animsys.h"
index 5fd67efba1d5e57520bfe79e4021db0edefbf8a2..088f2dba0bb55bd628d63c3a85f226384c8f1542 100644 (file)
@@ -1386,9 +1386,14 @@ static void rna_def_curve(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "use_fill_deform", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_DEFORM_FILL);
-       RNA_def_property_ui_text(prop, "Fill deformed", "Fill curve after applying shape keys and all modifiers");
+       RNA_def_property_ui_text(prop, "Fill Deformed", "Fill curve after applying shape keys and all modifiers");
        RNA_def_property_update(prop, 0, "rna_Curve_update_data");
-       
+
+       prop= RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FILL_CAPS);
+       RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for bevelled curves");
+       RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
        /* texture space */
        prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE);
index 52a4a1db36b054951bd309e23e10801bcfc573b7..8ae597f2d1c55d3a0dc7084d3bc1b383591c09c9 100644 (file)
@@ -295,43 +295,44 @@ EnumPropertyItem event_type_items[] = {
        {TIMER1, "TIMER1", 0, "Timer 1", ""},
        {TIMER2, "TIMER2", 0, "Timer 2", ""},
        {0, "", 0, NULL, NULL},
+       {NDOF_MOTION, "NDOF_MOTION", 0, "NDOF Motion", ""},
        /* buttons on all 3dconnexion devices */
-       {NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "Menu", ""},
-       {NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "Fit", ""},
+       {NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "NDOF Menu", ""},
+       {NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "NDOF Fit", ""},
        /* view buttons */
-       {NDOF_BUTTON_TOP, "NDOF_BUTTON_TOP", 0, "Top", ""},
-       {NDOF_BUTTON_BOTTOM, "NDOF_BUTTON_BOTTOM", 0, "Bottom", ""},
-       {NDOF_BUTTON_LEFT, "NDOF_BUTTON_LEFT", 0, "Left", ""},
-       {NDOF_BUTTON_RIGHT, "NDOF_BUTTON_RIGHT", 0, "Right", ""},
-       {NDOF_BUTTON_FRONT, "NDOF_BUTTON_FRONT", 0, "Front", ""},
-       {NDOF_BUTTON_BACK, "NDOF_BUTTON_BACK", 0, "Back", ""},
+       {NDOF_BUTTON_TOP, "NDOF_BUTTON_TOP", 0, "NDOF Top", ""},
+       {NDOF_BUTTON_BOTTOM, "NDOF_BUTTON_BOTTOM", 0, "NDOF Bottom", ""},
+       {NDOF_BUTTON_LEFT, "NDOF_BUTTON_LEFT", 0, "NDOF Left", ""},
+       {NDOF_BUTTON_RIGHT, "NDOF_BUTTON_RIGHT", 0, "NDOF Right", ""},
+       {NDOF_BUTTON_FRONT, "NDOF_BUTTON_FRONT", 0, "NDOF Front", ""},
+       {NDOF_BUTTON_BACK, "NDOF_BUTTON_BACK", 0, "NDOF Back", ""},
        /* more views */
-       {NDOF_BUTTON_ISO1, "NDOF_BUTTON_ISO1", 0, "ISO 1", ""},
-       {NDOF_BUTTON_ISO2, "NDOF_BUTTON_ISO2", 0, "ISO 2", ""},
+       {NDOF_BUTTON_ISO1, "NDOF_BUTTON_ISO1", 0, "NDOF ISO 1", ""},
+       {NDOF_BUTTON_ISO2, "NDOF_BUTTON_ISO2", 0, "NDOF ISO 2", ""},
        /* 90 degree rotations */
-       {NDOF_BUTTON_ROLL_CW, "NDOF_BUTTON_ROLL_CW", 0, "Roll CW", ""},
-       {NDOF_BUTTON_ROLL_CCW, "NDOF_BUTTON_ROLL_CCW", 0, "Roll CCW", ""},
-       {NDOF_BUTTON_SPIN_CW, "NDOF_BUTTON_SPIN_CW", 0, "Spin CW", ""},
-       {NDOF_BUTTON_SPIN_CCW, "NDOF_BUTTON_SPIN_CCW", 0, "Spin CCW", ""},
-       {NDOF_BUTTON_TILT_CW, "NDOF_BUTTON_TILT_CW", 0, "Tilt CW", ""},
-       {NDOF_BUTTON_TILT_CCW, "NDOF_BUTTON_TILT_CCW", 0, "Tilt CCW", ""},
+       {NDOF_BUTTON_ROLL_CW, "NDOF_BUTTON_ROLL_CW", 0, "NDOF Roll CW", ""},
+       {NDOF_BUTTON_ROLL_CCW, "NDOF_BUTTON_ROLL_CCW", 0, "NDOF Roll CCW", ""},
+       {NDOF_BUTTON_SPIN_CW, "NDOF_BUTTON_SPIN_CW", 0, "NDOF Spin CW", ""},
+       {NDOF_BUTTON_SPIN_CCW, "NDOF_BUTTON_SPIN_CCW", 0, "NDOF Spin CCW", ""},
+       {NDOF_BUTTON_TILT_CW, "NDOF_BUTTON_TILT_CW", 0, "NDOF Tilt CW", ""},
+       {NDOF_BUTTON_TILT_CCW, "NDOF_BUTTON_TILT_CCW", 0, "NDOF Tilt CCW", ""},
        /* device control */
-       {NDOF_BUTTON_ROTATE, "NDOF_BUTTON_ROTATE", 0, "Rotate", ""},
-       {NDOF_BUTTON_PANZOOM, "NDOF_BUTTON_PANZOOM", 0, "Pan/Zoom", ""},
-       {NDOF_BUTTON_DOMINANT, "NDOF_BUTTON_DOMINANT", 0, "Dominant", ""},
-       {NDOF_BUTTON_PLUS, "NDOF_BUTTON_PLUS", 0, "Plus", ""},
-       {NDOF_BUTTON_MINUS, "NDOF_BUTTON_MINUS", 0, "Minus", ""},
+       {NDOF_BUTTON_ROTATE, "NDOF_BUTTON_ROTATE", 0, "NDOF Rotate", ""},
+       {NDOF_BUTTON_PANZOOM, "NDOF_BUTTON_PANZOOM", 0, "NDOF Pan/Zoom", ""},
+       {NDOF_BUTTON_DOMINANT, "NDOF_BUTTON_DOMINANT", 0, "NDOF Dominant", ""},
+       {NDOF_BUTTON_PLUS, "NDOF_BUTTON_PLUS", 0, "NDOF Plus", ""},
+       {NDOF_BUTTON_MINUS, "NDOF_BUTTON_MINUS", 0, "NDOF Minus", ""},
        /* general-purpose buttons */
-       {NDOF_BUTTON_1, "NDOF_BUTTON_1", 0, "Button 1", ""},
-       {NDOF_BUTTON_2, "NDOF_BUTTON_2", 0, "Button 2", ""},
-       {NDOF_BUTTON_3, "NDOF_BUTTON_3", 0, "Button 3", ""},
-       {NDOF_BUTTON_4, "NDOF_BUTTON_4", 0, "Button 4", ""},
-       {NDOF_BUTTON_5, "NDOF_BUTTON_5", 0, "Button 5", ""},
-       {NDOF_BUTTON_6, "NDOF_BUTTON_6", 0, "Button 6", ""},
-       {NDOF_BUTTON_7, "NDOF_BUTTON_7", 0, "Button 7", ""},
-       {NDOF_BUTTON_8, "NDOF_BUTTON_8", 0, "Button 8", ""},
-       {NDOF_BUTTON_9, "NDOF_BUTTON_9", 0, "Button 9", ""},
-       {NDOF_BUTTON_10, "NDOF_BUTTON_10", 0, "Button 10", ""},
+       {NDOF_BUTTON_1, "NDOF_BUTTON_1", 0, "NDOF Button 1", ""},
+       {NDOF_BUTTON_2, "NDOF_BUTTON_2", 0, "NDOF Button 2", ""},
+       {NDOF_BUTTON_3, "NDOF_BUTTON_3", 0, "NDOF Button 3", ""},
+       {NDOF_BUTTON_4, "NDOF_BUTTON_4", 0, "NDOF Button 4", ""},
+       {NDOF_BUTTON_5, "NDOF_BUTTON_5", 0, "NDOF Button 5", ""},
+       {NDOF_BUTTON_6, "NDOF_BUTTON_6", 0, "NDOF Button 6", ""},
+       {NDOF_BUTTON_7, "NDOF_BUTTON_7", 0, "NDOF Button 7", ""},
+       {NDOF_BUTTON_8, "NDOF_BUTTON_8", 0, "NDOF Button 8", ""},
+       {NDOF_BUTTON_9, "NDOF_BUTTON_9", 0, "NDOF Button 9", ""},
+       {NDOF_BUTTON_10, "NDOF_BUTTON_10", 0, "NDOF Button 10", ""},
        {0, NULL, 0, NULL, NULL}};      
 
 EnumPropertyItem keymap_propvalue_items[] = {
@@ -1050,6 +1051,9 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
                        rna_Operator_unregister(bmain, ot->ext.srna);
        }
 
+       /* XXX, this doubles up with the operator name [#29666]
+        * for now just remove from dir(bpy.types) */
+
        /* create a new operator type */
        dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
        RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */
@@ -1126,7 +1130,10 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
                        rna_Operator_unregister(bmain, ot->ext.srna);
        }
 
-       /* create a new menu type */
+       /* XXX, this doubles up with the operator name [#29666]
+        * for now just remove from dir(bpy.types) */
+
+       /* create a new operator type */
        dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
        dummyot.ext.data= data;
        dummyot.ext.call= call;
index b25cf1916c6e148e98626503ff3f1d11008f81b7..9dc560afb0f290ca92d61e6d6597e4f9e19b8612 100644 (file)
@@ -152,9 +152,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
 
 void fluidsim_free(FluidsimModifierData *fluidmd)
 {
-#ifdef WITH_MOD_FLUID
-       if(fluidmd)
-       {
+       if(fluidmd) {
                if(fluidmd->fss->meshVelocities)
                {
                        MEM_freeN(fluidmd->fss->meshVelocities);
@@ -162,16 +160,13 @@ void fluidsim_free(FluidsimModifierData *fluidmd)
                }
                MEM_freeN(fluidmd->fss);
        }
-#else
-       (void)fluidmd; /* unused */
-#endif
        
        return;
 }
 
 #ifdef WITH_MOD_FLUID
 /* read .bobj.gz file into a fluidsimDerivedMesh struct */
-static DerivedMesh *fluidsim_read_obj(const char *filename)
+static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_example)
 {
        int wri = 0,i;
        int gotBytes;
@@ -184,6 +179,9 @@ static DerivedMesh *fluidsim_read_obj(const char *filename)
        short *normals, *no_s;
        float no[3];
 
+       const short mp_mat_nr = mp_example->mat_nr;
+       const char  mp_flag =   mp_example->flag;
+
        // ------------------------------------------------
        // get numverts + numfaces first
        // ------------------------------------------------
@@ -289,6 +287,10 @@ static DerivedMesh *fluidsim_read_obj(const char *filename)
 
                gotBytes = gzread(gzf, face, sizeof(int) * 3);
 
+               /* initialize from existing face */
+               mp->mat_nr = mp_mat_nr;
+               mp->flag =   mp_flag;
+
                mp->loopstart = i * 3;
                mp->totloop = 3;
 
@@ -444,8 +446,7 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
        FluidsimSettings *fss = fluidmd->fss;
        DerivedMesh *dm = NULL;
        MPoly *mpoly;
-       int numpolys;
-       int mat_nr, flag, i;
+       MPoly mp_example = {0};
 
        if(!useRenderParams) {
                displaymode = fss->guiDisplayMode;
@@ -473,7 +474,15 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
        BLI_path_abs(targetFile, modifier_path_relbase(ob));
        BLI_path_frame(targetFile, curFrame, 0); // fixed #frame-no
 
-       dm = fluidsim_read_obj(targetFile);
+       // assign material + flags to new dm
+       // if there's no faces in original dm, keep materials and flags unchanged
+       mpoly = orgdm->getPolyArray(orgdm);
+       if (mpoly) {
+               mp_example = *mpoly;
+       }
+       /* else leave NULL'd */
+
+       dm = fluidsim_read_obj(targetFile, &mp_example);
 
        if(!dm)
        {
@@ -494,21 +503,6 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
                return NULL;
        }
 
-       // assign material + flags to new dm
-       mpoly = orgdm->getPolyArray(orgdm);
-       if(mpoly) {
-               mat_nr = mpoly[0].mat_nr;
-               flag = mpoly[0].flag;
-
-               mpoly = dm->getPolyArray(dm);
-               numpolys = dm->getNumPolys(dm);
-               for(i=0; i<numpolys; i++)
-               {
-                       mpoly[i].mat_nr = mat_nr;
-                       mpoly[i].flag = flag;
-               }
-       }
-
        // load vertex velocities, if they exist...
        // TODO? use generate flag as loading flag as well?
        // warning, needs original .bobj.gz mesh loading filename
index bfb79ea6531f4151661beb8e744306bdb368910e..11e79fdee2a7e401045f2b9140cc6efaaa69ce98 100644 (file)
@@ -6298,6 +6298,8 @@ static struct PyMethodDef pyrna_basetype_methods[] = {
        {NULL, NULL, 0, NULL}
 };
 
+/* used to call ..._keys() direct, but we need to filter out operator subclasses */
+#if 0
 static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self)
 {
        PyObject *list;
@@ -6318,6 +6320,34 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self)
        return list;
 }
 
+#else
+
+static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self)
+{
+       PyObject *ret = PyList_New(0);
+       PyObject *item;
+
+       RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) {
+               StructRNA *srna = itemptr.data;
+               StructRNA *srna_base = RNA_struct_base(itemptr.data);
+               /* skip own operators, these double up [#29666] */
+               if (srna_base == &RNA_Operator) {
+                       /* do nothing */
+               }
+               else {
+                       /* add to python list */
+                       item = PyUnicode_FromString(RNA_struct_identifier(srna));
+                       PyList_Append(ret, item);
+                       Py_DECREF(item);
+               }
+       }
+       RNA_PROP_END;
+
+       return ret;
+}
+
+#endif
+
 static PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE;
 
 PyObject *BPY_rna_types(void)
index 5848e6e8c75d4f510fb58bcd1bef9a70274ff68b..0ca8878c96a27ffb2902a855388f2c66b52c01b9 100644 (file)
@@ -174,7 +174,7 @@ static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
        case 2:
                if (start >= stop) {
                        PyErr_SetString(PyExc_RuntimeError,
-                                       "Start value is larger"
+                                       "Start value is larger "
                                        "than the stop value");
                        return NULL;
                }
@@ -184,16 +184,27 @@ static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
        default:
                if (start >= stop) {
                        PyErr_SetString(PyExc_RuntimeError,
-                                       "Start value is larger"
+                                       "Start value is larger "
                                        "than the stop value");
                        return NULL;
                }
-               size = (stop - start)/step;
-               if (size%step)
-                       size++;
+
+               size = (stop - start);
+
+               if ((size % step) != 0)
+                       size += step;
+
+               size /= step;
+
                break;
        }
 
+       if (size < 2) {
+               PyErr_SetString(PyExc_RuntimeError,
+                               "Vector(): invalid size");
+               return NULL;
+       }
+
        vec = PyMem_Malloc(size * sizeof(float));
 
        if (vec == NULL) {
index df902886f30fa5d8c076b862b47561f378c9c7a9..489f011e693df326c875a0548a0596d6816a5677 100644 (file)
@@ -79,7 +79,7 @@ def seek(r, txt, recurs):
     except:
         keys = None
 
-    if keys != None:
+    if keys is not None:
         if PRINT_DATA:
             print(txt + '.keys() - ' + str(r.keys()))
 
index 604ba189dcfb4a1ae2d840370f5fea7183780080..100b12aa1694b8a91aba48fe54678f28c20dc2e6 100644 (file)
@@ -1745,7 +1745,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
                        check_comp= 0;
 
                        while(seq) {
-                               if(seq->type == SEQ_SCENE) {
+                               if(seq->type == SEQ_SCENE && seq->scene) {
                                        if(!seq->scene_camera) {
                                                if(!seq->scene->camera && !scene_find_camera(seq->scene)) {
                                                        if(seq->scene == scene) {
index a46b37916930dc3631643239ca30a69741daad66..0d5aed7dadb1503360e3929e4f656280319ae25c 100644 (file)
@@ -212,9 +212,9 @@ void fillrect(int *rect, int x, int y, int val)
 }
 
 /* based on Liang&Barsky, for clipping of pyramidical volume */
-static short cliptestf(float p, float q, float *u1, float *u2)
+static short cliptestf(float a, float b, float c, float d, float *u1, float *u2)
 {
-       float r;
+       float p= a + b, q= c + d, r;
        
        if(p<0.0f) {
                if(q<p) return 0;
@@ -854,20 +854,20 @@ static int clipline(float v1[4], float v2[4])     /* return 0: do not draw */
                filled in with zbufwire correctly when rendering in parts. otherwise
                you see line endings at edges... */
        
-       if(cliptestf(-dz-dw, v1[3]+v1[2], &u1,&u2)) {
-               if(cliptestf(dz-dw, v1[3]-v1[2], &u1,&u2)) {
+       if(cliptestf(-dz, -dw, v1[3], v1[2], &u1,&u2)) {
+               if(cliptestf(dz, -dw, v1[3], -v1[2], &u1,&u2)) {
                        
                        dx= v2[0]-v1[0];
                        dz= 1.01f*(v2[3]-v1[3]);
                        v13= 1.01f*v1[3];
                        
-                       if(cliptestf(-dx-dz, v1[0]+v13, &u1,&u2)) {
-                               if(cliptestf(dx-dz, v13-v1[0], &u1,&u2)) {
+                       if(cliptestf(-dx, -dz, v1[0], v13, &u1,&u2)) {
+                               if(cliptestf(dx, -dz, v13, -v1[0], &u1,&u2)) {
                                        
                                        dy= v2[1]-v1[1];
                                        
-                                       if(cliptestf(-dy-dz, v1[1]+v13, &u1,&u2)) {
-                                               if(cliptestf(dy-dz, v13-v1[1], &u1,&u2)) {
+                                       if(cliptestf(-dy, -dz, v1[1], v13, &u1,&u2)) {
+                                               if(cliptestf(dy, -dz, v13, -v1[1], &u1,&u2)) {
                                                        
                                                        if(u2<1.0f) {
                                                                v2[0]= v1[0]+u2*dx;
@@ -1628,8 +1628,8 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
         * who would have thought that of L&B!
         */
 
-       if(cliptestf(-da-dw, v13+v1[a], &u1,&u2)) {
-               if(cliptestf(da-dw, v13-v1[a], &u1,&u2)) {
+       if(cliptestf(-da, -dw, v13, v1[a], &u1,&u2)) {
+               if(cliptestf(da, -dw, v13, -v1[a], &u1,&u2)) {
                        *b3=1;
                        if(u2<1.0f) {
                                labda[1]= u2;
index 079833f693ff3362a61fac85f13126ca4658fed9..621e5449223dfb8b7578c88a976a46a4618af67d 100644 (file)
@@ -2684,9 +2684,11 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
                                }
                                event.utf8_buf[0]= '\0';
                        }
-                       else if (event.ascii<32 && event.ascii > 0) {
-                               event.ascii= '\0';
-                               /* TODO. should this also zero utf8?, dont for now, campbell */
+                       else {
+                               if (event.ascii<32 && event.ascii > 0)
+                                       event.ascii= '\0';
+                               if (event.utf8_buf[0]<32 && event.utf8_buf[0] > 0)
+                                       event.utf8_buf[0]= '\0';
                        }
 
                        if (event.utf8_buf[0]) {
index 3b63c85feeac930161d48fad3156819489595aaf..e6f8d7175dc57de8090f9ab4c13ce48d06931275 100644 (file)
@@ -248,7 +248,7 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
                }
 
                //create tris
-               polys = new unsigned short[npolys*3*2];
+               polys = (unsigned short*)MEM_callocN(sizeof(unsigned short)*3*2*npolys, "BuildVertIndArrays polys");
                memset(polys, 0xff, sizeof(unsigned short)*3*2*npolys);
                unsigned short *poly = polys;
                RAS_Polygon* raspoly;
index 917ccbc0d24f826bdb15a66c859f3c7f11907f26..0495f5d9f98cbca47b6312823562eb991eebff8c 100644 (file)
@@ -74,7 +74,7 @@ def render_gl(context, filepath, shade):
 
 def render_gl_all_modes(context, obj, filepath=""):
 
-    assert(obj != None)
+    assert(obj is not None)
     assert(filepath != "")
 
     scene = context.scene
index b64055df252b9b6cb1e3cceb99b0e290f348c38c..b3781e9469644487015af4aa2c1511de79e68572 100644 (file)
@@ -37,6 +37,7 @@ op_blacklist = (
     "render.render",
     "*.*_export",
     "*.*_import",
+    "wm.blenderplayer_start",
     "wm.url_open",
     "wm.doc_view",
     "wm.path_open",
@@ -137,7 +138,25 @@ def ctx_weightpaint():
     bpy.ops.object.mode_set(mode='WEIGHT_PAINT')
 
 
+def bpy_check_type_duplicates():
+    # non essential sanity check
+    bl_types = dir(bpy.types)
+    bl_types_unique = set(bl_types)
+    
+    if len(bl_types) != len(bl_types_unique):
+        print("Error, found duplicates in 'bpy.types'")
+        for t in sorted(bl_types_unique):
+            tot = bl_types.count(t)
+            if tot > 1:
+                print("    '%s', %d" % (t, tot))
+        import sys
+        sys.exit(1)
+
+
 def main():
+
+    bpy_check_type_duplicates()
+
     # bpy.ops.wm.read_factory_settings()
     import bpy
     operators = []