(2018-02-12, 18:15)Roland Melkert Wrote:(2018-02-12, 2:07)Michael Horvath Wrote: LDCad seems to assign ldMat382 to parts in a model I created in MLCad. I don't understand why it does that, since I did not set this color manually.
If you're talking about datsville, building_024_andershouse.ldr is using color 382. So even if its not in the LDConfig.ldr pallette the missing color willl be gray and yellow dithered.
Below is how I handle those colors, the actual RGB is (a+b)/2 of the two source colors.
might be useful for your script:
Code:if (calcMissingDitheredMaterial) { int cnt=0; TLDMaterial *a, *b, *mat; for (int i=256; i<512; i++) { mat=findMaterial(i); if (mat==NULL || mat->isMissing()) { a=findMaterial((i-256) >> 4); b=findMaterial((i-256) & 0x0F); if (a!=NULL && b!=NULL) { if (mat==NULL) { mat=new TLDMaterial(i, a, b); addMaterial(mat); } else mat->reInit(i, a, b); ++cnt; } } } LOG_REPORT1(log, LL_Progress, logMsg_LDraw_doneCalcDitherMat, cnt); }
My mistake. I changed the color in building_024_andershouse.ldr to light gray.