merge own commits into render branch into trunk since 27560
authorCampbell Barton <ideasman42@gmail.com>
Sat, 20 Mar 2010 16:41:01 +0000 (16:41 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 20 Mar 2010 16:41:01 +0000 (16:41 +0000)
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623

44 files changed:
CMakeLists.txt
release/scripts/io/import_scene_obj.py
release/scripts/op/image.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/space_image.py
release/scripts/ui/space_userpref.py
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenlib/BLI_listbase.h
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/listbase.c
source/blender/editors/armature/editarmature.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/include/ED_object.h
source/blender/editors/interface/interface_regions.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_transform.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/makesdna/DNA_anim_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/python/doc/sphinx_doc_gen.py
source/blender/python/doc/sphinx_doc_gen.sh [new file with mode: 0644]
source/blender/python/generic/IDProp.c
source/blender/python/intern/bpy_rna.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c

index 279f4d6594785d9277cc29e3f3764fadb9615da2..8b690cdd81a3c23262a4dc1907c40fdda08a58c5 100644 (file)
@@ -181,11 +181,12 @@ IF(UNIX AND NOT APPLE)
                ENDIF(NOT SDL_FOUND)
        ENDIF(WITH_SDL)
 
+    SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
        FIND_PATH(OPENEXR_INC
                ImfXdr.h
                PATHS
+        ${OPENEXR}/include/OpenEXR
                /usr/local/include/OpenEXR
-               /usr/include/OpenEXR
                /sw/include/OpenEXR
                /opt/local/include/OpenEXR
                /opt/csw/include/OpenEXR
index 25919c5d6aa8c373c4dc65b88d869e99262b6e63..e12d0c8eaac4e0f53165122281a10267b7e96ce1 100644 (file)
@@ -316,7 +316,7 @@ def line_value(line_split):
 def load_image(imagepath, dirname):
 
     if os.path.exists(imagepath):
-        return bpy.data.add_image(imagepath)
+        return bpy.data.images.load(imagepath)
 
     variants = [os.path.join(dirname, imagepath), os.path.join(dirname, os.path.basename(imagepath))]
 
index 02d8fcc3219eec46976c1b1198993106cd500442..e0e75a1f17a86e942ed54b8cdf4273076c5ffba4 100644 (file)
 # <pep8 compliant>
 
 import bpy
+from bpy.props import StringProperty
 
+class EditExternally(bpy.types.Operator):
+    '''Edit image in an external application'''
+    bl_idname = "image.external_edit"
+    bl_label = "Image Edit Externally"
+    bl_options = {'REGISTER'}
+
+    path = StringProperty(name="File Path", description="Path to an image file", maxlen= 1024, default= "")
+
+    def _editor_guess(self, context):
+        import platform
+        system = platform.system()
 
-def image_editor_guess(context):
-    import platform
-    system = platform.system()
-    
-    image_editor = context.user_preferences.filepaths.image_editor
+        image_editor = context.user_preferences.filepaths.image_editor
 
-    # use image editor in the preferences when available.
-    if not image_editor:
-        if system == 'Windows':
-            image_editor = ["start"] # not tested!
-        elif system == 'Darwin':
-            image_editor = ["open"]
+        # use image editor in the preferences when available.
+        if not image_editor:
+            if system == 'Windows':
+                image_editor = ["start"] # not tested!
+            elif system == 'Darwin':
+                image_editor = ["open"]
+            else:
+                image_editor = ["gimp"]
         else:
-            image_editor = ["gimp"]
-    else:
-        if system == 'Darwin':
-            # blender file selector treats .app as a folder
-            # and will include a trailing backslash, so we strip it.
-            image_editor.rstrip('\\')
-            image_editor = ["open", "-a", image_editor]
+            if system == 'Darwin':
+                # blender file selector treats .app as a folder
+                # and will include a trailing backslash, so we strip it.
+                image_editor.rstrip('\\')
+                image_editor = ["open", "-a", image_editor]
+
+        return image_editor
+
+    def execute(self, context):
+        import subprocess
+        path = self.properties.path
+        image_editor = self._editor_guess(context)
+
+        cmd = []
+        cmd.extend(image_editor)
+        cmd.append(bpy.utils.expandpath(path))
+
+        subprocess.Popen(cmd)
+
+        return {'FINISHED'}
 
-    return image_editor
+    def invoke(self, context, event):
+        try:
+            path = context.space_data.image.filename
+        except:
+            self.report({'ERROR'}, "Image not found on disk")
+            return {'CANCELLED'}
+
+        self.properties.path = path
+        self.execute(context)
+        
+        return {'FINISHED'}
 
 
 class SaveDirty(bpy.types.Operator):
@@ -79,7 +112,6 @@ class ProjectEdit(bpy.types.Operator):
         import subprocess
 
         EXT = "png" # could be made an option but for now ok
-        image_editor = image_editor_guess(context)
 
         for image in bpy.data.images:
             image.tag = True
@@ -124,11 +156,7 @@ class ProjectEdit(bpy.types.Operator):
         image_new.file_format = 'PNG'
         image_new.save()
 
-        cmd = []
-        cmd.extend(image_editor)
-        cmd.append(bpy.utils.expandpath(filename_final))
-
-        subprocess.Popen(cmd)
+        bpy.ops.image.external_edit(path=filename_final)
 
         return {'FINISHED'}
 
@@ -155,6 +183,7 @@ class ProjectApply(bpy.types.Operator):
 
 
 classes = [
+    EditExternally,
     SaveDirty,
     ProjectEdit,
     ProjectApply]
index ff78791fa0b3a12d72462bf0e35f47c7035716fd..8e381986f23509579713dc91f24c33ca7f71ada4 100644 (file)
@@ -44,7 +44,7 @@ class DataButtonsPanelActive(DataButtonsPanel):
 
     def poll(self, context):
         curve = context.curve
-        return (curve and curve.active_spline)
+        return (curve and curve.splines.active)
 
 
 class DATA_PT_context_curve(DataButtonsPanel):
@@ -205,7 +205,7 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
 
         ob = context.object
         curve = context.curve
-        act_spline = curve.active_spline
+        act_spline = curve.splines.active
         is_surf = (ob.type == 'SURFACE')
         is_poly = (act_spline.type == 'POLY')
 
index 3fd7025a4f72e7b315ff3807b8de9b1b1aa9aa3f..1e37cb16f817752cbb585de07007ed6f7a891454 100644 (file)
@@ -115,6 +115,8 @@ class IMAGE_MT_image(bpy.types.Menu):
             if ima.source == 'SEQUENCE':
                 layout.operator("image.save_sequence")
 
+            layout.operator("image.external_edit", "Edit Externally")
+
             if not show_render:
                 layout.separator()
 
index 64b79614a6f6e7d8914ea8ffe3e76560b59dcc41..9f86c27ca250526d5435a5c14cf1514e1716b697 100644 (file)
@@ -1413,8 +1413,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
         addons = [(mod, addon_info_get(mod)) for mod in self._addon_list()]
 
         cats = {info["category"] for mod, info in addons}
-        cats.add("")
-        cats.remove("")
+        cats.discard("")
 
         cats = ['All', 'Disabled', 'Enabled'] + sorted(cats)
 
@@ -1489,6 +1488,24 @@ class USERPREF_PT_addons(bpy.types.Panel):
                     split.separator()
                     split.separator()
 
+        # Append missing scripts
+        # First collect scripts that are used but have no script file.
+        module_names = {mod.__name__ for mod, info in addons}
+        missing_modules = {ext for ext in used_ext if ext not in module_names}
+
+        if missing_modules and filter in ("All", "Enabled"):
+            layout.column().separator()
+            layout.column().label(text="Missing script files")
+
+            module_names = {mod.__name__ for mod, info in addons}
+            for ext in sorted(missing_modules):
+                # Addon UI Code
+                box = layout.column().box()
+                column = box.column()
+                row = column.row()
+
+                row.label(text=ext, icon="ERROR")
+                row.operator("wm.addon_disable").module = ext
 
 from bpy.props import *
 
@@ -1537,21 +1554,8 @@ class WM_OT_addon_enable(bpy.types.Operator):
         # check if add-on is written for current blender version, or raise a warning
         info = addon_info_get(mod)
 
-        if info["blender"]:
-            version = info["blender"].split(".", 2)
-            for i in range(len(version)):
-                try:
-                    version[i] = int(version[i])
-                except:
-                    break
-
-                if version[i] > bpy.app.version[i]:
-                    self.report("WARNING','This script was written for a newer version of Blender \
-and might not function (correctly).\nThe script is enabled though.")
-                elif version[i] == bpy.app.version[i]:
-                    continue
-                else:
-                    break
+        if info.get("blender", (0, 0, 0)) > bpy.app.version:
+            self.report("WARNING','This script was written for a newer version of Blender and might not function (correctly).\nThe script is enabled though.")
 
         return {'FINISHED'}
 
@@ -1668,7 +1672,6 @@ class WM_OT_addon_expand(bpy.types.Operator):
 
         info = addon_info_get(mod)
         info["expanded"] = not info["expanded"]
-        print(info["expanded"])
         return {'FINISHED'}
 
 
index 5fb44c5230701366315af1db5e43d3c9ec48bb79..7119a7256301f3ba99965d5e53448c0b91235022 100644 (file)
@@ -40,12 +40,12 @@ struct ListBase;
 struct BezTriple;
 struct BevList;
 
-#define KNOTSU(nu)         ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_CYCLIC) ? (nu->orderu-1) : 0) )
-#define KNOTSV(nu)         ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_CYCLIC) ? (nu->orderv-1) : 0) )
+#define KNOTSU(nu)         ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_NURB_CYCLIC) ? (nu->orderu-1) : 0) )
+#define KNOTSV(nu)         ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_NURB_CYCLIC) ? (nu->orderv-1) : 0) )
 
 /* Non cyclic nurbs have 1 less segment */
-#define SEGMENTSU(nu)      ( ((nu)->flagu & CU_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 )
-#define SEGMENTSV(nu)      ( ((nu)->flagv & CU_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 )
+#define SEGMENTSU(nu)      ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 )
+#define SEGMENTSV(nu)      ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 )
 
 #define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1)
 #define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || cu->bevobj || cu->ext1!=0.0 || cu->ext2!=0.0) ? 1:0)
@@ -89,6 +89,9 @@ void sethandlesNurb(ListBase *editnurb, short code);
 
 void switchdirectionNurb( struct Nurb *nu);
 
+void addNurbPoints(struct Nurb *nu, int number);
+void addNurbPointsBezier(struct Nurb *nu, int number);
+
 float (*curve_getVertexCos(struct Curve *cu, struct ListBase *lb, int *numVerts_r))[3];
 void curve_applyVertexCos(struct Curve *cu, struct ListBase *lb, float (*vertexCos)[3]);
 
index 31743a6bd1ad9ca1a05337ce2bbc8a7e369a2d94..1e9103fb951e87ebb5c6513380364728ed5882e7 100644 (file)
@@ -771,6 +771,8 @@ static short animsys_remap_path (AnimMapper *remap, char *path, char **dst)
 /* Write the given value to a setting using RNA, and return success */
 static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value)
 {
+    // printf("%p %s %i %f\n", ptr, path, array_index, value);
+
        PropertyRNA *prop;
        PointerRNA new_ptr;
        
@@ -780,22 +782,35 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                /* set value - only for animatable numerical values */
                if (RNA_property_animateable(&new_ptr, prop)) 
                {
+                       int array_len= RNA_property_array_length(&new_ptr, prop);
+
+                       if(array_len && array_index >= array_len)
+                       {
+                               if (G.f & G_DEBUG) {
+                                       printf("Animato: Invalid array index. ID = '%s',  '%s[%d]', array length is %d \n",
+                                               (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>",
+                                               path, array_index, array_len-1);
+                               }
+
+                               return 0;
+                       }
+
                        switch (RNA_property_type(prop)) 
                        {
                                case PROP_BOOLEAN:
-                                       if (RNA_property_array_length(&new_ptr, prop))
+                                       if (array_len)
                                                RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value);
                                        else
                                                RNA_property_boolean_set(&new_ptr, prop, (int)value);
                                        break;
                                case PROP_INT:
-                                       if (RNA_property_array_length(&new_ptr, prop))
+                                       if (array_len)
                                                RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value);
                                        else
                                                RNA_property_int_set(&new_ptr, prop, (int)value);
                                        break;
                                case PROP_FLOAT:
-                                       if (RNA_property_array_length(&new_ptr, prop))
+                                       if (array_len)
                                                RNA_property_float_set_index(&new_ptr, prop, array_index, value);
                                        else
                                                RNA_property_float_set(&new_ptr, prop, value);
@@ -817,7 +832,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                // XXX don't tag as failed yet though, as there are some legit situations (Action Constraint) 
                // where some channels will not exist, but shouldn't lock up Action
                if (G.f & G_DEBUG) {
-                       printf("Animato: Invalid path. ID = '%s',  '%s [%d]' \n", 
+                       printf("Animato: Invalid path. ID = '%s',  '%s[%d]' \n",
                                (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>", 
                                path, array_index);
                }
@@ -989,6 +1004,9 @@ static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime)
                /* execute these settings as per normal */
                animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime);
        }
+
+       if (strip->flag & NLASTRIP_FLAG_USR_TIME && strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC)
+               strip->strip_time= fmod(strip->strip_time - strip->actstart, strip->actend - strip->actstart);
 }
 
 /* gets the strip active at the current time for a list of strips for evaluation purposes */
index 2430e417e514749755ef751a0db00b6b752a34f9..b476ebf4994f7e18b48770c161a714fefbd9b093 100644 (file)
@@ -519,7 +519,47 @@ void minmaxNurb(Nurb *nu, float *min, float *max)
                        bp++;
                }
        }
+}
+
+/* be sure to call makeknots after this */
+void addNurbPoints(Nurb *nu, int number)
+{
+       BPoint *tmp= nu->bp;
+       int i;
+       nu->bp= (BPoint *)MEM_mallocN((nu->pntsu + number) * sizeof(BPoint), "rna_Curve_spline_points_add");
+
+       if(tmp) {
+               memmove(nu->bp, tmp, nu->pntsu * sizeof(BPoint));
+               MEM_freeN(tmp);
+       }
+
+       memset(nu->bp + nu->pntsu, 0, number * sizeof(BPoint));
+
+       for(i=0, tmp= nu->bp + nu->pntsu; i < number; i++, tmp++) {
+               tmp->radius= 1.0f;
+       }
+
+       nu->pntsu += number;
+}
+
+void addNurbPointsBezier(Nurb *nu, int number)
+{
+       BezTriple *tmp= nu->bezt;
+       int i;
+       nu->bezt= (BezTriple *)MEM_mallocN((nu->pntsu + number) * sizeof(BezTriple), "rna_Curve_spline_points_add");
+
+       if(tmp) {
+               memmove(nu->bezt, tmp, nu->pntsu * sizeof(BezTriple));
+               MEM_freeN(tmp);
+       }
+
+       memset(nu->bezt + nu->pntsu, 0, number * sizeof(BezTriple));
+
+       for(i=0, tmp= nu->bezt + nu->pntsu; i < number; i++, tmp++) {
+               tmp->radius= 1.0f;
+       }
 
+       nu->pntsu += number;
 }
 
 /* ~~~~~~~~~~~~~~~~~~~~Non Uniform Rational B Spline calculations ~~~~~~~~~~~ */
@@ -603,7 +643,7 @@ void makeknots(Nurb *nu, short uv)
                        if(nu->knotsu) MEM_freeN(nu->knotsu);
                        if(check_valid_nurb_u(nu)) {
                                nu->knotsu= MEM_callocN(4+sizeof(float)*KNOTSU(nu), "makeknots");
-                               if(nu->flagu & CU_CYCLIC) {
+                               if(nu->flagu & CU_NURB_CYCLIC) {
                                        calcknots(nu->knotsu, nu->pntsu, nu->orderu, 0);  /* cyclic should be uniform */
                                        makecyclicknots(nu->knotsu, nu->pntsu, nu->orderu);
                                } else {
@@ -616,7 +656,7 @@ void makeknots(Nurb *nu, short uv)
                        if(nu->knotsv) MEM_freeN(nu->knotsv);
                        if(check_valid_nurb_v(nu)) {
                                nu->knotsv= MEM_callocN(4+sizeof(float)*KNOTSV(nu), "makeknots");
-                               if(nu->flagv & CU_CYCLIC) {
+                               if(nu->flagv & CU_NURB_CYCLIC) {
                                        calcknots(nu->knotsv, nu->pntsv, nu->orderv, 0);  /* cyclic should be uniform */
                                        makecyclicknots(nu->knotsv, nu->pntsv, nu->orderv);
                                } else {
@@ -734,18 +774,18 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride)
        
        fp= nu->knotsu;
        ustart= fp[nu->orderu-1];
-       if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
+       if(nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
        else uend= fp[nu->pntsu];
-       ustep= (uend-ustart)/((nu->flagu & CU_CYCLIC) ? totu : totu - 1);
+       ustep= (uend-ustart)/((nu->flagu & CU_NURB_CYCLIC) ? totu : totu - 1);
        
        basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbfaces3");
 
        fp= nu->knotsv;
        vstart= fp[nu->orderv-1];
        
-       if(nu->flagv & CU_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1];
+       if(nu->flagv & CU_NURB_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1];
        else vend= fp[nu->pntsv];
-       vstep= (vend-vstart)/((nu->flagv & CU_CYCLIC) ? totv : totv - 1);
+       vstep= (vend-vstart)/((nu->flagv & CU_NURB_CYCLIC) ? totv : totv - 1);
        
        len= KNOTSV(nu);
        basisv= (float *)MEM_mallocN(sizeof(float)*len*totv, "makeNurbfaces3");
@@ -753,7 +793,7 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride)
        jend= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces5");
 
        /* precalculation of basisv and jstart,jend */
-       if(nu->flagv & CU_CYCLIC) cycl= nu->orderv-1; 
+       if(nu->flagv & CU_NURB_CYCLIC) cycl= nu->orderv-1; 
        else cycl= 0;
        v= vstart;
        basis= basisv;
@@ -764,7 +804,7 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride)
                v+= vstep;
        }
 
-       if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1; 
+       if(nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1; 
        else cycl= 0;
        in= coord_array;
        u= ustart;
@@ -882,13 +922,13 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu
 
        fp= nu->knotsu;
        ustart= fp[nu->orderu-1];
-       if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
+       if(nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
        else uend= fp[nu->pntsu];
-       ustep= (uend-ustart)/(resolu - ((nu->flagu & CU_CYCLIC) ? 0 : 1));
+       ustep= (uend-ustart)/(resolu - ((nu->flagu & CU_NURB_CYCLIC) ? 0 : 1));
        
        basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbcurve3");
 
-       if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1; 
+       if(nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1; 
        else cycl= 0;
 
        u= ustart;
@@ -1022,8 +1062,8 @@ float *make_orco_surf(Object *ob)
                
                sizeu = nu->pntsu*nu->resolu; 
                sizev = nu->pntsv*nu->resolv;
-               if (nu->flagu & CU_CYCLIC) sizeu++;
-               if (nu->flagv & CU_CYCLIC) sizev++;
+               if (nu->flagu & CU_NURB_CYCLIC) sizeu++;
+               if (nu->flagv & CU_NURB_CYCLIC) sizev++;
                if(nu->pntsv>1) tot+= sizeu * sizev;
                
                nu= nu->next;
@@ -1036,8 +1076,8 @@ float *make_orco_surf(Object *ob)
                if(nu->pntsv>1) {
                        sizeu = nu->pntsu*nu->resolu; 
                        sizev = nu->pntsv*nu->resolv;
-                       if (nu->flagu & CU_CYCLIC) sizeu++;
-                       if (nu->flagv & CU_CYCLIC) sizev++;
+                       if (nu->flagu & CU_NURB_CYCLIC) sizeu++;
+                       if (nu->flagv & CU_NURB_CYCLIC) sizev++;
                        
                        if(cu->flag & CU_UV_ORCO) {
                                for(b=0; b< sizeu; b++) {
@@ -1063,12 +1103,12 @@ float *make_orco_surf(Object *ob)
                                
                                for(b=0; b<sizeu; b++) {
                                        int use_b= b;
-                                       if (b==sizeu-1 && (nu->flagu & CU_CYCLIC))
+                                       if (b==sizeu-1 && (nu->flagu & CU_NURB_CYCLIC))
                                                use_b= 0;
                                        
                                        for(a=0; a<sizev; a++) {
                                                int use_a= a;
-                                               if (a==sizev-1 && (nu->flagv & CU_CYCLIC))
+                                               if (a==sizev-1 && (nu->flagv & CU_NURB_CYCLIC))
                                                        use_a= 0;
                                                
                                                tdata = _tdata + 3 * (use_b * (nu->pntsv*nu->resolv) + use_a);
@@ -1511,14 +1551,14 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
        
        /* returns a point */
        if(prevbezt==nu->bezt) {
-               if(nu->flagu & CU_CYCLIC) pprev= last;
+               if(nu->flagu & CU_NURB_CYCLIC) pprev= last;
                else pprev= prevbezt;
        }
        else pprev= prevbezt-1;
        
        /* next point */
        if(bezt==last) {
-               if(nu->flagu & CU_CYCLIC) next= nu->bezt;
+               if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
                else next= bezt;
        }
        else next= bezt+1;
@@ -1977,7 +2017,7 @@ void makeBevelList(Object *ob)
                                bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList2");
                                BLI_addtail(&(cu->bev), bl);
        
-                               if(nu->flagu & CU_CYCLIC) bl->poly= 0;
+                               if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
                                else bl->poly= -1;
                                bl->nr= len;
                                bl->dupe_nr= 0;
@@ -1995,17 +2035,17 @@ void makeBevelList(Object *ob)
                        }
                        else if(nu->type == CU_BEZIER) {
        
-                               len= resolu*(nu->pntsu+ (nu->flagu & CU_CYCLIC) -1)+1;  /* in case last point is not cyclic */
+                               len= resolu*(nu->pntsu+ (nu->flagu & CU_NURB_CYCLIC) -1)+1;     /* in case last point is not cyclic */
                                bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelBPoints");
                                BLI_addtail(&(cu->bev), bl);
        
-                               if(nu->flagu & CU_CYCLIC) bl->poly= 0;
+                               if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
                                else bl->poly= -1;
                                bevp= (BevPoint *)(bl+1);
        
                                a= nu->pntsu-1;
                                bezt= nu->bezt;
-                               if(nu->flagu & CU_CYCLIC) {
+                               if(nu->flagu & CU_NURB_CYCLIC) {
                                        a++;
                                        prevbezt= nu->bezt+(nu->pntsu-1);
                                }
@@ -2066,7 +2106,7 @@ void makeBevelList(Object *ob)
                                        bezt++;
                                }
                                
-                               if((nu->flagu & CU_CYCLIC)==0) {            /* not cyclic: endpoint */
+                               if((nu->flagu & CU_NURB_CYCLIC)==0) {       /* not cyclic: endpoint */
                                        VECCOPY(bevp->vec, prevbezt->vec[1]);
                                        bevp->alfa= prevbezt->alfa;
                                        bevp->radius= prevbezt->radius;
@@ -2081,7 +2121,7 @@ void makeBevelList(Object *ob)
                                        BLI_addtail(&(cu->bev), bl);
                                        bl->nr= len;
                                        bl->dupe_nr= 0;
-                                       if(nu->flagu & CU_CYCLIC) bl->poly= 0;
+                                       if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
                                        else bl->poly= -1;
                                        bevp= (BevPoint *)(bl+1);
                                        
@@ -2521,7 +2561,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
        
        a= nu->pntsu;
        bezt= nu->bezt;
-       if(nu->flagu & CU_CYCLIC) prev= bezt+(a-1);
+       if(nu->flagu & CU_NURB_CYCLIC) prev= bezt+(a-1);
        else prev= 0;
        next= bezt+1;
 
@@ -2529,7 +2569,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
                calchandleNurb(bezt, prev, next, 0);
                prev= bezt;
                if(a==1) {
-                       if(nu->flagu & CU_CYCLIC) next= nu->bezt;
+                       if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
                        else next= 0;
                }
                else next++;
@@ -2986,7 +3026,7 @@ int check_valid_nurb_u( struct Nurb *nu )
        if (nu->type != CU_NURBS)                       return 1; /* not a nurb, lets assume its valid */
        
        if (nu->pntsu < nu->orderu)                     return 0;
-       if (((nu->flag & CU_CYCLIC)==0) && ((nu->flagu>>1) & 2)) { /* Bezier U Endpoints */
+       if (((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) { /* Bezier U Endpoints */
                if (nu->orderu==4) {
                        if (nu->pntsu < 5)                      return 0; /* bezier with 4 orderu needs 5 points */
                } else if (nu->orderu != 3)             return 0; /* order must be 3 or 4 */
@@ -3000,7 +3040,7 @@ int check_valid_nurb_v( struct Nurb *nu)
        if (nu->type != CU_NURBS)                       return 1; /* not a nurb, lets assume its valid */
        
        if (nu->pntsv < nu->orderv)                     return 0;
-       if (((nu->flag & CU_CYCLIC)==0) && ((nu->flagv>>1) & 2)) { /* Bezier V Endpoints */
+       if (((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) { /* Bezier V Endpoints */
                if (nu->orderv==4) {
                        if (nu->pntsv < 5)                      return 0; /* bezier with 4 orderu needs 5 points */
                } else if (nu->orderv != 3)             return 0; /* order must be 3 or 4 */
@@ -3015,7 +3055,7 @@ int clamp_nurb_order_u( struct Nurb *nu )
                nu->orderu= nu->pntsu;
                change= 1;
        }
-       if(((nu->flag & CU_CYCLIC)==0) && (nu->flagu>>1)&2) {
+       if(((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) {
                CLAMP(nu->orderu, 3,4);
                change= 1;
        }
@@ -3029,7 +3069,7 @@ int clamp_nurb_order_v( struct Nurb *nu)
                nu->orderv= nu->pntsv;
                change= 1;
        }
-       if(((nu->flag & CU_CYCLIC)==0) && (nu->flagv>>1)&2) {
+       if(((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) {
                CLAMP(nu->orderv, 3,4);
                change= 1;
        }
index 56eabc0f5eff13c2a746ab6ed5726bc55c8ecadc..07ecf4c92a979dd354abd6adf67da95e6a8e39a7 100644 (file)
@@ -840,17 +840,17 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
                                /* count */
                                len= 0;
                                a= nu->pntsu-1;
-                               if(nu->flagu & CU_CYCLIC) a++;
+                               if(nu->flagu & CU_NURB_CYCLIC) a++;
 
                                prevbezt= nu->bezt;
                                bezt= prevbezt+1;
                                while(a--) {
-                                       if(a==0 && (nu->flagu & CU_CYCLIC)) bezt= nu->bezt;
+                                       if(a==0 && (nu->flagu & CU_NURB_CYCLIC)) bezt= nu->bezt;
                                        
                                        if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) len++;
                                        else len+= resolu;
                                        
-                                       if(a==0 && (nu->flagu & CU_CYCLIC)==0) len++;
+                                       if(a==0 && (nu->flagu & CU_NURB_CYCLIC)==0) len++;
                                        
                                        prevbezt= bezt;
                                        bezt++;
@@ -867,7 +867,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
 
                                data= dl->verts;
 
-                               if(nu->flagu & CU_CYCLIC) {
+                               if(nu->flagu & CU_NURB_CYCLIC) {
                                        dl->type= DL_POLY;
                                        a= nu->pntsu;
                                }
@@ -920,7 +920,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
                                dl->charidx = nu->charidx;
 
                                data= dl->verts;
-                               if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY;
+                               if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
                                else dl->type= DL_SEGM;
                                makeNurbcurve(nu, data, NULL, NULL, resolu, 3*sizeof(float));
                        }
@@ -935,7 +935,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
                                dl->charidx = nu->charidx;
 
                                data= dl->verts;
-                               if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY;
+                               if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
                                else dl->type= DL_SEGM;
                                
                                a= len;
@@ -1610,7 +1610,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
                                dl->rt= nu->flag;
                                
                                data= dl->verts;
-                               if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY;
+                               if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
                                else dl->type= DL_SEGM;
                                
                                makeNurbcurve(nu, data, NULL, NULL, nu->resolu, 3*sizeof(float));
@@ -1631,8 +1631,8 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
                                
                                dl->parts= (nu->pntsu*nu->resolu);      /* in reverse, because makeNurbfaces works that way */
                                dl->nr= (nu->pntsv*nu->resolv);
-                               if(nu->flagv & CU_CYCLIC) dl->flag|= DL_CYCL_U; /* reverse too! */
-                               if(nu->flagu & CU_CYCLIC) dl->flag|= DL_CYCL_V;
+                               if(nu->flagv & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_U;    /* reverse too! */
+                               if(nu->flagu & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_V;
 
                                makeNurbfaces(nu, data, 0);
                                
index efd93aa362d3893bdfcc25ba371656a68b29f9b2..8ec4814dc94de265635a3897f608391757be1f72 100644 (file)
@@ -473,7 +473,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
        nu2->pntsv = 1;
        nu2->orderu = 4;
        nu2->orderv = 1;
-       nu2->flagu = CU_CYCLIC;
+       nu2->flagu = CU_NURB_CYCLIC;
 
        bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp"); 
        if (bp == 0){
index 8d2dfcd1989f910bc3b64e1da311e9a503a384cc..08130f51b0ea9b9b113573cd0900fcbbb1fae79a 100644 (file)
@@ -1165,7 +1165,7 @@ void mesh_to_curve(Scene *scene, Object *ob)
                                nu->pntsu= totpoly;
                                nu->pntsv= 1;
                                nu->orderu= 4;
-                               nu->flagu= 2 | (closed ? CU_CYCLIC:0);  /* endpoint */
+                               nu->flagu= CU_NURB_ENDPOINT | (closed ? CU_NURB_CYCLIC:0);      /* endpoint */
                                nu->resolu= 12;
 
                                nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*totpoly, "bpoints");
index f2fec215c2b8c8294e01018dcf0ae14ea4c03b1b..1f6a1ee5a971ab9ec78c6e2d6fdcd05d94a73c1d 100644 (file)
@@ -49,6 +49,7 @@ int BLI_findstringindex(struct ListBase *listbase, const char *id, int offset);
 void BLI_freelistN(struct ListBase *listbase);
 void BLI_addtail(struct ListBase *listbase, void *vlink);
 void BLI_remlink(struct ListBase *listbase, void *vlink);
+int BLI_remlink_safe(struct ListBase *listbase, void *vlink);
 
 void BLI_addhead(struct ListBase *listbase, void *vlink);
 void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink);
index b08631b9317ff3870864dc7a54b9596ad404728c..d06ca7b44d65edf97b91690b521fab52a9f27036 100644 (file)
@@ -150,7 +150,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
                        nu->pntsu = onpoints[j];
                        nu->resolu= 8;
                        nu->flag= CU_2D;
-                       nu->flagu= CU_CYCLIC;
+                       nu->flagu= CU_NURB_CYCLIC;
                        nu->bezt = bezt;
 
                        //individual curve loop, start-end
index 5d046dce0233192376a838ae43aef47b1c58987f..0a6831558d1aa77fdf7fe97bc5a34413aaf98599 100644 (file)
@@ -108,6 +108,17 @@ void BLI_remlink(ListBase *listbase, void *vlink)
        if (listbase->first == link) listbase->first = link->next;
 }
 
+int BLI_remlink_safe(ListBase *listbase, void *vlink)
+{
+       if(BLI_findindex(listbase, vlink) != -1) {
+               BLI_remlink(listbase, vlink);
+               return 1;
+       }
+       else {
+               return 0;
+       }
+}
+
 
 void BLI_freelinkN(ListBase *listbase, void *vlink)
 {
index b4666923a03d46ddf30ad2fd09e2f8843c778586..5d9531e6b3791aebd2b9edaa0f52e5cc435af655 100644 (file)
@@ -545,7 +545,7 @@ static void applyarmature_fix_boneparents (Scene *scene, Object *armob)
                        /* apply current transform from parent (not yet destroyed), 
                         * then calculate new parent inverse matrix
                         */
-                       ED_object_apply_obmat(ob);
+                       object_apply_mat4(ob, ob->obmat);
                        
                        what_does_parent(scene, ob, &workob);
                        invert_m4_m4(ob->parentinv, workob.obmat);
index de4f426eb65cf7a1b3afe8627791a8245dfcfa05..dfc76aff3dd3c5be7c54844a6087834211715d84 100644 (file)
@@ -929,9 +929,9 @@ static void adduplicateflagNurb(Object *obedit, short flag)
                                                bezt1++;
                                        }
 
-                                       if(nu->flagu & CU_CYCLIC) {
+                                       if(nu->flagu & CU_NURB_CYCLIC) {
                                                if(starta!=0 || enda!=nu->pntsu-1) {
-                                                       newnu->flagu &= ~CU_CYCLIC;
+                                                       newnu->flagu &= ~CU_NURB_CYCLIC;
                                                }
                                        }
                                }
@@ -966,9 +966,9 @@ static void adduplicateflagNurb(Object *obedit, short flag)
                                                bp1++;
                                        }
 
-                                       if(nu->flagu & CU_CYCLIC) {
+                                       if(nu->flagu & CU_NURB_CYCLIC) {
                                                if(starta!=0 || enda!=nu->pntsu-1) {
-                                                       newnu->flagu &= ~CU_CYCLIC;
+                                                       newnu->flagu &= ~CU_NURB_CYCLIC;
                                                }
                                        }
 
@@ -1904,7 +1904,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
            newly created. Old points are discarded.
         */
                        /* count */
-                       if(nu->flagu & CU_CYCLIC) {
+                       if(nu->flagu & CU_NURB_CYCLIC) {
                                a= nu->pntsu;
                                bezt= nu->bezt;
                                prevbezt= bezt+(a-1);
@@ -1925,7 +1925,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
                                beztnew =
                                        (BezTriple*)MEM_mallocN((amount + nu->pntsu) * sizeof(BezTriple), "subdivNurb");
                                beztn= beztnew;
-                               if(nu->flagu & CU_CYCLIC) {
+                               if(nu->flagu & CU_NURB_CYCLIC) {
                                        a= nu->pntsu;
                                        bezt= nu->bezt;
                                        prevbezt= bezt+(a-1);
@@ -1957,7 +1957,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
                                                mid_v3_v3v3(beztn->vec[1], vec+9, vec+12);
                                                VECCOPY(beztn->vec[2], vec+12);
                                                /* handle of next bezt */
-                                               if(a==0 && (nu->flagu & CU_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);}
+                                               if(a==0 && (nu->flagu & CU_NURB_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);}
                                                else {VECCOPY(bezt->vec[0], vec+6);}
                                                
                                                beztn->radius = (prevbezt->radius + bezt->radius)/2.0f;
@@ -1970,7 +1970,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
                                        bezt++;
                                }
                                /* last point */
-                               if((nu->flagu & CU_CYCLIC)==0) memcpy(beztn, prevbezt, sizeof(BezTriple));
+                               if((nu->flagu & CU_NURB_CYCLIC)==0) memcpy(beztn, prevbezt, sizeof(BezTriple));
 
                                MEM_freeN(nu->bezt);
                                nu->bezt= beztnew;
@@ -1987,7 +1987,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
            stable... nzc 30-5-'00
          */
                        /* count */
-                       if(nu->flagu & CU_CYCLIC) {
+                       if(nu->flagu & CU_NURB_CYCLIC) {
                                a= nu->pntsu;
                                bp= nu->bp;
                                prevbp= bp+(a-1);
@@ -2009,7 +2009,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
                                        (BPoint*)MEM_mallocN((amount + nu->pntsu) * sizeof(BPoint), "subdivNurb2");
                                bpn= bpnew;
 
-                               if(nu->flagu & CU_CYCLIC) {
+                               if(nu->flagu & CU_NURB_CYCLIC) {
                                        a= nu->pntsu;
                                        bp= nu->bp;
                                        prevbp= bp+(a-1);
@@ -2036,7 +2036,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
                                        prevbp= bp;
                                        bp++;
                                }
-                               if((nu->flagu & CU_CYCLIC)==0) memcpy(bpn, prevbp, sizeof(BPoint));     /* last point */
+                               if((nu->flagu & CU_NURB_CYCLIC)==0) memcpy(bpn, prevbp, sizeof(BPoint));        /* last point */
 
                                MEM_freeN(nu->bp);
                                nu->bp= bpnew;
@@ -2423,8 +2423,8 @@ static int convertspline(short type, Nurb *nu)
                else if(type==CU_NURBS) {
                        nu->type = CU_NURBS;
                        nu->orderu= 4;
-                       nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */
-                       nu->flagu += 4;
+                       nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */
+                       nu->flagu |= CU_NURB_BEZIER;
                        makeknots(nu, 1);
                        a= nu->pntsu*nu->pntsv;
                        bp= nu->bp;
@@ -2473,11 +2473,11 @@ static int convertspline(short type, Nurb *nu)
                        nu->orderu= 4;
                        nu->orderv= 1;
                        nu->type = type;
-                       if(nu->flagu & CU_CYCLIC) c= nu->orderu-1; 
+                       if(nu->flagu & CU_NURB_CYCLIC) c= nu->orderu-1; 
                        else c= 0;
                        if(type== CU_NURBS) {
-                               nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */
-                               nu->flagu += 4;
+                               nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */
+                               nu->flagu |= CU_NURB_BEZIER;
                                makeknots(nu, 1);
                        }
                }
@@ -2992,7 +2992,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
        
        /* find both nurbs and points, nu1 will be put behind nu2 */
        for(nu= editnurb->first; nu; nu= nu->next) {
-               if((nu->flagu & CU_CYCLIC)==0) {    /* not cyclic */
+               if((nu->flagu & CU_NURB_CYCLIC)==0) {    /* not cyclic */
                        if(nu->type == CU_BEZIER) {
                                bezt= nu->bezt;
                                if(nu1==0) {
@@ -3284,7 +3284,7 @@ static int spin_nurb(bContext *C, Scene *scene, Object *obedit, float *dvec, flo
                for(nu= editnurb->first; nu; nu= nu->next) {
                        if(isNurbsel(nu)) {
                                nu->orderv= 4;
-                               nu->flagv |= CU_CYCLIC;
+                               nu->flagv |= CU_NURB_CYCLIC;
                                makeknots(nu, 2);
                        }
                }
@@ -3587,7 +3587,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
                                bp= nu->bp;
                                while(a--) {
                                        if( bp->f1 & SELECT ) {
-                                               nu->flagu ^= CU_CYCLIC;
+                                               nu->flagu ^= CU_NURB_CYCLIC;
                                                break;
                                        }
                                        bp++;
@@ -3598,7 +3598,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
                                bezt= nu->bezt;
                                while(a--) {
                                        if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
-                                               nu->flagu ^= CU_CYCLIC;
+                                               nu->flagu ^= CU_NURB_CYCLIC;
                                                break;
                                        }
                                        bezt++;
@@ -3611,7 +3611,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
                                        bp= nu->bp;
                                        while(a--) {
                                                if( bp->f1 & SELECT ) {
-                                                       nu->flagu ^= CU_CYCLIC;
+                                                       nu->flagu ^= CU_NURB_CYCLIC;
                                                        makeknots(nu, 1);       /* 1==u  type is ignored for cyclic curves */
                                                        break;
                                                }
@@ -3626,11 +3626,11 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
        
                                        if( bp->f1 & SELECT) {
                                                if(direction==0 && nu->pntsu>1) {
-                                                       nu->flagu ^= CU_CYCLIC;
+                                                       nu->flagu ^= CU_NURB_CYCLIC;
                                                        makeknots(nu, 1);   /* 1==u  type is ignored for cyclic curves */
                                                }
                                                if(direction==1 && nu->pntsv>1) {
-                                                       nu->flagv ^= CU_CYCLIC;
+                                                       nu->flagv ^= CU_NURB_CYCLIC;
                                                        makeknots(nu, 2);   /* 2==v  type is ignored for cyclic curves */
                                                }
                                                break;
@@ -4430,10 +4430,10 @@ static int delete_exec(bContext *C, wmOperator *op)
                                                bezt2= bezt+1;
                                                if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ;
                                                else {  /* maybe do not make cyclic */
-                                                       if(a==0 && (nu->flagu & CU_CYCLIC) ) {
+                                                       if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
                                                                bezt2= bezt+(nu->pntsu-1);
                                                                if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) {
-                                                                       nu->flagu &= ~CU_CYCLIC;
+                                                                       nu->flagu &= ~CU_NURB_CYCLIC;
                                                                        WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
                                                                        DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
                                                                }
@@ -4456,10 +4456,10 @@ static int delete_exec(bContext *C, wmOperator *op)
                                                bp2= bp+1;
                                                if( bp2->f1 & 1 ) ;
                                                else {  /* maybe do not make cyclic */
-                                                       if(a==0 && (nu->flagu & CU_CYCLIC) ) {
+                                                       if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
                                                                bp2= bp+(nu->pntsu-1);
                                                                if( bp2->f1 & SELECT ) {
-                                                                       nu->flagu &= ~CU_CYCLIC;
+                                                                       nu->flagu &= ~CU_NURB_CYCLIC;
                                                                        WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
                                                                        DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
                                                                }
@@ -4484,14 +4484,14 @@ static int delete_exec(bContext *C, wmOperator *op)
                                        BLI_remlink(editnurb, nu);
                                        freeNurb(nu); nu = NULL;
                                }
-                               else if(nu1->flagu & CU_CYCLIC) {       /* cyclic */
+                               else if(nu1->flagu & CU_NURB_CYCLIC) {  /* cyclic */
                                        bezt =
                                                (BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb1");
                                        memcpy(bezt, nu1->bezt,(cut+1)*sizeof(BezTriple));
                                        a= nu1->pntsu-cut-1;
                                        memcpy(nu1->bezt, bezt2, a*sizeof(BezTriple));
                                        memcpy(nu1->bezt+a, bezt, (cut+1)*sizeof(BezTriple));
-                                       nu1->flagu &= ~CU_CYCLIC;
+                                       nu1->flagu &= ~CU_NURB_CYCLIC;
                                        MEM_freeN(bezt);
                                        calchandlesNurb(nu);
                                }
@@ -4526,14 +4526,14 @@ static int delete_exec(bContext *C, wmOperator *op)
                                        BLI_remlink(editnurb, nu);
                                        freeNurb(nu); nu= NULL;
                                }
-                               else if(nu1->flagu & CU_CYCLIC) {       /* cyclic */
+                               else if(nu1->flagu & CU_NURB_CYCLIC) {  /* cyclic */
                                        bp =
                                                (BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb5");
                                        memcpy(bp, nu1->bp,(cut+1)*sizeof(BPoint));
                                        a= nu1->pntsu-cut-1;
                                        memcpy(nu1->bp, bp2, a*sizeof(BPoint));
                                        memcpy(nu1->bp+a, bp, (cut+1)*sizeof(BPoint));
-                                       nu1->flagu &= ~CU_CYCLIC;
+                                       nu1->flagu &= ~CU_NURB_CYCLIC;
                                        MEM_freeN(bp);
                                }
                                else {                  /* add new curve */
@@ -4849,7 +4849,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
                nu->pntsu= 5;
                nu->pntsv= 1;
                nu->orderu= 5;
-               nu->flagu= 2;   /* endpoint */
+               nu->flagu= CU_NURB_ENDPOINT;    /* endpoint */
                nu->resolu= 8;
                nu->bp= callocstructN(BPoint, 5, "addNurbprim3");
 
@@ -4888,7 +4888,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
                        if (!force_3d) nu->flag |= CU_2D;
                        nu->pntsu= 4;
                        nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1");
-                       nu->flagu= CU_CYCLIC;
+                       nu->flagu= CU_NURB_CYCLIC;
                        bezt= nu->bezt;
 
                        bezt->h1= bezt->h2= HD_AUTO;
@@ -4925,7 +4925,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
                        nu->pntsv= 1;
                        nu->orderu= 4;
                        nu->bp= callocstructN(BPoint, 8, "addNurbprim6");
-                       nu->flagu= CU_CYCLIC;
+                       nu->flagu= CU_NURB_CYCLIC;
                        bp= nu->bp;
 
                        for(a=0; a<8; a++) {
@@ -5047,7 +5047,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
                                mul_m4_v3(mat,bp->vec);
                                bp++;
                        }
-                       nu->flagu= 4;
+                       nu->flagu= CU_NURB_BEZIER;
                        makeknots(nu, 1);
 
                        BLI_addtail(editnurb, nu); /* temporal for spin */
index 7bcfc81bf26224fa504df47cac5817ec651d2126..5c9b939aa1fc855225714b94d79ca3bd3611f8a3 100644 (file)
@@ -423,7 +423,7 @@ static void gp_stroke_to_path (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Cur
        nu->pntsu= gps->totpoints;
        nu->pntsv= 1;
        nu->orderu= gps->totpoints;
-       nu->flagu= 2;   /* endpoint */
+       nu->flagu= CU_NURB_ENDPOINT;
        nu->resolu= 32;
        
        nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*gps->totpoints, "bpoints");
index 8045f2a91302803285f93248813e6e93dbfaf37f..ba80a15d050500d1533319e62d7bd07723beb083 100644 (file)
@@ -62,7 +62,6 @@ void ED_base_object_activate(struct bContext *C, struct Base *base);
 
 void ED_base_object_free_and_unlink(struct Scene *scene, struct Base *base);
 
-void ED_object_apply_obmat(struct Object *ob);
        /* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */
 struct Base *ED_object_add_duplicate(struct Scene *scene, struct Base *base, int dupflag);
 
index e29a6703bb8d91cc36e959cef71873a760376ecd..e12db3674d4b1e4450a68847fd500e168f11dcf4 100644 (file)
@@ -413,6 +413,15 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
                BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
                data->linedark[data->totline]= 1;
                data->totline++;
+               
+               if(but->rnapoin.id.data) {
+                       ID *id= but->rnapoin.id.data;
+                       if(id->lib && id->lib->name) {
+                               BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Library: %s", id->lib->name);
+                               data->linedark[data->totline]= 1;
+                               data->totline++;
+                       }
+               }
        }
        else if (but->optype) {
                PointerRNA *opptr;
index b1405d1d12e081c08df23a789736b1f4283b87a1..484a67b94dbd6fcc2729f69a6ed2f8ace58f3c2b 100644 (file)
@@ -1118,7 +1118,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base)
                ob->lay= base->lay;
                
                copy_m4_m4(ob->obmat, dob->mat);
-               ED_object_apply_obmat(ob);
+               object_apply_mat4(ob, ob->obmat);
        }
        
        copy_object_set_idnew(C, 0);
index 807fa00d8067694ec909667a0097537c92a5406a..65e8fbeeb8f421700e2e3977e4a3b8b1edd755dc 100644 (file)
@@ -150,34 +150,6 @@ static int pupmenu(const char *msg) {return 0;}
 static bContext *C;
 static void error_libdata() {}
 
-/* ********************************** */
-
-/* --------------------------------- */
-
-void ED_object_apply_obmat(Object *ob)
-{
-       float mat[3][3], imat[3][3], tmat[3][3];
-       
-       /* from obmat to loc rot size */
-       
-       if(ob==NULL) return;
-       copy_m3_m4(mat, ob->obmat);
-       
-       VECCOPY(ob->loc, ob->obmat[3]);
-
-       mat3_to_eul( ob->rot,mat);
-       eul_to_mat3( tmat,ob->rot);
-
-       invert_m3_m3(imat, tmat);
-       
-       mul_m3_m3m3(tmat, imat, mat);
-       
-       ob->size[0]= tmat[0][0];
-       ob->size[1]= tmat[1][1];
-       ob->size[2]= tmat[2][2];
-       
-}
-
 /* ********* clear/set restrict view *********/
 static int object_restrictview_clear_exec(bContext *C, wmOperator *op)
 {
index f55e7594c24dfe76210e41a34d3c6d9021f7d43a..94eae2a7ab9c0f56d9a5e6a0ad7b8c4ba10c2702 100644 (file)
@@ -430,7 +430,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op)
                else if(type == 1) {
                        ob->parent= NULL;
                        ob->track= NULL;
-                       ED_object_apply_obmat(ob);
+                       object_apply_mat4(ob, ob->obmat);
                }
                else if(type == 2)
                        unit_m4(ob->parentinv);
@@ -572,7 +572,7 @@ static int parent_set_exec(bContext *C, wmOperator *op)
                                Object workob;
                                
                                /* apply transformation of previous parenting */
-                               ED_object_apply_obmat(ob);
+                               object_apply_mat4(ob, ob->obmat);
                                
                                /* set the parent (except for follow-path constraint option) */
                                if(partype != PAR_PATH_CONST)
@@ -887,7 +887,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
                }
                
                if(type == 1)
-                       ED_object_apply_obmat(ob);
+                       object_apply_mat4(ob, ob->obmat);
        }
        CTX_DATA_END;
 
index db15322bbc4f90cc53a9402262be78b037921714..ca6feabdf80daa993ff5f254c481d14fa2d4b878 100644 (file)
@@ -392,7 +392,7 @@ static void ignore_parent_tx(Main *bmain, Scene *scene, Object *ob )
        /* a change was made, adjust the children to compensate */
        for(ob_child=bmain->object.first; ob_child; ob_child=ob_child->id.next) {
                if(ob_child->parent == ob) {
-                       ED_object_apply_obmat(ob_child);
+                       object_apply_mat4(ob_child, ob_child->obmat);
                        what_does_parent(scene, ob_child, &workob);
                        invert_m4_m4(ob_child->parentinv, workob.obmat);
                }
index d7f3436713c5a04e7a26779a62ab66c73ba04f46..e29a81612fa59a28db552aac3ed197e022707e5e 100644 (file)
@@ -40,6 +40,7 @@
 #include "DNA_space_types.h"
 #include "DNA_world_types.h"
 
+#include "BKE_animsys.h"
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
 #include "BKE_font.h"
index 944a93a713f57ceeca87cd0a270ab6fc16eac9a7..62a325b59f416c90a82e54dfc57da114d0f25e8b 100644 (file)
@@ -379,7 +379,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
 {
        PointerRNA strip_ptr;
        uiLayout *layout= pa->layout;
-       uiLayout *column, *subcolumn;
+       uiLayout *column, *subcolumn, *subrow;
        uiBlock *block;
 
        /* check context and also validity of pointer */
@@ -398,10 +398,13 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
                
        
        column= uiLayoutColumn(layout, 1);
-               uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0);
-               
+               subrow= uiLayoutRow(column, 0);
+               uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time", 0);
+               uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time_cyclic", 0);
+
                subcolumn= uiLayoutColumn(column, 1);
-               uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_time"));
+               subrow= uiLayoutRow(subcolumn, 0);
+               uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "animated_time"));
                        uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0);
 }
 
index 8fedc56df67c8da671ab4b56e311c3505274cb13..5a495488afaf16471ad9cc59acfb998b2abf7638 100644 (file)
@@ -5773,7 +5773,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        }
                        break;
                case OB_CAMERA:
-                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0 || (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */
                                drawcamera(scene, v3d, rv3d, ob, flag);
                        break;
                case OB_LATTICE:
index b1f5e95938875c29d0516ddfa94fc0f365fb4f48..79448ecf8754857896bd066c2e8df16888a868ce 100644 (file)
@@ -2352,11 +2352,11 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
        
        /* Draw particle edit brush XXX (removed) */
        
-       if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
 
-               if(rv3d->persp==RV3D_CAMOB) drawviewborder(scene, ar, v3d);
-               if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar);
+       if(rv3d->persp==RV3D_CAMOB) drawviewborder(scene, ar, v3d);
+       if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar);
 
+       if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
                /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */
        //      if (v3d->flag2 & V3D_DISPGP)
                        draw_gpencil_3dview((bContext *)C, 0);
index f09b127bfdd804bbb0f96d2ba8428f44e63473a8..efc3c80de5f59a77132922c86fbdc60c158736ca 100644 (file)
@@ -1353,11 +1353,12 @@ static int viewselected_exec(bContext *C, wmOperator *op) /* like a localview wi
                        for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
                                if(pchan->bone->flag & BONE_SELECTED) {
                                        if(pchan->bone->layer & arm->layer) {
+                                               bPoseChannel *pchan_tx= pchan->custom_tx ? pchan->custom_tx : pchan;
                                                ok= 1;
-                                               VECCOPY(vec, pchan->pose_head);
+                                               VECCOPY(vec, pchan_tx->pose_head);
                                                mul_m4_v3(ob->obmat, vec);
                                                DO_MINMAX(vec, min, max);
-                                               VECCOPY(vec, pchan->pose_tail);
+                                               VECCOPY(vec, pchan_tx->pose_tail);
                                                mul_m4_v3(ob->obmat, vec);
                                                DO_MINMAX(vec, min, max);
                                        }
index 828d536883499433834faef4eb8475fd5115bc98..02c4a1d91ed2aea18d0c241baefdd0fe0d50afb8 100644 (file)
@@ -2288,12 +2288,12 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
                                break;
 
                        case FLY_MODAL_DIR_UP:
-                               if (fly->speed < 0.0f) fly->speed= -fly->speed;
+                               if (fly->speed > 0.0f) fly->speed= -fly->speed;
                                fly->axis= 1;
                                break;
 
                        case FLY_MODAL_DIR_DOWN:
-                               if (fly->speed > 0.0f) fly->speed= -fly->speed;
+                               if (fly->speed < 0.0f) fly->speed= -fly->speed;
                                fly->axis= 1;
                                break;
 
index 83f68758da922778901b2897743ad067f1e14438..8c2fc7db390fcef3672b28e70a7581b27daf7714 100644 (file)
@@ -601,6 +601,7 @@ typedef enum eNlaStrip_Flag {
                /* strip influence is controlled by local F-Curve */
        NLASTRIP_FLAG_USR_INFLUENCE     = (1<<5),
        NLASTRIP_FLAG_USR_TIME          = (1<<6),
+       NLASTRIP_FLAG_USR_TIME_CYCLIC = (1<<7),
        
                /* NLA strip length is synced to the length of the referenced action */
        NLASTRIP_FLAG_SYNC_LENGTH       = (1<<9),
index 1e2cc2745a4d3324e1b99372857de037faa858f9..82418899172d5ed431fd8ed8a1af5e2e3ddab83d 100644 (file)
@@ -288,7 +288,9 @@ typedef struct Curve {
 
 
 /* flagu flagv (nurb) */
-#define CU_CYCLIC              1
+#define CU_NURB_CYCLIC         1
+#define CU_NURB_ENDPOINT       2
+#define CU_NURB_BEZIER         4
 
 /* *************** BEZTRIPLE **************** */
 
index 178cdacf3c34cb1a37fd187afa70720121849359..77eff6ad4c51f6c2ce4db41f1877a70de6d8dadc 100644 (file)
@@ -334,6 +334,7 @@ typedef struct ExtensionRNA {
 #define MainMaterials Main
 #define MainMeshes Main
 #define MainLamps Main
+#define MainImages Main
 #define MainObjects Main
 #define MainTexts Main
 #define MainActions Main
index 24701ed866d2c360bf81e28b319f7a058fc4fafd..579ebfc9332c96830fe72f7c1d79f13531b09cd8 100644 (file)
@@ -50,6 +50,14 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = {
                {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
                {0, NULL, 0, NULL, NULL}};
 
+EnumPropertyItem curve_type_items[] = {
+       {CU_POLY, "POLY", 0, "Poly", ""},
+       {CU_BEZIER, "BEZIER", 0, "Bezier", ""},
+       {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""},
+       {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
+       {CU_NURBS, "NURBS", 0, "Ease", ""},
+       {0, NULL, 0, NULL, NULL}};
+
 #ifdef RNA_RUNTIME
 
 #include "DNA_object_types.h"
@@ -72,22 +80,6 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr)
        else return &RNA_Curve;
 }
 
-
-static PointerRNA rna_Curve_active_nurb_get(PointerRNA *ptr)
-{
-       Curve *cu= (Curve*)ptr->data;
-       Nurb *nu= NULL;
-
-       if(cu->editnurb)
-               nu = BLI_findlink(cu->editnurb, cu->actnu);
-
-       if(nu)
-               return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
-
-       return rna_pointer_inherit_refine(ptr, NULL, NULL);
-}
-
-
 static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
 {
        BezTriple *bt= (BezTriple*)ptr->data;
@@ -208,14 +200,17 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA
        rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
 }
 
-static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Curve_update_data_id(Main *bmain, Scene *scene, ID *id)
 {
-       ID *id= ptr->id.data;
-       
        DAG_id_flush_update(id, OB_RECALC_DATA);
        WM_main_add_notifier(NC_GEOM|ND_DATA, id);
 }
 
+static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+       rna_Curve_update_data_id(bmain, scene, ptr->id.data);
+}
+
 static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        DAG_scene_sort(scene);
@@ -316,6 +311,119 @@ static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
        rna_Curve_update_data(bmain, scene, ptr);
 }
 
+static void rna_Curve_spline_points_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number)
+{
+       if(nu->type == CU_BEZIER) {
+               BKE_report(reports, RPT_ERROR, "Bezier spline can't have points added");
+       }
+       else if(number==0) {
+               // do nothing
+       } else {
+
+               addNurbPoints(nu, number);
+
+               /* update */
+               makeknots(nu, 1);
+
+               rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id);
+       }
+}
+
+static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number)
+{
+       if(nu->type != CU_BEZIER) {
+               BKE_report(reports, RPT_ERROR, "Only bezier splines can be added");
+       }
+       else if(number==0) {
+               // do nothing
+       } else {
+               addNurbPointsBezier(nu, number);
+
+               /* update */
+               makeknots(nu, 1);
+
+               rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id);
+       }
+}
+
+static Nurb *rna_Curve_spline_new(Curve *cu, int type)
+{
+       Nurb *nu= ( Nurb * ) MEM_callocN( sizeof( Nurb ), "spline.new" );
+
+       if(type==CU_BEZIER) {
+               BezTriple *bezt= (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
+               bezt->radius= 1.0;
+               nu->bezt= bezt;
+       }
+       else {
+               BPoint *bp= (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp");
+               bp->radius= 1.0f;
+               nu->bp= bp;
+       }
+
+       nu->type= type;
+       nu->pntsu= 1;
+       nu->pntsv= 1;
+
+       nu->orderu= nu->orderv= 4;
+       nu->resolu= nu->resolv= 12;
+       nu->flag= CU_SMOOTH;
+
+       BLI_addtail(&cu->nurb, nu);
+
+       return nu;
+}
+
+static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
+{
+       /* todo, check we're in the list */
+       int found= 0;
+       if(cu->editnurb) {
+               found= BLI_remlink_safe(cu->editnurb, nu);
+       }
+       else {
+               found= BLI_remlink_safe(&cu->nurb, nu);
+       }
+
+       if(!found) {
+               BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2);
+               return;
+       }
+
+       freeNurb(nu);
+       /* invalidate pointer!, no can do */
+}
+
+static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
+{
+       Curve *cu= (Curve*)ptr->data;
+       Nurb *nu;
+
+       if(cu->editnurb)
+               nu= BLI_findlink(cu->editnurb, cu->actnu);
+       else
+               nu= BLI_findlink(&cu->nurb, cu->actnu); // currently set to -1,  should be changed to be allowed outside of editmode.
+
+       if(nu)
+               return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
+
+       return rna_pointer_inherit_refine(ptr, NULL, NULL);
+}
+
+static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
+{
+       Curve *cu= (Curve*)ptr->data;
+       Nurb *nu= value.data;
+
+       /* -1 is ok for an unset index */
+       if(nu==NULL)
+               cu->actnu= -1;
+       else if(cu->editnurb)
+               cu->actnu= BLI_findindex(cu->editnurb, nu);
+       else
+               cu->actnu= BLI_findindex(&cu->nurb, nu);
+}
+
 #else
 
 static void rna_def_bpoint(BlenderRNA *brna)
@@ -725,6 +833,100 @@ static void rna_def_text(BlenderRNA *brna)
        rna_def_nurbs(brna, srna);
 }
 
+
+/* curve.splines[0].points */
+static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
+{
+       StructRNA *srna;
+       //PropertyRNA *prop;
+
+       FunctionRNA *func;
+       PropertyRNA *parm;
+
+       RNA_def_property_srna(cprop, "SplinePoints");
+       srna= RNA_def_struct(brna, "SplinePoints", NULL);
+       RNA_def_struct_sdna(srna, "Nurb");
+       RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points");
+
+       func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
+       RNA_def_function_ui_description(func, "Add a number of points to this spline.");
+       RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
+       parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+
+       /*
+       func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+       RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+       RNA_def_function_flag(func, FUNC_USE_REPORTS);
+       parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
+       */
+}
+
+static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
+{
+       StructRNA *srna;
+       //PropertyRNA *prop;
+
+       FunctionRNA *func;
+       PropertyRNA *parm;
+
+       RNA_def_property_srna(cprop, "SplineBezierPoints");
+       srna= RNA_def_struct(brna, "SplineBezierPoints", NULL);
+       RNA_def_struct_sdna(srna, "Nurb");
+       RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points");
+
+       func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
+       RNA_def_function_ui_description(func, "Add a number of points to this spline.");
+       RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
+       parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+
+       /*
+       func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+       RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+       RNA_def_function_flag(func, FUNC_USE_REPORTS);
+       parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
+       */
+}
+
+/* curve.splines */
+static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+
+       FunctionRNA *func;
+       PropertyRNA *parm;
+
+       RNA_def_property_srna(cprop, "CurveSplines");
+       srna= RNA_def_struct(brna, "CurveSplines", NULL);
+       RNA_def_struct_sdna(srna, "Curve");
+       RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines");
+
+       func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
+       RNA_def_function_ui_description(func, "Add a new spline to the curve.");
+       parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
+       parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
+       RNA_def_function_return(func, parm);
+
+       func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+       RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+       RNA_def_function_flag(func, FUNC_USE_REPORTS);
+       parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
+
+       prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+       RNA_def_property_struct_type(prop, "Object");
+       RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL);
+       RNA_def_property_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline");
+       /* Could call: ED_base_object_activate(C, scene->basact);
+        * but would be a bad level call and it seems the notifier is enough */
+       RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
+}
+
+
 static void rna_def_curve(BlenderRNA *brna)
 {
        StructRNA *srna;
@@ -757,12 +959,7 @@ static void rna_def_curve(BlenderRNA *brna)
        RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL);
        RNA_def_property_struct_type(prop, "Spline");
        RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object");
-
-       prop= RNA_def_property(srna, "active_spline", PROP_POINTER, PROP_NONE);
-       RNA_def_property_struct_type(prop, "Spline");
-       RNA_def_property_pointer_funcs(prop, "rna_Curve_active_nurb_get", NULL, NULL);
-       RNA_def_property_ui_text(prop, "Active Spline", "The active editmode spline");
-
+       rna_def_curve_splines(brna, prop);
 
        prop= RNA_def_property(srna, "draw_handles", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES);
@@ -888,14 +1085,6 @@ static void rna_def_curve(BlenderRNA *brna)
 
 static void rna_def_curve_nurb(BlenderRNA *brna)
 {
-       static EnumPropertyItem curve_type_items[] = {
-               {CU_POLY, "POLY", 0, "Poly", ""},
-               {CU_BEZIER, "BEZIER", 0, "Bezier", ""},
-               {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""},
-               {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
-               {CU_NURBS, "NURBS", 0, "Ease", ""},
-               {0, NULL, 0, NULL, NULL}};
-
        static EnumPropertyItem spline_interpolation_items[] = {
                {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""},
                {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""},
@@ -915,11 +1104,13 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
        RNA_def_property_struct_type(prop, "SplinePoint");
        RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0);
        RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline");
+       rna_def_curve_spline_points(brna, prop);
 
        prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "BezierSplinePoint");
        RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu");
        RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for bezier curves only");
+       rna_def_curve_spline_bezpoints(brna, prop);
 
        
        prop= RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE);
@@ -982,34 +1173,34 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
        RNA_def_property_update(prop, 0, "rna_Curve_update_data");
 
        prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_CYCLIC);
+       RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_CYCLIC);
        RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction");
        RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */
 
        prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_CYCLIC);
+       RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_CYCLIC);
        RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction");
        RNA_def_property_update(prop, 0, "rna_Curve_update_data");
 
 
        /* Note, endpoint and bezier flags should never be on at the same time! */
        prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flagu", 2);
+       RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_ENDPOINT);
        RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)");
        RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
 
        prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flagv", 2);
+       RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT);
        RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)");
        RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
 
        prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flagu", 4);
+       RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_BEZIER);
        RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)");
        RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
 
        prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flagv", 4);
+       RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_BEZIER);
        RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)");
        RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
 
index 5f007c63b9e65dbf32997a93f4142acf197ad95a..9433294fdd3976882955b59481261a78da9bc649 100644 (file)
@@ -69,11 +69,6 @@ Tex *rna_Main_add_texture(Main *bmain, char *name)
        return add_texture(name);
 }
 
-Image *rna_Main_add_image(Main *bmain, char *filename)
-{
-       return BKE_add_image_file(filename, 0);
-}
-
 Camera *rna_Main_cameras_new(Main *bmain, char* name)
 {
        return add_camera(name);
@@ -227,6 +222,27 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
        /* XXX python now has invalid pointer? */
 }
 
+Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int float_buffer)
+{
+       float color[4]= {0.0, 0.0, 0.0, 1.0};
+       Image *image= BKE_add_image_size(width, height, name, float_buffer, 0, color);
+       image->id.us--;
+       return image;
+}
+Image *rna_Main_images_load(Main *bmain, char *filename)
+{
+       return BKE_add_image_file(filename, 0);
+}
+void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
+{
+       if(ID_REAL_USERS(image) <= 0)
+               free_libblock(&bmain->image, image);
+       else
+               BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d.", image->id.name+2, ID_REAL_USERS(image));
+
+       /* XXX python now has invalid pointer? */
+}
+
 Tex *rna_Main_textures_new(Main *bmain, char* name)
 {
        Tex *tex= add_texture(name);
@@ -309,15 +325,20 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
 
 void RNA_api_main(StructRNA *srna)
 {
+       /*
        FunctionRNA *func;
        PropertyRNA *parm;
-
+       */
+       /* maybe we want to add functions in 'bpy.data' still?
+        * for now they are all in collections bpy.data.images.new(...) */
+       /*
        func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
        RNA_def_function_ui_description(func, "Add a new image.");
        parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from.");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
        RNA_def_function_return(func, parm);
+       */
 
 }
 
@@ -491,8 +512,40 @@ void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
 }
 void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
 {
+       StructRNA *srna;
+       FunctionRNA *func;
+       PropertyRNA *parm;
 
+       RNA_def_property_srna(cprop, "MainImages");
+       srna= RNA_def_struct(brna, "MainImages", NULL);
+       RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
+
+       func= RNA_def_function(srna, "new", "rna_Main_images_new");
+       RNA_def_function_ui_description(func, "Add a new image to the main database");
+       parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
+       parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX);
+       parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX);
+       parm= RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
+       /* return type */
+       parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
+       RNA_def_function_return(func, parm);
+
+       func= RNA_def_function(srna, "load", "rna_Main_images_load");
+       RNA_def_function_ui_description(func, "Load a new image into the main database");
+       parm= RNA_def_string(func, "filename", "File Name", 0, "", "path of the file to load.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
+       /* return type */
+       parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
+       RNA_def_function_return(func, parm);
+
+       func= RNA_def_function(srna, "remove", "rna_Main_images_remove");
+       RNA_def_function_flag(func, FUNC_USE_REPORTS);
+       RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
+       parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
+       RNA_def_property_flag(parm, PROP_REQUIRED);
 }
+
 void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
 {
 
index 9cbe46dac58f00ce6832e6f2bca4ccaab46bef48..b3f4aab7599d3931d3393c120dec139a440a676f 100644 (file)
@@ -411,6 +411,11 @@ static void rna_def_nlastrip(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
        RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
+
+       prop= RNA_def_property(srna, "animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
+       RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
+       RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag?
        
        /* settings */
        prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
index 117a1d5bc600e4c34b7c88505843941900bfa738..21a1b7994a54b7822602a89a1fb7be72133477e0 100644 (file)
@@ -125,7 +125,7 @@ void rna_Object_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 
 void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
-       ED_object_apply_obmat(ptr->id.data);
+       object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat);
        rna_Object_update(bmain, scene, ptr);
 }
 
index 1686f3e69db4b8a402c390c87b256169d5782503..1fb24c2da2806beacec2cd7fe8e1a420506ed663 100644 (file)
@@ -178,12 +178,12 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
        return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
 }
 
-static Base *rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob)
+static Base *rna_Scene_object_link(Scene *scene, ReportList *reports, Object *ob)
 {
        Base *base;
 
        if (ob->type != OB_EMPTY && ob->data==NULL) {
-               BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.");
+               BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.", ob->id.name+2);
                return NULL;
        }
 
@@ -204,7 +204,7 @@ static Base *rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob
        return base;
 }
 
-static void rna_Scene_unlink_object(Scene *scene, bContext *C, ReportList *reports, Object *ob)
+static void rna_Scene_object_unlink(Scene *scene, bContext *C, ReportList *reports, Object *ob)
 {
        Base *base= object_in_scene(ob, scene);
        if (!base) {
@@ -2604,7 +2604,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
        RNA_def_struct_sdna(srna, "Scene");
        RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
 
-       func= RNA_def_function(srna, "link", "rna_Scene_link_object");
+       func= RNA_def_function(srna, "link", "rna_Scene_object_link");
        RNA_def_function_ui_description(func, "Link object to scene.");
        RNA_def_function_flag(func, FUNC_USE_REPORTS);
        parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
@@ -2612,7 +2612,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
        parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
        RNA_def_function_return(func, parm);
 
-       func= RNA_def_function(srna, "unlink", "rna_Scene_unlink_object");
+       func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
        RNA_def_function_ui_description(func, "Unlink object from scene.");
        RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
        parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
index 701aad651cfcd98c21369b111449b8cc23364737..944dbb082a6bde3872beb12c933dfa658eaf23b3 100644 (file)
@@ -277,6 +277,8 @@ def rna2sphinx(BASEPATH):
     fw("\n")
     fw("An introduction to blender and python can be found at <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\n")
     fw("\n")
+    fw("`A PDF version of this document is also available <blender_python_reference_250.pdf>`__\n")
+    fw("\n")
     fw(".. warning:: The Python API in Blender is **UNSTABLE**, It should only be used for testing, any script written now may break in future releases.\n")
     fw("   \n")
     fw("   The following areas are subject to change.\n")
diff --git a/source/blender/python/doc/sphinx_doc_gen.sh b/source/blender/python/doc/sphinx_doc_gen.sh
new file mode 100644 (file)
index 0000000..3f5460a
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+# run from the blender source dir
+#   bash source/blender/python/doc/sphinx_doc_gen.sh
+# ssh upload means you need a login into the server
+
+BLENDER="./blender.bin"
+SSH_HOST="ideasman42@emo.blender.org"
+SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation/250PythonDoc"
+
+# clear doc dir
+rm -rf ./source/blender/python/doc/sphinx-in ./source/blender/python/doc/sphinx-out
+$BLENDER -b -P ./source/blender/python/doc/sphinx_doc_gen.py
+
+# html
+sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out
+cp source/blender/python/doc/sphinx-out/contents.html source/blender/python/doc/sphinx-out/index.html
+ssh ideasman42@emo.blender.org 'rm -rf '$SSH_UPLOAD'/*'
+rsync --progress -avze "ssh -p 22" /b/source/blender/python/doc/sphinx-out/* $SSH_HOST:$SSH_UPLOAD/
+
+# pdf
+sphinx-build -b latex source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out
+cd source/blender/python/doc/sphinx-out
+make
+cd ../../../../../
+rsync --progress -avze "ssh -p 22" source/blender/python/doc/sphinx-out/contents.pdf $SSH_HOST:$SSH_UPLOAD/blender_python_reference_250.pdf
index eb883be5a56012e720a85b7857f65d5771638d85..f7eb800ef23cff65facb4e526eb4e26814a9cb90 100644 (file)
  */
 
 #include "BKE_idprop.h"
-
 #include "IDProp.h"
-
-#define BSTR_EQ(a, b)  (*(a) == *(b) && !strcmp(a, b))
+#include "MEM_guardedalloc.h"
 
 /*** Function to wrap ID properties ***/
 PyObject *BPy_Wrap_IDProperty(ID *id, IDProperty *prop, IDProperty *parent);
index c9906bb15993d7001c38341024d0f016ca63e5e7..dcbdc6d64d429c5b8438ad9da12936e83744d72a 100644 (file)
@@ -359,7 +359,7 @@ static PyObject *pyrna_struct_repr( BPy_StructRNA *self )
                return pyob;
        }
 
-       return PyUnicode_FromFormat( "<bpy_struct, %.200s>", RNA_struct_identifier(self->ptr.type));
+       return PyUnicode_FromFormat( "<bpy_struct, %.200s at %p>", RNA_struct_identifier(self->ptr.type), self->ptr.data);
 }
 
 static PyObject *pyrna_prop_repr( BPy_PropertyRNA *self )
@@ -1663,8 +1663,9 @@ int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, char *error_pre
 {
        char *path;
        PropertyRNA *prop;
+       int array_len;
 
-       if (!PyArg_ParseTuple(args, "s|if", &path, &index, &cfra)) {
+       if (!PyArg_ParseTuple(args, "s|if", &path, index, cfra)) {
                PyErr_Format(PyExc_TypeError, "%.200s expected a string and optionally an int and float arguments", error_prefix);
                return -1;
        }
@@ -1693,6 +1694,12 @@ int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, char *error_pre
                return -1;
        }
 
+       array_len= RNA_property_array_length(ptr, prop);
+       if((*index) != -1 && (*index) >= array_len) {
+               PyErr_Format( PyExc_TypeError, "%.200s index out of range \"%s\", given %d, array length is %d", error_prefix, path, *index, array_len);
+               return -1;
+       }
+
        if(*cfra==FLT_MAX)
                *cfra= CTX_data_scene(BPy_GetContext())->r.cfra;
 
index fc6433b95b9e04c5f1554405d2cf5242d274096c..4f9218cc8875e77327ddc3d381b67b5915eabbdd 100644 (file)
@@ -225,7 +225,6 @@ void ED_mesh_transform(struct Mesh *me, float *mat){}
 void ED_mesh_update(struct Mesh *mesh, struct bContext *C){}
 int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me){return 0;}
 int ED_mesh_uv_texture_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me){return 0;}
-void ED_object_apply_obmat(struct Object *ob){}
 void ED_object_constraint_dependency_update(struct Scene *scene, struct Object *ob){}
 void ED_object_constraint_update(struct Object *ob){}
 struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, char *name){return (struct bDeformGroup *) NULL;}
index 703ed09c97639e77b08fcba568c8435c0958a077..7eb8f36e4d850b3ba8389cef23f8721d8f20ebf1 100644 (file)
@@ -162,6 +162,7 @@ static void blender_esc(int sig)
 }
 
 /* buildinfo can have quotes */
+#ifdef BUILD_DATE
 static void strip_quotes(char *str)
 {
     if(str[0] == '"') {
@@ -172,6 +173,7 @@ static void strip_quotes(char *str)
         }
     }
 }
+#endif
 
 static int print_version(int argc, char **argv, void *data)
 {