[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12130] branches/particles/source/blender: *bug fixes:

Janne Karhu jhkarh at utu.fi
Mon Sep 24 12:00:48 CEST 2007


Revision: 12130
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12130
Author:   jhk
Date:     2007-09-24 12:00:47 +0200 (Mon, 24 Sep 2007)

Log Message:
-----------
*bug fixes:
	-rendering billboards crashed if there was no 3d window open
	-particle path rotations were calculated wrong sometimes causing "from particle" children to behave strangely
	-loading old softbody didn't work properly some times
	-particle modifier "convert" didn't work properly
	-reactor events sometimes woke up dead particles
	-hair with children crashed when changing parent particles amount from something to zero and back
	-deleting a baked particle system while in bake mode crashed
	-changes in mesh structure didn't start autobaking
*new things:
	-billboards assign default uv channel to only the normal billboard uv channel (time-index and split uvs need to be set separately to be used)
	-added gpl headers to files
	-endian switches to bakeable system loading
	-removed "apply" button from particle modifier, since it didn't do anything anymore (explode is it's own modifier now)
	-shuffled baking code around a bit and added proper stubs for editbake things
	-little better memory allocation for child particle paths
	-hair baking to geometry space is now on by default

Modified Paths:
--------------
    branches/particles/source/blender/blenkernel/BKE_bad_level_calls.h
    branches/particles/source/blender/blenkernel/BKE_dynamics_bake.h
    branches/particles/source/blender/blenkernel/BKE_particle.h
    branches/particles/source/blender/blenkernel/intern/anim.c
    branches/particles/source/blender/blenkernel/intern/dynamics_bake.c
    branches/particles/source/blender/blenkernel/intern/modifier.c
    branches/particles/source/blender/blenkernel/intern/object.c
    branches/particles/source/blender/blenkernel/intern/particle.c
    branches/particles/source/blender/blenkernel/intern/particle_system.c
    branches/particles/source/blender/blenkernel/intern/scene.c
    branches/particles/source/blender/blenkernel/intern/softbody.c
    branches/particles/source/blender/blenloader/intern/readfile.c
    branches/particles/source/blender/blenloader/intern/writefile.c
    branches/particles/source/blender/include/BIF_editbake.h
    branches/particles/source/blender/makesdna/DNA_bake_types.h
    branches/particles/source/blender/makesdna/DNA_particle_types.h
    branches/particles/source/blender/render/intern/source/convertblender.c
    branches/particles/source/blender/src/buttons_editing.c
    branches/particles/source/blender/src/buttons_object.c
    branches/particles/source/blender/src/drawobject.c
    branches/particles/source/blender/src/drawview.c
    branches/particles/source/blender/src/editbake.c
    branches/particles/source/blender/src/header_oops.c
    branches/particles/source/blender/src/space.c
    branches/particles/source/blender/src/transform_manipulator.c

Modified: branches/particles/source/blender/blenkernel/BKE_bad_level_calls.h
===================================================================
--- branches/particles/source/blender/blenkernel/BKE_bad_level_calls.h	2007-09-24 09:40:09 UTC (rev 12129)
+++ branches/particles/source/blender/blenkernel/BKE_bad_level_calls.h	2007-09-24 10:00:47 UTC (rev 12130)
@@ -224,5 +224,19 @@
 /* imagetexture.c */
 void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result);
 
+/* editbake.c */
+struct BakeableSystem;
+struct BakeKey;
+void EB_free_BakeEdit(struct BakeableSystem *bsys);
+struct BakeableSystem *EB_get_current(struct Object *ob, short cur_type);
+void EB_get_colors(char sel[4], char nosel[4]);
+struct BakeKey *EB_nearest_key(struct BakeableSystem *bsys, int a);
+void EB_create_BakeEdit(struct BakeableSystem *bsys);
+void EB_iterate_lengths(struct BakeableSystem *bsys);
+void EB_deflect_emitter(struct BakeableSystem *bsys);
+void EB_apply_lengths(struct BakeableSystem *bsys);
+void EB_recalc_wcos(struct BakeableSystem *bsys);
+void EB_hide_beks(struct BakeableSystem *bsys, float cfra);
+
 #endif
 

Modified: branches/particles/source/blender/blenkernel/BKE_dynamics_bake.h
===================================================================
--- branches/particles/source/blender/blenkernel/BKE_dynamics_bake.h	2007-09-24 09:40:09 UTC (rev 12129)
+++ branches/particles/source/blender/blenkernel/BKE_dynamics_bake.h	2007-09-24 10:00:47 UTC (rev 12130)
@@ -1,3 +1,37 @@
+/* BKE_dynamics_bake.h
+ *
+ *
+ * $Id: BKE_dynamics_bake.h $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 by Janne Karhu.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
 #ifndef BKE_DYNAMICS_BAKE_H
 #define BKE_DYNAMICS_BAKE_H
 
@@ -5,6 +39,8 @@
 struct BakeKey;
 struct BakeBase;
 struct ListBase;
+struct ModifierData;
+struct ParticleKey;
 
 /* number of floats in the struct*/
 #define PARTICLE_CUSTOM_SIZE	8
@@ -22,7 +58,7 @@
 	float col[4];
 } BakeCacheKey;
 
-typedef struct BakeableAccess{
+typedef struct BakeableTypeInfo{
 	short custom_size, recalc_flag;
 
 	/* starting frame of baking */
@@ -63,8 +99,34 @@
 	void (*interpolate_customkey)(struct BakeableSystem *bsys, float *ckey1, float *ckey2, float keytime, float *ckey);
 
 	void (*remove_set_elements)(struct BakeableSystem *bsys, int new_totbel);
-} BakeableAccess;
+} BakeableTypeInfo;
 
+#define EB_TOT_BRUSH		7
+
+typedef struct BakeEditKey{
+	float world_co[3];
+	float length;
+	short flag;
+} BakeEditKey;
+
+typedef struct BakeEdit{
+	struct ListBase undo;
+	struct BakeUndo *curundo;
+	struct KDTreeNode *emitter_field;
+	BakeEditKey **keys;
+	float *emitter_cosnos;
+
+	float keytime, o_keytime;
+	float emitter_dist;
+	
+	int totkeys;
+	
+	short flag, brush, totrekey, totaddkey, draw_timed;
+	short brushsize[EB_TOT_BRUSH];
+	short brushpow[EB_TOT_BRUSH];
+	short average, brushstep;
+} BakeEdit;
+
 int modifier_effects_baked(struct Object *ob, struct ModifierData *mod);
 int dynamicsbake_test();
 struct BakeableSystem *DB_find_bsys(struct ListBase *bakeable, void *system);
@@ -101,15 +163,47 @@
 void DB_cache_paths(struct BakeableSystem *bsys, float time);
 void DB_save_keys(struct BakeableSystem *bsys, float cfra);
 void DB_free_bake(struct BakeableSystem *bsys);
+void DB_end_baking(struct BakeableSystem *bsys);
 
 struct ListBase *DB_get_all_systems_to_bake();
 struct ListBase *DB_get_all_autobake_systems();
-void DB_unified_bake_cb(void *arg1, void *arg2);
-void DB_single_bake_cb(void *bsys, void *arg2);
-void DB_single_bake_from_cfra_cb(void *bsys_v, void *arg2);
-void DB_unified_bake(struct ListBase *bakelist, int from_cfra, int autobake);
+//void DB_unified_bake_cb(void *arg1, void *arg2);
+//void DB_single_bake_cb(void *bsys, void *arg2);
+//void DB_single_bake_from_cfra_cb(void *bsys_v, void *arg2);
 
+void DB_unified_bake_init(struct ListBase *bakelist, int from_cfra, float *start_frame, float *end_frame);
+int DB_unified_bake_save(struct ListBase *bakelist, float cfra, int first, float *step);
+void DB_unified_bake_end(struct ListBase *bakelist, int autobake);
+//void DB_unified_bake(struct ListBase *bakelist, int from_cfra, int autobake);
+
 struct BakeBase *DB_psys_to_BakeBase(struct Object *ob, struct ParticleSystem *psys);
 struct BakeBase *DB_soft_to_BakeBase(struct Object *ob, struct SoftBody *sb);
-struct BakeableAccess *access_BakeableSystem(struct BakeableSystem *bsys);
+struct BakeableTypeInfo *access_BakeableSystem(struct BakeableSystem *bsys);
+
+/* BakeEditKey->flag */
+#define BEK_SELECT		1
+#define BEK_TO_SELECT	2
+#define BEK_REMOVE		4
+#define BEK_HIDE		8
+
+/* BakeEdit->flag */
+#define EB_KEEP_LENGTHS		1
+#define EB_LOCK_FIRST		2
+#define EB_DEFLECT_EMITTER	4
+#define EB_INTERPOLATE_ADDED	8
+#define EB_SHOW_CHILD		16
+#define EB_SHOW_TIME		32
+#define EB_ROT_VEL			64
+#define EB_ROT_ROT			128
+
+/* BakeEdit->brush */
+#define EB_BRUSH_NO			-1
+#define EB_BRUSH_COMB		0
+#define EB_BRUSH_CUT		1
+#define EB_BRUSH_GROW		2
+#define EB_BRUSH_SHRINK		3
+#define EB_BRUSH_ADD		4
+#define EB_BRUSH_WEIGHT		5
+#define EB_BRUSH_SMOOTH		6
+
 #endif
\ No newline at end of file

Modified: branches/particles/source/blender/blenkernel/BKE_particle.h
===================================================================
--- branches/particles/source/blender/blenkernel/BKE_particle.h	2007-09-24 09:40:09 UTC (rev 12129)
+++ branches/particles/source/blender/blenkernel/BKE_particle.h	2007-09-24 10:00:47 UTC (rev 12130)
@@ -1,3 +1,37 @@
+/* BKE_particle.h
+ *
+ *
+ * $Id: BKE_particle.h $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 by Janne Karhu.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
 #ifndef BKE_PARTICLE_H
 #define BKE_PARTICLE_H
 

Modified: branches/particles/source/blender/blenkernel/intern/anim.c
===================================================================
--- branches/particles/source/blender/blenkernel/intern/anim.c	2007-09-24 09:40:09 UTC (rev 12129)
+++ branches/particles/source/blender/blenkernel/intern/anim.c	2007-09-24 10:00:47 UTC (rev 12130)
@@ -700,20 +700,19 @@
 }
 static void new_particle_duplilist(ListBase *lb, Scene *sce, Object *par, ParticleSystem *psys)
 {
-	GroupObject *go,dummy_go;
+	GroupObject *go;
 	Object *ob, copyob, **oblist=0;
-	Base *base;
 	BakeableSystem *bsys=DB_find_bsys(&par->bakeable,psys);
 	ParticleSettings *part;
 	ParticleData *pa;
 	ParticleKey state;
-	float ctime, drawtime, deltatime, pa_time;
+	float ctime, pa_time;
 	float tmat[4][4], mat[3][3], obrotmat[3][3], parotmat[3][3], size=0.0;
 	float xvec[3]={-1.0,0.0,0.0}, *q;
 						
 
 	int lay, a, k, step_nbr, counter;
-	int totpart, totchild, tot, totgroup=0, pa_num;
+	int totpart, totchild, totgroup=0, pa_num;
 
 	if(psys==0) return;
 	

Modified: branches/particles/source/blender/blenkernel/intern/dynamics_bake.c
===================================================================
--- branches/particles/source/blender/blenkernel/intern/dynamics_bake.c	2007-09-24 09:40:09 UTC (rev 12129)
+++ branches/particles/source/blender/blenkernel/intern/dynamics_bake.c	2007-09-24 10:00:47 UTC (rev 12130)
@@ -1,3 +1,37 @@
+/* dynamics_bake.c
+ *
+ *
+ * $Id: dynamics_bake.c $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 by Janne Karhu.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
 #include <stdio.h>

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list