mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Include transparency values
This commit is contained in:
parent
6094899dc2
commit
199b56d5ac
1 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include "lc_math.h"
|
#include "lc_math.h"
|
||||||
#include "lc_mesh.h"
|
#include "lc_mesh.h"
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <string.h>
|
||||||
#include "pieceinf.h"
|
#include "pieceinf.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
|
@ -1717,11 +1718,14 @@ void Project::ExportWavefront(const QString& FileName)
|
||||||
OBJFile.WriteLine(Line);
|
OBJFile.WriteLine(Line);
|
||||||
|
|
||||||
FILE* mat = fopen(buf, "wt");
|
FILE* mat = fopen(buf, "wt");
|
||||||
fputs("# Colors used by LeoCAD\n# You need to add transparency values\n#\n\n", mat);
|
fputs("# Colors used by LeoCAD\n\n", mat);
|
||||||
for (int ColorIdx = 0; ColorIdx < gColorList.GetSize(); ColorIdx++)
|
for (int ColorIdx = 0; ColorIdx < gColorList.GetSize(); ColorIdx++)
|
||||||
{
|
{
|
||||||
lcColor* Color = &gColorList[ColorIdx];
|
lcColor* Color = &gColorList[ColorIdx];
|
||||||
fprintf(mat, "newmtl %s\nKd %.2f %.2f %.2f\n\n", Color->SafeName, Color->Value[0], Color->Value[1], Color->Value[2]);
|
if (Color->Translucent)
|
||||||
|
fprintf(mat, "newmtl %s\nD 0.2\nKd %.2f %.2f %.2f\n\n", Color->SafeName, Color->Value[0], Color->Value[1], Color->Value[2]);
|
||||||
|
else
|
||||||
|
fprintf(mat, "newmtl %s\nKd %.2f %.2f %.2f\n\n", Color->SafeName, Color->Value[0], Color->Value[1], Color->Value[2]);
|
||||||
}
|
}
|
||||||
fclose(mat);
|
fclose(mat);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue