Bugfix for a) Fluid ipos gone after save-load b) changing viscosity causes fluidsim to be reversed [both reported by broken] (at least 3 known bugs left)
This commit is contained in:
@@ -181,7 +181,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Object *ob, Deri
|
||||
// clmd->sim_parms->timescale= timescale;
|
||||
|
||||
// support reversing of baked fluid frames here
|
||||
if((fss->show_advancedoptions & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0))
|
||||
if((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0))
|
||||
{
|
||||
framenr = fss->lastgoodframe - framenr + 1;
|
||||
CLAMP(framenr, 1, fss->lastgoodframe);
|
||||
|
||||
@@ -3045,6 +3045,13 @@ static void lib_link_object(FileData *fd, Main *main)
|
||||
act= act->next;
|
||||
}
|
||||
|
||||
{
|
||||
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
|
||||
|
||||
if(fluidmd && fluidmd->fss)
|
||||
fluidmd->fss->ipo = newlibadr_us(fd, ob->id.lib, fluidmd->fss->ipo);
|
||||
}
|
||||
|
||||
/* texture field */
|
||||
if(ob->pd)
|
||||
if(ob->pd->tex)
|
||||
@@ -3121,7 +3128,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
|
||||
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
|
||||
|
||||
fluidmd->fss= newdataadr(fd, fluidmd->fss);
|
||||
fluidmd->fss->ipo = newlibadr_us(fd, lb, fluidmd->fss->ipo);
|
||||
}
|
||||
else if (md->type==eModifierType_Collision) {
|
||||
|
||||
@@ -7794,6 +7800,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
MEM_freeN(ob->fluidsimSettings);
|
||||
|
||||
fluidmd->fss->lastgoodframe = INT_MAX;
|
||||
fluidmd->fss->flag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ typedef struct FluidsimSettings {
|
||||
#define OB_FSPART_FLOAT (1<<4)
|
||||
|
||||
// new fluid bit flags for fss->flags - dg
|
||||
#define OB_FLUIDSIM_REVERSE 1
|
||||
#define OB_FLUIDSIM_REVERSE (1 << 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -2407,7 +2407,7 @@ void do_object_panels(unsigned short event)
|
||||
case B_FLUIDSIM_CHANGETYPE:
|
||||
{
|
||||
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
|
||||
fluidmd->fss->show_advancedoptions &= ~OB_FLUIDSIM_REVERSE; // clear flag
|
||||
fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; // clear flag
|
||||
if(ob && ob->particlesystem.first && fluidmd->fss->type!=OB_FLUIDSIM_PARTICLE){
|
||||
ParticleSystem *psys;
|
||||
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
|
||||
@@ -5185,7 +5185,7 @@ static void object_panel_fluidsim(Object *ob)
|
||||
yline -= 1*separateHeight;
|
||||
|
||||
uiBlockBeginAlign ( block );
|
||||
uiDefButBitS ( block, TOG, OB_FLUIDSIM_REVERSE, REDRAWBUTSOBJECT, "Reverse", 0, yline,50,objHeight, &fss->flag, 0, 0, 0, 0, "Reverse fluidsim frames" );
|
||||
uiDefButBitI ( block, TOG, OB_FLUIDSIM_REVERSE, REDRAWBUTSOBJECT, "Reverse", 0, yline,50,objHeight, &fss->flag, 0, 0, 0, 0, "Reverse fluidsim frames" );
|
||||
uiDefBut ( block, LABEL, 0, "", 50,yline,25,objHeight, NULL, 0.0, 0, 0, 0, "" );
|
||||
uiDefIconBut ( block, BUT, B_FLUIDSIM_SELDIR, ICON_FILESEL, 75, yline, 20, objHeight, 0, 0, 0, 0, 0, "Select Directory (and/or filename prefix) to store baked fluid simulation files in" );
|
||||
uiDefBut ( block, TEX, B_BAKE_CACHE_CHANGE,"", 95, yline, 205, objHeight, fss->surfdataPath, 0.0,79.0, 0, 0, "Enter Directory (and/or filename prefix) to store baked fluid simulation files in" );
|
||||
@@ -5342,7 +5342,7 @@ static void object_panel_fluidsim(Object *ob)
|
||||
|
||||
yline -= lineHeight;
|
||||
uiDefButF ( block, NUM, B_DIFF, "Quality:", 0, yline,150,20, &fss->cpsQuality, 5.0, 100.0, 10,0, "Specifies the quality which is used for object sampling (higher = better but slower)." );
|
||||
uiDefButBitS ( block, TOG, OB_FLUIDSIM_REVERSE, REDRAWBUTSOBJECT, "Reverse", 150, yline,150,20, &fss->flag, 0, 0, 0, 0, "Reverse control object movement." );
|
||||
uiDefButBitI ( block, TOG, OB_FLUIDSIM_REVERSE, REDRAWBUTSOBJECT, "Reverse", 150, yline,150,20, &fss->flag, 0, 0, 0, 0, "Reverse control object movement." );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user