[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21119] branches/blender2.5/blender/source /blender: 2.5 - Particle Settings now Animateable
Joshua Leung
aligorith at gmail.com
Wed Jun 24 04:11:37 CEST 2009
Revision: 21119
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21119
Author: aligorith
Date: 2009-06-24 04:11:36 +0200 (Wed, 24 Jun 2009)
Log Message:
-----------
2.5 - Particle Settings now Animateable
Added AnimData to ParticleSettings so that this will work. This seems to be ok in the brief tests I did, but be warned that this may not be optimal for the Particles System...
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c
branches/blender2.5/blender/source/blender/makesdna/DNA_particle_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c
Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c 2009-06-24 01:41:12 UTC (rev 21118)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c 2009-06-24 02:11:36 UTC (rev 21119)
@@ -43,6 +43,7 @@
case ID_OB:
case ID_CU:
case ID_KE:
+ case ID_PA:
case ID_MA: case ID_TE: case ID_NT:
case ID_LA: case ID_CA: case ID_WO:
case ID_SCE:
@@ -883,6 +884,9 @@
/* meshes */
// TODO...
+ /* particles */
+ EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM);
+
/* objects */
/* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets
* this tagged by Depsgraph on framechange
Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 2009-06-24 01:41:12 UTC (rev 21118)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 2009-06-24 02:11:36 UTC (rev 21119)
@@ -2899,7 +2899,9 @@
part= main->particle.first;
while(part) {
if(part->id.flag & LIB_NEEDLINK) {
+ if (part->adt) lib_link_animdata(fd, &part->id, part->adt);
part->ipo= newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system
+
part->dup_ob = newlibadr(fd, part->id.lib, part->dup_ob);
part->dup_group = newlibadr(fd, part->id.lib, part->dup_group);
part->eff_group = newlibadr(fd, part->id.lib, part->eff_group);
@@ -2912,6 +2914,7 @@
static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
{
+ part->adt= newdataadr(fd, part->adt);
part->pd= newdataadr(fd, part->pd);
part->pd2= newdataadr(fd, part->pd2);
}
@@ -9522,6 +9525,8 @@
expand_doit(fd, mainvar, part->dup_group);
expand_doit(fd, mainvar, part->eff_group);
expand_doit(fd, mainvar, part->bb_ob);
+
+ expand_animdata(fd, mainvar, part->adt);
}
static void expand_group(FileData *fd, Main *mainvar, Group *group)
Modified: branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c 2009-06-24 01:41:12 UTC (rev 21118)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c 2009-06-24 02:11:36 UTC (rev 21119)
@@ -382,6 +382,7 @@
/*These functions are used by blender's .blend system for file saving/loading.*/
void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd);
void IDP_WriteProperty(IDProperty *prop, void *wd);
+void write_animdata(WriteData *wd, AnimData *adt); // XXX code needs reshuffling, but not before NLA SoC is merged back into 2.5
static void IDP_WriteArray(IDProperty *prop, void *wd)
{
@@ -575,6 +576,7 @@
/* write LibData */
writestruct(wd, ID_PA, "ParticleSettings", 1, part);
if (part->id.properties) IDP_WriteProperty(part->id.properties, wd);
+ if (part->adt) write_animdata(wd, part->adt);
writestruct(wd, DATA, "PartDeflect", 1, part->pd);
writestruct(wd, DATA, "PartDeflect", 1, part->pd2);
}
Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_particle_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_particle_types.h 2009-06-24 01:41:12 UTC (rev 21118)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_particle_types.h 2009-06-24 02:11:36 UTC (rev 21119)
@@ -34,6 +34,8 @@
#include "DNA_ID.h"
+struct AnimData;
+
typedef struct HairKey {
float co[3]; /* location of hair vertex */
float time; /* time along hair, default 0-100 */
@@ -100,6 +102,7 @@
typedef struct ParticleSettings {
ID id;
+ struct AnimData *adt;
int flag;
short type, from, distr;
@@ -167,7 +170,7 @@
struct Group *eff_group;
struct Object *dup_ob;
struct Object *bb_ob;
- struct Ipo *ipo;
+ struct Ipo *ipo; // xxx depreceated... old animation system
struct PartDeflect *pd;
struct PartDeflect *pd2;
} ParticleSettings;
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c 2009-06-24 01:41:12 UTC (rev 21118)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c 2009-06-24 02:11:36 UTC (rev 21119)
@@ -1470,15 +1470,10 @@
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
+
+ /* animation here? */
+ rna_def_animdata_common(srna);
-#if 0
- prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_sdna(prop, NULL, "ipo");
- RNA_def_property_struct_type(prop, "Ipo");
- RNA_def_property_ui_text(prop, "Ipo", "");
-#endif
-
// struct PartDeflect *pd;
// struct PartDeflect *pd2;
}
More information about the Bf-blender-cvs
mailing list