Commit: 0d979ce13829a81c9857323104d4b175d93b6434
Author: Roman Pogribnyi
Date:   Sat Jun 7 16:16:30 2014 +0200
https://developer.blender.org/rB0d979ce13829a81c9857323104d4b175d93b6434

noise accounts for indentation

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

M       intern/smoke/intern/MANTA.h

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

diff --git a/intern/smoke/intern/MANTA.h b/intern/smoke/intern/MANTA.h
index bc7a345..6e6e443 100644
--- a/intern/smoke/intern/MANTA.h
+++ b/intern/smoke/intern/MANTA.h
@@ -81,20 +81,24 @@ extern "C" void read_mantaflow_sim(struct FLUID_3D *fluid, 
char *name)
 #      endif   /*zlib*/
 }
 
-static void manta_gen_noise(stringstream& ss, char *noise, bool clamp, int 
clampNeg, int clampPos, float valScale, float valOffset, float timeAnim)
+static void manta_gen_noise(stringstream& ss, int indent, char *noise, bool 
clamp, int clampNeg, int clampPos, float valScale, float valOffset, float 
timeAnim)
 {
        if (ss == NULL)/*should never be here*/
        {
                return;
        }
-       ss << noise << " = s.create(NoiseField) \n";
-       ss << noise << ".posScale = vec3(45) \n";
-       ss << noise << ".clamp = " << ((clamp)?"True":"False") << " \n";
-       ss << noise << ".clampNeg = " << clampNeg << " \n";
-       ss << noise << ".clampPos = " << clampPos << " \n";
-       ss << noise << ".valScale = " << valScale << " \n";
-       ss << noise << ".valOffset = " << valOffset << " \n";
-       ss << noise << ".timeAnim = " << timeAnim << " \n";
+       std::string indentation = ""; 
+       for (size_t cnt(0); cnt < indent; ++cnt) {
+               indentation += "  ";/*two-spaces indent*/
+       }
+       ss << indentation << noise << " = s.create(NoiseField) \n";
+       ss << indentation << noise << ".posScale = vec3(45) \n";
+       ss << indentation << noise << ".clamp = " << ((clamp)?"True":"False") 
<< " \n";
+       ss << indentation << noise << ".clampNeg = " << clampNeg << " \n";
+       ss << indentation << noise << ".clampPos = " << clampPos << " \n";
+       ss << indentation << noise << ".valScale = " << valScale << " \n";
+       ss << indentation << noise << ".valOffset = " << valOffset << " \n";
+       ss << indentation << noise << ".timeAnim = " << timeAnim << " \n";
 }
 
 static void manta_solve_pressure(stringstream& ss, char *flags, char *vel, 
char *pressure, bool useResNorms, int openBound, int solver_res)
@@ -167,7 +171,7 @@ static void generate_manta_sim_file(Scene *scene, 
SmokeModifierData *smd)
        ss << "pressure = s.create(RealGrid) \n";/*must always be present*/
 
 /*Noise Field*/
-       manta_gen_noise(ss, "noise", true, 0, 1, 1, 0.75, 0.2);
+       manta_gen_noise(ss, 0, "noise", true, 0, 1, 1, 0.75, 0.2);
        
 /*Flow setup*/
        ss << "flags.initDomain() \n";

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to