Skip to content

Commit f72fc16

Browse files
committed
mesh(use_value)
1 parent c66c2aa commit f72fc16

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

voxec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,17 +1286,18 @@ class op_create_prop_filter : public voxel_operation {
12861286
class op_mesh : public voxel_operation {
12871287
public:
12881288
const std::vector<argument_spec>& arg_names() const {
1289-
static std::vector<argument_spec> nm_ = { { true, "input", "voxels" }, { true, "filename", "string"} };
1289+
static std::vector<argument_spec> nm_ = { { true, "input", "voxels" }, { true, "filename", "string"}, {false, "use_value", "integer"} };
12901290
return nm_;
12911291
}
12921292
symbol_value invoke(const scope_map& scope) const {
12931293
auto voxels = scope.get_value<abstract_voxel_storage*>("input");
1294+
auto use_value = scope.get_value_or<int>("use_value", -1);
12941295
auto filename = scope.get_value<std::string>("filename");
12951296
std::ofstream ofs(filename.c_str());
12961297
if (voxels->value_bits() == 1) {
12971298
((regular_voxel_storage*)voxels)->obj_export(ofs);
12981299
} else {
1299-
((regular_voxel_storage*)voxels)->obj_export(ofs, false, true);
1300+
((regular_voxel_storage*)voxels)->obj_export(ofs, use_value != 1, use_value == 1);
13001301
}
13011302
symbol_value v;
13021303
return v;

0 commit comments

Comments
 (0)