1 /* 2 Copyright (c) 2008-2009 NetAllied Systems GmbH 3 4 This file is part of MayaDataModel. 5 6 Licensed under the MIT Open Source License, 7 for details please see LICENSE file or the website 8 http://www.opensource.org/licenses/mit-license.php 9 */ 10 #ifndef __MayaDM_BRUSH_H__ 11 #define __MayaDM_BRUSH_H__ 12 #include "MayaDMTypes.h" 13 #include "MayaDMConnectables.h" 14 #include "MayaDMDependNode.h" 15 namespace MayaDM 16 { 17 class Brush : public DependNode 18 { 19 public: 20 struct LeafCurl{ 21 float leafCurl_Position; 22 float leafCurl_FloatValue; 23 unsigned int leafCurl_Interp; writeLeafCurl24 void write(FILE* file) const 25 { 26 fprintf(file,"%f ", leafCurl_Position); 27 fprintf(file,"%f ", leafCurl_FloatValue); 28 fprintf(file,"%i", leafCurl_Interp); 29 } 30 }; 31 struct PetalCurl{ 32 float petalCurl_Position; 33 float petalCurl_FloatValue; 34 unsigned int petalCurl_Interp; writePetalCurl35 void write(FILE* file) const 36 { 37 fprintf(file,"%f ", petalCurl_Position); 38 fprintf(file,"%f ", petalCurl_FloatValue); 39 fprintf(file,"%i", petalCurl_Interp); 40 } 41 }; 42 struct WidthScale{ 43 float widthScale_Position; 44 float widthScale_FloatValue; 45 unsigned int widthScale_Interp; writeWidthScale46 void write(FILE* file) const 47 { 48 fprintf(file,"%f ", widthScale_Position); 49 fprintf(file,"%f ", widthScale_FloatValue); 50 fprintf(file,"%i", widthScale_Interp); 51 } 52 }; 53 struct LeafWidthScale{ 54 float leafWidthScale_Position; 55 float leafWidthScale_FloatValue; 56 unsigned int leafWidthScale_Interp; writeLeafWidthScale57 void write(FILE* file) const 58 { 59 fprintf(file,"%f ", leafWidthScale_Position); 60 fprintf(file,"%f ", leafWidthScale_FloatValue); 61 fprintf(file,"%i", leafWidthScale_Interp); 62 } 63 }; 64 struct PetalWidthScale{ 65 float petalWidthScale_Position; 66 float petalWidthScale_FloatValue; 67 unsigned int petalWidthScale_Interp; writePetalWidthScale68 void write(FILE* file) const 69 { 70 fprintf(file,"%f ", petalWidthScale_Position); 71 fprintf(file,"%f ", petalWidthScale_FloatValue); 72 fprintf(file,"%i", petalWidthScale_Interp); 73 } 74 }; 75 struct TwigLengthScale{ 76 float twigLengthScale_Position; 77 float twigLengthScale_FloatValue; 78 unsigned int twigLengthScale_Interp; writeTwigLengthScale79 void write(FILE* file) const 80 { 81 fprintf(file,"%f ", twigLengthScale_Position); 82 fprintf(file,"%f ", twigLengthScale_FloatValue); 83 fprintf(file,"%i", twigLengthScale_Interp); 84 } 85 }; 86 struct Environment{ 87 float environment_Position; 88 float3 environment_Color; 89 unsigned int environment_Interp; writeEnvironment90 void write(FILE* file) const 91 { 92 fprintf(file,"%f ", environment_Position); 93 environment_Color.write(file); 94 fprintf(file, " "); 95 fprintf(file,"%i", environment_Interp); 96 } 97 }; 98 struct ReflectionRolloff{ 99 float reflectionRolloff_Position; 100 float reflectionRolloff_FloatValue; 101 unsigned int reflectionRolloff_Interp; writeReflectionRolloff102 void write(FILE* file) const 103 { 104 fprintf(file,"%f ", reflectionRolloff_Position); 105 fprintf(file,"%f ", reflectionRolloff_FloatValue); 106 fprintf(file,"%i", reflectionRolloff_Interp); 107 } 108 }; 109 public: 110 Brush()111 Brush():DependNode(){} 112 Brush(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true) 113 :DependNode(file, name, parent, "brush", shared, create){} ~Brush()114 virtual ~Brush(){} 115 setTime(double tim)116 void setTime(double tim) 117 { 118 if(tim == 0) return; 119 fprintf(mFile,"\tsetAttr \".tim\" %f;\n", tim); 120 } setGlobalScale(double gsc)121 void setGlobalScale(double gsc) 122 { 123 if(gsc == 1.0) return; 124 fprintf(mFile,"\tsetAttr \".gsc\" %f;\n", gsc); 125 } setDepth(bool dep)126 void setDepth(bool dep) 127 { 128 if(dep == false) return; 129 fprintf(mFile,"\tsetAttr \".dep\" %i;\n", dep); 130 } setModifyDepth(bool mdp)131 void setModifyDepth(bool mdp) 132 { 133 if(mdp == true) return; 134 fprintf(mFile,"\tsetAttr \".mdp\" %i;\n", mdp); 135 } setModifyColor(bool mdc)136 void setModifyColor(bool mdc) 137 { 138 if(mdc == true) return; 139 fprintf(mFile,"\tsetAttr \".mdc\" %i;\n", mdc); 140 } setModifyAlpha(bool mda)141 void setModifyAlpha(bool mda) 142 { 143 if(mda == true) return; 144 fprintf(mFile,"\tsetAttr \".mda\" %i;\n", mda); 145 } setIlluminated(bool ill)146 void setIlluminated(bool ill) 147 { 148 if(ill == false) return; 149 fprintf(mFile,"\tsetAttr \".ill\" %i;\n", ill); 150 } setCastShadows(bool csd)151 void setCastShadows(bool csd) 152 { 153 if(csd == false) return; 154 fprintf(mFile,"\tsetAttr \".csd\" %i;\n", csd); 155 } setLightingBasedWidth(double lbw)156 void setLightingBasedWidth(double lbw) 157 { 158 if(lbw == 0.0) return; 159 fprintf(mFile,"\tsetAttr \".lbw\" %f;\n", lbw); 160 } setBranches(bool brc)161 void setBranches(bool brc) 162 { 163 if(brc == false) return; 164 fprintf(mFile,"\tsetAttr \".brc\" %i;\n", brc); 165 } setTwigs(bool twg)166 void setTwigs(bool twg) 167 { 168 if(twg == false) return; 169 fprintf(mFile,"\tsetAttr \".twg\" %i;\n", twg); 170 } setBuds(bool bud)171 void setBuds(bool bud) 172 { 173 if(bud == false) return; 174 fprintf(mFile,"\tsetAttr \".bud\" %i;\n", bud); 175 } setLeaves(bool lvs)176 void setLeaves(bool lvs) 177 { 178 if(lvs == false) return; 179 fprintf(mFile,"\tsetAttr \".lvs\" %i;\n", lvs); 180 } setFlowers(bool flw)181 void setFlowers(bool flw) 182 { 183 if(flw == false) return; 184 fprintf(mFile,"\tsetAttr \".flw\" %i;\n", flw); 185 } setBrushType(unsigned int brt)186 void setBrushType(unsigned int brt) 187 { 188 if(brt == 0) return; 189 fprintf(mFile,"\tsetAttr \".brt\" %i;\n", brt); 190 } setBrushWidth(double bwd)191 void setBrushWidth(double bwd) 192 { 193 if(bwd == 0.05) return; 194 fprintf(mFile,"\tsetAttr \".bwd\" %f;\n", bwd); 195 } setScreenspaceWidth(bool spw)196 void setScreenspaceWidth(bool spw) 197 { 198 if(spw == false) return; 199 fprintf(mFile,"\tsetAttr \".spw\" %i;\n", spw); 200 } setDistanceScaling(double dsl)201 void setDistanceScaling(double dsl) 202 { 203 if(dsl == 0.0) return; 204 fprintf(mFile,"\tsetAttr \".dsl\" %f;\n", dsl); 205 } setMinPixelWidth(double mpw)206 void setMinPixelWidth(double mpw) 207 { 208 if(mpw == 0.0) return; 209 fprintf(mFile,"\tsetAttr \".mpw\" %f;\n", mpw); 210 } setMaxPixelWidth(double mxp)211 void setMaxPixelWidth(double mxp) 212 { 213 if(mxp == 1000.0) return; 214 fprintf(mFile,"\tsetAttr \".mxp\" %f;\n", mxp); 215 } setStampDensity(double sdn)216 void setStampDensity(double sdn) 217 { 218 if(sdn == 8.0) return; 219 fprintf(mFile,"\tsetAttr \".sdn\" %f;\n", sdn); 220 } setSoftness(double sft)221 void setSoftness(double sft) 222 { 223 if(sft == 0.2) return; 224 fprintf(mFile,"\tsetAttr \".sft\" %f;\n", sft); 225 } setEdgeAntialias(bool eaa)226 void setEdgeAntialias(bool eaa) 227 { 228 if(eaa == true) return; 229 fprintf(mFile,"\tsetAttr \".eaa\" %i;\n", eaa); 230 } setEdgeClip(bool ecl)231 void setEdgeClip(bool ecl) 232 { 233 if(ecl == false) return; 234 fprintf(mFile,"\tsetAttr \".ecl\" %i;\n", ecl); 235 } setEdgeClipDepth(double ecd)236 void setEdgeClipDepth(double ecd) 237 { 238 if(ecd == 0.1) return; 239 fprintf(mFile,"\tsetAttr \".ecd\" %f;\n", ecd); 240 } setOcclusionWidthScale(bool ows)241 void setOcclusionWidthScale(bool ows) 242 { 243 if(ows == false) return; 244 fprintf(mFile,"\tsetAttr \".ows\" %i;\n", ows); 245 } setBlurIntensity(int bin)246 void setBlurIntensity(int bin) 247 { 248 if(bin == 4) return; 249 fprintf(mFile,"\tsetAttr \".bin\" %i;\n", bin); 250 } setColor1(const float3 & cl1)251 void setColor1(const float3& cl1) 252 { 253 fprintf(mFile,"\tsetAttr \".cl1\" -type \"float3\" "); 254 cl1.write(mFile); 255 fprintf(mFile,";\n"); 256 } setColor1R(float c1r)257 void setColor1R(float c1r) 258 { 259 if(c1r == 0.0) return; 260 fprintf(mFile,"\tsetAttr \".cl1.c1r\" %f;\n", c1r); 261 } setColor1G(float c1g)262 void setColor1G(float c1g) 263 { 264 if(c1g == 0.0) return; 265 fprintf(mFile,"\tsetAttr \".cl1.c1g\" %f;\n", c1g); 266 } setColor1B(float c1b)267 void setColor1B(float c1b) 268 { 269 if(c1b == 0.0) return; 270 fprintf(mFile,"\tsetAttr \".cl1.c1b\" %f;\n", c1b); 271 } setColor2(const float3 & cl2)272 void setColor2(const float3& cl2) 273 { 274 fprintf(mFile,"\tsetAttr \".cl2\" -type \"float3\" "); 275 cl2.write(mFile); 276 fprintf(mFile,";\n"); 277 } setColor2R(float c2r)278 void setColor2R(float c2r) 279 { 280 if(c2r == 1.0) return; 281 fprintf(mFile,"\tsetAttr \".cl2.c2r\" %f;\n", c2r); 282 } setColor2G(float c2g)283 void setColor2G(float c2g) 284 { 285 if(c2g == 1.0) return; 286 fprintf(mFile,"\tsetAttr \".cl2.c2g\" %f;\n", c2g); 287 } setColor2B(float c2b)288 void setColor2B(float c2b) 289 { 290 if(c2b == 1.0) return; 291 fprintf(mFile,"\tsetAttr \".cl2.c2b\" %f;\n", c2b); 292 } setTransparency1(const float3 & tn1)293 void setTransparency1(const float3& tn1) 294 { 295 fprintf(mFile,"\tsetAttr \".tn1\" -type \"float3\" "); 296 tn1.write(mFile); 297 fprintf(mFile,";\n"); 298 } setTransparency1R(float t1r)299 void setTransparency1R(float t1r) 300 { 301 if(t1r == 0.0) return; 302 fprintf(mFile,"\tsetAttr \".tn1.t1r\" %f;\n", t1r); 303 } setTransparency1G(float t1g)304 void setTransparency1G(float t1g) 305 { 306 if(t1g == 0.0) return; 307 fprintf(mFile,"\tsetAttr \".tn1.t1g\" %f;\n", t1g); 308 } setTransparency1B(float t1b)309 void setTransparency1B(float t1b) 310 { 311 if(t1b == 0.0) return; 312 fprintf(mFile,"\tsetAttr \".tn1.t1b\" %f;\n", t1b); 313 } setTransparency2(const float3 & tn2)314 void setTransparency2(const float3& tn2) 315 { 316 fprintf(mFile,"\tsetAttr \".tn2\" -type \"float3\" "); 317 tn2.write(mFile); 318 fprintf(mFile,";\n"); 319 } setTransparency2R(float t2r)320 void setTransparency2R(float t2r) 321 { 322 if(t2r == 0.0) return; 323 fprintf(mFile,"\tsetAttr \".tn2.t2r\" %f;\n", t2r); 324 } setTransparency2G(float t2g)325 void setTransparency2G(float t2g) 326 { 327 if(t2g == 0.0) return; 328 fprintf(mFile,"\tsetAttr \".tn2.t2g\" %f;\n", t2g); 329 } setTransparency2B(float t2b)330 void setTransparency2B(float t2b) 331 { 332 if(t2b == 0.0) return; 333 fprintf(mFile,"\tsetAttr \".tn2.t2b\" %f;\n", t2b); 334 } setIncandescence1(const float3 & in1)335 void setIncandescence1(const float3& in1) 336 { 337 fprintf(mFile,"\tsetAttr \".in1\" -type \"float3\" "); 338 in1.write(mFile); 339 fprintf(mFile,";\n"); 340 } setIncandescence1R(float i1r)341 void setIncandescence1R(float i1r) 342 { 343 if(i1r == 0.0) return; 344 fprintf(mFile,"\tsetAttr \".in1.i1r\" %f;\n", i1r); 345 } setIncandescence1G(float i1g)346 void setIncandescence1G(float i1g) 347 { 348 if(i1g == 0.0) return; 349 fprintf(mFile,"\tsetAttr \".in1.i1g\" %f;\n", i1g); 350 } setIncandescence1B(float i1b)351 void setIncandescence1B(float i1b) 352 { 353 if(i1b == 0.0) return; 354 fprintf(mFile,"\tsetAttr \".in1.i1b\" %f;\n", i1b); 355 } setIncandescence2(const float3 & in2)356 void setIncandescence2(const float3& in2) 357 { 358 fprintf(mFile,"\tsetAttr \".in2\" -type \"float3\" "); 359 in2.write(mFile); 360 fprintf(mFile,";\n"); 361 } setIncandescence2R(float i2r)362 void setIncandescence2R(float i2r) 363 { 364 if(i2r == 0.0) return; 365 fprintf(mFile,"\tsetAttr \".in2.i2r\" %f;\n", i2r); 366 } setIncandescence2G(float i2g)367 void setIncandescence2G(float i2g) 368 { 369 if(i2g == 0.0) return; 370 fprintf(mFile,"\tsetAttr \".in2.i2g\" %f;\n", i2g); 371 } setIncandescence2B(float i2b)372 void setIncandescence2B(float i2b) 373 { 374 if(i2b == 0.0) return; 375 fprintf(mFile,"\tsetAttr \".in2.i2b\" %f;\n", i2b); 376 } setSpecularColor(const float3 & spc)377 void setSpecularColor(const float3& spc) 378 { 379 fprintf(mFile,"\tsetAttr \".spc\" -type \"float3\" "); 380 spc.write(mFile); 381 fprintf(mFile,";\n"); 382 } setSpecularColorR(float spr)383 void setSpecularColorR(float spr) 384 { 385 if(spr == 1.0) return; 386 fprintf(mFile,"\tsetAttr \".spc.spr\" %f;\n", spr); 387 } setSpecularColorG(float spg)388 void setSpecularColorG(float spg) 389 { 390 if(spg == 1.0) return; 391 fprintf(mFile,"\tsetAttr \".spc.spg\" %f;\n", spg); 392 } setSpecularColorB(float spb)393 void setSpecularColorB(float spb) 394 { 395 if(spb == 1.0) return; 396 fprintf(mFile,"\tsetAttr \".spc.spb\" %f;\n", spb); 397 } setSpecular(double spe)398 void setSpecular(double spe) 399 { 400 if(spe == 0.0) return; 401 fprintf(mFile,"\tsetAttr \".spe\" %f;\n", spe); 402 } setSpecularPower(double spp)403 void setSpecularPower(double spp) 404 { 405 if(spp == 10.0) return; 406 fprintf(mFile,"\tsetAttr \".spp\" %f;\n", spp); 407 } setTranslucence(double trn)408 void setTranslucence(double trn) 409 { 410 if(trn == 0.2) return; 411 fprintf(mFile,"\tsetAttr \".trn\" %f;\n", trn); 412 } setGlow(double glw)413 void setGlow(double glw) 414 { 415 if(glw == 0.0) return; 416 fprintf(mFile,"\tsetAttr \".glw\" %f;\n", glw); 417 } setGlowColor(const float3 & glc)418 void setGlowColor(const float3& glc) 419 { 420 fprintf(mFile,"\tsetAttr \".glc\" -type \"float3\" "); 421 glc.write(mFile); 422 fprintf(mFile,";\n"); 423 } setGlowColorR(float glr)424 void setGlowColorR(float glr) 425 { 426 if(glr == 0.5) return; 427 fprintf(mFile,"\tsetAttr \".glc.glr\" %f;\n", glr); 428 } setGlowColorG(float glg)429 void setGlowColorG(float glg) 430 { 431 if(glg == 0.5) return; 432 fprintf(mFile,"\tsetAttr \".glc.glg\" %f;\n", glg); 433 } setGlowColorB(float glb)434 void setGlowColorB(float glb) 435 { 436 if(glb == 0.5) return; 437 fprintf(mFile,"\tsetAttr \".glc.glb\" %f;\n", glb); 438 } setGlowSpread(double gls)439 void setGlowSpread(double gls) 440 { 441 if(gls == 3.0) return; 442 fprintf(mFile,"\tsetAttr \".gls\" %f;\n", gls); 443 } setShaderGlow(double sgl)444 void setShaderGlow(double sgl) 445 { 446 if(sgl == 0.0) return; 447 fprintf(mFile,"\tsetAttr \".sgl\" %f;\n", sgl); 448 } setHueRand(double chr)449 void setHueRand(double chr) 450 { 451 if(chr == 0.0) return; 452 fprintf(mFile,"\tsetAttr \".chr\" %f;\n", chr); 453 } setSatRand(double csr)454 void setSatRand(double csr) 455 { 456 if(csr == 0.0) return; 457 fprintf(mFile,"\tsetAttr \".csr\" %f;\n", csr); 458 } setValRand(double cvr)459 void setValRand(double cvr) 460 { 461 if(cvr == 0.0) return; 462 fprintf(mFile,"\tsetAttr \".cvr\" %f;\n", cvr); 463 } setRootFade(double rfd)464 void setRootFade(double rfd) 465 { 466 if(rfd == 0.0) return; 467 fprintf(mFile,"\tsetAttr \".rfd\" %f;\n", rfd); 468 } setTipFade(double tfd)469 void setTipFade(double tfd) 470 { 471 if(tfd == 0.0) return; 472 fprintf(mFile,"\tsetAttr \".tfd\" %f;\n", tfd); 473 } setFakeShadow(unsigned int fks)474 void setFakeShadow(unsigned int fks) 475 { 476 if(fks == 0) return; 477 fprintf(mFile,"\tsetAttr \".fks\" %i;\n", fks); 478 } setShadowOffset(double sof)479 void setShadowOffset(double sof) 480 { 481 if(sof == 0.5) return; 482 fprintf(mFile,"\tsetAttr \".sof\" %f;\n", sof); 483 } setShadowDiffusion(double sdf)484 void setShadowDiffusion(double sdf) 485 { 486 if(sdf == 0.1) return; 487 fprintf(mFile,"\tsetAttr \".sdf\" %f;\n", sdf); 488 } setShadowTransparency(double stn)489 void setShadowTransparency(double stn) 490 { 491 if(stn == 0.8) return; 492 fprintf(mFile,"\tsetAttr \".stn\" %f;\n", stn); 493 } setBackShadow(double bks)494 void setBackShadow(double bks) 495 { 496 if(bks == 0.0) return; 497 fprintf(mFile,"\tsetAttr \".bks\" %f;\n", bks); 498 } setBrightnessRand(double brn)499 void setBrightnessRand(double brn) 500 { 501 if(brn == 0.0) return; 502 fprintf(mFile,"\tsetAttr \".brn\" %f;\n", brn); 503 } setCenterShadow(double cns)504 void setCenterShadow(double cns) 505 { 506 if(cns == 0.0) return; 507 fprintf(mFile,"\tsetAttr \".cns\" %f;\n", cns); 508 } setDepthShadowType(unsigned int dpt)509 void setDepthShadowType(unsigned int dpt) 510 { 511 if(dpt == 0) return; 512 fprintf(mFile,"\tsetAttr \".dpt\" %i;\n", dpt); 513 } setDepthShadow(double dpl)514 void setDepthShadow(double dpl) 515 { 516 if(dpl == 0.0) return; 517 fprintf(mFile,"\tsetAttr \".dpl\" %f;\n", dpl); 518 } setDepthShadowDepth(double dps)519 void setDepthShadowDepth(double dps) 520 { 521 if(dps == 0.0) return; 522 fprintf(mFile,"\tsetAttr \".dps\" %f;\n", dps); 523 } setRealLights(bool rll)524 void setRealLights(bool rll) 525 { 526 if(rll == false) return; 527 fprintf(mFile,"\tsetAttr \".rll\" %i;\n", rll); 528 } setLightDirection(const double3 & ldr)529 void setLightDirection(const double3& ldr) 530 { 531 fprintf(mFile,"\tsetAttr \".ldr\" -type \"double3\" "); 532 ldr.write(mFile); 533 fprintf(mFile,";\n"); 534 } setLightDirectionX(double ldx)535 void setLightDirectionX(double ldx) 536 { 537 if(ldx == 0.5) return; 538 fprintf(mFile,"\tsetAttr \".ldr.ldx\" %f;\n", ldx); 539 } setLightDirectionY(double ldy)540 void setLightDirectionY(double ldy) 541 { 542 if(ldy == 0.5) return; 543 fprintf(mFile,"\tsetAttr \".ldr.ldy\" %f;\n", ldy); 544 } setLightDirectionZ(double ldz)545 void setLightDirectionZ(double ldz) 546 { 547 if(ldz == -0.5) return; 548 fprintf(mFile,"\tsetAttr \".ldr.ldz\" %f;\n", ldz); 549 } setGapSize(double gsz)550 void setGapSize(double gsz) 551 { 552 if(gsz == 0.0) return; 553 fprintf(mFile,"\tsetAttr \".gsz\" %f;\n", gsz); 554 } setGapSpacing(double gsp)555 void setGapSpacing(double gsp) 556 { 557 if(gsp == 1.0) return; 558 fprintf(mFile,"\tsetAttr \".gsp\" %f;\n", gsp); 559 } setGapRand(double grn)560 void setGapRand(double grn) 561 { 562 if(grn == 0.0) return; 563 fprintf(mFile,"\tsetAttr \".grn\" %f;\n", grn); 564 } setFlowSpeed(double fws)565 void setFlowSpeed(double fws) 566 { 567 if(fws == 0.0) return; 568 fprintf(mFile,"\tsetAttr \".fws\" %f;\n", fws); 569 } setTextureFlow(bool tfl)570 void setTextureFlow(bool tfl) 571 { 572 if(tfl == true) return; 573 fprintf(mFile,"\tsetAttr \".tfl\" %i;\n", tfl); 574 } setTimeClip(bool tcl)575 void setTimeClip(bool tcl) 576 { 577 if(tcl == false) return; 578 fprintf(mFile,"\tsetAttr \".tcl\" %i;\n", tcl); 579 } setStrokeTime(bool srm)580 void setStrokeTime(bool srm) 581 { 582 if(srm == false) return; 583 fprintf(mFile,"\tsetAttr \".srm\" %i;\n", srm); 584 } setStartTime(double sti)585 void setStartTime(double sti) 586 { 587 if(sti == 0.0) return; 588 fprintf(mFile,"\tsetAttr \".sti\" %f;\n", sti); 589 } setEndTime(double eti)590 void setEndTime(double eti) 591 { 592 if(eti == 1000.0) return; 593 fprintf(mFile,"\tsetAttr \".eti\" %f;\n", eti); 594 } setTubes(bool tub)595 void setTubes(bool tub) 596 { 597 if(tub == false) return; 598 fprintf(mFile,"\tsetAttr \".tub\" %i;\n", tub); 599 } setCreationScript(const string & csc)600 void setCreationScript(const string& csc) 601 { 602 if(csc == "NULL") return; 603 fprintf(mFile,"\tsetAttr \".csc\" -type \"string\" "); 604 csc.write(mFile); 605 fprintf(mFile,";\n"); 606 } setRuntimeScript(const string & rsc)607 void setRuntimeScript(const string& rsc) 608 { 609 if(rsc == "NULL") return; 610 fprintf(mFile,"\tsetAttr \".rsc\" -type \"string\" "); 611 rsc.write(mFile); 612 fprintf(mFile,";\n"); 613 } setTubeCompletion(bool tcm)614 void setTubeCompletion(bool tcm) 615 { 616 if(tcm == true) return; 617 fprintf(mFile,"\tsetAttr \".tcm\" %i;\n", tcm); 618 } setTubesPerStep(double tps)619 void setTubesPerStep(double tps) 620 { 621 if(tps == 0.5) return; 622 fprintf(mFile,"\tsetAttr \".tps\" %f;\n", tps); 623 } setTubeRand(double trd)624 void setTubeRand(double trd) 625 { 626 if(trd == 1.0) return; 627 fprintf(mFile,"\tsetAttr \".trd\" %f;\n", trd); 628 } setStartTubes(int stb)629 void setStartTubes(int stb) 630 { 631 if(stb == 0) return; 632 fprintf(mFile,"\tsetAttr \".stb\" %i;\n", stb); 633 } setLengthMax(double lnx)634 void setLengthMax(double lnx) 635 { 636 if(lnx == 1.0) return; 637 fprintf(mFile,"\tsetAttr \".lnx\" %f;\n", lnx); 638 } setLengthMin(double lnn)639 void setLengthMin(double lnn) 640 { 641 if(lnn == 0.0) return; 642 fprintf(mFile,"\tsetAttr \".lnn\" %f;\n", lnn); 643 } setSegments(int sgm)644 void setSegments(int sgm) 645 { 646 if(sgm == 10) return; 647 fprintf(mFile,"\tsetAttr \".sgm\" %i;\n", sgm); 648 } setTubeWidth1(double tw1)649 void setTubeWidth1(double tw1) 650 { 651 if(tw1 == 0.01) return; 652 fprintf(mFile,"\tsetAttr \".tw1\" %f;\n", tw1); 653 } setTubeWidth2(double tw2)654 void setTubeWidth2(double tw2) 655 { 656 if(tw2 == 0.01) return; 657 fprintf(mFile,"\tsetAttr \".tw2\" %f;\n", tw2); 658 } setWidthRand(double wdr)659 void setWidthRand(double wdr) 660 { 661 if(wdr == 0.0) return; 662 fprintf(mFile,"\tsetAttr \".wdr\" %f;\n", wdr); 663 } setWidthBias(double wdb)664 void setWidthBias(double wdb) 665 { 666 if(wdb == 0.0) return; 667 fprintf(mFile,"\tsetAttr \".wdb\" %f;\n", wdb); 668 } setLengthFlex(double lfx)669 void setLengthFlex(double lfx) 670 { 671 if(lfx == 0.0) return; 672 fprintf(mFile,"\tsetAttr \".lfx\" %f;\n", lfx); 673 } setSegmentLengthBias(double sgb)674 void setSegmentLengthBias(double sgb) 675 { 676 if(sgb == 0.0) return; 677 fprintf(mFile,"\tsetAttr \".sgb\" %f;\n", sgb); 678 } setSegmentWidthBias(double swb)679 void setSegmentWidthBias(double swb) 680 { 681 if(swb == 0.0) return; 682 fprintf(mFile,"\tsetAttr \".swb\" %f;\n", swb); 683 } setTubeDirection(unsigned int tdr)684 void setTubeDirection(unsigned int tdr) 685 { 686 if(tdr == 0) return; 687 fprintf(mFile,"\tsetAttr \".tdr\" %i;\n", tdr); 688 } setElevationMin(double elm)689 void setElevationMin(double elm) 690 { 691 if(elm == 0.2) return; 692 fprintf(mFile,"\tsetAttr \".elm\" %f;\n", elm); 693 } setElevationMax(double elx)694 void setElevationMax(double elx) 695 { 696 if(elx == 0.5) return; 697 fprintf(mFile,"\tsetAttr \".elx\" %f;\n", elx); 698 } setAzimuthMin(double azn)699 void setAzimuthMin(double azn) 700 { 701 if(azn == -0.1) return; 702 fprintf(mFile,"\tsetAttr \".azn\" %f;\n", azn); 703 } setAzimuthMax(double azx)704 void setAzimuthMax(double azx) 705 { 706 if(azx == 0.1) return; 707 fprintf(mFile,"\tsetAttr \".azx\" %f;\n", azx); 708 } setFlatness1(double fl1)709 void setFlatness1(double fl1) 710 { 711 if(fl1 == 0.0) return; 712 fprintf(mFile,"\tsetAttr \".fl1\" %f;\n", fl1); 713 } setFlatness2(double fl2)714 void setFlatness2(double fl2) 715 { 716 if(fl2 == 0.0) return; 717 fprintf(mFile,"\tsetAttr \".fl2\" %f;\n", fl2); 718 } setTwist(double twi)719 void setTwist(double twi) 720 { 721 if(twi == 0.0) return; 722 fprintf(mFile,"\tsetAttr \".twi\" %f;\n", twi); 723 } setTwistRate(double twr)724 void setTwistRate(double twr) 725 { 726 if(twr == 0.0) return; 727 fprintf(mFile,"\tsetAttr \".twr\" %f;\n", twr); 728 } setTwistRand(double twd)729 void setTwistRand(double twd) 730 { 731 if(twd == 1.0) return; 732 fprintf(mFile,"\tsetAttr \".twd\" %f;\n", twd); 733 } setSpiralMin(double spm)734 void setSpiralMin(double spm) 735 { 736 if(spm == 0.0) return; 737 fprintf(mFile,"\tsetAttr \".spm\" %f;\n", spm); 738 } setSpiralMax(double spx)739 void setSpiralMax(double spx) 740 { 741 if(spx == 0.0) return; 742 fprintf(mFile,"\tsetAttr \".spx\" %f;\n", spx); 743 } setSpiralDecay(double spd)744 void setSpiralDecay(double spd) 745 { 746 if(spd == 0.0) return; 747 fprintf(mFile,"\tsetAttr \".spd\" %f;\n", spd); 748 } setBend(double ben)749 void setBend(double ben) 750 { 751 if(ben == 0.0) return; 752 fprintf(mFile,"\tsetAttr \".ben\" %f;\n", ben); 753 } setBendBias(double bnb)754 void setBendBias(double bnb) 755 { 756 if(bnb == 0.0) return; 757 fprintf(mFile,"\tsetAttr \".bnb\" %f;\n", bnb); 758 } setDisplacementDelay(double ddl)759 void setDisplacementDelay(double ddl) 760 { 761 if(ddl == 0.2) return; 762 fprintf(mFile,"\tsetAttr \".ddl\" %f;\n", ddl); 763 } setWiggle(double wgl)764 void setWiggle(double wgl) 765 { 766 if(wgl == 0.0) return; 767 fprintf(mFile,"\tsetAttr \".wgl\" %f;\n", wgl); 768 } setWiggleFrequency(double wgf)769 void setWiggleFrequency(double wgf) 770 { 771 if(wgf == 3) return; 772 fprintf(mFile,"\tsetAttr \".wgf\" %f;\n", wgf); 773 } setWiggleOffset(double wgo)774 void setWiggleOffset(double wgo) 775 { 776 if(wgo == 0.0) return; 777 fprintf(mFile,"\tsetAttr \".wgo\" %f;\n", wgo); 778 } setCurl(double crl)779 void setCurl(double crl) 780 { 781 if(crl == 0.0) return; 782 fprintf(mFile,"\tsetAttr \".crl\" %f;\n", crl); 783 } setCurlFrequency(double crf)784 void setCurlFrequency(double crf) 785 { 786 if(crf == 1) return; 787 fprintf(mFile,"\tsetAttr \".crf\" %f;\n", crf); 788 } setCurlOffset(double cro)789 void setCurlOffset(double cro) 790 { 791 if(cro == 0.0) return; 792 fprintf(mFile,"\tsetAttr \".cro\" %f;\n", cro); 793 } setNoise(double noi)794 void setNoise(double noi) 795 { 796 if(noi == 0.0) return; 797 fprintf(mFile,"\tsetAttr \".noi\" %f;\n", noi); 798 } setNoiseFrequency(double nof)799 void setNoiseFrequency(double nof) 800 { 801 if(nof == 0.2) return; 802 fprintf(mFile,"\tsetAttr \".nof\" %f;\n", nof); 803 } setNoiseOffset(double noo)804 void setNoiseOffset(double noo) 805 { 806 if(noo == 0.0) return; 807 fprintf(mFile,"\tsetAttr \".noo\" %f;\n", noo); 808 } setSplitMaxDepth(double smd)809 void setSplitMaxDepth(double smd) 810 { 811 if(smd == 2.0) return; 812 fprintf(mFile,"\tsetAttr \".smd\" %f;\n", smd); 813 } setSplitRand(double srd)814 void setSplitRand(double srd) 815 { 816 if(srd == 0.0) return; 817 fprintf(mFile,"\tsetAttr \".srd\" %f;\n", srd); 818 } setSplitAngle(double spa)819 void setSplitAngle(double spa) 820 { 821 if(spa == 30.0) return; 822 fprintf(mFile,"\tsetAttr \".spa\" %f;\n", spa); 823 } setSplitSizeDecay(double ssd)824 void setSplitSizeDecay(double ssd) 825 { 826 if(ssd == 0.7) return; 827 fprintf(mFile,"\tsetAttr \".ssd\" %f;\n", ssd); 828 } setSplitBias(double slb)829 void setSplitBias(double slb) 830 { 831 if(slb == 0.0) return; 832 fprintf(mFile,"\tsetAttr \".slb\" %f;\n", slb); 833 } setSplitTwist(double slt)834 void setSplitTwist(double slt) 835 { 836 if(slt == 0.5) return; 837 fprintf(mFile,"\tsetAttr \".slt\" %f;\n", slt); 838 } setStartBranches(double sbr)839 void setStartBranches(double sbr) 840 { 841 if(sbr == 0) return; 842 fprintf(mFile,"\tsetAttr \".sbr\" %f;\n", sbr); 843 } setNumBranches(int nbr)844 void setNumBranches(int nbr) 845 { 846 if(nbr == 2) return; 847 fprintf(mFile,"\tsetAttr \".nbr\" %i;\n", nbr); 848 } setBranchDropout(double bdr)849 void setBranchDropout(double bdr) 850 { 851 if(bdr == 0.0) return; 852 fprintf(mFile,"\tsetAttr \".bdr\" %f;\n", bdr); 853 } setMiddleBranch(bool mbr)854 void setMiddleBranch(bool mbr) 855 { 856 if(mbr == false) return; 857 fprintf(mFile,"\tsetAttr \".mbr\" %i;\n", mbr); 858 } setMinSize(double mms)859 void setMinSize(double mms) 860 { 861 if(mms == 0.0001) return; 862 fprintf(mFile,"\tsetAttr \".mms\" %f;\n", mms); 863 } setPathFollow(double pfl)864 void setPathFollow(double pfl) 865 { 866 if(pfl == 0.0) return; 867 fprintf(mFile,"\tsetAttr \".pfl\" %f;\n", pfl); 868 } setPathAttract(double pat)869 void setPathAttract(double pat) 870 { 871 if(pat == 0.0) return; 872 fprintf(mFile,"\tsetAttr \".pat\" %f;\n", pat); 873 } setCurveFollow(double cfw)874 void setCurveFollow(double cfw) 875 { 876 if(cfw == 0.0) return; 877 fprintf(mFile,"\tsetAttr \".cfw\" %f;\n", cfw); 878 } setCurveAttract(double cva)879 void setCurveAttract(double cva) 880 { 881 if(cva == 0.0) return; 882 fprintf(mFile,"\tsetAttr \".cva\" %f;\n", cva); 883 } setCurveMaxDist(double cmd)884 void setCurveMaxDist(double cmd) 885 { 886 if(cmd == 0.0) return; 887 fprintf(mFile,"\tsetAttr \".cmd\" %f;\n", cmd); 888 } setUniformForce(const double3 & ufr)889 void setUniformForce(const double3& ufr) 890 { 891 fprintf(mFile,"\tsetAttr \".ufr\" -type \"double3\" "); 892 ufr.write(mFile); 893 fprintf(mFile,";\n"); 894 } setUniformForceX(double ufx)895 void setUniformForceX(double ufx) 896 { 897 if(ufx == 0.0) return; 898 fprintf(mFile,"\tsetAttr \".ufr.ufx\" %f;\n", ufx); 899 } setUniformForceY(double ufy)900 void setUniformForceY(double ufy) 901 { 902 if(ufy == 0.0) return; 903 fprintf(mFile,"\tsetAttr \".ufr.ufy\" %f;\n", ufy); 904 } setUniformForceZ(double ufz)905 void setUniformForceZ(double ufz) 906 { 907 if(ufz == 0.0) return; 908 fprintf(mFile,"\tsetAttr \".ufr.ufz\" %f;\n", ufz); 909 } setTurbulenceType(unsigned int trt)910 void setTurbulenceType(unsigned int trt) 911 { 912 if(trt == 0) return; 913 fprintf(mFile,"\tsetAttr \".trt\" %i;\n", trt); 914 } setTurbulenceInterpolation(unsigned int tin)915 void setTurbulenceInterpolation(unsigned int tin) 916 { 917 if(tin == 0) return; 918 fprintf(mFile,"\tsetAttr \".tin\" %i;\n", tin); 919 } setTurbulence(double tur)920 void setTurbulence(double tur) 921 { 922 if(tur == 0.2) return; 923 fprintf(mFile,"\tsetAttr \".tur\" %f;\n", tur); 924 } setTurbulenceFrequency(double trf)925 void setTurbulenceFrequency(double trf) 926 { 927 if(trf == 0.2) return; 928 fprintf(mFile,"\tsetAttr \".trf\" %f;\n", trf); 929 } setTurbulenceSpeed(double trs)930 void setTurbulenceSpeed(double trs) 931 { 932 if(trs == 0.5) return; 933 fprintf(mFile,"\tsetAttr \".trs\" %f;\n", trs); 934 } setTurbulenceOffset(const double3 & tro)935 void setTurbulenceOffset(const double3& tro) 936 { 937 fprintf(mFile,"\tsetAttr \".tro\" -type \"double3\" "); 938 tro.write(mFile); 939 fprintf(mFile,";\n"); 940 } setTurbulenceOffsetX(double trx)941 void setTurbulenceOffsetX(double trx) 942 { 943 if(trx == 0.0) return; 944 fprintf(mFile,"\tsetAttr \".tro.trx\" %f;\n", trx); 945 } setTurbulenceOffsetY(double try_)946 void setTurbulenceOffsetY(double try_) 947 { 948 if(try_ == 0.0) return; 949 fprintf(mFile,"\tsetAttr \".tro.try\" %f;\n", try_); 950 } setTurbulenceOffsetZ(double trz)951 void setTurbulenceOffsetZ(double trz) 952 { 953 if(trz == 0.0) return; 954 fprintf(mFile,"\tsetAttr \".tro.trz\" %f;\n", trz); 955 } setRandom(double ran)956 void setRandom(double ran) 957 { 958 if(ran == 0.0) return; 959 fprintf(mFile,"\tsetAttr \".ran\" %f;\n", ran); 960 } setGravity(double grv)961 void setGravity(double grv) 962 { 963 if(grv == 0.0) return; 964 fprintf(mFile,"\tsetAttr \".grv\" %f;\n", grv); 965 } setMomentum(double mmt)966 void setMomentum(double mmt) 967 { 968 if(mmt == 1.0) return; 969 fprintf(mFile,"\tsetAttr \".mmt\" %f;\n", mmt); 970 } setDeflection(bool def)971 void setDeflection(bool def) 972 { 973 if(def == false) return; 974 fprintf(mFile,"\tsetAttr \".def\" %i;\n", def); 975 } setDeflectionMin(double dfm)976 void setDeflectionMin(double dfm) 977 { 978 if(dfm == 0.0) return; 979 fprintf(mFile,"\tsetAttr \".dfm\" %f;\n", dfm); 980 } setDeflectionMax(double dfx)981 void setDeflectionMax(double dfx) 982 { 983 if(dfx == 0.3) return; 984 fprintf(mFile,"\tsetAttr \".dfx\" %f;\n", dfx); 985 } setTwigsInCluster(int tic)986 void setTwigsInCluster(int tic) 987 { 988 if(tic == 1) return; 989 fprintf(mFile,"\tsetAttr \".tic\" %i;\n", tic); 990 } setTwigDropout(double tdp)991 void setTwigDropout(double tdp) 992 { 993 if(tdp == 0.0) return; 994 fprintf(mFile,"\tsetAttr \".tdp\" %f;\n", tdp); 995 } setTwigAngle1(double ta1)996 void setTwigAngle1(double ta1) 997 { 998 if(ta1 == 90.0) return; 999 fprintf(mFile,"\tsetAttr \".ta1\" %f;\n", ta1); 1000 } setTwigAngle2(double ta2)1001 void setTwigAngle2(double ta2) 1002 { 1003 if(ta2 == 80.0) return; 1004 fprintf(mFile,"\tsetAttr \".ta2\" %f;\n", ta2); 1005 } setTwigTwist(double ttw)1006 void setTwigTwist(double ttw) 1007 { 1008 if(ttw == 0.0) return; 1009 fprintf(mFile,"\tsetAttr \".ttw\" %f;\n", ttw); 1010 } setTwigLength(double twl)1011 void setTwigLength(double twl) 1012 { 1013 if(twl == 0.5) return; 1014 fprintf(mFile,"\tsetAttr \".twl\" %f;\n", twl); 1015 } setTwigStart(double tst)1016 void setTwigStart(double tst) 1017 { 1018 if(tst == 0.5) return; 1019 fprintf(mFile,"\tsetAttr \".tst\" %f;\n", tst); 1020 } setNumTwigClusters(double ntc)1021 void setNumTwigClusters(double ntc) 1022 { 1023 if(ntc == 4) return; 1024 fprintf(mFile,"\tsetAttr \".ntc\" %f;\n", ntc); 1025 } setTwigBaseWidth(double twb)1026 void setTwigBaseWidth(double twb) 1027 { 1028 if(twb == 0.4) return; 1029 fprintf(mFile,"\tsetAttr \".twb\" %f;\n", twb); 1030 } setTwigTipWidth(double twt)1031 void setTwigTipWidth(double twt) 1032 { 1033 if(twt == 0.2) return; 1034 fprintf(mFile,"\tsetAttr \".twt\" %f;\n", twt); 1035 } setTwigStiffness(double tgs)1036 void setTwigStiffness(double tgs) 1037 { 1038 if(tgs == 0.5) return; 1039 fprintf(mFile,"\tsetAttr \".tgs\" %f;\n", tgs); 1040 } setBranchAfterTwigs(bool bat)1041 void setBranchAfterTwigs(bool bat) 1042 { 1043 if(bat == false) return; 1044 fprintf(mFile,"\tsetAttr \".bat\" %i;\n", bat); 1045 } setLeavesInCluster(int lic)1046 void setLeavesInCluster(int lic) 1047 { 1048 if(lic == 1) return; 1049 fprintf(mFile,"\tsetAttr \".lic\" %i;\n", lic); 1050 } setLeafLocation(unsigned int llo)1051 void setLeafLocation(unsigned int llo) 1052 { 1053 if(llo == 0) return; 1054 fprintf(mFile,"\tsetAttr \".llo\" %i;\n", llo); 1055 } setLeafDropout(double ldp)1056 void setLeafDropout(double ldp) 1057 { 1058 if(ldp == 0.0) return; 1059 fprintf(mFile,"\tsetAttr \".ldp\" %f;\n", ldp); 1060 } setLeafAngle1(double ll1)1061 void setLeafAngle1(double ll1) 1062 { 1063 if(ll1 == 75.0) return; 1064 fprintf(mFile,"\tsetAttr \".ll1\" %f;\n", ll1); 1065 } setLeafAngle2(double ll2)1066 void setLeafAngle2(double ll2) 1067 { 1068 if(ll2 == 25.0) return; 1069 fprintf(mFile,"\tsetAttr \".ll2\" %f;\n", ll2); 1070 } setLeafTwist(double ltw)1071 void setLeafTwist(double ltw) 1072 { 1073 if(ltw == 0.0) return; 1074 fprintf(mFile,"\tsetAttr \".ltw\" %f;\n", ltw); 1075 } setLeafBend(double lbn)1076 void setLeafBend(double lbn) 1077 { 1078 if(lbn == 0.0) return; 1079 fprintf(mFile,"\tsetAttr \".lbn\" %f;\n", lbn); 1080 } setLeafCurl(size_t lcl_i,const LeafCurl & lcl)1081 void setLeafCurl(size_t lcl_i,const LeafCurl& lcl) 1082 { 1083 fprintf(mFile,"\tsetAttr \".lcl[%i]\" ",lcl_i); 1084 lcl.write(mFile); 1085 fprintf(mFile,";\n"); 1086 } setLeafCurl(size_t lcl_start,size_t lcl_end,LeafCurl * lcl)1087 void setLeafCurl(size_t lcl_start,size_t lcl_end,LeafCurl* lcl) 1088 { 1089 fprintf(mFile,"\tsetAttr \".lcl[%i:%i]\" ", lcl_start,lcl_end); 1090 size_t size = (lcl_end-lcl_start)*1+1; 1091 for(size_t i=0;i<size;++i) 1092 { 1093 lcl[i].write(mFile); 1094 fprintf(mFile,"\n"); 1095 } 1096 fprintf(mFile,";\n"); 1097 } startLeafCurl(size_t lcl_start,size_t lcl_end)1098 void startLeafCurl(size_t lcl_start,size_t lcl_end)const 1099 { 1100 fprintf(mFile,"\tsetAttr \".lcl[%i:%i]\"",lcl_start,lcl_end); 1101 fprintf(mFile," -type \"LeafCurl\" "); 1102 } appendLeafCurl(const LeafCurl & lcl)1103 void appendLeafCurl(const LeafCurl& lcl)const 1104 { 1105 fprintf(mFile," "); 1106 lcl.write(mFile); 1107 } endLeafCurl()1108 void endLeafCurl()const 1109 { 1110 fprintf(mFile,";\n"); 1111 } setLeafCurl_Position(size_t lcl_i,float lclp)1112 void setLeafCurl_Position(size_t lcl_i,float lclp) 1113 { 1114 if(lclp == 0.0) return; 1115 fprintf(mFile,"\tsetAttr \".lcl[%i].lclp\" %f;\n", lcl_i,lclp); 1116 } setLeafCurl_FloatValue(size_t lcl_i,float lclfv)1117 void setLeafCurl_FloatValue(size_t lcl_i,float lclfv) 1118 { 1119 if(lclfv == 0.0) return; 1120 fprintf(mFile,"\tsetAttr \".lcl[%i].lclfv\" %f;\n", lcl_i,lclfv); 1121 } setLeafCurl_Interp(size_t lcl_i,unsigned int lcli)1122 void setLeafCurl_Interp(size_t lcl_i,unsigned int lcli) 1123 { 1124 if(lcli == 0) return; 1125 fprintf(mFile,"\tsetAttr \".lcl[%i].lcli\" %i;\n", lcl_i,lcli); 1126 } setLeafTwirl(double ltwl)1127 void setLeafTwirl(double ltwl) 1128 { 1129 if(ltwl == 0.0) return; 1130 fprintf(mFile,"\tsetAttr \".ltwl\" %f;\n", ltwl); 1131 } setLeafSegments(int lsg)1132 void setLeafSegments(int lsg) 1133 { 1134 if(lsg == 5) return; 1135 fprintf(mFile,"\tsetAttr \".lsg\" %i;\n", lsg); 1136 } setLeafStart(double lst)1137 void setLeafStart(double lst) 1138 { 1139 if(lst == .5) return; 1140 fprintf(mFile,"\tsetAttr \".lst\" %f;\n", lst); 1141 } setNumLeafClusters(double nlc)1142 void setNumLeafClusters(double nlc) 1143 { 1144 if(nlc == 3) return; 1145 fprintf(mFile,"\tsetAttr \".nlc\" %f;\n", nlc); 1146 } setLeafFlatness(double lft)1147 void setLeafFlatness(double lft) 1148 { 1149 if(lft == 1.0) return; 1150 fprintf(mFile,"\tsetAttr \".lft\" %f;\n", lft); 1151 } setLeafLength(double lln)1152 void setLeafLength(double lln) 1153 { 1154 if(lln == 0.3) return; 1155 fprintf(mFile,"\tsetAttr \".lln\" %f;\n", lln); 1156 } setLeafBaseWidth(double leb)1157 void setLeafBaseWidth(double leb) 1158 { 1159 if(leb == 0.15) return; 1160 fprintf(mFile,"\tsetAttr \".leb\" %f;\n", leb); 1161 } setLeafTipWidth(double let)1162 void setLeafTipWidth(double let) 1163 { 1164 if(let == 0.05) return; 1165 fprintf(mFile,"\tsetAttr \".let\" %f;\n", let); 1166 } setLeafSizeDecay(double lsd)1167 void setLeafSizeDecay(double lsd) 1168 { 1169 if(lsd == 0.7) return; 1170 fprintf(mFile,"\tsetAttr \".lsd\" %f;\n", lsd); 1171 } setLeafTranslucence(double ltr)1172 void setLeafTranslucence(double ltr) 1173 { 1174 if(ltr == 0.7) return; 1175 fprintf(mFile,"\tsetAttr \".ltr\" %f;\n", ltr); 1176 } setLeafSpecular(double lsp)1177 void setLeafSpecular(double lsp) 1178 { 1179 if(lsp == 0.0) return; 1180 fprintf(mFile,"\tsetAttr \".lsp\" %f;\n", lsp); 1181 } setTerminalLeaf(bool tml)1182 void setTerminalLeaf(bool tml) 1183 { 1184 if(tml == false) return; 1185 fprintf(mFile,"\tsetAttr \".tml\" %i;\n", tml); 1186 } setLeafColor1(const float3 & lc1)1187 void setLeafColor1(const float3& lc1) 1188 { 1189 fprintf(mFile,"\tsetAttr \".lc1\" -type \"float3\" "); 1190 lc1.write(mFile); 1191 fprintf(mFile,";\n"); 1192 } setLeafColor1R(float lr1)1193 void setLeafColor1R(float lr1) 1194 { 1195 if(lr1 == 0.2) return; 1196 fprintf(mFile,"\tsetAttr \".lc1.lr1\" %f;\n", lr1); 1197 } setLeafColor1G(float lg1)1198 void setLeafColor1G(float lg1) 1199 { 1200 if(lg1 == 0.6) return; 1201 fprintf(mFile,"\tsetAttr \".lc1.lg1\" %f;\n", lg1); 1202 } setLeafColor1B(float lb1)1203 void setLeafColor1B(float lb1) 1204 { 1205 if(lb1 == 0.3) return; 1206 fprintf(mFile,"\tsetAttr \".lc1.lb1\" %f;\n", lb1); 1207 } setLeafColor2(const float3 & lc2)1208 void setLeafColor2(const float3& lc2) 1209 { 1210 fprintf(mFile,"\tsetAttr \".lc2\" -type \"float3\" "); 1211 lc2.write(mFile); 1212 fprintf(mFile,";\n"); 1213 } setLeafColor2R(float lr2)1214 void setLeafColor2R(float lr2) 1215 { 1216 if(lr2 == 0.4) return; 1217 fprintf(mFile,"\tsetAttr \".lc2.lr2\" %f;\n", lr2); 1218 } setLeafColor2G(float lg2)1219 void setLeafColor2G(float lg2) 1220 { 1221 if(lg2 == 0.6) return; 1222 fprintf(mFile,"\tsetAttr \".lc2.lg2\" %f;\n", lg2); 1223 } setLeafColor2B(float lb2)1224 void setLeafColor2B(float lb2) 1225 { 1226 if(lb2 == 0.3) return; 1227 fprintf(mFile,"\tsetAttr \".lc2.lb2\" %f;\n", lb2); 1228 } setLeafHueRand(double lhr)1229 void setLeafHueRand(double lhr) 1230 { 1231 if(lhr == 0.0) return; 1232 fprintf(mFile,"\tsetAttr \".lhr\" %f;\n", lhr); 1233 } setLeafSatRand(double lsr)1234 void setLeafSatRand(double lsr) 1235 { 1236 if(lsr == 0.0) return; 1237 fprintf(mFile,"\tsetAttr \".lsr\" %f;\n", lsr); 1238 } setLeafValRand(double lvr)1239 void setLeafValRand(double lvr) 1240 { 1241 if(lvr == 0.0) return; 1242 fprintf(mFile,"\tsetAttr \".lvr\" %f;\n", lvr); 1243 } setLeafUseBranchTex(bool lub)1244 void setLeafUseBranchTex(bool lub) 1245 { 1246 if(lub == true) return; 1247 fprintf(mFile,"\tsetAttr \".lub\" %i;\n", lub); 1248 } setLeafImage(const string & lim)1249 void setLeafImage(const string& lim) 1250 { 1251 if(lim == "NULL") return; 1252 fprintf(mFile,"\tsetAttr \".lim\" -type \"string\" "); 1253 lim.write(mFile); 1254 fprintf(mFile,";\n"); 1255 } setLeafStiffness(double lfs)1256 void setLeafStiffness(double lfs) 1257 { 1258 if(lfs == 0.5) return; 1259 fprintf(mFile,"\tsetAttr \".lfs\" %f;\n", lfs); 1260 } setBudSize(double bds)1261 void setBudSize(double bds) 1262 { 1263 if(bds == 0.03) return; 1264 fprintf(mFile,"\tsetAttr \".bds\" %f;\n", bds); 1265 } setBudColor(const float3 & bcr)1266 void setBudColor(const float3& bcr) 1267 { 1268 fprintf(mFile,"\tsetAttr \".bcr\" -type \"float3\" "); 1269 bcr.write(mFile); 1270 fprintf(mFile,";\n"); 1271 } setBudColorR(float bur)1272 void setBudColorR(float bur) 1273 { 1274 if(bur == 0.4) return; 1275 fprintf(mFile,"\tsetAttr \".bcr.bur\" %f;\n", bur); 1276 } setBudColorG(float bug)1277 void setBudColorG(float bug) 1278 { 1279 if(bug == 0.8) return; 1280 fprintf(mFile,"\tsetAttr \".bcr.bug\" %f;\n", bug); 1281 } setBudColorB(float bub)1282 void setBudColorB(float bub) 1283 { 1284 if(bub == 0.2) return; 1285 fprintf(mFile,"\tsetAttr \".bcr.bub\" %f;\n", bub); 1286 } setPetalsInFlower(int pif)1287 void setPetalsInFlower(int pif) 1288 { 1289 if(pif == 1) return; 1290 fprintf(mFile,"\tsetAttr \".pif\" %i;\n", pif); 1291 } setFlowerLocation(unsigned int flc)1292 void setFlowerLocation(unsigned int flc) 1293 { 1294 if(flc == 0) return; 1295 fprintf(mFile,"\tsetAttr \".flc\" %i;\n", flc); 1296 } setPetalDropout(double pdp)1297 void setPetalDropout(double pdp) 1298 { 1299 if(pdp == 0.0) return; 1300 fprintf(mFile,"\tsetAttr \".pdp\" %f;\n", pdp); 1301 } setFlowerAngle1(double fw1)1302 void setFlowerAngle1(double fw1) 1303 { 1304 if(fw1 == 75.0) return; 1305 fprintf(mFile,"\tsetAttr \".fw1\" %f;\n", fw1); 1306 } setFlowerAngle2(double fw2)1307 void setFlowerAngle2(double fw2) 1308 { 1309 if(fw2 == 25.0) return; 1310 fprintf(mFile,"\tsetAttr \".fw2\" %f;\n", fw2); 1311 } setFlowerTwist(double ftw)1312 void setFlowerTwist(double ftw) 1313 { 1314 if(ftw == 0.23) return; 1315 fprintf(mFile,"\tsetAttr \".ftw\" %f;\n", ftw); 1316 } setPetalBend(double pbn)1317 void setPetalBend(double pbn) 1318 { 1319 if(pbn == 0.0) return; 1320 fprintf(mFile,"\tsetAttr \".pbn\" %f;\n", pbn); 1321 } setPetalCurl(size_t pcl_i,const PetalCurl & pcl)1322 void setPetalCurl(size_t pcl_i,const PetalCurl& pcl) 1323 { 1324 fprintf(mFile,"\tsetAttr \".pcl[%i]\" ",pcl_i); 1325 pcl.write(mFile); 1326 fprintf(mFile,";\n"); 1327 } setPetalCurl(size_t pcl_start,size_t pcl_end,PetalCurl * pcl)1328 void setPetalCurl(size_t pcl_start,size_t pcl_end,PetalCurl* pcl) 1329 { 1330 fprintf(mFile,"\tsetAttr \".pcl[%i:%i]\" ", pcl_start,pcl_end); 1331 size_t size = (pcl_end-pcl_start)*1+1; 1332 for(size_t i=0;i<size;++i) 1333 { 1334 pcl[i].write(mFile); 1335 fprintf(mFile,"\n"); 1336 } 1337 fprintf(mFile,";\n"); 1338 } startPetalCurl(size_t pcl_start,size_t pcl_end)1339 void startPetalCurl(size_t pcl_start,size_t pcl_end)const 1340 { 1341 fprintf(mFile,"\tsetAttr \".pcl[%i:%i]\"",pcl_start,pcl_end); 1342 fprintf(mFile," -type \"PetalCurl\" "); 1343 } appendPetalCurl(const PetalCurl & pcl)1344 void appendPetalCurl(const PetalCurl& pcl)const 1345 { 1346 fprintf(mFile," "); 1347 pcl.write(mFile); 1348 } endPetalCurl()1349 void endPetalCurl()const 1350 { 1351 fprintf(mFile,";\n"); 1352 } setPetalCurl_Position(size_t pcl_i,float pclp)1353 void setPetalCurl_Position(size_t pcl_i,float pclp) 1354 { 1355 if(pclp == 0.0) return; 1356 fprintf(mFile,"\tsetAttr \".pcl[%i].pclp\" %f;\n", pcl_i,pclp); 1357 } setPetalCurl_FloatValue(size_t pcl_i,float pclfv)1358 void setPetalCurl_FloatValue(size_t pcl_i,float pclfv) 1359 { 1360 if(pclfv == 0.0) return; 1361 fprintf(mFile,"\tsetAttr \".pcl[%i].pclfv\" %f;\n", pcl_i,pclfv); 1362 } setPetalCurl_Interp(size_t pcl_i,unsigned int pcli)1363 void setPetalCurl_Interp(size_t pcl_i,unsigned int pcli) 1364 { 1365 if(pcli == 0) return; 1366 fprintf(mFile,"\tsetAttr \".pcl[%i].pcli\" %i;\n", pcl_i,pcli); 1367 } setPetalTwirl(double lpwl)1368 void setPetalTwirl(double lpwl) 1369 { 1370 if(lpwl == 0.0) return; 1371 fprintf(mFile,"\tsetAttr \".lpwl\" %f;\n", lpwl); 1372 } setPetalSegments(int psg)1373 void setPetalSegments(int psg) 1374 { 1375 if(psg == 5) return; 1376 fprintf(mFile,"\tsetAttr \".psg\" %i;\n", psg); 1377 } setFlowerStart(double fst)1378 void setFlowerStart(double fst) 1379 { 1380 if(fst == 1) return; 1381 fprintf(mFile,"\tsetAttr \".fst\" %f;\n", fst); 1382 } setNumFlowers(double nfl)1383 void setNumFlowers(double nfl) 1384 { 1385 if(nfl == 10) return; 1386 fprintf(mFile,"\tsetAttr \".nfl\" %f;\n", nfl); 1387 } setPetalFlatness(double pft)1388 void setPetalFlatness(double pft) 1389 { 1390 if(pft == 1.0) return; 1391 fprintf(mFile,"\tsetAttr \".pft\" %f;\n", pft); 1392 } setPetalLength(double pln)1393