Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2009-08-29 19:20:36 +0400
committerJanne Karhu <jhkarh@gmail.com>2009-08-29 19:20:36 +0400
commit874d38eeb401a75f849cc36c7d7b911129c3aa75 (patch)
treef9d1ad815e40cfd27668dae5be83de72b385c650 /source/blender/blenkernel/BKE_pointcache.h
parentc03004f93eb94d4af10acaf0b7e8ca7adb097dd0 (diff)
Point cache editing:
- Baked point caches for particles, cloth and softbody can now be edited in particle mode. * This overwrites the old cloth/sb cache editmode editing. * The type of editable system is chosen from a menu. * For particles the current particle system and it's current cache are used. - Currently this only works for caches that are in memory, but some automatic conversion from disk to memory and back can be implemented later. - All tools from hair editing can't be applied to point caches and are hidden in the tool panel and specials menu. Some functionality like subdividing paths can be later implemented in a slightly different way from how it works for hair. - Code is not yet optimized for speed, so editing might be slow sometimes. Known issues: - Cloth doesn't update properly while in particle mode, due to the way cloth modifier currently works. Daniel can you check on this? - As "particle mode" is not only for particles any more some other name would be in place? - Better icons are needed for the path, point, and tip-modes as the current icons from mesh edit mode are quite misleading. - Direct editing of point velocities is not yet implemented, but will be in the future. Other changes: - Hair editing doesn't require a "make editable" button press any more. - Multiple caches in single particle system disables changing emission properties. - Unified ui code for all point cache panels. * Defined in buttons_particle.py and imported for cloth, smoke & softbody. - Proper disabling of properties in ui after baking point caches. (Daniel could you please make needed disable code for smoke panels as their functionality is not familiar to me.) - Hair weight brush has been removed. Once hair dynamics is re-implemented I'll code a more useable alternative to the functionality. Bug fixes: - Unlinking particle settings crashed. - Deleting the active object with particles in the scene crashed. - Softbody didn't write point caches correctly on save.
Diffstat (limited to 'source/blender/blenkernel/BKE_pointcache.h')
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 531487549da..9ba34091064 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -101,6 +101,8 @@ typedef struct PTCacheFile {
void *cur[BPHYS_TOT_DATA];
} PTCacheFile;
+#define PTCACHE_VEL_PER_SEC 1
+
typedef struct PTCacheID {
struct PTCacheID *next, *prev;
@@ -109,6 +111,7 @@ typedef struct PTCacheID {
void *calldata;
int type;
int stack_index;
+ int flag;
/* flags defined in DNA_object_force.h */
unsigned int data_types, info_types;
@@ -151,6 +154,75 @@ typedef struct PTCacheBaker {
void *progresscontext;
} PTCacheBaker;
+/* PTCacheEditKey->flag */
+#define PEK_SELECT 1
+#define PEK_TAG 2
+#define PEK_HIDE 4
+#define PEK_USE_WCO 8
+
+typedef struct PTCacheEditKey{
+ float *co;
+ float *vel;
+ float *rot;
+ float *time;
+
+ float world_co[3];
+ float ftime;
+ float length;
+ short flag;
+} PTCacheEditKey;
+
+/* PTCacheEditPoint->flag */
+#define PEP_TAG 1
+#define PEP_EDIT_RECALC 2
+#define PEP_TRANSFORM 4
+#define PEP_HIDE 8
+
+typedef struct PTCacheEditPoint {
+ struct PTCacheEditKey *keys;
+ int totkey;
+ short flag;
+} PTCacheEditPoint;
+
+typedef struct PTCacheUndo {
+ struct PTCacheUndo *next, *prev;
+ struct PTCacheEditPoint *points;
+
+ /* particles stuff */
+ struct ParticleData *particles;
+ struct KDTree *emitter_field;
+ float *emitter_cosnos;
+
+ /* cache stuff */
+ struct ListBase mem_cache;
+
+ int totpoint;
+ char name[64];
+} PTCacheUndo;
+
+typedef struct PTCacheEdit {
+ ListBase undo;
+ struct PTCacheUndo *curundo;
+ PTCacheEditPoint *points;
+
+ struct PTCacheID pid;
+
+ /* particles stuff */
+ struct ParticleSystem *psys;
+ struct ParticleData *particles;
+ struct KDTree *emitter_field;
+ float *emitter_cosnos;
+ int *mirror_cache;
+
+ struct ParticleCacheKey **pathcache; /* path cache (runtime) */
+ ListBase pathcachebufs;
+
+ int totpoint, totframes, totcached, edited;
+
+ char sel_col[3];
+ char nosel_col[3];
+} PTCacheEdit;
+
/* Particle functions */
void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **data, float time);
@@ -179,6 +251,10 @@ void BKE_ptcache_update_info(PTCacheID *pid);
/* Size of cache data type. */
int BKE_ptcache_data_size(int data_type);
+/* Memory cache read/write helpers. */
+void BKE_ptcache_mem_init_pointers(struct PTCacheMem *pm);
+void BKE_ptcache_mem_incr_pointers(struct PTCacheMem *pm);
+
/* Copy a specific data type from cache data to point data. */
void BKE_ptcache_data_get(void **data, int type, int index, void *to);
@@ -197,7 +273,7 @@ int BKE_ptcache_get_continue_physics(void);
/******************* Allocate & free ***************/
struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
-void BKE_ptache_free_mem(struct PointCache *cache);
+void BKE_ptcache_free_mem(struct ListBase *mem_cache);
void BKE_ptcache_free(struct PointCache *cache);
void BKE_ptcache_free_list(struct ListBase *ptcaches);
struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old);