mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
add -C to egg2obj
This commit is contained in:
parent
d995a97ca1
commit
f7353b79e7
@ -38,6 +38,11 @@ EggToObj() :
|
||||
"Specify the coordinate system of the resulting " + _format_name +
|
||||
" file. Normally, this is z-up.");
|
||||
|
||||
add_option
|
||||
("C", "", 0,
|
||||
"Clean out higher-order polygons by subdividing into triangles.",
|
||||
&EggToObj::dispatch_none, &_triangulate_polygons);
|
||||
|
||||
_coordinate_system = CS_zup_right;
|
||||
_got_coordinate_system = true;
|
||||
}
|
||||
@ -49,6 +54,12 @@ EggToObj() :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void EggToObj::
|
||||
run() {
|
||||
if (_triangulate_polygons) {
|
||||
nout << "Triangulating polygons.\n";
|
||||
int num_produced = _data->triangulate_polygons(~0);
|
||||
nout << " (" << num_produced << " triangles produced.)\n";
|
||||
}
|
||||
|
||||
_data->flatten_transforms();
|
||||
collect_vertices(_data);
|
||||
|
||||
|
@ -63,6 +63,8 @@ private:
|
||||
const UniqueVertices &unique);
|
||||
|
||||
private:
|
||||
bool _triangulate_polygons;
|
||||
|
||||
UniqueVertices _unique_vert3, _unique_vert4, _unique_uv2, _unique_uv3, _unique_norm;
|
||||
VertexMap _vmap;
|
||||
EggGroupNode *_current_group;
|
||||
|
Loading…
x
Reference in New Issue
Block a user