Fluidsim - Restoring simulation speed control (ZanQdo request)
This commit restores support for freezing or speeding up physics sims. Animate the "Speed" parameter under Domain->Time, which controls a multiplier factor for the rate at which the sim proceeds (i.e. the old "Fac-Tim" setting). Notes: * Subversion bumped to 4 to patch up defaults for new value so that old sim files will still run correctly * Names/descriptions could do with some tweaking * Porting this across was not that obvious since quite a bit of stuff had changed (as in, been cleaned up). However, from tests so far, it seems to work well.
This commit is contained in:
		@@ -13019,6 +13019,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 4))
 | 
			
		||||
	{
 | 
			
		||||
		{
 | 
			
		||||
			/* set fluidsim rate */
 | 
			
		||||
			Object *ob;
 | 
			
		||||
			for (ob = main->object.first; ob; ob = ob->id.next) {
 | 
			
		||||
				ModifierData *md;
 | 
			
		||||
				for (md = ob->modifiers.first; md; md = md->next) {
 | 
			
		||||
					if (md->type == eModifierType_Fluidsim) {
 | 
			
		||||
						FluidsimSettings *fss = (FluidsimSettings *)md;
 | 
			
		||||
						fss->animRate = 1.0f;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/* put compatibility code here until next subversion bump */
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user