File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2662,12 +2662,16 @@ namespace Skirt {
2662
2662
2663
2663
} // namespace Skirt
2664
2664
2665
- inline std::string get_instance_name (const PrintObject *object, const PrintInstance &inst) {
2666
- return (boost::format (" %1%_id_%2%_copy_%3%" ) % object->model_object ()->name % object->get_id () % inst.id ).str ();
2665
+ inline std::string get_instance_name (const PrintObject *object, size_t inst_id) {
2666
+ auto obj_name = object->model_object ()->name ;
2667
+ // replace space in obj_name with '-'
2668
+ std::replace (obj_name.begin (), obj_name.end (), ' ' , ' _' );
2669
+
2670
+ return (boost::format (" %1%_id_%2%_copy_%3%" ) % obj_name % object->get_id () % inst_id).str ();
2667
2671
}
2668
2672
2669
- inline std::string get_instance_name (const PrintObject *object, size_t inst_id ) {
2670
- return ( boost::format ( " %1%_id_%2%_copy_%3% " ) % object-> model_object ()-> name % object-> get_id () % inst_id). str ( );
2673
+ inline std::string get_instance_name (const PrintObject *object, const PrintInstance &inst ) {
2674
+ return get_instance_name ( object, inst. id );
2671
2675
}
2672
2676
2673
2677
// In sequential mode, process_layer is called once per each object and its copy,
You can’t perform that action at this time.
0 commit comments