[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41543] trunk/blender/source/blender: more DNA object edits

Campbell Barton ideasman42 at gmail.com
Sat Nov 5 04:03:02 CET 2011


Revision: 41543
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41543
Author:   campbellbarton
Date:     2011-11-05 03:02:55 +0000 (Sat, 05 Nov 2011)
Log Message:
-----------
more DNA object edits
- remove 'path' pointer, wasnt used anywhere.
- remove comments about what each game flag 'bit' does, these are defines now.
- reduce the size of DupliObject 8 bytes.
also commented some of the struct members.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/object.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/makesdna/DNA_object_types.h

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c	2011-11-05 02:30:25 UTC (rev 41542)
+++ trunk/blender/source/blender/blenkernel/intern/object.c	2011-11-05 03:02:55 UTC (rev 41543)
@@ -303,8 +303,6 @@
 	ob->matbits= NULL;
 	if(ob->bb) MEM_freeN(ob->bb); 
 	ob->bb= NULL;
-	if(ob->path) free_path(ob->path); 
-	ob->path= NULL;
 	if(ob->adt) BKE_free_animdata((ID *)ob);
 	if(ob->poselib) ob->poselib->id.us--;
 	if(ob->gpd) ((ID *)ob->gpd)->us--;
@@ -1376,7 +1374,6 @@
 	}
 	
 	if(ob->bb) obn->bb= MEM_dupallocN(ob->bb);
-	obn->path= NULL;
 	obn->flag &= ~OB_FROMGROUP;
 	
 	obn->modifiers.first = obn->modifiers.last= NULL;

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2011-11-05 02:30:25 UTC (rev 41542)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2011-11-05 03:02:55 UTC (rev 41543)
@@ -7429,9 +7429,9 @@
 	if(main->versionfile <= 200) {
 		Object *ob= main->object.first;
 		while(ob) {
-			ob->scaflag = ob->gameflag & (64+128+256+512+1024+2048);
+			ob->scaflag = ob->gameflag & (OB_DO_FH|OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
 				/* 64 is do_fh */
-			ob->gameflag &= ~(128+256+512+1024+2048);
+			ob->gameflag &= ~(OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
 			ob = ob->id.next;
 		}
 	}

Modified: trunk/blender/source/blender/makesdna/DNA_object_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_types.h	2011-11-05 02:30:25 UTC (rev 41542)
+++ trunk/blender/source/blender/makesdna/DNA_object_types.h	2011-11-05 03:02:55 UTC (rev 41543)
@@ -111,12 +111,12 @@
 	/* proxy_from is set in target back to the proxy. */
 	struct Object *proxy, *proxy_group, *proxy_from;
 	struct Ipo *ipo;		// XXX depreceated... old animation system
-	struct Path *path;
+	/* struct Path *path; */
 	struct BoundBox *bb;
 	struct bAction *action;	 // XXX depreceated... old animation system
 	struct bAction *poselib;
-	struct bPose *pose;	
-	void *data;
+	struct bPose *pose;  /* pose data, armature objects only */
+	void *data;  /* pointer to objects data - an 'ID' or NULL */
 	
 	struct bGPdata *gpd;	/* Grease Pencil data */
 	
@@ -124,9 +124,9 @@
 	bMotionPath *mpath;		/* motion path cache for this object */
 	
 	ListBase constraintChannels; // XXX depreceated... old animation system
-	ListBase effect;
-	ListBase disp;
-	ListBase defbase;
+	ListBase effect;             // XXX depreceated... keep for readfile
+	ListBase disp;      /* list of DispList, used by lattice, metaballs curve & surfaces */
+	ListBase defbase;   /* list of bDeformGroup (vertex groups) names and flag only */
 	ListBase modifiers; /* list of ModifierData structures */
 
 	int mode;           /* Local object mode */
@@ -156,7 +156,7 @@
 	 */
 	float imat_ren[4][4];
 	
-	unsigned int lay;				/* copy of Base */
+	unsigned int lay;	/* copy of Base's layer in the scene */
 	
 	short flag;			/* copy of Base */
 	short colbits;		/* deprecated */
@@ -164,8 +164,8 @@
 	short transflag, protectflag;	/* transformation settings and transform locks  */
 	short trackflag, upflag;
 	short nlaflag, ipoflag;		// xxx depreceated... old animation system
-	short scaflag;		/* ipowin: blocktype last ipowindow */
-	char scavisflag;
+	short scaflag;				/* ui state for game logic */
+	char scavisflag;			/* more display settings for game logic */
 	char pad5;
 
 	int dupon, dupoff, dupsta, dupend;
@@ -200,39 +200,27 @@
 	char boundtype;            /* bounding box use for drawing */
 	char collision_boundtype;  /* bounding box type used for collision */
 
-	char  restrictflag;			/* for restricting view, select, render etc. accessible in outliner */
+	char  restrictflag;	/* for restricting view, select, render etc. accessible in outliner */
 
-	char dt, dtx;
+	char dt;			/* viewport draw type */
+	char dtx;			/* viewport draw extra settings */
 	char empty_drawtype;
 	float empty_drawsize;
 	float dupfacesca;	/* dupliface scale */
 	
-	ListBase prop;
-	ListBase sensors;
-	ListBase controllers;
-	ListBase actuators;
+	ListBase prop;			/* game logic property list (not to be confused with IDProperties) */
+	ListBase sensors;		/* game logic sensors */
+	ListBase controllers;	/* game logic controllers */
+	ListBase actuators;		/* game logic actuators */
 
 	float bbsize[3];
 	short index;			/* custom index, for renderpasses */
 	unsigned short actdef;	/* current deformation group, note: index starts at 1 */
 	float col[4];			/* object color */
-	/**
-	 * Settings for game objects
-	 * bit 0: Object has dynamic behaviour
-	 * bit 2: Object is evaluated by the gameengine
-	 * bit 6: Use Fh settings in Materials
-	 * bit 7: Use face normal to rotate Object
-	 * bit 8: Friction is anisotropic
-	 * bit 9: Object is a ghost
-	 * bit 10: Do rigid body dynamics.
-	 * bit 11: Use bounding object for physics
-	 */
+
 	int gameflag;
-	/**
-	 * More settings
-	 * bit 15: Always ignore activity culling 
-	 */
 	int gameflag2;
+
 	struct BulletSoftBody *bsoft;	/* settings for game engine bullet soft body */
 
 	short softflag;			/* softbody settings */
@@ -241,7 +229,7 @@
 
 	ListBase constraints;		/* object constraints */
 	ListBase nlastrips;			// XXX depreceated... old animation system
-	ListBase hooks;
+	ListBase hooks;				// XXX depreceated... old animation system
 	ListBase particlesystem;	/* particle systems */
 	
 	struct PartDeflect *pd;		/* particle deflector/attractor/collision data */
@@ -261,7 +249,7 @@
 	unsigned int state;			/* bit masks of game controllers that are active */
 	unsigned int init_state;	/* bit masks of initial state as recorded by the users */
 
-	ListBase gpulamp;		/* runtime, for lamps only */
+	ListBase gpulamp;		/* runtime, for glsl lamp display only */
 	ListBase pc_ids;
 	ListBase *duplilist;	/* for temporary dupli list storage, only for use by RNA API */
 
@@ -286,13 +274,17 @@
 	float force;
 } ObHook;
 
+/* runtime only, but include here for rna access */
 typedef struct DupliObject {
 	struct DupliObject *next, *prev;
 	struct Object *ob;
 	unsigned int origlay;
-	int index, no_draw, type, animated;
+	int index;
 	float mat[4][4], omat[4][4];
 	float orco[3], uv[2];
+
+	short type; /* from Object.transflag */
+	char no_draw, animated;
 } DupliObject;
 
 /* **************** OBJECT ********************* */




More information about the Bf-blender-cvs mailing list