make Node.links return a tuple, this may you can't do socket.links.append() by mistake.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 21 Dec 2012 12:16:13 +0000 (12:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 21 Dec 2012 12:16:13 +0000 (12:16 +0000)
removed RNAMeta mixin class since you cant register subclasses.

also some minor code cleanup

release/scripts/modules/bpy_types.py
source/blender/blenkernel/intern/object.c
source/blender/blenlib/BLI_array.h
source/blender/compositor/operations/COM_TrackPositionOperation.cpp
source/blender/windowmanager/intern/wm_draw.c

index a32feda5d0ca23a8aba5248a2e1262e1b402d183..11e1115fa4cec2500e192e4b06fcd34442863a58 100644 (file)
@@ -484,6 +484,15 @@ class Text(bpy_types.ID):
                                  if cont.type == 'PYTHON']
                      )
 
+class NodeSocket(StructRNA):  # , metaclass=RNAMeta
+    __slots__ = ()
+
+    @property
+    def links(self):
+        """List of node links from or to this socket"""
+        return tuple(link for link in self.id_data.links if link.from_socket == self or link.to_socket == self)
+
+
 # values are module: [(cls, path, line), ...]
 TypeMap = {}
 
@@ -717,12 +726,3 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
         self.path_menu(bpy.utils.preset_paths(self.preset_subdir),
                        self.preset_operator,
                        filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
-
-
-class NodeSocket(StructRNA, metaclass=RNAMeta):
-    __slots__ = ()
-
-    @property
-    def links(self):
-        """List of node links from or to this socket"""
-        return [link for link in self.id_data.links if link.from_socket == self or link.to_socket == self]
index f9bbf0dcc53c96ea631b7d24c9e98fb74635b5a1..8826f86d72a2d5011c888fe0b169198bcf1719e2 100644 (file)
@@ -1925,7 +1925,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
        }
        else if (ELEM(par->type, OB_CURVE, OB_SURF)) {
                Curve *cu       = par->data;
-               ListBase *nurb  = BKE_curve_nurbs_get(cu);;
+               ListBase *nurb  = BKE_curve_nurbs_get(cu);
 
                BKE_nurbList_index_get_co(nurb, nr, vec);
        }
index 6d34b0d48d5be95f8f1b24ccdb67b9a218bfa76c..7c8816cb58a923bcb7b51c21ace3d33ffe926a08 100644 (file)
        ((arr = (void *)_##arr##_static), (_##arr##_count += (num)))              \
            :                                                                     \
        /* use existing static array or allocate */                               \
-       ((BLI_array_totalsize(arr) >= _##arr##_count + num) ?                     \
-           (_##arr##_count += num) :                                             \
+       (LIKELY(BLI_array_totalsize(arr) >= _##arr##_count + num) ?               \
+           (_##arr##_count += num) :  /* UNLIKELY --> realloc */                 \
            (                                                                     \
                (void) (_##arr##_tmp = MEM_callocN(                               \
                        sizeof(*arr) * (num < _##arr##_count ?                    \
index 8b5288321c13ffd037b9c26e79f8585cc1a8e1bf..e647ae975ffe85fc796aa65d4910775f1d3a1bc0 100644 (file)
@@ -42,7 +42,7 @@ TrackPositionOperation::TrackPositionOperation() : NodeOperation()
        this->m_trackingObjectName[0] = 0;
        this->m_trackName[0] = 0;
        this->m_axis = 0;
-       this->m_position = POSITION_ABSOLUTE;;
+       this->m_position = POSITION_ABSOLUTE;
        this->m_relativeFrame = 0;
 }
 
index 11cf1088280e89036e46340c86b778061bb39bc6..dbd722c80dd32a989e9fcf40a1d0bde8abbd4316 100644 (file)
@@ -796,7 +796,7 @@ void wm_draw_update(bContext *C)
        GPU_free_unused_buffers();
        
        for (win = wm->windows.first; win; win = win->next) {
-               int state = GHOST_GetWindowState(win->ghostwin);;
+               int state = GHOST_GetWindowState(win->ghostwin);
 
                if (state == GHOST_kWindowStateMinimized) {
                        /* do not update minimized windows, it gives issues on intel drivers (see [#33223])