forked from mitsuba-renderer/mitsuba2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mesh: added a constructor to convert a Blender mesh
- Loading branch information
Showing
4 changed files
with
281 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
|
||
// Blender Mesh format types for the exporter | ||
NAMESPACE_BEGIN(blender) | ||
static const int ME_SMOOTH = 1 << 0; // smooth shading flag | ||
|
||
/// Triangle tesselation of the mesh, contains references to 3 MLoop and the "real" face | ||
struct MLoopTri { | ||
unsigned int tri[3]; | ||
unsigned int poly; | ||
}; | ||
|
||
struct MLoopUV { | ||
float uv[2]; | ||
int flag; | ||
}; | ||
|
||
struct MLoopCol { | ||
unsigned char r, g, b, a; | ||
}; | ||
|
||
struct MLoop { | ||
/// Vertex index. | ||
unsigned int v; | ||
/// Edge index. | ||
unsigned int e; | ||
}; | ||
|
||
/// Contains info about the face, like material ID and smooth shading flag | ||
struct MPoly { | ||
/// Offset into loop array and number of loops in the face | ||
int loopstart; | ||
int totloop; | ||
short mat_nr; | ||
char flag, _pad; | ||
}; | ||
|
||
struct MVert { | ||
float co[3]; // position | ||
short no[3]; // normal | ||
char flag, bweight; | ||
}; | ||
NAMESPACE_END(blender) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters