Removed DNA for point caches.
This commit is contained in:
parent
ac30a04b27
commit
735727e2b8
|
@ -99,7 +99,6 @@ void BKE_rigidbody_remove_constraint(struct Scene *scene, struct Object *ob);
|
|||
void BKE_rigidbody_aftertrans_update(struct Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle);
|
||||
void BKE_rigidbody_sync_transforms(struct RigidBodyWorld *rbw, struct Object *ob, float ctime);
|
||||
bool BKE_rigidbody_check_sim_running(struct RigidBodyWorld *rbw, float ctime);
|
||||
void BKE_rigidbody_cache_reset(struct RigidBodyWorld *rbw);
|
||||
void BKE_rigidbody_rebuild_world(struct Scene *scene, float ctime);
|
||||
void BKE_rigidbody_do_simulation(struct Scene *scene, float ctime);
|
||||
|
||||
|
|
|
@ -462,19 +462,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
|
|||
Object *ob = (Object *)id;
|
||||
ModifierData *md;
|
||||
|
||||
#define BPATH_TRAVERSE_POINTCACHE(ptcaches) \
|
||||
{ \
|
||||
PointCache *cache; \
|
||||
for (cache = (ptcaches).first; cache; cache = cache->next) { \
|
||||
if (cache->flag & PTCACHE_DISK_CACHE) { \
|
||||
rewrite_path_fixed(cache->path, \
|
||||
visit_cb, \
|
||||
absbase, \
|
||||
bpath_user_data); \
|
||||
} \
|
||||
} \
|
||||
} (void)0
|
||||
|
||||
/* do via modifiers instead */
|
||||
#if 0
|
||||
if (ob->fluidsimSettings) {
|
||||
|
@ -489,16 +476,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
|
|||
rewrite_path_fixed(fluidmd->fss->surfdataPath, visit_cb, absbase, bpath_user_data);
|
||||
}
|
||||
}
|
||||
else if (md->type == eModifierType_Smoke) {
|
||||
SmokeModifierData *smd = (SmokeModifierData *)md;
|
||||
if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
|
||||
BPATH_TRAVERSE_POINTCACHE(smd->domain->ptcaches[0]);
|
||||
}
|
||||
}
|
||||
else if (md->type == eModifierType_Cloth) {
|
||||
ClothModifierData *clmd = (ClothModifierData *) md;
|
||||
BPATH_TRAVERSE_POINTCACHE(clmd->ptcaches);
|
||||
}
|
||||
else if (md->type == eModifierType_Ocean) {
|
||||
OceanModifierData *omd = (OceanModifierData *) md;
|
||||
rewrite_path_fixed(omd->cachepath, visit_cb, absbase, bpath_user_data);
|
||||
|
@ -509,12 +486,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
|
|||
}
|
||||
}
|
||||
|
||||
if (ob->soft) {
|
||||
BPATH_TRAVERSE_POINTCACHE(ob->soft->ptcaches);
|
||||
}
|
||||
|
||||
#undef BPATH_TRAVERSE_POINTCACHE
|
||||
|
||||
break;
|
||||
}
|
||||
case ID_SO:
|
||||
|
|
|
@ -963,10 +963,9 @@ void BKE_rigidbody_world_id_loop(RigidBodyWorld *rbw, RigidbodyWorldIDFunc func,
|
|||
}
|
||||
|
||||
/* Add rigid body settings to the specified object */
|
||||
RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type)
|
||||
RigidBodyOb *BKE_rigidbody_create_object(Scene *UNUSED(scene), Object *ob, short type)
|
||||
{
|
||||
RigidBodyOb *rbo;
|
||||
RigidBodyWorld *rbw = scene->rigidbody_world;
|
||||
|
||||
/* sanity checks
|
||||
* - rigidbody world must exist
|
||||
|
@ -1010,18 +1009,14 @@ RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type)
|
|||
/* set initial transform */
|
||||
mat4_to_loc_quat(rbo->pos, rbo->orn, ob->obmat);
|
||||
|
||||
/* flag cache as outdated */
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
|
||||
/* return this object */
|
||||
return rbo;
|
||||
}
|
||||
|
||||
/* Add rigid body constraint to the specified object */
|
||||
RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short type)
|
||||
RigidBodyCon *BKE_rigidbody_create_constraint(Scene *UNUSED(scene), Object *ob, short type)
|
||||
{
|
||||
RigidBodyCon *rbc;
|
||||
RigidBodyWorld *rbw = scene->rigidbody_world;
|
||||
|
||||
/* sanity checks
|
||||
* - rigidbody world must exist
|
||||
|
@ -1071,9 +1066,6 @@ RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short ty
|
|||
rbc->motor_ang_max_impulse = 1.0f;
|
||||
rbc->motor_ang_target_velocity = 1.0f;
|
||||
|
||||
/* flag cache as outdated */
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
|
||||
/* return this object */
|
||||
return rbc;
|
||||
}
|
||||
|
@ -1133,9 +1125,6 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
|
|||
|
||||
/* remove object's settings */
|
||||
BKE_rigidbody_free_object(ob);
|
||||
|
||||
/* flag cache as outdated */
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
}
|
||||
|
||||
void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob)
|
||||
|
@ -1149,9 +1138,6 @@ void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob)
|
|||
}
|
||||
/* remove object's settings */
|
||||
BKE_rigidbody_free_constraint(ob);
|
||||
|
||||
/* flag cache as outdated */
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1418,9 +1404,9 @@ static void rigidbody_update_simulation_post_step(RigidBodyWorld *rbw)
|
|||
}
|
||||
}
|
||||
|
||||
bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float ctime)
|
||||
bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float UNUSED(ctime))
|
||||
{
|
||||
return (rbw && (rbw->flag & RBW_FLAG_MUTED) == 0 && ctime > rbw->pointcache->startframe);
|
||||
return (rbw && (rbw->flag & RBW_FLAG_MUTED) == 0);
|
||||
}
|
||||
|
||||
/* Sync rigid body and object transformations */
|
||||
|
@ -1483,12 +1469,6 @@ void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], flo
|
|||
// RB_TODO update rigid body physics object's loc/rot for dynamic objects here as well (needs to be done outside bullet's update loop)
|
||||
}
|
||||
|
||||
void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw)
|
||||
{
|
||||
if (rbw)
|
||||
rbw->pointcache->flag |= PTCACHE_OUTDATED;
|
||||
}
|
||||
|
||||
/* ------------------ */
|
||||
|
||||
/* Rebuild rigid body world */
|
||||
|
@ -1571,7 +1551,6 @@ void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob) {}
|
|||
void BKE_rigidbody_sync_transforms(RigidBodyWorld *rbw, Object *ob, float ctime) {}
|
||||
void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle) {}
|
||||
bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float ctime) { return false; }
|
||||
void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
|
||||
void BKE_rigidbody_rebuild_world(Scene *scene, float ctime) {}
|
||||
void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {}
|
||||
|
||||
|
|
|
@ -1057,57 +1057,6 @@ static void write_userdef(WriteData *wd)
|
|||
}
|
||||
}
|
||||
|
||||
/* update this also to readfile.c */
|
||||
static const char *ptcache_data_struct[] = {
|
||||
"", // BPHYS_DATA_INDEX
|
||||
"", // BPHYS_DATA_LOCATION
|
||||
"", // BPHYS_DATA_VELOCITY
|
||||
"", // BPHYS_DATA_ROTATION
|
||||
"", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */
|
||||
"", // BPHYS_DATA_SIZE:
|
||||
"", // BPHYS_DATA_TIMES:
|
||||
"BoidData" // case BPHYS_DATA_BOIDS:
|
||||
};
|
||||
static const char *ptcache_extra_struct[] = {
|
||||
"",
|
||||
"ParticleSpring"
|
||||
};
|
||||
static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
|
||||
{
|
||||
PointCache *cache = ptcaches->first;
|
||||
int i;
|
||||
|
||||
for (; cache; cache=cache->next) {
|
||||
writestruct(wd, DATA, "PointCache", 1, cache);
|
||||
|
||||
if ((cache->flag & PTCACHE_DISK_CACHE)==0) {
|
||||
PTCacheMem *pm = cache->mem_cache.first;
|
||||
|
||||
for (; pm; pm=pm->next) {
|
||||
PTCacheExtra *extra = pm->extradata.first;
|
||||
|
||||
writestruct(wd, DATA, "PTCacheMem", 1, pm);
|
||||
|
||||
for (i=0; i<BPHYS_TOT_DATA; i++) {
|
||||
if (pm->data[i] && pm->data_types & (1<<i)) {
|
||||
if (ptcache_data_struct[i][0] == '\0')
|
||||
writedata(wd, DATA, MEM_allocN_len(pm->data[i]), pm->data[i]);
|
||||
else
|
||||
writestruct(wd, DATA, ptcache_data_struct[i], pm->totpoint, pm->data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (; extra; extra=extra->next) {
|
||||
if (ptcache_extra_struct[extra->type][0] == '\0')
|
||||
continue;
|
||||
writestruct(wd, DATA, "PTCacheExtra", 1, extra);
|
||||
writestruct(wd, DATA, ptcache_extra_struct[extra->type], extra->totdata, extra->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void write_properties(WriteData *wd, ListBase *lb)
|
||||
{
|
||||
bProperty *prop;
|
||||
|
@ -1417,7 +1366,6 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
|
|||
writestruct(wd, DATA, "ClothSimSettings", 1, clmd->sim_parms);
|
||||
writestruct(wd, DATA, "ClothCollSettings", 1, clmd->coll_parms);
|
||||
writestruct(wd, DATA, "EffectorWeights", 1, clmd->sim_parms->effector_weights);
|
||||
write_pointcaches(wd, &clmd->ptcaches);
|
||||
}
|
||||
else if (md->type==eModifierType_Smoke) {
|
||||
SmokeModifierData *smd = (SmokeModifierData*) md;
|
||||
|
@ -1451,8 +1399,6 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
|
|||
writestruct(wd, DATA, "DynamicPaintSurface", 1, surface);
|
||||
/* write caches and effector weights */
|
||||
for (surface=pmd->canvas->surfaces.first; surface; surface=surface->next) {
|
||||
write_pointcaches(wd, &(surface->ptcaches));
|
||||
|
||||
writestruct(wd, DATA, "EffectorWeights", 1, surface->effector_weights);
|
||||
}
|
||||
}
|
||||
|
@ -1552,7 +1498,6 @@ static void write_objects(WriteData *wd, ListBase *idbase)
|
|||
writestruct(wd, DATA, "PartDeflect", 1, ob->pd);
|
||||
writestruct(wd, DATA, "SoftBody", 1, ob->soft);
|
||||
if (ob->soft) {
|
||||
write_pointcaches(wd, &ob->soft->ptcaches);
|
||||
writestruct(wd, DATA, "EffectorWeights", 1, ob->soft->effector_weights);
|
||||
}
|
||||
writestruct(wd, DATA, "BulletSoftBody", 1, ob->bsoft);
|
||||
|
@ -2422,7 +2367,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
|
|||
if (sce->rigidbody_world) {
|
||||
writestruct(wd, DATA, "RigidBodyWorld", 1, sce->rigidbody_world);
|
||||
writestruct(wd, DATA, "EffectorWeights", 1, sce->rigidbody_world->effector_weights);
|
||||
write_pointcaches(wd, &(sce->rigidbody_world->ptcaches));
|
||||
}
|
||||
|
||||
write_previews(wd, sce->preview);
|
||||
|
|
|
@ -6694,6 +6694,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
|
|||
/* only draw domains */
|
||||
if (smd->domain) {
|
||||
SmokeDomainSettings *sds = smd->domain;
|
||||
const bool show_smoke = true; /* XXX was checking cached frame range before */
|
||||
float viewnormal[3];
|
||||
|
||||
glLoadMatrixf(rv3d->viewmat);
|
||||
|
@ -6734,7 +6735,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
|
|||
}
|
||||
|
||||
/* don't show smoke before simulation starts, this could be made an option in the future */
|
||||
if (sds->fluid && CFRA >= sds->point_cache[0]->startframe) {
|
||||
if (sds->fluid && show_smoke) {
|
||||
float p0[3], p1[3];
|
||||
|
||||
/* get view vector */
|
||||
|
|
|
@ -108,8 +108,6 @@ typedef struct DynamicPaintSurface {
|
|||
struct EffectorWeights *effector_weights;
|
||||
|
||||
/* cache */
|
||||
struct PointCache *pointcache;
|
||||
struct ListBase ptcaches;
|
||||
int current_frame;
|
||||
|
||||
/* surface */
|
||||
|
|
|
@ -592,8 +592,6 @@ typedef struct ClothModifierData {
|
|||
struct Cloth *clothObject; /* The internal data structure for cloth. */
|
||||
struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */
|
||||
struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */
|
||||
struct PointCache *point_cache; /* definition is in DNA_object_force.h */
|
||||
struct ListBase ptcaches;
|
||||
/* XXX nasty hack, remove once hair can be separated from cloth modifier data */
|
||||
struct ClothHairData *hairdata;
|
||||
/* grid geometry values of hair continuum */
|
||||
|
@ -746,7 +744,6 @@ typedef struct FluidsimModifierData {
|
|||
ModifierData modifier;
|
||||
|
||||
struct FluidsimSettings *fss; /* definition is in DNA_object_fluidsim.h */
|
||||
struct PointCache *point_cache; /* definition is in DNA_object_force.h */
|
||||
} FluidsimModifierData;
|
||||
|
||||
typedef struct ShrinkwrapModifierData {
|
||||
|
|
|
@ -127,87 +127,6 @@ typedef struct EffectorWeights {
|
|||
/* EffectorWeights->flag */
|
||||
#define EFF_WEIGHT_DO_HAIR 1
|
||||
|
||||
/* Point cache file data types:
|
||||
* - used as (1<<flag) so poke jahka if you reach the limit of 15
|
||||
* - to add new data types update:
|
||||
* * BKE_ptcache_data_size()
|
||||
* * ptcache_file_init_pointers()
|
||||
*/
|
||||
#define BPHYS_DATA_INDEX 0
|
||||
#define BPHYS_DATA_LOCATION 1
|
||||
#define BPHYS_DATA_SMOKE_LOW 1
|
||||
#define BPHYS_DATA_VELOCITY 2
|
||||
#define BPHYS_DATA_SMOKE_HIGH 2
|
||||
#define BPHYS_DATA_ROTATION 3
|
||||
#define BPHYS_DATA_DYNAMICPAINT 3
|
||||
#define BPHYS_DATA_AVELOCITY 4 /* used for particles */
|
||||
#define BPHYS_DATA_XCONST 4 /* used for cloth */
|
||||
#define BPHYS_DATA_SIZE 5
|
||||
#define BPHYS_DATA_TIMES 6
|
||||
#define BPHYS_DATA_BOIDS 7
|
||||
|
||||
#define BPHYS_TOT_DATA 8
|
||||
|
||||
#define BPHYS_EXTRA_FLUID_SPRINGS 1
|
||||
|
||||
typedef struct PTCacheExtra {
|
||||
struct PTCacheExtra *next, *prev;
|
||||
unsigned int type, totdata;
|
||||
void *data;
|
||||
} PTCacheExtra;
|
||||
|
||||
typedef struct PTCacheMem {
|
||||
struct PTCacheMem *next, *prev;
|
||||
unsigned int frame, totpoint;
|
||||
unsigned int data_types, flag;
|
||||
|
||||
void *data[8]; /* BPHYS_TOT_DATA */
|
||||
void *cur[8]; /* BPHYS_TOT_DATA */
|
||||
|
||||
struct ListBase extradata;
|
||||
} PTCacheMem;
|
||||
|
||||
typedef struct PointCache {
|
||||
struct PointCache *next, *prev;
|
||||
int flag; /* generic flag */
|
||||
|
||||
int step; /* The number of frames between cached frames.
|
||||
* This should probably be an upper bound for a per point adaptive step in the future,
|
||||
* buf for now it's the same for all points. Without adaptivity this can effect the perceived
|
||||
* simulation quite a bit though. If for example particles are colliding with a horizontal
|
||||
* plane (with high damping) they quickly come to a stop on the plane, however there are still
|
||||
* forces acting on the particle (gravity and collisions), so the particle velocity isn't necessarily
|
||||
* zero for the whole duration of the frame even if the particle seems stationary. If all simulation
|
||||
* frames aren't cached (step > 1) these velocities are interpolated into movement for the non-cached
|
||||
* frames. The result will look like the point is oscillating around the collision location. So for
|
||||
* now cache step should be set to 1 for accurate reproduction of collisions.
|
||||
*/
|
||||
|
||||
int simframe; /* current frame of simulation (only if SIMULATION_VALID) */
|
||||
int startframe; /* simulation start frame */
|
||||
int endframe; /* simulation end frame */
|
||||
int editframe; /* frame being edited (runtime only) */
|
||||
int last_exact; /* last exact frame that's cached */
|
||||
int last_valid; /* used for editing cache - what is the last baked frame */
|
||||
int pad;
|
||||
|
||||
/* for external cache files */
|
||||
int totpoint; /* number of cached points */
|
||||
int index; /* modifier stack index */
|
||||
short compression, rt;
|
||||
|
||||
char name[64];
|
||||
char prev_name[64];
|
||||
char info[64];
|
||||
char path[1024]; /* file path, 1024 = FILE_MAX */
|
||||
char *cached_frames; /* array of length endframe-startframe+1 with flags to indicate cached frames */
|
||||
/* can be later used for other per frame flags too if needed */
|
||||
struct ListBase mem_cache;
|
||||
|
||||
struct PTCacheEdit *edit;
|
||||
void (*free_edit)(struct PTCacheEdit *edit); /* free callback */
|
||||
} PointCache;
|
||||
|
||||
typedef struct SBVertex {
|
||||
float vec[4];
|
||||
} SBVertex;
|
||||
|
@ -336,9 +255,6 @@ typedef struct SoftBody {
|
|||
float shearstiff;
|
||||
float inpush;
|
||||
|
||||
struct PointCache *pointcache;
|
||||
struct ListBase ptcaches;
|
||||
|
||||
struct EffectorWeights *effector_weights;
|
||||
/* reverse esimated obmatrix .. no need to store in blend file .. how ever who cares */
|
||||
float lcom[3];
|
||||
|
@ -392,31 +308,6 @@ typedef struct SoftBody {
|
|||
#define PFIELD_Z_POS 1
|
||||
#define PFIELD_Z_NEG 2
|
||||
|
||||
/* pointcache->flag */
|
||||
#define PTCACHE_BAKED 1
|
||||
#define PTCACHE_OUTDATED 2
|
||||
#define PTCACHE_SIMULATION_VALID 4
|
||||
#define PTCACHE_BAKING 8
|
||||
//#define PTCACHE_BAKE_EDIT 16
|
||||
//#define PTCACHE_BAKE_EDIT_ACTIVE 32
|
||||
#define PTCACHE_DISK_CACHE 64
|
||||
//#define PTCACHE_QUICK_CACHE 128 /* removed since 2.64 - [#30974], could be added back in a more useful way */
|
||||
#define PTCACHE_FRAMES_SKIPPED 256
|
||||
#define PTCACHE_EXTERNAL 512
|
||||
#define PTCACHE_READ_INFO 1024
|
||||
/* don't use the filename of the blendfile the data is linked from (write a local cache) */
|
||||
#define PTCACHE_IGNORE_LIBPATH 2048
|
||||
/* high resolution cache is saved for smoke for backwards compatibility, so set this flag to know it's a "fake" cache */
|
||||
#define PTCACHE_FAKE_SMOKE (1<<12)
|
||||
#define PTCACHE_IGNORE_CLEAR (1<<13)
|
||||
|
||||
/* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */
|
||||
#define PTCACHE_REDO_NEEDED 258
|
||||
|
||||
#define PTCACHE_COMPRESS_NO 0
|
||||
#define PTCACHE_COMPRESS_LZO 1
|
||||
#define PTCACHE_COMPRESS_LZMA 2
|
||||
|
||||
/* ob->softflag */
|
||||
#define OB_SB_ENABLE 1 /* deprecated, use modifier */
|
||||
#define OB_SB_GOAL 2
|
||||
|
|
|
@ -58,9 +58,6 @@ typedef struct RigidBodyWorld {
|
|||
int pad;
|
||||
float ltime; /* last frame world was evaluated for (internal) */
|
||||
|
||||
/* cache */
|
||||
struct PointCache *pointcache;
|
||||
struct ListBase ptcaches;
|
||||
int numbodies; /* number of objects in rigid body group */
|
||||
|
||||
short steps_per_second; /* number of simulation steps thaken per second */
|
||||
|
|
|
@ -146,9 +146,6 @@ typedef struct SmokeDomainSettings {
|
|||
char data_depth;
|
||||
char pad[2];
|
||||
|
||||
/* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading old files. */
|
||||
struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */
|
||||
struct ListBase ptcaches[2];
|
||||
struct EffectorWeights *effector_weights;
|
||||
int border_collisions; /* How domain border collisions are handled */
|
||||
float time_scale;
|
||||
|
|
|
@ -109,8 +109,7 @@ static EnumPropertyItem rigidbody_mesh_source_items[] = {
|
|||
static void rna_RigidBodyWorld_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
|
||||
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
UNUSED_VARS(rbw);
|
||||
}
|
||||
|
||||
static char *rna_RigidBodyWorld_path(PointerRNA *UNUSED(ptr))
|
||||
|
@ -149,10 +148,10 @@ static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value)
|
|||
static void rna_RigidBodyOb_reset(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
RigidBodyWorld *rbw = scene->rigidbody_world;
|
||||
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
UNUSED_VARS(rbw);
|
||||
}
|
||||
|
||||
|
||||
static void rna_RigidBodyOb_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = ptr->id.data;
|
||||
|
@ -162,12 +161,10 @@ static void rna_RigidBodyOb_shape_update(Main *bmain, Scene *scene, PointerRNA *
|
|||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
|
||||
}
|
||||
|
||||
static void rna_RigidBodyOb_shape_reset(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
|
||||
static void rna_RigidBodyOb_shape_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
RigidBodyWorld *rbw = scene->rigidbody_world;
|
||||
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
|
||||
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
if (rbo->physics_shape)
|
||||
rbo->flag |= RBO_FLAG_NEEDS_RESHAPE;
|
||||
}
|
||||
|
|
|
@ -66,20 +66,11 @@ static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *p
|
|||
DAG_relations_tag_update(bmain);
|
||||
}
|
||||
|
||||
static void rna_Smoke_resetCache(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
|
||||
if (settings->smd && settings->smd->domain)
|
||||
settings->point_cache[0]->flag |= PTCACHE_OUTDATED;
|
||||
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
|
||||
|
||||
smokeModifier_reset(settings->smd);
|
||||
rna_Smoke_resetCache(bmain, scene, ptr);
|
||||
|
||||
rna_Smoke_update(bmain, scene, ptr);
|
||||
}
|
||||
|
@ -90,9 +81,6 @@ static void rna_Smoke_reset_dependency(Main *bmain, Scene *scene, PointerRNA *pt
|
|||
|
||||
smokeModifier_reset(settings->smd);
|
||||
|
||||
if (settings->smd && settings->smd->domain)
|
||||
settings->smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED;
|
||||
|
||||
rna_Smoke_dependency_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
|
@ -457,7 +445,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|||
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
|
||||
RNA_def_property_ui_text(prop, "Density",
|
||||
"How much density affects smoke motion (higher value results in faster rising smoke)");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "beta");
|
||||
|
@ -465,7 +453,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|||
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
|
||||
RNA_def_property_ui_text(prop, "Heat",
|
||||
"How much heat affects smoke motion (higher value results in faster rising smoke)");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
|
||||
|
@ -493,24 +481,24 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|||
RNA_def_property_range(prop, 0.0, 10.0);
|
||||
RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
|
||||
RNA_def_property_ui_text(prop, "Strength", "Strength of noise");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
|
||||
RNA_def_property_range(prop, 1.0, 10000.0);
|
||||
RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, -1);
|
||||
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
|
||||
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
|
||||
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "openvdb_cache_compress_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "openvdb_comp");
|
||||
|
@ -540,21 +528,21 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "highres_sampling", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, smoke_highres_sampling_items);
|
||||
RNA_def_property_ui_text(prop, "Emitter", "Method for sampling the high resolution flow");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "time_scale");
|
||||
RNA_def_property_range(prop, 0.2, 1.5);
|
||||
RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
|
||||
RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "vorticity");
|
||||
RNA_def_property_range(prop, 0.01, 4.0);
|
||||
RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
|
||||
RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "density_grid", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_array(prop, 32);
|
||||
|
@ -614,36 +602,36 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|||
RNA_def_property_range(prop, 0.01, 4.0);
|
||||
RNA_def_property_ui_range(prop, 0.01, 2.0, 1.0, 5);
|
||||
RNA_def_property_ui_text(prop, "Speed", "Speed of the burning reaction (use larger values for smaller flame)");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "flame_smoke", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.0, 8.0);
|
||||
RNA_def_property_ui_range(prop, 0.0, 4.0, 1.0, 5);
|
||||
RNA_def_property_ui_text(prop, "Smoke", "Amount of smoke created by burning fuel");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "flame_vorticity", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.0, 2.0);
|
||||
RNA_def_property_ui_range(prop, 0.0, 1.0, 1.0, 5);
|
||||
RNA_def_property_ui_text(prop, "Vorticity", "Additional vorticity for the flames");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "flame_ignition", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.5, 5.0);
|
||||
RNA_def_property_ui_range(prop, 0.5, 2.5, 1.0, 5);
|
||||
RNA_def_property_ui_text(prop, "Ignition", "Minimum temperature of flames");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "flame_max_temp", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 1.0, 10.0);
|
||||
RNA_def_property_ui_range(prop, 1.0, 5.0, 1.0, 5);
|
||||
RNA_def_property_ui_text(prop, "Maximum", "Maximum temperature of flames");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "flame_smoke_color", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Smoke Color", "Color of smoke emitted from burning fuel");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_adaptive_domain", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_ADAPTIVE_DOMAIN);
|
||||
|
@ -656,21 +644,21 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|||
RNA_def_property_range(prop, 0, 512);
|
||||
RNA_def_property_ui_range(prop, 0, 512, 2, -1);
|
||||
RNA_def_property_ui_text(prop, "Additional", "Maximum number of additional cells");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "adapt_margin", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "adapt_margin");
|
||||
RNA_def_property_range(prop, 2, 24);
|
||||
RNA_def_property_ui_range(prop, 2, 24, 2, -1);
|
||||
RNA_def_property_ui_text(prop, "Margin", "Margin added around fluid to minimize boundary interference");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
|
||||
prop = RNA_def_property(srna, "adapt_threshold", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.01, 0.5);
|
||||
RNA_def_property_ui_range(prop, 0.01, 0.5, 1.0, 5);
|
||||
RNA_def_property_ui_text(prop, "Threshold",
|
||||
"Maximum amount of fluid cell can contain before it is considered empty");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
|
||||
}
|
||||
|
||||
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
|
||||
|
|
|
@ -225,7 +225,7 @@ static int read_voxeldata_header(FILE *fp, struct VoxelData *vd)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void init_frame_smoke(VoxelData *vd, int cfra)
|
||||
static void init_frame_smoke(VoxelData *vd, int UNUSED(cfra))
|
||||
{
|
||||
#ifdef WITH_SMOKE
|
||||
Object *ob;
|
||||
|
@ -248,9 +248,7 @@ static void init_frame_smoke(VoxelData *vd, int cfra)
|
|||
return;
|
||||
}
|
||||
|
||||
if (cfra < sds->point_cache[0]->startframe)
|
||||
; /* don't show smoke before simulation starts, this could be made an option in the future */
|
||||
else if (vd->smoked_type == TEX_VD_SMOKEHEAT) {
|
||||
if (vd->smoked_type == TEX_VD_SMOKEHEAT) {
|
||||
size_t totRes;
|
||||
size_t i;
|
||||
float *heat;
|
||||
|
|
Loading…
Reference in New Issue