[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15689] branches/soc-2008-jaguarandi/ source: svn merge -r 15590:15688 https://svn.blender.org/svnroot/bf-blender /trunk/blender

André Pinto andresusanopinto at gmail.com
Tue Jul 22 14:02:57 CEST 2008


Revision: 15689
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15689
Author:   jaguarandi
Date:     2008-07-22 14:02:57 +0200 (Tue, 22 Jul 2008)

Log Message:
-----------
svn merge -r 15590:15688 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_global.h
    branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/collision.c
    branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/lattice.c
    branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/particle_system.c
    branches/soc-2008-jaguarandi/source/blender/blenlib/intern/arithb.c
    branches/soc-2008-jaguarandi/source/blender/blenloader/intern/readfile.c
    branches/soc-2008-jaguarandi/source/blender/blenloader/intern/writefile.c
    branches/soc-2008-jaguarandi/source/blender/include/BDR_drawaction.h
    branches/soc-2008-jaguarandi/source/blender/include/BIF_editaction.h
    branches/soc-2008-jaguarandi/source/blender/include/BIF_space.h
    branches/soc-2008-jaguarandi/source/blender/include/BSE_editaction_types.h
    branches/soc-2008-jaguarandi/source/blender/include/transform.h
    branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_action_types.h
    branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_space_types.h
    branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_view3d_types.h
    branches/soc-2008-jaguarandi/source/blender/makesdna/intern/makesdna.c
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Blender.c
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Library.c
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Particle.c
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/doc/LibData.py
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/doc/Particle.py
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/doc/Render.py
    branches/soc-2008-jaguarandi/source/blender/python/api2_2x/sceneRender.c
    branches/soc-2008-jaguarandi/source/blender/render/intern/source/rendercore.c
    branches/soc-2008-jaguarandi/source/blender/render/intern/source/shadeoutput.c
    branches/soc-2008-jaguarandi/source/blender/src/drawaction.c
    branches/soc-2008-jaguarandi/source/blender/src/drawnode.c
    branches/soc-2008-jaguarandi/source/blender/src/drawobject.c
    branches/soc-2008-jaguarandi/source/blender/src/drawseq.c
    branches/soc-2008-jaguarandi/source/blender/src/drawview.c
    branches/soc-2008-jaguarandi/source/blender/src/editaction.c
    branches/soc-2008-jaguarandi/source/blender/src/editmesh.c
    branches/soc-2008-jaguarandi/source/blender/src/editnode.c
    branches/soc-2008-jaguarandi/source/blender/src/editobject.c
    branches/soc-2008-jaguarandi/source/blender/src/header_action.c
    branches/soc-2008-jaguarandi/source/blender/src/header_node.c
    branches/soc-2008-jaguarandi/source/blender/src/header_seq.c
    branches/soc-2008-jaguarandi/source/blender/src/header_view3d.c
    branches/soc-2008-jaguarandi/source/blender/src/interface.c
    branches/soc-2008-jaguarandi/source/blender/src/space.c
    branches/soc-2008-jaguarandi/source/blender/src/transform_conversions.c
    branches/soc-2008-jaguarandi/source/blender/src/transform_generics.c
    branches/soc-2008-jaguarandi/source/blender/src/usiblender.c
    branches/soc-2008-jaguarandi/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
    branches/soc-2008-jaguarandi/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
    branches/soc-2008-jaguarandi/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Converter/BL_DeformableGameObject.h
    branches/soc-2008-jaguarandi/source/gameengine/Converter/BL_ShapeDeformer.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Converter/BL_SkinDeformer.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Converter/BL_SkinDeformer.h
    branches/soc-2008-jaguarandi/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/soc-2008-jaguarandi/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
    branches/soc-2008-jaguarandi/source/gameengine/GameLogic/SCA_ILogicBrick.h
    branches/soc-2008-jaguarandi/source/gameengine/GameLogic/SCA_IObject.cpp
    branches/soc-2008-jaguarandi/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/GameLogic/SCA_PropertyActuator.h
    branches/soc-2008-jaguarandi/source/gameengine/GamePlayer/common/GPC_Canvas.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_BulletPhysicsController.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_CameraActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_CameraActuator.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_GameObject.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_IPhysicsController.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_OdePhysicsController.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_OdePhysicsController.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_ParentActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_ParentActuator.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_RadarSensor.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_Scene.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_Scene.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_SceneActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_SceneActuator.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_SumoPhysicsController.h
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_TrackToActuator.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_TrackToActuator.h
    branches/soc-2008-jaguarandi/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Physics/Bullet/CcdPhysicsController.h
    branches/soc-2008-jaguarandi/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
    branches/soc-2008-jaguarandi/source/gameengine/PyDoc/KX_GameObject.py
    branches/soc-2008-jaguarandi/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
    branches/soc-2008-jaguarandi/source/gameengine/Rasterizer/RAS_2DFilterManager.h
    branches/soc-2008-jaguarandi/source/gameengine/Rasterizer/RAS_ICanvas.h
    branches/soc-2008-jaguarandi/source/gameengine/SceneGraph/SG_IObject.cpp
    branches/soc-2008-jaguarandi/source/gameengine/SceneGraph/SG_IObject.h
    branches/soc-2008-jaguarandi/source/gameengine/SceneGraph/SG_Node.cpp
    branches/soc-2008-jaguarandi/source/gameengine/SceneGraph/SG_Node.h

Added Paths:
-----------
    branches/soc-2008-jaguarandi/source/blender/include/BDR_gpencil.h
    branches/soc-2008-jaguarandi/source/blender/include/BIF_drawgpencil.h
    branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_gpencil_types.h
    branches/soc-2008-jaguarandi/source/blender/src/drawgpencil.c
    branches/soc-2008-jaguarandi/source/blender/src/editaction_gpencil.c
    branches/soc-2008-jaguarandi/source/blender/src/gpencil.c

Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_global.h
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_global.h	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_global.h	2008-07-22 12:02:57 UTC (rev 15689)
@@ -175,6 +175,7 @@
 #define G_WEIGHTPAINT	(1 << 15)	
 #define G_TEXTUREPAINT	(1 << 16)
 /* #define G_NOFROZEN	(1 << 17) also removed */
+#define G_GREASEPENCIL 	(1 << 17)
 #define G_DRAWEDGES		(1 << 18)
 #define G_DRAWCREASES	(1 << 19)
 #define G_DRAWSEAMS     (1 << 20)
@@ -265,3 +266,4 @@
 	
 #endif
 
+

Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/collision.c
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/collision.c	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/collision.c	2008-07-22 12:02:57 UTC (rev 15689)
@@ -1437,6 +1437,9 @@
 
 					if(coll_ob == self)
 						continue;
+					
+					if( !collmd->bvhtree)
+						continue;
 
 					if(numobj >= maxobj)
 					{

Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/lattice.c
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/lattice.c	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/lattice.c	2008-07-22 12:02:57 UTC (rev 15689)
@@ -915,7 +915,10 @@
 		mti->deformVerts(md, ob, NULL, vertexCos, numVerts);
 	}
 
-	if (vertexCos) {
+	/* always displist to make this work like derivedmesh */
+	if (!vertexCos) vertexCos = lattice_getVertexCos(ob, &numVerts);
+	
+	{
 		DispList *dl = MEM_callocN(sizeof(*dl), "lt_dl");
 		dl->type = DL_VERTS;
 		dl->parts = 1;

Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/particle_system.c	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/particle_system.c	2008-07-22 12:02:57 UTC (rev 15689)
@@ -2797,7 +2797,10 @@
 				epart= epsys->part;
 				pd= epart->pd;
 				totepart= epsys->totpart;
-
+				
+				if(totepart <= 0)
+					continue;
+				
 				if(pd->forcefield==PFIELD_HARMONIC){
 					/* every particle is mapped to only one harmonic effector particle */
 					p= pa_no%epsys->totpart;

Modified: branches/soc-2008-jaguarandi/source/blender/blenlib/intern/arithb.c
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenlib/intern/arithb.c	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenlib/intern/arithb.c	2008-07-22 12:02:57 UTC (rev 15689)
@@ -59,6 +59,7 @@
 
 /* A few small defines. Keep'em local! */
 #define SMALL_NUMBER	1.e-8
+#define CLAMP(a, b, c)		if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
 
 
 #if defined(WIN32) || defined(__APPLE__)

Modified: branches/soc-2008-jaguarandi/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenloader/intern/readfile.c	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenloader/intern/readfile.c	2008-07-22 12:02:57 UTC (rev 15689)
@@ -69,6 +69,7 @@
 #include "DNA_effect_types.h"
 #include "DNA_fileglobal_types.h"
 #include "DNA_group_types.h"
+#include "DNA_gpencil_types.h"
 #include "DNA_ipo_types.h"
 #include "DNA_image_types.h"
 #include "DNA_key_types.h"
@@ -3698,6 +3699,32 @@
 
 /* ************ READ SCREEN ***************** */
 
+/* relinks grease-pencil data for 3d-view(s) - used for direct_link */
+static void link_gpencil(FileData *fd, bGPdata *gpd)
+{
+	bGPDlayer *gpl;
+	bGPDframe *gpf;
+	bGPDstroke *gps;
+	
+	/* relink layers */
+	link_list(fd, &gpd->layers);
+	
+	for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+		/* relink frames */
+		link_list(fd, &gpl->frames);
+		gpl->actframe= newdataadr(fd, gpl->actframe);
+		
+		for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
+			/* relink strokes (and their points) */
+			link_list(fd, &gpf->strokes);
+			
+			for (gps= gpf->strokes.first; gps; gps= gps->next) {
+				gps->points= newdataadr(fd, gps->points);
+			}
+		}
+	}
+}
+
 /* note: file read without screens option G_FILE_NO_UI; 
    check lib pointers in call below */
 static void lib_link_screen(FileData *fd, Main *main)
@@ -3709,23 +3736,23 @@
 		if(sc->id.flag & LIB_NEEDLINK) {
 			sc->id.us= 1;
 			sc->scene= newlibadr(fd, sc->id.lib, sc->scene);
-
+			
 			sa= sc->areabase.first;
 			while(sa) {
 				SpaceLink *sl;
-
+				
 				sa->full= newlibadr(fd, sc->id.lib, sa->full);
-
+				
 				/* space handler scriptlinks */
 				lib_link_scriptlink(fd, &sc->id, &sa->scriptlink);
-
+				
 				for (sl= sa->spacedata.first; sl; sl= sl->next) {
 					if(sl->spacetype==SPACE_VIEW3D) {
 						View3D *v3d= (View3D*) sl;
-
+						
 						v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera);
 						v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre);
-
+						
 						if(v3d->bgpic) {
 							v3d->bgpic->ima= newlibadr_us(fd, sc->id.lib, v3d->bgpic->ima);
 						}
@@ -4081,6 +4108,10 @@
 				v3d->bgpic= newdataadr(fd, v3d->bgpic);
 				if(v3d->bgpic)
 					v3d->bgpic->iuser.ok= 1;
+				if(v3d->gpd) {
+					v3d->gpd= newdataadr(fd, v3d->gpd);
+					link_gpencil(fd, v3d->gpd);
+				}
 				v3d->localvd= newdataadr(fd, v3d->localvd);
 				v3d->afterdraw.first= v3d->afterdraw.last= NULL;
 				v3d->clipbb= newdataadr(fd, v3d->clipbb);
@@ -4115,9 +4146,30 @@
 			}
 			else if(sl->spacetype==SPACE_NODE) {
 				SpaceNode *snode= (SpaceNode *)sl;
+				
+				if(snode->gpd) {
+					snode->gpd= newdataadr(fd, snode->gpd);
+					link_gpencil(fd, snode->gpd);
+				}
 				snode->nodetree= snode->edittree= NULL;
 				snode->flag |= SNODE_DO_PREVIEW;
 			}
+			else if(sl->spacetype==SPACE_SEQ) {
+				SpaceSeq *sseq= (SpaceSeq *)sl;
+				if(sseq->gpd) {
+					sseq->gpd= newdataadr(fd, sseq->gpd);
+					link_gpencil(fd, sseq->gpd);
+				}
+			}
+			else if(sl->spacetype==SPACE_ACTION) {
+				SpaceAction *sact= (SpaceAction *)sl;
+				
+				/* WARNING: action-editor doesn't have it's own gpencil data! 
+				 * so only adjust pointer, but DON'T LINK
+				 */
+				if (sact->gpd) 
+					sact->gpd= newdataadr(fd, sact->gpd);
+			}
 		}
 
 		sa->v1= newdataadr(fd, sa->v1);

Modified: branches/soc-2008-jaguarandi/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/blenloader/intern/writefile.c	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/blenloader/intern/writefile.c	2008-07-22 12:02:57 UTC (rev 15689)
@@ -112,6 +112,7 @@
 #include "DNA_customdata_types.h"
 #include "DNA_effect_types.h"
 #include "DNA_group_types.h"
+#include "DNA_gpencil_types.h"
 #include "DNA_image_types.h"
 #include "DNA_ipo_types.h"
 #include "DNA_fileglobal_types.h"
@@ -1565,6 +1566,32 @@
 	mywrite(wd, MYWRITE_FLUSH, 0);
 }
 
+static void write_gpencil(WriteData *wd, bGPdata *gpd)
+{
+	bGPDlayer *gpl;
+	bGPDframe *gpf;
+	bGPDstroke *gps;
+	
+	/* write gpd data block to file */
+	writestruct(wd, DATA, "bGPdata", 1, gpd);
+	
+	/* write grease-pencil layers to file */
+	for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+		writestruct(wd, DATA, "bGPDlayer", 1, gpl);
+		
+		/* write this layer's frames to file */
+		for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
+			writestruct(wd, DATA, "bGPDframe", 1, gpf);
+			
+			/* write strokes */
+			for (gps= gpf->strokes.first; gps; gps= gps->next) {
+				writestruct(wd, DATA, "bGPDstroke", 1, gps);
+				writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);				
+			}
+		}
+	}
+}
+
 static void write_screens(WriteData *wd, ListBase *scrbase)
 {
 	bScreen *sc;
@@ -1610,11 +1637,12 @@
 			sl= sa->spacedata.first;
 			while(sl) {
 				if(sl->spacetype==SPACE_VIEW3D) {
-					View3D *v3d= (View3D*) sl;
+					View3D *v3d= (View3D *) sl;
 					writestruct(wd, DATA, "View3D", 1, v3d);
 					if(v3d->bgpic) writestruct(wd, DATA, "BGpic", 1, v3d->bgpic);
 					if(v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd);
 					if(v3d->clipbb) writestruct(wd, DATA, "BoundBox", 1, v3d->clipbb);
+					if(v3d->gpd) write_gpencil(wd, v3d->gpd);
 				}
 				else if(sl->spacetype==SPACE_IPO) {
 					writestruct(wd, DATA, "SpaceIpo", 1, sl);
@@ -1626,7 +1654,9 @@
 					writestruct(wd, DATA, "SpaceFile", 1, sl);
 				}
 				else if(sl->spacetype==SPACE_SEQ) {
+					SpaceSeq *sseq= (SpaceSeq *)sl;
 					writestruct(wd, DATA, "SpaceSeq", 1, sl);
+					if(sseq->gpd) write_gpencil(wd, sseq->gpd);
 				}
 				else if(sl->spacetype==SPACE_OOPS) {
 					SpaceOops *so= (SpaceOops *)sl;
@@ -1689,7 +1719,9 @@
 					writestruct(wd, DATA, "SpaceTime", 1, sl);
 				}
 				else if(sl->spacetype==SPACE_NODE){
+					SpaceNode *snode= (SpaceNode *)sl;
 					writestruct(wd, DATA, "SpaceNode", 1, sl);
+					if(snode->gpd) write_gpencil(wd, snode->gpd);
 				}
 				sl= sl->next;
 			}

Modified: branches/soc-2008-jaguarandi/source/blender/include/BDR_drawaction.h
===================================================================
--- branches/soc-2008-jaguarandi/source/blender/include/BDR_drawaction.h	2008-07-22 11:50:50 UTC (rev 15688)
+++ branches/soc-2008-jaguarandi/source/blender/include/BDR_drawaction.h	2008-07-22 12:02:57 UTC (rev 15689)
@@ -38,6 +38,7 @@
 struct bActionGroup;
 struct Object;
 struct ListBase;
+struct bGPDlayer;
 
 /* ****************************** Base Structs ****************************** */
 
@@ -82,6 +83,7 @@
 void draw_agroup_channel(struct gla2DDrawInfo *di, struct bActionGroup *agrp, float ypos);
 void draw_action_channel(struct gla2DDrawInfo *di, struct bAction *act, float ypos);
 void draw_object_channel(struct gla2DDrawInfo *di, struct Object *ob, float ypos);
+void draw_gpl_channel(struct gla2DDrawInfo *di, struct bGPDlayer *gpl, float ypos);
 
 /* Keydata Generation */
 void icu_to_keylist(struct IpoCurve *icu, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
@@ -89,6 +91,7 @@
 void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list