[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12860] trunk/blender/source/blender: Added a 'LinkData' struct for use with ListBases.

Joshua Leung aligorith at gmail.com
Thu Dec 13 03:09:45 CET 2007


Revision: 12860
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12860
Author:   aligorith
Date:     2007-12-13 03:08:47 +0100 (Thu, 13 Dec 2007)

Log Message:
-----------
Added a 'LinkData' struct for use with ListBases. 

It is used to store a reference to some data that is already in another ListBase. Sometimes, these are needed for small one-off situations, where a custom struct seems overkill...

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_listBase.h
    trunk/blender/source/blender/src/space.c

Modified: trunk/blender/source/blender/makesdna/DNA_listBase.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_listBase.h	2007-12-12 21:49:48 UTC (rev 12859)
+++ trunk/blender/source/blender/makesdna/DNA_listBase.h	2007-12-13 02:08:47 UTC (rev 12860)
@@ -43,11 +43,20 @@
 extern "C" {
 #endif
 
+/* generic - all structs which are used in linked-lists used this */
 typedef struct Link
 {
 	struct Link *next,*prev;
 } Link;
 
+
+/* use this when it is not worth defining a custom one... */
+typedef struct LinkData
+{
+	struct LinkData *next, *prev;
+	void *data;
+} LinkData;
+
 /* never change the size of this! genfile.c detects pointerlen with it */
 typedef struct ListBase 
 {

Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c	2007-12-12 21:49:48 UTC (rev 12859)
+++ trunk/blender/source/blender/src/space.c	2007-12-13 02:08:47 UTC (rev 12860)
@@ -1893,7 +1893,12 @@
 						}
 
 					}
-					else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) addsegment_nurb();
+					else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
+						addsegment_nurb();
+					}
+					else if(G.obedit->type == OB_ARMATURE) {
+						fill_bones_armature();
+					}
 				}
 				else if(G.qual==LR_CTRLKEY)
 					sort_faces();
@@ -2160,6 +2165,9 @@
 							mergemenu();
 							DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
 						}
+						else if (G.obedit == OB_ARMATURE) {
+							merge_armature();
+						}
 					}
 					else if ((G.qual==0) || (G.qual==LR_CTRLKEY)) {
 						mirrormenu();





More information about the Bf-blender-cvs mailing list