mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 17:57:55 -06:00
Add check for platform mesh & texture
It simply checks if the file exists
This commit is contained in:
parent
c3b447cd89
commit
338f9c0052
8 changed files with 11 additions and 7 deletions
|
@ -8,7 +8,6 @@
|
|||
"manufacturer": "Cubicon",
|
||||
"visible": true,
|
||||
"file_formats": "text/x-gcode",
|
||||
"platform": "",
|
||||
"supports_usb_connection": false,
|
||||
"machine_extruder_trains": {
|
||||
"0": "cubicon_3dp_110f_extruder_0"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
"manufacturer": "Cubicon",
|
||||
"visible": true,
|
||||
"file_formats": "text/x-gcode",
|
||||
"platform": "",
|
||||
"supports_usb_connection": false,
|
||||
"machine_extruder_trains": {
|
||||
"0": "cubicon_3dp_210f_extruder_0"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
"manufacturer": "Cubicon",
|
||||
"visible": true,
|
||||
"file_formats": "text/x-gcode",
|
||||
"platform": "",
|
||||
"supports_usb_connection": false,
|
||||
"machine_extruder_trains": {
|
||||
"0": "cubicon_3dp_310f_extruder_0"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
"manufacturer": "Deltaprintr",
|
||||
"file_formats": "text/x-gcode",
|
||||
"platform_offset": [0, 0, 0],
|
||||
"platform": "",
|
||||
"machine_extruder_trains":
|
||||
{
|
||||
"0": "delta_go_extruder_0"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
"author": "Chris Pearson",
|
||||
"manufacturer": "Printrbot",
|
||||
"file_formats": "text/x-gcode",
|
||||
"platform": "",
|
||||
"machine_extruder_trains":
|
||||
{
|
||||
"0": "printrbot_play_heated_extruder_0"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
"manufacturer": "uBuild-3D",
|
||||
"category": "Other",
|
||||
"file_formats": "text/x-gcode",
|
||||
"platform": "mr_bot_280_platform.stl",
|
||||
"has_materials": true,
|
||||
"preferred_quality_type": "draft",
|
||||
"machine_extruder_trains":
|
||||
|
|
|
@ -18,7 +18,8 @@ Resources.addSearchPath(os.path.abspath(os.path.join(os.path.dirname(__file__),
|
|||
|
||||
|
||||
machine_filepaths = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "definitions"))
|
||||
|
||||
all_meshes = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "meshes"))
|
||||
all_images = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "images"))
|
||||
|
||||
@pytest.fixture
|
||||
def definition_container():
|
||||
|
@ -44,5 +45,13 @@ def isDefinitionValid(definition_container, path, file_name):
|
|||
parser, is_valid = definition_container.readAndValidateSerialized(json)
|
||||
if not is_valid:
|
||||
print("The definition '{0}', has invalid data.".format(file_name))
|
||||
metadata = DefinitionContainer.deserializeMetadata(json, "whatever")
|
||||
|
||||
# If the definition defines a platform file, it should be in /resources/meshes/
|
||||
if "platform" in metadata[0]:
|
||||
assert metadata[0]["platform"] in all_meshes
|
||||
|
||||
if "platform_texture" in metadata[0]:
|
||||
assert metadata[0]["platform_texture"] in all_images
|
||||
|
||||
return is_valid
|
||||
|
|
|
@ -41,6 +41,7 @@ def collectAllSettingIds():
|
|||
definition_container.deserialize(data.read())
|
||||
return definition_container.getAllKeys()
|
||||
|
||||
|
||||
def collectAllVariants():
|
||||
result = []
|
||||
for root, directories, filenames in os.walk(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "variants"))):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue