[Bf-blender-cvs] [411ee40] soc-2014-fluid: single-threaded re-runs work ok

Roman Pogribnyi noreply at git.blender.org
Wed Jul 30 18:24:52 CEST 2014


Commit: 411ee40384a7f7682eab6ad921597d926fb511f7
Author: Roman Pogribnyi
Date:   Wed Jul 30 18:24:02 2014 +0200
Branches: soc-2014-fluid
https://developer.blender.org/rB411ee40384a7f7682eab6ad921597d926fb511f7

single-threaded re-runs work ok

===================================================================

M	intern/smoke/intern/MANTA.cpp
M	source/blender/python/manta_pp/pwrapper/pymain.cpp

===================================================================

diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index 835d71b..f909148 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -195,17 +195,17 @@ void *run_manta_scene_thread(void *arguments)
 
 void run_manta_scene(char *filepath)
 {
-	vector<string> a;
-	a.push_back(filepath);
+	//vector<string> a;
+	//a.push_back(filepath);
 	//PyGILState_STATE gilstate = PyGILState_Ensure();
-	runMantaScript(a);
+	//runMantaScript(a);
 	//PyGILState_Release(gilstate);
 
-//	pthread_t manta_thread;
-//	struct manta_arg_struct args;
-//	args.filepath = filepath;
-//	int rc = pthread_create(&manta_thread, NULL, run_manta_scene_thread, (void *)&args);
-//	pthread_detach(manta_thread);
+	pthread_t manta_thread;
+	struct manta_arg_struct args;
+	args.filepath = filepath;
+	int rc = pthread_create(&manta_thread, NULL, run_manta_scene_thread, (void *)&args);
+	pthread_detach(manta_thread);
 }
 
 void generate_manta_sim_file(Scene *scene, SmokeModifierData *smd)
@@ -328,7 +328,7 @@ void generate_manta_sim_file(Scene *scene, SmokeModifierData *smd)
 	ss << "tempFlag  = s.create(FlagGrid)\n";
 	ss << "sdf_flow  = s.create(LevelsetGrid)\n";
 	ss << "source.meshSDF(source, sdf_flow, 1.1)\n";
-	
+	ss << "source_shape = s.create(Cylinder, center=gs*vec3(0.5,0.1,0.5), radius=res*0.14, z=gs*vec3(0, 0.02, 0))\n";
 	/*Wavelets noise field*/
 	if (wavelets)
 	{
@@ -358,7 +358,8 @@ void generate_manta_sim_file(Scene *scene, SmokeModifierData *smd)
 	}
 	ss << "  applyInflow=False\n";
 	ss << "  if (t>=0 and t<75):\n";
-	ss << "    densityInflowMesh( flags=flags, density=density, noise=noise, mesh=source, scale=1, sigma=0.5 )\n";
+	ss << "    source_shape.applyToGrid(grid=density, value=1)\n";
+	//ss << "    densityInflowMesh( flags=flags, density=density, noise=noise, mesh=source, scale=1, sigma=0.5 )\n";
 	//ss << "    densityInflow( flags=flags, density=density, noise=noise, shape=source, scale=1, sigma=0.5 )\n";
 	ss << "    sourceVel.applyToGrid(grid=vel , value=velInflow,cutoff = 3)\n";
 	//ss << "    sourceVel.applyToGrid( grid=vel , value=velInflow )\n";
diff --git a/source/blender/python/manta_pp/pwrapper/pymain.cpp b/source/blender/python/manta_pp/pwrapper/pymain.cpp
index 6f3a69a..2b502e2 100644
--- a/source/blender/python/manta_pp/pwrapper/pymain.cpp
+++ b/source/blender/python/manta_pp/pwrapper/pymain.cpp
@@ -87,11 +87,11 @@ void runMantaScript(vector<string>& args) {
 	// for linux, use this as it produces nicer error messages
 	PyRun_SimpleFileEx(fp, filename.c_str(), 1);    
 	fclose(fp);
-	Pb::finalize();
-	Pb::setup(filename, args);
-	fp = fopen(filename.c_str(),"rb");    
-	debMsg("one more time",0);
-	PyRun_SimpleFileEx(fp, filename.c_str(), 1);    
+//	Pb::finalize();
+//	Pb::setup(filename, args);
+//	fp = fopen(filename.c_str(),"rb");    
+//	debMsg("one more time",0);
+//	PyRun_SimpleFileEx(fp, filename.c_str(), 1);    
 	fclose(fp);    
 #endif




More information about the Bf-blender-cvs mailing list