mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
Store object and volume names in the new 'name' property instead of relying on material id
This commit is contained in:
@@ -186,6 +186,7 @@ ModelObject::ModelObject(Model *model)
|
||||
|
||||
ModelObject::ModelObject(Model *model, const ModelObject &other)
|
||||
: model(model),
|
||||
name(other.name),
|
||||
input_file(other.input_file),
|
||||
instances(),
|
||||
volumes(),
|
||||
@@ -321,7 +322,8 @@ ModelVolume::ModelVolume(ModelObject* object, const TriangleMesh &mesh)
|
||||
{}
|
||||
|
||||
ModelVolume::ModelVolume(ModelObject* object, const ModelVolume &other)
|
||||
: object(object), mesh(other.mesh), config(other.config), modifier(other.modifier)
|
||||
: object(object), name(other.name), mesh(other.mesh), config(other.config),
|
||||
modifier(other.modifier)
|
||||
{
|
||||
this->material_id(other.material_id());
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ class ModelObject
|
||||
{
|
||||
friend class Model;
|
||||
public:
|
||||
std::string name;
|
||||
std::string input_file;
|
||||
ModelInstancePtrs instances;
|
||||
ModelVolumePtrs volumes;
|
||||
@@ -138,6 +139,7 @@ class ModelVolume
|
||||
{
|
||||
friend class ModelObject;
|
||||
public:
|
||||
std::string name;
|
||||
TriangleMesh mesh;
|
||||
DynamicPrintConfig config;
|
||||
bool modifier;
|
||||
|
||||
@@ -136,6 +136,10 @@ ModelMaterial::attributes()
|
||||
int instances_count()
|
||||
%code%{ RETVAL = THIS->instances.size(); %};
|
||||
|
||||
std::string name()
|
||||
%code%{ RETVAL = THIS->name; %};
|
||||
void set_name(std::string value)
|
||||
%code%{ THIS->name = value; %};
|
||||
std::string input_file()
|
||||
%code%{ RETVAL = THIS->input_file; %};
|
||||
void set_input_file(std::string value)
|
||||
@@ -162,6 +166,10 @@ ModelMaterial::attributes()
|
||||
Ref<ModelObject> object()
|
||||
%code%{ RETVAL = THIS->get_object(); %};
|
||||
|
||||
std::string name()
|
||||
%code%{ RETVAL = THIS->name; %};
|
||||
void set_name(std::string value)
|
||||
%code%{ THIS->name = value; %};
|
||||
t_model_material_id material_id();
|
||||
void set_material_id(t_model_material_id material_id)
|
||||
%code%{ THIS->material_id(material_id); %};
|
||||
|
||||
Reference in New Issue
Block a user