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_FURFEEDBACK_H__ 11 #define __MayaDM_FURFEEDBACK_H__ 12 #include "MayaDMTypes.h" 13 #include "MayaDMConnectables.h" 14 #include "MayaDMLocator.h" 15 namespace MayaDM 16 { 17 class FurFeedback : public Locator 18 { 19 public: 20 struct Attractors{ 21 }; 22 struct MentalRayControls{ 23 bool miOverrideCaustics; 24 short miCausticAccuracy; 25 float miCausticRadius; 26 bool miOverrideGlobalIllumination; 27 short miGlobillumAccuracy; 28 float miGlobillumRadius; 29 bool miOverrideFinalGather; 30 int miFinalGatherRays; 31 float miFinalGatherMinRadius; 32 float miFinalGatherMaxRadius; 33 short miFinalGatherFilter; 34 bool miFinalGatherView; 35 bool miOverrideSamples; 36 short miMinSamples; 37 short miMaxSamples; 38 bool miFinalGatherCast; 39 bool miFinalGatherReceive; 40 bool miTransparencyCast; 41 bool miTransparencyReceive; writeMentalRayControls42 void write(FILE* file) const 43 { 44 fprintf(file,"%i ", miOverrideCaustics); 45 fprintf(file,"%i ", miCausticAccuracy); 46 fprintf(file,"%f ", miCausticRadius); 47 fprintf(file,"%i ", miOverrideGlobalIllumination); 48 fprintf(file,"%i ", miGlobillumAccuracy); 49 fprintf(file,"%f ", miGlobillumRadius); 50 fprintf(file,"%i ", miOverrideFinalGather); 51 fprintf(file,"%i ", miFinalGatherRays); 52 fprintf(file,"%f ", miFinalGatherMinRadius); 53 fprintf(file,"%f ", miFinalGatherMaxRadius); 54 fprintf(file,"%i ", miFinalGatherFilter); 55 fprintf(file,"%i ", miFinalGatherView); 56 fprintf(file,"%i ", miOverrideSamples); 57 fprintf(file,"%i ", miMinSamples); 58 fprintf(file,"%i ", miMaxSamples); 59 fprintf(file,"%i ", miFinalGatherCast); 60 fprintf(file,"%i ", miFinalGatherReceive); 61 fprintf(file,"%i ", miTransparencyCast); 62 fprintf(file,"%i", miTransparencyReceive); 63 } 64 }; 65 public: 66 FurFeedback()67 FurFeedback():Locator(){} 68 FurFeedback(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true) 69 :Locator(file, name, parent, "FurFeedback", shared, create){} ~FurFeedback()70 virtual ~FurFeedback(){} 71 setInputSurface(const nurbsSurface & is)72 void setInputSurface(const nurbsSurface& is) 73 { 74 fprintf(mFile,"\tsetAttr \".is\" -type \"nurbsSurface\" "); 75 is.write(mFile); 76 fprintf(mFile,";\n"); 77 } setInputMesh(const mesh & imsh)78 void setInputMesh(const mesh& imsh) 79 { 80 fprintf(mFile,"\tsetAttr \".imsh\" -type \"mesh\" "); 81 imsh.write(mFile); 82 fprintf(mFile,";\n"); 83 } setRealUSamples(int rus)84 void setRealUSamples(int rus) 85 { 86 if(rus == 32) return; 87 fprintf(mFile,"\tsetAttr \".rus\" %i;\n", rus); 88 } setRealVSamples(int rvs)89 void setRealVSamples(int rvs) 90 { 91 if(rvs == 32) return; 92 fprintf(mFile,"\tsetAttr \".rvs\" %i;\n", rvs); 93 } setUSamples(int us)94 void setUSamples(int us) 95 { 96 if(us == 32) return; 97 fprintf(mFile,"\tsetAttr \".us\" %i;\n", us); 98 } setVSamples(int vs)99 void setVSamples(int vs) 100 { 101 if(vs == 32) return; 102 fprintf(mFile,"\tsetAttr \".vs\" %i;\n", vs); 103 } setFlipNormals(bool fn)104 void setFlipNormals(bool fn) 105 { 106 if(fn == false) return; 107 fprintf(mFile,"\tsetAttr \".fn\" %i;\n", fn); 108 } setHairs(const pointArray & h)109 void setHairs(const pointArray& h) 110 { 111 fprintf(mFile,"\tsetAttr \".h\" -type \"pointArray\" "); 112 h.write(mFile); 113 fprintf(mFile,";\n"); 114 } setFurAccuracy(float ha)115 void setFurAccuracy(float ha) 116 { 117 if(ha == 0.0) return; 118 fprintf(mFile,"\tsetAttr \".ha\" %f;\n", ha); 119 } setFurGlobalScale(float fgs)120 void setFurGlobalScale(float fgs) 121 { 122 if(fgs == 1.0) return; 123 fprintf(mFile,"\tsetAttr \".fgs\" %f;\n", fgs); 124 } setAttractorGlobalScale(float ags)125 void setAttractorGlobalScale(float ags) 126 { 127 if(ags == 1.0) return; 128 fprintf(mFile,"\tsetAttr \".ags\" %f;\n", ags); 129 } setExportAttr(const string & ea)130 void setExportAttr(const string& ea) 131 { 132 if(ea == "n/a") return; 133 fprintf(mFile,"\tsetAttr \".ea\" -type \"string\" "); 134 ea.write(mFile); 135 fprintf(mFile,";\n"); 136 } setExportFile(const string & ef)137 void setExportFile(const string& ef) 138 { 139 if(ef == "n/a") return; 140 fprintf(mFile,"\tsetAttr \".ef\" -type \"string\" "); 141 ef.write(mFile); 142 fprintf(mFile,";\n"); 143 } setExportWidth(int ew)144 void setExportWidth(int ew) 145 { 146 if(ew == 256) return; 147 fprintf(mFile,"\tsetAttr \".ew\" %i;\n", ew); 148 } setExportHeight(int eh)149 void setExportHeight(int eh) 150 { 151 if(eh == 256) return; 152 fprintf(mFile,"\tsetAttr \".eh\" %i;\n", eh); 153 } setColorFeedbackEnabled(bool cfe)154 void setColorFeedbackEnabled(bool cfe) 155 { 156 if(cfe == false) return; 157 fprintf(mFile,"\tsetAttr \".cfe\" %i;\n", cfe); 158 } setAttractorModel(unsigned int amd)159 void setAttractorModel(unsigned int amd) 160 { 161 if(amd == 0) return; 162 fprintf(mFile,"\tsetAttr \".amd\" %i;\n", amd); 163 } setAttractorsPerHair(int aph)164 void setAttractorsPerHair(int aph) 165 { 166 if(aph == 1) return; 167 fprintf(mFile,"\tsetAttr \".aph\" %i;\n", aph); 168 } setDrawAttractors(bool drat)169 void setDrawAttractors(bool drat) 170 { 171 if(drat == false) return; 172 fprintf(mFile,"\tsetAttr \".drat\" %i;\n", drat); 173 } setLength(double dl)174 void setLength(double dl) 175 { 176 if(dl == 1) return; 177 fprintf(mFile,"\tsetAttr \".dl\" %f;\n", dl); 178 } setLengthSamples(size_t ls_i,double ls)179 void setLengthSamples(size_t ls_i,double ls) 180 { 181 if(ls == 0.0) return; 182 fprintf(mFile,"\tsetAttr \".ls[%i]\" %f;\n", ls_i,ls); 183 } setLengthSamples(size_t ls_start,size_t ls_end,double * ls)184 void setLengthSamples(size_t ls_start,size_t ls_end,double* ls) 185 { 186 fprintf(mFile,"\tsetAttr \".ls[%i:%i]\" ", ls_start,ls_end); 187 size_t size = (ls_end-ls_start)*1+1; 188 for(size_t i=0;i<size;++i) 189 { 190 fprintf(mFile,"%f",ls[i]); 191 if(i+1<size) fprintf(mFile," "); 192 } 193 fprintf(mFile,";\n"); 194 } startLengthSamples(size_t ls_start,size_t ls_end)195 void startLengthSamples(size_t ls_start,size_t ls_end)const 196 { 197 fprintf(mFile,"\tsetAttr \".ls[%i:%i]\"",ls_start,ls_end); 198 } appendLengthSamples(double ls)199 void appendLengthSamples(double ls)const 200 { 201 fprintf(mFile," %f",ls); 202 } endLengthSamples()203 void endLengthSamples()const 204 { 205 fprintf(mFile,";\n"); 206 } setLengthMap(const string & lm)207 void setLengthMap(const string& lm) 208 { 209 if(lm == "n/a") return; 210 fprintf(mFile,"\tsetAttr \".lm\" -type \"string\" "); 211 lm.write(mFile); 212 fprintf(mFile,";\n"); 213 } setLengthMapOffset(double lmo)214 void setLengthMapOffset(double lmo) 215 { 216 if(lmo == 0) return; 217 fprintf(mFile,"\tsetAttr \".lmo\" %f;\n", lmo); 218 } setLengthMapMult(double lmm)219 void setLengthMapMult(double lmm) 220 { 221 if(lmm == 1) return; 222 fprintf(mFile,"\tsetAttr \".lmm\" %f;\n", lmm); 223 } setLengthNoise(double ln)224 void setLengthNoise(double ln) 225 { 226 if(ln == 0) return; 227 fprintf(mFile,"\tsetAttr \".ln\" %f;\n", ln); 228 } setLengthNoiseFreq(float lnf)229 void setLengthNoiseFreq(float lnf) 230 { 231 if(lnf == 10.0) return; 232 fprintf(mFile,"\tsetAttr \".lnf\" %f;\n", lnf); 233 } setLengthSamplesDirty(int lsd)234 void setLengthSamplesDirty(int lsd) 235 { 236 if(lsd == 0.0) return; 237 fprintf(mFile,"\tsetAttr \".lsd\" %i;\n", lsd); 238 } setLengthMapDirty(int lmd)239 void setLengthMapDirty(int lmd) 240 { 241 if(lmd == 0.0) return; 242 fprintf(mFile,"\tsetAttr \".lmd\" %i;\n", lmd); 243 } setInclination(float din)244 void setInclination(float din) 245 { 246 if(din == 0.0) return; 247 fprintf(mFile,"\tsetAttr \".din\" %f;\n", din); 248 } setInclinationSamples(size_t ins_i,double ins)249 void setInclinationSamples(size_t ins_i,double ins) 250 { 251 if(ins == 0.0) return; 252 fprintf(mFile,"\tsetAttr \".ins[%i]\" %f;\n", ins_i,ins); 253 } setInclinationSamples(size_t ins_start,size_t ins_end,double * ins)254 void setInclinationSamples(size_t ins_start,size_t ins_end,double* ins) 255 { 256 fprintf(mFile,"\tsetAttr \".ins[%i:%i]\" ", ins_start,ins_end); 257 size_t size = (ins_end-ins_start)*1+1; 258 for(size_t i=0;i<size;++i) 259 { 260 fprintf(mFile,"%f",ins[i]); 261 if(i+1<size) fprintf(mFile," "); 262 } 263 fprintf(mFile,";\n"); 264 } startInclinationSamples(size_t ins_start,size_t ins_end)265 void startInclinationSamples(size_t ins_start,size_t ins_end)const 266 { 267 fprintf(mFile,"\tsetAttr \".ins[%i:%i]\"",ins_start,ins_end); 268 } appendInclinationSamples(double ins)269 void appendInclinationSamples(double ins)const 270 { 271 fprintf(mFile," %f",ins); 272 } endInclinationSamples()273 void endInclinationSamples()const 274 { 275 fprintf(mFile,";\n"); 276 } setInclinationMap(const string & inm)277 void setInclinationMap(const string& inm) 278 { 279 if(inm == "n/a") return; 280 fprintf(mFile,"\tsetAttr \".inm\" -type \"string\" "); 281 inm.write(mFile); 282 fprintf(mFile,";\n"); 283 } setInclinationMapOffset(float inmo)284 void setInclinationMapOffset(float inmo) 285 { 286 if(inmo == 0.0) return; 287 fprintf(mFile,"\tsetAttr \".inmo\" %f;\n", inmo); 288 } setInclinationMapMult(float inmm)289 void setInclinationMapMult(float inmm) 290 { 291 if(inmm == 1.0) return; 292 fprintf(mFile,"\tsetAttr \".inmm\" %f;\n", inmm); 293 } setInclinationNoise(float inn)294 void setInclinationNoise(float inn) 295 { 296 if(inn == 0.0) return; 297 fprintf(mFile,"\tsetAttr \".inn\" %f;\n", inn); 298 } setInclinationNoiseFreq(float innf)299 void setInclinationNoiseFreq(float innf) 300 { 301 if(innf == 10.0) return; 302 fprintf(mFile,"\tsetAttr \".innf\" %f;\n", innf); 303 } setInclinationSamplesDirty(int insd)304 void setInclinationSamplesDirty(int insd) 305 { 306 if(insd == 0.0) return; 307 fprintf(mFile,"\tsetAttr \".insd\" %i;\n", insd); 308 } setInclinationMapDirty(int inmd)309 void setInclinationMapDirty(int inmd) 310 { 311 if(inmd == 0.0) return; 312 fprintf(mFile,"\tsetAttr \".inmd\" %i;\n", inmd); 313 } setRoll(float drl)314 void setRoll(float drl) 315 { 316 if(drl == 0.5) return; 317 fprintf(mFile,"\tsetAttr \".drl\" %f;\n", drl); 318 } setRollSamples(size_t rls_i,double rls)319 void setRollSamples(size_t rls_i,double rls) 320 { 321 if(rls == 0.0) return; 322 fprintf(mFile,"\tsetAttr \".rls[%i]\" %f;\n", rls_i,rls); 323 } setRollSamples(size_t rls_start,size_t rls_end,double * rls)324 void setRollSamples(size_t rls_start,size_t rls_end,double* rls) 325 { 326 fprintf(mFile,"\tsetAttr \".rls[%i:%i]\" ", rls_start,rls_end); 327 size_t size = (rls_end-rls_start)*1+1; 328 for(size_t i=0;i<size;++i) 329 { 330 fprintf(mFile,"%f",rls[i]); 331 if(i+1<size) fprintf(mFile," "); 332 } 333 fprintf(mFile,";\n"); 334 } startRollSamples(size_t rls_start,size_t rls_end)335 void startRollSamples(size_t rls_start,size_t rls_end)const 336 { 337 fprintf(mFile,"\tsetAttr \".rls[%i:%i]\"",rls_start,rls_end); 338 } appendRollSamples(double rls)339 void appendRollSamples(double rls)const 340 { 341 fprintf(mFile," %f",rls); 342 } endRollSamples()343 void endRollSamples()const 344 { 345 fprintf(mFile,";\n"); 346 } setRollMap(const string & rlm)347 void setRollMap(const string& rlm) 348 { 349 if(rlm == "n/a") return; 350 fprintf(mFile,"\tsetAttr \".rlm\" -type \"string\" "); 351 rlm.write(mFile); 352 fprintf(mFile,";\n"); 353 } setRollMapOffset(float rlmo)354 void setRollMapOffset(float rlmo) 355 { 356 if(rlmo == 0.0) return; 357 fprintf(mFile,"\tsetAttr \".rlmo\" %f;\n", rlmo); 358 } setRollMapMult(float rlmm)359 void setRollMapMult(float rlmm) 360 { 361 if(rlmm == 1.0) return; 362 fprintf(mFile,"\tsetAttr \".rlmm\" %f;\n", rlmm); 363 } setRollNoise(float rln)364 void setRollNoise(float rln) 365 { 366 if(rln == 0.0) return; 367 fprintf(mFile,"\tsetAttr \".rln\" %f;\n", rln); 368 } setRollNoiseFreq(float rlnf)369 void setRollNoiseFreq(float rlnf) 370 { 371 if(rlnf == 10.0) return; 372 fprintf(mFile,"\tsetAttr \".rlnf\" %f;\n", rlnf); 373 } setRollSamplesDirty(int rlsd)374 void setRollSamplesDirty(int rlsd) 375 { 376 if(rlsd == 0.0) return; 377 fprintf(mFile,"\tsetAttr \".rlsd\" %i;\n", rlsd); 378 } setRollMapDirty(int rlmd)379 void setRollMapDirty(int rlmd) 380 { 381 if(rlmd == 0.0) return; 382 fprintf(mFile,"\tsetAttr \".rlmd\" %i;\n", rlmd); 383 } setPolar(float dpo)384 void setPolar(float dpo) 385 { 386 if(dpo == 0.5) return; 387 fprintf(mFile,"\tsetAttr \".dpo\" %f;\n", dpo); 388 } setPolarSamples(size_t pos_i,double pos)389 void setPolarSamples(size_t pos_i,double pos) 390 { 391 if(pos == 0.0) return; 392 fprintf(mFile,"\tsetAttr \".pos[%i]\" %f;\n", pos_i,pos); 393 } setPolarSamples(size_t pos_start,size_t pos_end,double * pos)394 void setPolarSamples(size_t pos_start,size_t pos_end,double* pos) 395 { 396 fprintf(mFile,"\tsetAttr \".pos[%i:%i]\" ", pos_start,pos_end); 397 size_t size = (pos_end-pos_start)*1+1; 398 for(size_t i=0;i<size;++i) 399 { 400 fprintf(mFile,"%f",pos[i]); 401 if(i+1<size) fprintf(mFile," "); 402 } 403 fprintf(mFile,";\n"); 404 } startPolarSamples(size_t pos_start,size_t pos_end)405 void startPolarSamples(size_t pos_start,size_t pos_end)const 406 { 407 fprintf(mFile,"\tsetAttr \".pos[%i:%i]\"",pos_start,pos_end); 408 } appendPolarSamples(double pos)409 void appendPolarSamples(double pos)const 410 { 411 fprintf(mFile," %f",pos); 412 } endPolarSamples()413 void endPolarSamples()const 414 { 415 fprintf(mFile,";\n"); 416 } setPolarMap(const string & pom)417 void setPolarMap(const string& pom) 418 { 419 if(pom == "n/a") return; 420 fprintf(mFile,"\tsetAttr \".pom\" -type \"string\" "); 421 pom.write(mFile); 422 fprintf(mFile,";\n"); 423 } setPolarMapOffset(float pomo)424 void setPolarMapOffset(float pomo) 425 { 426 if(pomo == 0.0) return; 427 fprintf(mFile,"\tsetAttr \".pomo\" %f;\n", pomo); 428 } setPolarMapMult(float pomm)429 void setPolarMapMult(float pomm) 430 { 431 if(pomm == 1.0) return; 432 fprintf(mFile,"\tsetAttr \".pomm\" %f;\n", pomm); 433 } setPolarNoise(float pon)434 void setPolarNoise(float pon) 435 { 436 if(pon == 0.0) return; 437 fprintf(mFile,"\tsetAttr \".pon\" %f;\n", pon); 438 } setPolarNoiseFreq(float ponf)439 void setPolarNoiseFreq(float ponf) 440 { 441 if(ponf == 10.0) return; 442 fprintf(mFile,"\tsetAttr \".ponf\" %f;\n", ponf); 443 } setPolarSamplesDirty(int posd)444 void setPolarSamplesDirty(int posd) 445 { 446 if(posd == 0.0) return; 447 fprintf(mFile,"\tsetAttr \".posd\" %i;\n", posd); 448 } setPolarMapDirty(int pomd)449 void setPolarMapDirty(int pomd) 450 { 451 if(pomd == 0.0) return; 452 fprintf(mFile,"\tsetAttr \".pomd\" %i;\n", pomd); 453 } setBaldness(float db)454 void setBaldness(float db) 455 { 456 if(db == 1.0) return; 457 fprintf(mFile,"\tsetAttr \".db\" %f;\n", db); 458 } setBaldnessSamples(size_t bs_i,double bs)459 void setBaldnessSamples(size_t bs_i,double bs) 460 { 461 if(bs == 0.0) return; 462 fprintf(mFile,"\tsetAttr \".bs[%i]\" %f;\n", bs_i,bs); 463 } setBaldnessSamples(size_t bs_start,size_t bs_end,double * bs)464 void setBaldnessSamples(size_t bs_start,size_t bs_end,double* bs) 465 { 466 fprintf(mFile,"\tsetAttr \".bs[%i:%i]\" ", bs_start,bs_end); 467 size_t size = (bs_end-bs_start)*1+1; 468 for(size_t i=0;i<size;++i) 469 { 470 fprintf(mFile,"%f",bs[i]); 471 if(i+1<size) fprintf(mFile," "); 472 } 473 fprintf(mFile,";\n"); 474 } startBaldnessSamples(size_t bs_start,size_t bs_end)475 void startBaldnessSamples(size_t bs_start,size_t bs_end)const 476 { 477 fprintf(mFile,"\tsetAttr \".bs[%i:%i]\"",bs_start,bs_end); 478 } appendBaldnessSamples(double bs)479 void appendBaldnessSamples(double bs)const 480 { 481 fprintf(mFile," %f",bs); 482 } endBaldnessSamples()483 void endBaldnessSamples()const 484 { 485 fprintf(mFile,";\n"); 486 } setBaldnessMap(const string & bm)487 void setBaldnessMap(const string& bm) 488 { 489 if(bm == "n/a") return; 490 fprintf(mFile,"\tsetAttr \".bm\" -type \"string\" "); 491 bm.write(mFile); 492 fprintf(mFile,";\n"); 493 } setBaldnessMapOffset(float bmo)494 void setBaldnessMapOffset(float bmo) 495 { 496 if(bmo == 0.0) return; 497 fprintf(mFile,"\tsetAttr \".bmo\" %f;\n", bmo); 498 } setBaldnessMapMult(float bmm)499 void setBaldnessMapMult(float bmm) 500 { 501 if(bmm == 1.0) return; 502 fprintf(mFile,"\tsetAttr \".bmm\" %f;\n", bmm); 503 } setBaldnessNoise(float bn)504 void setBaldnessNoise(float bn) 505 { 506 if(bn == 0.0) return; 507 fprintf(mFile,"\tsetAttr \".bn\" %f;\n", bn); 508 } setBaldnessNoiseFreq(float bnf)509 void setBaldnessNoiseFreq(float bnf) 510 { 511 if(bnf == 10.0) return; 512 fprintf(mFile,"\tsetAttr \".bnf\" %f;\n", bnf); 513 } setBaldnessSamplesDirty(int bsd)514 void setBaldnessSamplesDirty(int bsd) 515 { 516 if(bsd == 0.0) return; 517 fprintf(mFile,"\tsetAttr \".bsd\" %i;\n", bsd); 518 } setBaldnessMapDirty(int bmd)519 void setBaldnessMapDirty(int bmd) 520 { 521 if(bmd == 0.0) return; 522 fprintf(mFile,"\tsetAttr \".bmd\" %i;\n", bmd); 523 } setBaseOpacity(float dbo)524 void setBaseOpacity(float dbo) 525 { 526 if(dbo == 1.0) return; 527 fprintf(mFile,"\tsetAttr \".dbo\" %f;\n", dbo); 528 } setBaseOpacitySamples(size_t bos_i,double bos)529 void setBaseOpacitySamples(size_t bos_i,double bos) 530 { 531 if(bos == 0.0) return; 532 fprintf(mFile,"\tsetAttr \".bos[%i]\" %f;\n", bos_i,bos); 533 } setBaseOpacitySamples(size_t bos_start,size_t bos_end,double * bos)534 void setBaseOpacitySamples(size_t bos_start,size_t bos_end,double* bos) 535 { 536 fprintf(mFile,"\tsetAttr \".bos[%i:%i]\" ", bos_start,bos_end); 537 size_t size = (bos_end-bos_start)*1+1; 538 for(size_t i=0;i<size;++i) 539 { 540 fprintf(mFile,"%f",bos[i]); 541 if(i+1<size) fprintf(mFile," "); 542 } 543 fprintf(mFile,";\n"); 544 } startBaseOpacitySamples(size_t bos_start,size_t bos_end)545 void startBaseOpacitySamples(size_t bos_start,size_t bos_end)const 546 { 547 fprintf(mFile,"\tsetAttr \".bos[%i:%i]\"",bos_start,bos_end); 548 } appendBaseOpacitySamples(double bos)549 void appendBaseOpacitySamples(double bos)const 550 { 551 fprintf(mFile," %f",bos); 552 } endBaseOpacitySamples()553 void endBaseOpacitySamples()const 554 { 555 fprintf(mFile,";\n"); 556 } setBaseOpacityMap(const string & bom)557 void setBaseOpacityMap(const string& bom) 558 { 559 if(bom == "n/a") return; 560 fprintf(mFile,"\tsetAttr \".bom\" -type \"string\" "); 561 bom.write(mFile); 562 fprintf(mFile,";\n"); 563 } setBaseOpacityMapOffset(float bomo)564 void setBaseOpacityMapOffset(float bomo) 565 { 566 if(bomo == 0.0) return; 567 fprintf(mFile,"\tsetAttr \".bomo\" %f;\n", bomo); 568 } setBaseOpacityMapMult(float bomm)569 void setBaseOpacityMapMult(float bomm) 570 { 571 if(bomm == 1.0) return; 572 fprintf(mFile,"\tsetAttr \".bomm\" %f;\n", bomm); 573 } setBaseOpacityNoise(float bon)574 void setBaseOpacityNoise(float bon) 575 { 576 if(bon == 0.0) return; 577 fprintf(mFile,"\tsetAttr \".bon\" %f;\n", bon); 578 } setBaseOpacityNoiseFreq(float bonf)579 void setBaseOpacityNoiseFreq(float bonf) 580 { 581 if(bonf == 10.0) return; 582 fprintf(mFile,"\tsetAttr \".bonf\" %f;\n", bonf); 583 } setBaseOpacitySamplesDirty(int bosd)584 void setBaseOpacitySamplesDirty(int bosd) 585 { 586 if(bosd == 0.0) return; 587 fprintf(mFile,"\tsetAttr \".bosd\" %i;\n", bosd); 588 } setBaseOpacityMapDirty(int bomd)589 void setBaseOpacityMapDirty(int bomd) 590 { 591 if(bomd == 0.0) return; 592 fprintf(mFile,"\tsetAttr \".bomd\" %i;\n", bomd); 593 } setTipOpacity(float dto)594 void setTipOpacity(float dto) 595 { 596 if(dto == 1.0) return; 597 fprintf(mFile,"\tsetAttr \".dto\" %f;\n", dto); 598 } setTipOpacitySamples(size_t tos_i,double tos)599 void setTipOpacitySamples(size_t tos_i,double tos) 600 { 601 if(tos == 0.0) return; 602 fprintf(mFile,"\tsetAttr \".tos[%i]\" %f;\n", tos_i,tos); 603 } setTipOpacitySamples(size_t tos_start,size_t tos_end,double * tos)604 void setTipOpacitySamples(size_t tos_start,size_t tos_end,double* tos) 605 { 606 fprintf(mFile,"\tsetAttr \".tos[%i:%i]\" ", tos_start,tos_end); 607 size_t size = (tos_end-tos_start)*1+1; 608 for(size_t i=0;i<size;++i) 609 { 610 fprintf(mFile,"%f",tos[i]); 611 if(i+1<size) fprintf(mFile," "); 612 } 613 fprintf(mFile,";\n"); 614 } startTipOpacitySamples(size_t tos_start,size_t tos_end)615 void startTipOpacitySamples(size_t tos_start,size_t tos_end)const 616 { 617 fprintf(mFile,"\tsetAttr \".tos[%i:%i]\"",tos_start,tos_end); 618 } appendTipOpacitySamples(double tos)619 void appendTipOpacitySamples(double tos)const 620 { 621 fprintf(mFile," %f",tos); 622 } endTipOpacitySamples()623 void endTipOpacitySamples()const 624 { 625 fprintf(mFile,";\n"); 626 } setTipOpacityMap(const string & tom)627 void setTipOpacityMap(const string& tom) 628 { 629 if(tom == "n/a") return; 630 fprintf(mFile,"\tsetAttr \".tom\" -type \"string\" "); 631 tom.write(mFile); 632 fprintf(mFile,";\n"); 633 } setTipOpacityMapOffset(float tomo)634 void setTipOpacityMapOffset(float tomo) 635 { 636 if(tomo == 0.0) return; 637 fprintf(mFile,"\tsetAttr \".tomo\" %f;\n", tomo); 638 } setTipOpacityMapMult(float tomm)639 void setTipOpacityMapMult(float tomm) 640 { 641 if(tomm == 1.0) return; 642 fprintf(mFile,"\tsetAttr \".tomm\" %f;\n", tomm); 643 } setTipOpacityNoise(float ton)644 void setTipOpacityNoise(float ton) 645 { 646 if(ton == 0.0) return; 647 fprintf(mFile,"\tsetAttr \".ton\" %f;\n", ton); 648 } setTipOpacityNoiseFreq(float tonf)649 void setTipOpacityNoiseFreq(float tonf) 650 { 651 if(tonf == 10.0) return; 652 fprintf(mFile,"\tsetAttr \".tonf\" %f;\n", tonf); 653 } setTipOpacitySamplesDirty(int tosd)654 void setTipOpacitySamplesDirty(int tosd) 655 { 656 if(tosd == 0.0) return; 657 fprintf(mFile,"\tsetAttr \".tosd\" %i;\n", tosd); 658 } setTipOpacityMapDirty(int tomd)659 void setTipOpacityMapDirty(int tomd) 660 { 661 if(tomd == 0.0) return; 662 fprintf(mFile,"\tsetAttr \".tomd\" %i;\n", tomd); 663 } setBaseCurl(float dbcl)664 void setBaseCurl(float dbcl) 665 { 666 if(dbcl == 0.50) return; 667 fprintf(mFile,"\tsetAttr \".dbcl\" %f;\n", dbcl); 668 } setBaseCurlSamples(size_t bcls_i,double bcls)669 void setBaseCurlSamples(size_t bcls_i,double bcls) 670 { 671 if(bcls == 0.0) return; 672 fprintf(mFile,"\tsetAttr \".bcls[%i]\" %f;\n", bcls_i,bcls); 673 } setBaseCurlSamples(size_t bcls_start,size_t bcls_end,double * bcls)674 void setBaseCurlSamples(size_t bcls_start,size_t bcls_end,double* bcls) 675 { 676 fprintf(mFile,"\tsetAttr \".bcls[%i:%i]\" ", bcls_start,bcls_end); 677 size_t size = (bcls_end-bcls_start)*1+1; 678 for(size_t i=0;i<size;++i) 679 { 680 fprintf(mFile,"%f",bcls[i]); 681 if(i+1<size) fprintf(mFile," "); 682 } 683 fprintf(mFile,";\n"); 684 } startBaseCurlSamples(size_t bcls_start,size_t bcls_end)685 void startBaseCurlSamples(size_t bcls_start,size_t bcls_end)const 686 { 687 fprintf(mFile,"\tsetAttr \".bcls[%i:%i]\"",bcls_start,bcls_end); 688 } appendBaseCurlSamples(double bcls)689 void appendBaseCurlSamples(double bcls)const 690 { 691 fprintf(mFile," %f",bcls); 692 } endBaseCurlSamples()693 void endBaseCurlSamples()const 694 { 695 fprintf(mFile,";\n"); 696 } setBaseCurlMap(const string & bclm)697 void setBaseCurlMap(const string& bclm) 698 { 699 if(bclm == "n/a") return; 700 fprintf(mFile,"\tsetAttr \".bclm\" -type \"string\" "); 701 bclm.write(mFile); 702 fprintf(mFile,";\n"); 703 } setBaseCurlMapOffset(float bclmo)704 void setBaseCurlMapOffset(float bclmo) 705 { 706 if(bclmo == 0.0) return; 707 fprintf(mFile,"\tsetAttr \".bclmo\" %f;\n", bclmo); 708 } setBaseCurlMapMult(float bclmm)709 void setBaseCurlMapMult(float bclmm) 710 { 711 if(bclmm == 1.0) return; 712 fprintf(mFile,"\tsetAttr \".bclmm\" %f;\n", bclmm); 713 } setBaseCurlNoise(float bcln)714 void setBaseCurlNoise(float bcln) 715 { 716 if(bcln == 0.0) return; 717 fprintf(mFile,"\tsetAttr \".bcln\" %f;\n", bcln); 718 } setBaseCurlNoiseFreq(float bclnf)719 void setBaseCurlNoiseFreq(float bclnf) 720 { 721 if(bclnf == 10.0) return; 722 fprintf(mFile,"\tsetAttr \".bclnf\" %f;\n", bclnf); 723 } setBaseCurlSamplesDirty(int bclsd)724 void setBaseCurlSamplesDirty(int bclsd) 725 { 726 if(bclsd == 0.0) return; 727 fprintf(mFile,"\tsetAttr \".bclsd\" %i;\n", bclsd); 728 } setBaseCurlMapDirty(int bclmd)729 void setBaseCurlMapDirty(int bclmd) 730 { 731 if(bclmd == 0.0) return; 732 fprintf(mFile,"\tsetAttr \".bclmd\" %i;\n", bclmd); 733 } setTipCurl(float dtcl)734 void setTipCurl(float dtcl) 735 { 736 if(dtcl == 0.5) return; 737 fprintf(mFile,"\tsetAttr \".dtcl\" %f;\n", dtcl); 738 } setTipCurlSamples(size_t tcls_i,double tcls)739 void setTipCurlSamples(size_t tcls_i,double tcls) 740 { 741 if(tcls == 0.0) return; 742 fprintf(mFile,"\tsetAttr \".tcls[%i]\" %f;\n", tcls_i,tcls); 743 } setTipCurlSamples(size_t tcls_start,size_t tcls_end,double * tcls)744 void setTipCurlSamples(size_t tcls_start,size_t tcls_end,double* tcls) 745 { 746 fprintf(mFile,"\tsetAttr \".tcls[%i:%i]\" ", tcls_start,tcls_end); 747 size_t size = (tcls_end-tcls_start)*1+1; 748 for(size_t i=0;i<size;++i) 749 { 750 fprintf(mFile,"%f",tcls[i]); 751 if(i+1<size) fprintf(mFile," "); 752 } 753 fprintf(mFile,";\n"); 754 } startTipCurlSamples(size_t tcls_start,size_t tcls_end)755 void startTipCurlSamples(size_t tcls_start,size_t tcls_end)const 756 { 757 fprintf(mFile,"\tsetAttr \".tcls[%i:%i]\"",tcls_start,tcls_end); 758 } appendTipCurlSamples(double tcls)759 void appendTipCurlSamples(double tcls)const 760 { 761 fprintf(mFile," %f",tcls); 762 } endTipCurlSamples()763 void endTipCurlSamples()const 764 { 765 fprintf(mFile,";\n"); 766 } setTipCurlMap(const string & tclm)767 void setTipCurlMap(const string& tclm) 768 { 769 if(tclm == "n/a") return; 770 fprintf(mFile,"\tsetAttr \".tclm\" -type \"string\" "); 771 tclm.write(mFile); 772 fprintf(mFile,";\n"); 773 } setTipCurlMapOffset(float tclmo)774 void setTipCurlMapOffset(float tclmo) 775 { 776 if(tclmo == 0.0) return; 777 fprintf(mFile,"\tsetAttr \".tclmo\" %f;\n", tclmo); 778 } setTipCurlMapMult(float tclmm)779 void setTipCurlMapMult(float tclmm) 780 { 781 if(tclmm == 1.0) return; 782 fprintf(mFile,"\tsetAttr \".tclmm\" %f;\n", tclmm); 783 } setTipCurlNoise(float tcln)784 void setTipCurlNoise(float tcln) 785 { 786 if(tcln == 0.0) return; 787 fprintf(mFile,"\tsetAttr \".tcln\" %f;\n", tcln); 788 } setTipCurlNoiseFreq(float tclnf)789 void setTipCurlNoiseFreq(float tclnf) 790 { 791 if(tclnf == 10.0) return; 792 fprintf(mFile,"\tsetAttr \".tclnf\" %f;\n", tclnf); 793 } setTipCurlSamplesDirty(int tclsd)794 void setTipCurlSamplesDirty(int tclsd) 795 { 796 if(tclsd == 0.0) return; 797 fprintf(mFile,"\tsetAttr \".tclsd\" %i;\n", tclsd); 798 } setTipCurlMapDirty(int tclmd)799 void setTipCurlMapDirty(int tclmd) 800 { 801 if(tclmd == 0.0) return; 802 fprintf(mFile,"\tsetAttr \".tclmd\" %i;\n", tclmd); 803 } setBaseWidth(double dbw)804 void setBaseWidth(double dbw) 805 { 806 if(dbw == 0) return; 807 fprintf(mFile,"\tsetAttr \".dbw\" %f;\n", dbw); 808 } setBaseWidthSamples(size_t bws_i,double bws)809 void setBaseWidthSamples(size_t bws_i,double bws) 810 { 811 if(bws == 0.0) return; 812 fprintf(mFile,"\tsetAttr \".bws[%i]\" %f;\n", bws_i,bws); 813 } setBaseWidthSamples(size_t bws_start,size_t bws_end,double * bws)814 void setBaseWidthSamples(size_t bws_start,size_t bws_end,double* bws) 815 { 816 fprintf(mFile,"\tsetAttr \".bws[%i:%i]\" ", bws_start,bws_end); 817 size_t size = (bws_end-bws_start)*1+1; 818 for(size_t i=0;i<size;++i) 819 { 820 fprintf(mFile,"%f",bws[i]); 821 if(i+1<size) fprintf(mFile," "); 822 } 823 fprintf(mFile,";\n"); 824 } startBaseWidthSamples(size_t bws_start,size_t bws_end)825 void startBaseWidthSamples(size_t bws_start,size_t bws_end)const 826 { 827 fprintf(mFile,"\tsetAttr \".bws[%i:%i]\"",bws_start,bws_end); 828 } appendBaseWidthSamples(double bws)829 void appendBaseWidthSamples(double bws)const 830 { 831 fprintf(mFile," %f",bws); 832 } endBaseWidthSamples()833 void endBaseWidthSamples()const 834 { 835 fprintf(mFile,";\n"); 836 } setBaseWidthMap(const string & bwm)837 void setBaseWidthMap(const string& bwm) 838 { 839 if(bwm == "n/a") return; 840 fprintf(mFile,"\tsetAttr \".bwm\" -type \"string\" "); 841 bwm.write(mFile); 842 fprintf(mFile,";\n"); 843 } setBaseWidthMapOffset(double bwmo)844 void setBaseWidthMapOffset(double bwmo) 845 { 846 if(bwmo == 0) return; 847 fprintf(mFile,"\tsetAttr \".bwmo\" %f;\n", bwmo); 848 } setBaseWidthMapMult(double bwmm)849 void setBaseWidthMapMult(double bwmm) 850 { 851 if(bwmm == 1) return; 852 fprintf(mFile,"\tsetAttr \".bwmm\" %f;\n", bwmm); 853 } setBaseWidthNoise(double bwn)854 void setBaseWidthNoise(double bwn) 855 { 856 if(bwn == 0) return; 857 fprintf(mFile,"\tsetAttr \".bwn\" %f;\n", bwn); 858 } setBaseWidthNoiseFreq(float bwnf)859 void setBaseWidthNoiseFreq(float bwnf) 860 { 861 if(bwnf == 10.0) return; 862 fprintf(mFile,"\tsetAttr \".bwnf\" %f;\n", bwnf); 863 } setBaseWidthSamplesDirty(int bwsd)864 void setBaseWidthSamplesDirty(int bwsd) 865 { 866 if(bwsd == 0.0) return; 867 fprintf(mFile,"\tsetAttr \".bwsd\" %i;\n", bwsd); 868 } setBaseWidthMapDirty(int bwmd)869 void setBaseWidthMapDirty(int bwmd) 870 { 871 if(bwmd == 0.0) return; 872 fprintf(mFile,"\tsetAttr \".bwmd\" %i;\n", bwmd); 873 } setTipWidth(double dtw)874 void setTipWidth(double dtw) 875 { 876 if(dtw == 0) return; 877 fprintf(mFile,"\tsetAttr \".dtw\" %f;\n", dtw); 878 } setTipWidthSamples(size_t tws_i,double tws)879 void setTipWidthSamples(size_t tws_i,double tws) 880 { 881 if(tws == 0.0) return; 882 fprintf(mFile,"\tsetAttr \".tws[%i]\" %f;\n", tws_i,tws); 883 } setTipWidthSamples(size_t tws_start,size_t tws_end,double * tws)884 void setTipWidthSamples(size_t tws_start,size_t tws_end,double* tws) 885 { 886 fprintf(mFile,"\tsetAttr \".tws[%i:%i]\" ", tws_start,tws_end); 887 size_t size = (tws_end-tws_start)*1+1; 888 for(size_t i=0;i<size;++i) 889 { 890 fprintf(mFile,"%f",tws[i]); 891 if(i+1<size) fprintf(mFile," "); 892 } 893 fprintf(mFile,";\n"); 894 } startTipWidthSamples(size_t tws_start,size_t tws_end)895 void startTipWidthSamples(size_t tws_start,size_t tws_end)const 896 { 897 fprintf(mFile,"\tsetAttr \".tws[%i:%i]\"",tws_start,tws_end); 898 } appendTipWidthSamples(double tws)899 void appendTipWidthSamples(double tws)const 900 { 901 fprintf(mFile," %f",tws); 902 } endTipWidthSamples()903 void endTipWidthSamples()const 904 { 905 fprintf(mFile,";\n"); 906 } setTipWidthMap(const string & twm)907 void setTipWidthMap(const string& twm) 908 { 909 if(twm == "n/a") return; 910 fprintf(mFile,"\tsetAttr \".twm\" -type \"string\" "); 911 twm.write(mFile); 912 fprintf(mFile,";\n"); 913 } setTipWidthMapOffset(double twmo)914 void setTipWidthMapOffset(double twmo) 915 { 916 if(twmo == 0) return; 917 fprintf(mFile,"\tsetAttr \".twmo\" %f;\n", twmo); 918 } setTipWidthMapMult(double twmm)919 void setTipWidthMapMult(double twmm) 920 { 921 if(twmm == 1) return; 922 fprintf(mFile,"\tsetAttr \".twmm\" %f;\n", twmm); 923 } setTipWidthNoise(double twn)924 void setTipWidthNoise(double twn) 925 { 926 if(twn == 0) return; 927 fprintf(mFile,"\tsetAttr \".twn\" %f;\n", twn); 928 } setTipWidthNoiseFreq(float twnf)929 void setTipWidthNoiseFreq(float twnf) 930 { 931 if(twnf == 10.0) return; 932 fprintf(mFile,"\tsetAttr \".twnf\" %f;\n", twnf); 933 } setTipWidthSamplesDirty(int twsd)934 void setTipWidthSamplesDirty(int twsd) 935 { 936 if(twsd == 0.0) return; 937 fprintf(mFile,"\tsetAttr \".twsd\" %i;\n", twsd); 938 } setTipWidthMapDirty(int twmd)939 void setTipWidthMapDirty(int twmd) 940 { 941 if(twmd == 0.0) return; 942 fprintf(mFile,"\tsetAttr \".twmd\" %i;\n", twmd); 943 } setScraggle(float ds)944 void setScraggle(float ds) 945 { 946 if(ds == 0.0) return; 947 fprintf(mFile,"\tsetAttr \".ds\" %f;\n", ds); 948 } setScraggleSamples(size_t ss_i,double ss)949 void setScraggleSamples(size_t ss_i,double ss) 950 { 951 if(ss == 0.0) return; 952 fprintf(mFile,"\tsetAttr \".ss[%i]\" %f;\n", ss_i,ss); 953 } setScraggleSamples(size_t ss_start,size_t ss_end,double * ss)954 void setScraggleSamples(size_t ss_start,size_t ss_end,double* ss) 955 { 956 fprintf(mFile,"\tsetAttr \".ss[%i:%i]\" ", ss_start,ss_end); 957 size_t size = (ss_end-ss_start)*1+1; 958 for(size_t i=0;i<size;++i) 959 { 960 fprintf(mFile,"%f",ss[i]); 961 if(i+1<size) fprintf(mFile," "); 962 } 963 fprintf(mFile,";\n"); 964 } startScraggleSamples(size_t ss_start,size_t ss_end)965 void startScraggleSamples(size_t ss_start,size_t ss_end)const 966 { 967 fprintf(mFile,"\tsetAttr \".ss[%i:%i]\"",ss_start,ss_end); 968 } appendScraggleSamples(double ss)969 void appendScraggleSamples(double ss)const 970 { 971 fprintf(mFile," %f",ss); 972 } endScraggleSamples()973 void endScraggleSamples()const 974 { 975 fprintf(mFile,";\n"); 976 } setScraggleMap(const string & sm)977 void setScraggleMap(const string& sm) 978 { 979 if(sm == "n/a") return; 980 fprintf(mFile,"\tsetAttr \".sm\" -type \"string\" "); 981 sm.write(mFile); 982 fprintf(mFile,";\n"); 983 } setScraggleMapOffset(float smo)984 void setScraggleMapOffset(float smo) 985 { 986 if(smo == 0.0) return; 987 fprintf(mFile,"\tsetAttr \".smo\" %f;\n", smo); 988 } setScraggleMapMult(float smm)989 void setScraggleMapMult(float smm) 990 { 991 if(smm == 1.0) return; 992 fprintf(mFile,"\tsetAttr \".smm\" %f;\n", smm); 993 } setScraggleNoise(float sn)994 void setScraggleNoise(float sn) 995 { 996 if(sn == 0.0) return; 997 fprintf(mFile,"\tsetAttr \".sn\" %f;\n", sn); 998 } setScraggleNoiseFreq(float snf)999 void setScraggleNoiseFreq(float snf) 1000 { 1001 if(snf == 10.0) return; 1002 fprintf(mFile,"\tsetAttr \".snf\" %f;\n", snf); 1003 } setScraggleSamplesDirty(int ssd)1004 void setScraggleSamplesDirty(int ssd) 1005 { 1006 if(ssd == 0.0) return; 1007 fprintf(mFile,"\tsetAttr \".ssd\" %i;\n", ssd); 1008 } setScraggleMapDirty(int smd)1009 void setScraggleMapDirty(int smd) 1010 { 1011 if(smd == 0.0) return; 1012 fprintf(mFile,"\tsetAttr \".smd\" %i;\n", smd); 1013 } setScraggleCorrelation(float dsco)1014 void setScraggleCorrelation(float dsco) 1015 { 1016 if(dsco == 0.0) return; 1017 fprintf(mFile,"\tsetAttr \".dsco\" %f;\n", dsco); 1018 } setScraggleCorrelationSamples(size_t scos_i,double scos)1019 void setScraggleCorrelationSamples(size_t scos_i,double scos) 1020 { 1021 if(scos == 0.0) return; 1022 fprintf(mFile,"\tsetAttr \".scos[%i]\" %f;\n", scos_i,scos); 1023 } setScraggleCorrelationSamples(size_t scos_start,size_t scos_end,double * scos)1024 void setScraggleCorrelationSamples(size_t scos_start,size_t scos_end,double* scos) 1025 { 1026 fprintf(mFile,"\tsetAttr \".scos[%i:%i]\" ", scos_start,scos_end); 1027 size_t size = (scos_end-scos_start)*1+1; 1028 for(size_t i=0;i<size;++i) 1029 { 1030 fprintf(mFile,"%f",scos[i]); 1031 if(i+1<size) fprintf(mFile," "); 1032 } 1033 fprintf(mFile,";\n"); 1034 } startScraggleCorrelationSamples(size_t scos_start,size_t scos_end)1035 void startScraggleCorrelationSamples(size_t scos_start,size_t scos_end)const 1036 { 1037 fprintf(mFile,"\tsetAttr \".scos[%i:%i]\"",scos_start,scos_end); 1038 } appendScraggleCorrelationSamples(double scos)1039 void appendScraggleCorrelationSamples(double scos)const 1040 { 1041 fprintf(mFile," %f",scos); 1042 } endScraggleCorrelationSamples()1043 void endScraggleCorrelationSamples()const 1044 { 1045 fprintf(mFile,";\n"); 1046 } setScraggleCorrelationMap(const string & scom)1047 void setScraggleCorrelationMap(const string& scom) 1048 { 1049 if(scom == "n/a") return; 1050 fprintf(mFile,"\tsetAttr \".scom\" -type \"string\" "); 1051 scom.write(mFile); 1052 fprintf(mFile,";\n"); 1053 } setScraggleCorrelationMapOffset(float scomo)1054 void setScraggleCorrelationMapOffset(float scomo) 1055 { 1056 if(scomo == 0.0) return; 1057 fprintf(mFile,"\tsetAttr \".scomo\" %f;\n", scomo); 1058 } setScraggleCorrelationMapMult(float scomm)1059 void setScraggleCorrelationMapMult(float scomm) 1060 { 1061 if(scomm == 1.0) return; 1062 fprintf(mFile,"\tsetAttr \".scomm\" %f;\n", scomm); 1063 } setScraggleCorrelationNoise(float scon)1064 void setScraggleCorrelationNoise(float scon) 1065 { 1066 if(scon == 0.0) return; 1067 fprintf(mFile,"\tsetAttr \".scon\" %f;\n", scon); 1068 } setScraggleCorrelationNoiseFreq(float sconf)1069 void setScraggleCorrelationNoiseFreq(float sconf) 1070 { 1071 if(sconf == 10.0) return; 1072 fprintf(mFile,"\tsetAttr \".sconf\" %f;\n", sconf); 1073 } setScraggleCorrelationSamplesDirty(int scosd)1074 void setScraggleCorrelationSamplesDirty(int scosd) 1075 { 1076 if(scosd == 0.0) return; 1077 fprintf(mFile,"\tsetAttr \".scosd\" %i;\n", scosd); 1078 } setScraggleCorrelationMapDirty(int scomd)1079 void setScraggleCorrelationMapDirty(int scomd) 1080 { 1081 if(scomd == 0.0) return; 1082 fprintf(mFile,"\tsetAttr \".scomd\" %i;\n", scomd); 1083 } setScraggleFrequency(float dscf)1084 void setScraggleFrequency(float dscf) 1085 { 1086 if(dscf == 5.0) return; 1087 fprintf(mFile,"\tsetAttr \".dscf\" %f;\n", dscf); 1088 } setScraggleFrequencySamples(size_t scfs_i,double scfs)1089 void setScraggleFrequencySamples(size_t scfs_i,double scfs) 1090 { 1091 if(scfs == 0.0) return; 1092 fprintf(mFile,"\tsetAttr \".scfs[%i]\" %f;\n", scfs_i,scfs); 1093 } setScraggleFrequencySamples(size_t scfs_start,size_t scfs_end,double * scfs)1094 void setScraggleFrequencySamples(size_t scfs_start,size_t scfs_end,double* scfs) 1095 { 1096 fprintf(mFile,"\tsetAttr \".scfs[%i:%i]\" ", scfs_start,scfs_end); 1097 size_t size = (scfs_end-scfs_start)*1+1; 1098 for(size_t i=0;i<size;++i) 1099 { 1100 fprintf(mFile,"%f",scfs[i]); 1101 if(i+1<size) fprintf(mFile," "); 1102 } 1103 fprintf(mFile,";\n"); 1104 } startScraggleFrequencySamples(size_t scfs_start,size_t scfs_end)1105 void startScraggleFrequencySamples(size_t scfs_start,size_t scfs_end)const 1106 { 1107 fprintf(mFile,"\tsetAttr \".scfs[%i:%i]\"",scfs_start,scfs_end); 1108 } appendScraggleFrequencySamples(double scfs)1109 void appendScraggleFrequencySamples(double scfs)const 1110 { 1111 fprintf(mFile," %f",scfs); 1112 } endScraggleFrequencySamples()1113 void endScraggleFrequencySamples()const 1114 { 1115 fprintf(mFile,";\n"); 1116 } setScraggleFrequencyMap(const string & scfm)1117 void setScraggleFrequencyMap(const string& scfm) 1118 { 1119 if(scfm == "n/a") return; 1120 fprintf(mFile,"\tsetAttr \".scfm\" -type \"string\" "); 1121 scfm.write(mFile); 1122 fprintf(mFile,";\n"); 1123 } setScraggleFrequencyMapOffset(float scfmo)1124 void setScraggleFrequencyMapOffset(float scfmo) 1125 { 1126 if(scfmo == 0.0) return; 1127 fprintf(mFile,"\tsetAttr \".scfmo\" %f;\n", scfmo); 1128 } setScraggleFrequencyMapMult(float scfmm)1129 void setScraggleFrequencyMapMult(float scfmm) 1130 { 1131 if(scfmm == 1.0) return; 1132 fprintf(mFile,"\tsetAttr \".scfmm\" %f;\n", scfmm); 1133 } setScraggleFrequencyNoise(float scfn)1134 void setScraggleFrequencyNoise(float scfn) 1135 { 1136 if(scfn == 0.0) return; 1137 fprintf(mFile,"\tsetAttr \".scfn\" %f;\n", scfn); 1138 } setScraggleFrequencyNoiseFreq(float scfnf)1139 void setScraggleFrequencyNoiseFreq(float scfnf) 1140 { 1141 if(scfnf == 10.0) return; 1142 fprintf(mFile,"\tsetAttr \".scfnf\" %f;\n", scfnf); 1143 } setScraggleFrequencySamplesDirty(int scfsd)1144 void setScraggleFrequencySamplesDirty(int scfsd) 1145 { 1146 if(scfsd == 0.0) return; 1147 fprintf(mFile,"\tsetAttr \".scfsd\" %i;\n", scfsd); 1148 } setScraggleFrequencyMapDirty(int scfmd)1149 void setScraggleFrequencyMapDirty(int scfmd) 1150 { 1151 if(scfmd == 0.0) return; 1152 fprintf(mFile,"\tsetAttr \".scfmd\" %i;\n", scfmd); 1153 } setSegments(float dseg)1154 void setSegments(float dseg) 1155 { 1156 if(dseg == 10) return; 1157 fprintf(mFile,"\tsetAttr \".dseg\" %f;\n", dseg); 1158 } setSegmentsSamples(size_t segs_i,double segs)1159 void setSegmentsSamples(size_t segs_i,double segs) 1160 { 1161 if(segs == 0.0) return; 1162 fprintf(mFile,"\tsetAttr \".segs[%i]\" %f;\n", segs_i,segs); 1163 } setSegmentsSamples(size_t segs_start,size_t segs_end,double * segs)1164 void setSegmentsSamples(size_t segs_start,size_t segs_end,double* segs) 1165 { 1166 fprintf(mFile,"\tsetAttr \".segs[%i:%i]\" ", segs_start,segs_end); 1167 size_t size = (segs_end-segs_start)*1+1; 1168 for(size_t i=0;i<size;++i) 1169 { 1170 fprintf(mFile,"%f",segs[i]); 1171 if(i+1<size) fprintf(mFile," "); 1172 } 1173 fprintf(mFile,";\n"); 1174 } startSegmentsSamples(size_t segs_start,size_t segs_end)1175 void startSegmentsSamples(size_t segs_start,size_t segs_end)const 1176 { 1177 fprintf(mFile,"\tsetAttr \".segs[%i:%i]\"",segs_start,segs_end); 1178 } appendSegmentsSamples(double segs)1179 void appendSegmentsSamples(double segs)const 1180 { 1181 fprintf(mFile," %f",segs); 1182 } endSegmentsSamples()1183 void endSegmentsSamples()const 1184 { 1185 fprintf(mFile,";\n"); 1186 } setSegmentsMap(const string & segm)1187 void setSegmentsMap(const string& segm) 1188 { 1189 if(segm == "n/a") return; 1190 fprintf(mFile,"\tsetAttr \".segm\" -type \"string\" "); 1191 segm.write(mFile); 1192 fprintf(mFile,";\n"); 1193 } setSegmentsMapOffset(float segmo)1194 void setSegmentsMapOffset(float segmo) 1195 { 1196 if(segmo == 0.0) return; 1197 fprintf(mFile,"\tsetAttr \".segmo\" %f;\n", segmo); 1198 } setSegmentsMapMult(float segmm)1199 void setSegmentsMapMult(float segmm) 1200 { 1201 if(segmm == 1.0) return; 1202 fprintf(mFile,"\tsetAttr \".segmm\" %f;\n", segmm); 1203 } setSegmentsNoise(float segn)1204 void setSegmentsNoise(float segn) 1205 { 1206 if(segn == 0.0) return; 1207 fprintf(mFile,"\tsetAttr \".segn\" %f;\n", segn); 1208 } setSegmentsNoiseFreq(float segnf)1209 void setSegmentsNoiseFreq(float segnf) 1210 { 1211 if(segnf == 10.0) return; 1212 fprintf(mFile,"\tsetAttr \".segnf\" %f;\n", segnf); 1213 } setSegmentsSamplesDirty(int segsd)1214 void setSegmentsSamplesDirty(int segsd) 1215 { 1216 if(segsd == 0.0) return; 1217 fprintf(mFile,"\tsetAttr \".segsd\" %i;\n", segsd); 1218 } setSegmentsMapDirty(int segmd)1219 void setSegmentsMapDirty(int segmd) 1220 { 1221 if(segmd == 0.0) return; 1222 fprintf(mFile,"\tsetAttr \".segmd\" %i;\n", segmd); 1223 } setAttraction(float dat)1224 void setAttraction(float dat) 1225 { 1226 if(dat == 1.0) return; 1227 fprintf(mFile,"\tsetAttr \".dat\" %f;\n", dat); 1228 } setAttractionSamples(size_t ats_i,double ats)1229 void setAttractionSamples(size_t ats_i,double ats) 1230 { 1231 if(ats == 0.0) return; 1232 fprintf(mFile,"\tsetAttr \".ats[%i]\" %f;\n", ats_i,ats); 1233 } setAttractionSamples(size_t ats_start,size_t ats_end,double * ats)1234 void setAttractionSamples(size_t ats_start,size_t ats_end,double* ats) 1235 { 1236 fprintf(mFile,"\tsetAttr \".ats[%i:%i]\" ", ats_start,ats_end); 1237 size_t size = (ats_end-ats_start)*1+1; 1238 for(size_t i=0;i<size;++i) 1239 { 1240 fprintf(mFile,"%f",ats[i]); 1241 if(i+1<size) fprintf(mFile," "); 1242 } 1243 fprintf(mFile,";\n"); 1244 } startAttractionSamples(size_t ats_start,size_t ats_end)1245 void startAttractionSamples(size_t ats_start,size_t ats_end)const 1246 { 1247 fprintf(mFile,"\tsetAttr \".ats[%i:%i]\"",ats_start,ats_end); 1248 } appendAttractionSamples(double ats)1249 void appendAttractionSamples(double ats)const 1250 { 1251 fprintf(mFile," %f",ats); 1252 } endAttractionSamples()1253 void endAttractionSamples()const 1254 { 1255 fprintf(mFile,";\n"); 1256 } setAttractionMap(const string & atm)1257 void setAttractionMap(const string& atm) 1258 { 1259 if(atm == "n/a") return; 1260 fprintf(mFile,"\tsetAttr \".atm\" -type \"string\" "); 1261 atm.write(mFile); 1262 fprintf(mFile,";\n"); 1263 } setAttractionMapOffset(float atmo)1264 void setAttractionMapOffset(float atmo) 1265 { 1266 if(atmo == 0.0) return; 1267 fprintf(mFile,"\tsetAttr \".atmo\" %f;\n", atmo); 1268 } setAttractionMapMult(float atmm)1269 void setAttractionMapMult(float atmm) 1270 { 1271 if(atmm == 1.0) return; 1272 fprintf(mFile,"\tsetAttr \".atmm\" %f;\n", atmm); 1273 } setAttractionNoise(float atn)1274 void setAttractionNoise(float atn) 1275 { 1276 if(atn == 0.0) return; 1277 fprintf(mFile,"\tsetAttr \".atn\" %f;\n", atn); 1278 } setAttractionNoiseFreq(float atnf)1279 void setAttractionNoiseFreq(float atnf) 1280 { 1281 if(atnf == 10.0) return; 1282 fprintf(mFile,"\tsetAttr \".atnf\" %f;\n", atnf); 1283 } setAttractionSamplesDirty(int atsd)1284 void setAttractionSamplesDirty(int atsd) 1285 { 1286 if(atsd == 0.0) return; 1287 fprintf(mFile,"\tsetAttr \".atsd\" %i;\n", atsd); 1288 } setAttractionMapDirty(int atmd)1289 void setAttractionMapDirty(int atmd) 1290 { 1291 if(atmd == 0.0) return; 1292 fprintf(mFile,"\tsetAttr \".atmd\" %i;\n", atmd); 1293 } setOffset(double dofs)1294 void setOffset(double dofs) 1295 { 1296 if(dofs == 0) return; 1297 fprintf(mFile,"\tsetAttr \".dofs\" %f;\n", dofs); 1298 } setOffsetSamples(size_t ofss_i,double ofss)1299 void setOffsetSamples(size_t ofss_i,double ofss) 1300 { 1301 if(ofss == 0.0) return; 1302 fprintf(mFile,"\tsetAttr \".ofss[%i]\" %f;\n", ofss_i,ofss); 1303 } setOffsetSamples(size_t ofss_start,size_t ofss_end,double * ofss)1304 void setOffsetSamples(size_t ofss_start,size_t ofss_end,double* ofss) 1305 { 1306 fprintf(mFile,"\tsetAttr \".ofss[%i:%i]\" ", ofss_start,ofss_end); 1307 size_t size = (ofss_end-ofss_start)*1+1; 1308 for(size_t i=0;i<size;++i) 1309 { 1310 fprintf(mFile,"%f",ofss[i]); 1311 if(i+1<size) fprintf(mFile," "); 1312 } 1313 fprintf(mFile,";\n"); 1314 } startOffsetSamples(size_t ofss_start,size_t ofss_end)1315 void startOffsetSamples(size_t ofss_start,size_t ofss_end)const 1316 { 1317 fprintf(mFile,"\tsetAttr \".ofss[%i:%i]\"",ofss_start,ofss_end); 1318 } appendOffsetSamples(double ofss)1319 void appendOffsetSamples(double ofss)const 1320 { 1321 fprintf(mFile," %f",ofss); 1322 } endOffsetSamples()1323 void endOffsetSamples()const 1324 { 1325 fprintf(mFile,";\n"); 1326 } setOffsetMap(const string & ofsm)1327 void setOffsetMap(const string& ofsm) 1328 { 1329 if(ofsm == "n/a") return; 1330 fprintf(mFile,"\tsetAttr \".ofsm\" -type \"string\" "); 1331 ofsm.write(mFile); 1332 fprintf(mFile,";\n"); 1333 } setOffsetMapOffset(double ofsmo)1334 void setOffsetMapOffset(double ofsmo) 1335 { 1336 if(ofsmo == 0) return; 1337 fprintf(mFile,"\tsetAttr \".ofsmo\" %f;\n", ofsmo); 1338 } setOffsetMapMult(double ofsmm)1339 void setOffsetMapMult(double ofsmm) 1340 { 1341 if(ofsmm == 1) return; 1342 fprintf(mFile,"\tsetAttr \".ofsmm\" %f;\n", ofsmm); 1343 } setOffsetNoise(double ofsn)1344 void setOffsetNoise(double ofsn) 1345 { 1346 if(ofsn == 0) return; 1347 fprintf(mFile,"\tsetAttr \".ofsn\" %f;\n", ofsn); 1348 } setOffsetNoiseFreq(float ofsnf)1349 void setOffsetNoiseFreq(float ofsnf) 1350 { 1351 if(ofsnf == 10.0) return; 1352 fprintf(mFile,"\tsetAttr \".ofsnf\" %f;\n", ofsnf); 1353 } setOffsetSamplesDirty(int ofssd)1354 void setOffsetSamplesDirty(int ofssd) 1355 { 1356 if(ofssd == 0.0) return; 1357 fprintf(mFile,"\tsetAttr \".ofssd\" %i;\n", ofssd); 1358 } setOffsetMapDirty(int ofsmd)1359 void setOffsetMapDirty(int ofsmd) 1360 { 1361 if(ofsmd == 0.0) return; 1362 fprintf(mFile,"\tsetAttr \".ofsmd\" %i;\n", ofsmd); 1363 } setClumping(float dc)1364 void setClumping(float dc) 1365 { 1366 if(dc == 0.0) return; 1367 fprintf(mFile,"\tsetAttr \".dc\" %f;\n", dc); 1368 } setClumpingSamples(size_t cs_i,double cs)1369 void setClumpingSamples(size_t cs_i,double cs) 1370 { 1371 if(cs == 0.0) return; 1372 fprintf(mFile,"\tsetAttr \".cs[%i]\" %f;\n", cs_i,cs); 1373 } setClumpingSamples(size_t cs_start,size_t cs_end,double * cs)1374 void setClumpingSamples(size_t cs_start,size_t cs_end,double* cs) 1375 { 1376 fprintf(mFile,"\tsetAttr \".cs[%i:%i]\" ", cs_start,cs_end); 1377 size_t size = (cs_end-cs_start)*1+1; 1378 for(size_t i=0;i<size;++i) 1379 { 1380 fprintf(mFile,"%f",cs[i]); 1381 if(i+1<size) fprintf(mFile," "); 1382 } 1383 fprintf(mFile,";\n"); 1384 } startClumpingSamples(size_t cs_start,size_t cs_end)1385 void startClumpingSamples(size_t cs_start,size_t cs_end)const 1386 { 1387 fprintf(mFile,"\tsetAttr \".cs[%i:%i]\"",cs_start,cs_end); 1388 } appendClumpingSamples(double cs)1389 void appendClumpingSamples(double cs)const 1390 { 1391 fprintf(mFile," %f",cs); 1392 } endClumpingSamples()1393 void endClumpingSamples()const 1394 { 1395 fprintf(mFile,";\n"); 1396 } setClumpingMap(const string & cm)1397 void setClumpingMap(const string& cm) 1398 { 1399 if(cm == "n/a") return; 1400 fprintf(mFile,"\tsetAttr \".cm\" -type \"string\" "); 1401 cm.write(mFile); 1402 fprintf(mFile,";\n"); 1403 } setClumpingMapOffset(float cmo)1404 void setClumpingMapOffset(float cmo) 1405 { 1406 if(cmo == 0.0) return; 1407 fprintf(mFile,"\tsetAttr \".cmo\" %f;\n", cmo); 1408 } setClumpingMapMult(float cmm)1409 void setClumpingMapMult(float cmm) 1410 { 1411 if(cmm == 0.0) return; 1412 fprintf(mFile,"\tsetAttr \".cmm\" %f;\n", cmm); 1413 } setClumpingNoise(float cn)1414