[Bf-blender-cvs] [2deb386] fluid-mantaflow: more noise and ui cleanup

Sebastián Barschkis noreply at git.blender.org
Fri Feb 26 11:15:54 CET 2016


Commit: 2deb38631890f689e644bdb4fadac7bd068a3607
Author: Sebastián Barschkis
Date:   Fri Feb 26 11:15:02 2016 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB2deb38631890f689e644bdb4fadac7bd068a3607

more noise and ui cleanup

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

M	intern/smoke/intern/MANTA.cpp
M	intern/smoke/intern/scenarios/smoke.h
M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/makesdna/DNA_smoke_types.h
M	source/blender/makesrna/intern/rna_smoke.c

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

diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index f8258d5..bb9a4ed 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -47,6 +47,8 @@ std::string Manta_API::get_real_value( const std::string& varName, SmokeModifier
 		else { 		ss << smd->domain->fluid->_zRes;}
 	else if (varName == "SOLVER_DIM")
 		ss <<  smd->domain->manta_solver_res;
+	else if (varName == "NOISE_POSSCALE")
+		ss << smd->domain->noise_pos_scale;
 	else if (varName == "NOISE_TIMEANIM")
 		ss << smd->domain->noise_time_anim;
 	else if (varName == "HRESX")
diff --git a/intern/smoke/intern/scenarios/smoke.h b/intern/smoke/intern/scenarios/smoke.h
index 76ae6d9..12415fd 100644
--- a/intern/smoke/intern/scenarios/smoke.h
+++ b/intern/smoke/intern/scenarios/smoke.h
@@ -52,7 +52,7 @@ s.timestep = dt0\n\
 timings = Timings()\n\
 vorticity = $VORTICITY$\n\
 boundaryWidth = 1\n\
-uvs = $UVS_CNT$\n";
+uvs = 2\n";
 
 const string alloc_base_grids_low = "\n\
 # prepare grids low\n\
@@ -134,7 +134,7 @@ if doOpen:\n\
 const string wavelet_turbulence_noise = "\n\
 # wavelet turbulence noise field\n\
 xl_wltnoise = s.create(NoiseField, loadFromFile=True)\n\
-xl_wltnoise.posScale = vec3(int(1.0*gs.x)) * 0.5\n\
+xl_wltnoise.posScale = vec3(int(1.0*gs.x)) * $NOISE_POSSCALE$\n\
 xl_wltnoise.timeAnim = $NOISE_TIMEANIM$\n\
 if(upres>0):\n\
   xl_wltnoise.posScale = xl_wltnoise.posScale * (1./upres)\n\
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index 64a46ad..884a111 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -261,6 +261,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
         col.label(text="Noise Method:")
         col.row().prop(md, "noise_type", text="")
         col.prop(md, "strength")
+        col.prop(md, "noise_pos_scale")
+        col.prop(md, "noise_time_anim")
 
         layout.prop(md, "show_high_resolution")
 
@@ -416,58 +418,26 @@ class OBJECT_OT_RunMantaButton(bpy.types.Operator):
         #bpy.ops.manta.sim_step()
         return{'FINISHED'}
 
-#class OBJECT_OT_StopMantaButton(bpy.types.Operator):
-#    bl_idname = "manta_stop_sim.button"
-#    bl_label = "Stop Mantaflow Simulation"
-#    def execute(self, context):
-#        domain = context.smoke.domain_settings
-#        #setting manta_sim_frame to "stop" value 
-#        domain.manta_sim_frame = -1
-#        return{'FINISHED'}
-
-
 class PHYSICS_PT_smoke_manta_settings(PhysicButtonsPanel, Panel):
-    bl_label = "MantaFlow Settings"
+    bl_label = "Mantaflow Settings"
     bl_options = {'DEFAULT_CLOSED'}
-    name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
-    StringProp = bpy.props.StringProperty(name="manta_status", description="Status Of Simulation", default="Doing Nothing" )
-#    filepath = StringProperty(subtype='FILE_PATH',)
+
     @classmethod
     def poll(cls, context):
         md = context.smoke
         return md and (md.smoke_type == 'DOMAIN')
-    
-    def draw_header(self, context):
-        md = context.smoke.domain_settings
         
     def draw(self, context):
         layout = self.layout
         
         domain = context.smoke.domain_settings
         split = layout.split()
-        split.prop(domain, "use_manta_liquid", text="Liquid")
         split.operator("manta_export_scene.button", text="Export Mantaflow Script")
         split = layout.split()
         split.prop(domain, "manta_filepath")
         split = layout.split()
         col = split.column()
         col.prop(domain, "manta_solver_res", text="Solver Resolution")
-        col.prop(domain, "manta_uvs", text="UVs count")
-        split = layout.split()
-        col = split.column()
-        col.label("Wavelet Noise")
-        col.active = domain.use_high_resolution
-        col.prop(domain, "noise_clamp", text="Clamp")
-        sub = col.column()
-        sub.active = domain.noise_clamp
-        sub.prop(domain, "noise_clamp_neg", text="Clamp Neg")
-        sub.prop(domain, "noise_clamp_pos", text="Clamp Pos")
-        col = split.column()
-        col.active = domain.use_high_resolution
-        col.label("")
-        col.prop(domain, "noise_val_scale", text="Scale")
-        col.prop(domain, "noise_val_offset", text="Offset")
-        col.prop(domain, "noise_time_anim", text="Time Anim")
 
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index bcac98f..9ce705e 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -583,15 +583,8 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
 			
 			/*mantaflow settings*/
 			smd->domain->manta_solver_res = 3;
-//			smd->domain->manta_sim_frame = -1;
-			smd->domain->manta_start_frame = 1;
-			smd->domain->manta_end_frame = 10;
-			smd->domain->noise_clamp_neg = 0;
-			smd->domain->noise_clamp_pos = 1;
-			smd->domain->noise_val_scale = 1.;
-			smd->domain->noise_val_offset = 0.;
-			smd->domain->noise_time_anim = 0.;
-			smd->domain->noise_clamp = 1;
+			smd->domain->noise_pos_scale = 0.5f;
+			smd->domain->noise_time_anim = 0.1f;
 			BLI_make_file_string("/", smd->domain->_manta_filepath, BKE_tempdir_base(), "manta_scene.py");
 		}
 		else if (smd->type & MOD_SMOKE_TYPE_FLOW)
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index f372802..5ec3b0d 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -163,19 +163,12 @@ typedef struct SmokeDomainSettings {
 	float flame_smoke_color[3];
 	/* mantaflow settings */
 	int manta_solver_res;	/*dimension of manta solver, 2d or 3d*/
-	int manta_start_frame;
-	int manta_end_frame;
 	int manta_uvs_num;		/*number of UVs, important for octaves count*/
-		/*noise settings*/
-	float noise_clamp_neg;
-	float noise_clamp_pos;
-	float noise_val_scale;
-	float noise_val_offset;
+	/*noise settings*/
+	float noise_pos_scale;
 	float noise_time_anim;
-	int noise_clamp;
-	//int manta_sim_frame;/*current simulation frame number. If not simulating-> manta_sim_frame == -1*/
-	float mock_var;	/*not used*/
-//	float mock_var2;	/*not used*/
+	//float mock_var;	/*not used*/
+	//float mock_var2;	/*not used*/
 } SmokeDomainSettings;
 
 /* inflow / outflow */
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 2b2eee7..f7c83ca 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -630,92 +630,29 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "manta_filepath", PROP_STRING, PROP_FILEPATH);
 	RNA_def_property_string_sdna(prop, NULL, "_manta_filepath");
-	RNA_def_property_ui_text(prop, "Output Path",
-	                         "Directory/name to save Mantaflow scene for further simulations");
+	RNA_def_property_ui_text(prop, "Output Path", "Directory to save Mantaflow scene script");
 //	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_manta_write_settings");
 	
-	// Currently not used
-//	prop = RNA_def_property(srna, "use_manta_liquid", PROP_BOOLEAN, PROP_NONE);
-//	RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_MANTA_USE_LIQUID);
-//	RNA_def_property_ui_text(prop, "MantaFlow Liquid", "Use Mantaflow liquid");
-//	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
-	
-	// Currently not used
-//	prop = RNA_def_property(srna, "manta_solver_res", PROP_INT, PROP_NONE);
-//	RNA_def_property_int_sdna(prop, NULL, "manta_solver_res");
-//	RNA_def_property_range(prop, 2, 3);
-//	RNA_def_property_ui_range(prop, 2, 3, 1, -1);
-//	RNA_def_property_ui_text(prop, "Solver Res", "Solver resolution(2D/3D)");
-//	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_manta_switch2D");
-
-//	prop = RNA_def_property(srna, "manta_sim_frame", PROP_INT, PROP_NONE);
-//	RNA_def_property_int_sdna(prop, NULL, "manta_sim_frame");
-//	RNA_def_property_range(prop, -1, 250);
-//	RNA_def_property_ui_range(prop, -1, 250, 1, -1);
-//	RNA_def_property_ui_text(prop, "Current Simulation Frame", "-1, if not simulating");
-	
-	prop = RNA_def_property(srna, "manta_start_frame", PROP_INT, PROP_NONE);
-	RNA_def_property_int_sdna(prop, NULL, "manta_start_frame");
-	RNA_def_property_range(prop, 0, 249);
-	RNA_def_property_ui_range(prop, 0, 249, 1, -1);
-	RNA_def_property_ui_text(prop, "Sim Start", "Frame from which to start simulation");
-//	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
-	
-	prop = RNA_def_property(srna, "manta_end_frame", PROP_INT, PROP_NONE);
-	RNA_def_property_int_sdna(prop, NULL, "manta_end_frame");
-	RNA_def_property_range(prop, 1, 250);
-	RNA_def_property_ui_range(prop, 1, 250, 1, -1);
-	RNA_def_property_ui_text(prop, "Sim End", "Frame on which to end simulation");
-//	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
-	
 	prop = RNA_def_property(srna, "manta_uvs", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "manta_uvs_num");
 	RNA_def_property_range(prop, 0, 4);
 	RNA_def_property_ui_range(prop, 0, 4, 1, -1);
 	RNA_def_property_ui_text(prop, "UVs number", "Number of UV coordinate grids to use (Better not more than 2)");
-	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
-	
-	prop = RNA_def_property(srna, "noise_clamp", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_NOISE_CLAMP);
-	RNA_def_property_ui_text(prop, "Clamp Noise", "");
-	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
-	
-	prop = RNA_def_property(srna, "noise_clamp_neg", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "noise_clamp_neg");
-	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, "Clamp Negative Noise", "");
-	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rn

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list