Browse Source

Merge branch 'master' into CURA-5744-move-oauth-login

ChrisTerBeke 6 years ago
parent
commit
185a1707b2

+ 1 - 1
cura.desktop.in

@@ -13,6 +13,6 @@ TryExec=@CMAKE_INSTALL_FULL_BINDIR@/cura
 Icon=cura-icon
 Terminal=false
 Type=Application
-MimeType=application/sla;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml;
+MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml;
 Categories=Graphics;
 Keywords=3D;Printing;Slicer;

+ 1 - 1
cura.sharedmimeinfo

@@ -6,7 +6,7 @@
         <glob-deleteall/>
         <glob pattern="*.3mf"/>
     </mime-type>
-    <mime-type type="application/sla">
+    <mime-type type="model/stl">
         <comment>Computer-aided design and manufacturing format</comment>
         <icon name="unknown"/>
         <glob-deleteall/>

+ 1 - 2
cura/CuraApplication.py

@@ -83,7 +83,6 @@ from cura.Settings.SettingInheritanceManager import SettingInheritanceManager
 from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager
 
 from cura.Machines.VariantManager import VariantManager
-from plugins.SliceInfoPlugin.SliceInfo import SliceInfo
 
 from .SingleInstance import SingleInstance
 from .AutoSave import AutoSave
@@ -1722,7 +1721,7 @@ class CuraApplication(QtApplication):
     @pyqtSlot()
     def showMoreInformationDialogForAnonymousDataCollection(self):
         try:
-            slice_info = cast(SliceInfo, self._plugin_registry.getPluginObject("SliceInfoPlugin"))
+            slice_info = self._plugin_registry.getPluginObject("SliceInfoPlugin")
             slice_info.showMoreInfoDialog()
         except PluginNotFoundError:
             Logger.log("w", "Plugin SliceInfo was not found, so not able to show the info dialog.")

+ 5 - 2
cura/Machines/MaterialManager.py

@@ -337,6 +337,7 @@ class MaterialManager(QObject):
         machine_exclude_materials = machine_definition.getMetaDataEntry("exclude_materials", [])
 
         material_id_metadata_dict = dict()  # type: Dict[str, MaterialNode]
+        excluded_materials = set()
         for current_node in nodes_to_check:
             if current_node is None:
                 continue
@@ -345,13 +346,15 @@ class MaterialManager(QObject):
             # Do not exclude other materials that are of the same type.
             for material_id, node in current_node.material_map.items():
                 if material_id in machine_exclude_materials:
-                    Logger.log("d", "Exclude material [%s] for machine [%s]",
-                               material_id, machine_definition.getId())
+                    excluded_materials.add(material_id)
                     continue
 
                 if material_id not in material_id_metadata_dict:
                     material_id_metadata_dict[material_id] = node
 
+        if excluded_materials:
+            Logger.log("d", "Exclude materials {excluded_materials} for machine {machine_definition_id}".format(excluded_materials = ", ".join(excluded_materials), machine_definition_id = machine_definition_id))
+
         return material_id_metadata_dict
 
     #

+ 1 - 1
cura/Settings/CuraContainerStack.py

@@ -291,7 +291,7 @@ class CuraContainerStack(ContainerStack):
 
     # Helper to make sure we emit a PyQt signal on container changes.
     def _onContainersChanged(self, container: Any) -> None:
-        self.pyqtContainersChanged.emit()
+        Application.getInstance().callLater(self.pyqtContainersChanged.emit)
 
     # Helper that can be overridden to get the "machine" definition, that is, the definition that defines the machine
     # and its properties rather than, for example, the extruder. Defaults to simply returning the definition property.

+ 3 - 1
plugins/SimulationView/layers3d.shader

@@ -256,6 +256,7 @@ fragment41core =
     out vec4 frag_color;
 
     uniform mediump vec4 u_ambientColor;
+    uniform mediump vec4 u_minimumAlbedo;
     uniform highp vec3 u_lightPosition;
 
     void main()
@@ -263,7 +264,7 @@ fragment41core =
         mediump vec4 finalColor = vec4(0.0);
         float alpha = f_color.a;
 
-        finalColor.rgb += f_color.rgb * 0.3;
+        finalColor.rgb += f_color.rgb * 0.2 + u_minimumAlbedo.rgb;
 
         highp vec3 normal = normalize(f_normal);
         highp vec3 light_dir = normalize(u_lightPosition - f_vertex);
@@ -285,6 +286,7 @@ u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
 u_specularColor = [0.4, 0.4, 0.4, 1.0]
 u_ambientColor = [0.3, 0.3, 0.3, 0.0]
 u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
+u_minimumAlbedo = [0.1, 0.1, 0.1, 1.0]
 u_shininess = 20.0
 
 u_show_travel_moves = 0

+ 1 - 1
resources/definitions/creality_cr10.def.json

@@ -37,7 +37,7 @@
         "top_bottom_thickness": {
             "default_value": 0.6
         },
-        "top_bottom_pattern": {
+        "top_bottom_pattern_0": {
             "default_value": "concentric"
         },
         "infill_pattern": {

+ 0 - 1
resources/qml/Menus/SettingVisibilityPresetsMenu.qml

@@ -29,7 +29,6 @@ Menu
             onTriggered:
             {
                 settingVisibilityPresetsModel.setActivePreset(model.id);
-                showSettingVisibilityProfile();
             }
         }
 

+ 12 - 1
resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml

@@ -27,9 +27,20 @@ Item
 
     function updateMaterialPropertiesObject()
     {
+        // DRAGON WARNING!!! DO NOT TOUCH THIS IF YOU DON'T KNOW.
+        // TL;DR: Always update "container_id" first!
+        //
+        // Other widgets such as MaterialsView have bindings towards "materialProperties" and its properties. Here the
+        // properties are updated one by one, and each change can trigger a reaction on those widgets that have
+        // connections to the property gets changed, and some reactions will use functions such as
+        // ContainerManager.getContainerMetaDataEntry() to fetch data using the "container_id" as the reference.
+        // We need to change "container_id" first so any underlying triggers will use the correct "container_id" to
+        // fetch data. Or, for example, if we change GUID first, which triggered the weight widget to fetch weight
+        // before we can update "container_id", so it will fetch weight with the wrong (old) "container_id".
+        materialProperties.container_id = currentItem.id
+
         materialProperties.name = currentItem.name || "Unknown"
         materialProperties.guid = currentItem.GUID
-        materialProperties.container_id = currentItem.id
         materialProperties.brand = currentItem.brand || "Unknown"
         materialProperties.material = currentItem.material || "Unknown"
         materialProperties.color_name = currentItem.color_name || "Yellow"

+ 17 - 3
resources/qml/Preferences/Materials/MaterialsList.qml

@@ -17,9 +17,23 @@ Item
 
     // Children
     UM.I18nCatalog { id: catalog; name: "cura"; }
-    Cura.MaterialBrandsModel { id: materialsModel }
-    Cura.FavoriteMaterialsModel { id: favoriteMaterialsModel }
-    Cura.GenericMaterialsModel { id: genericMaterialsModel }
+    Cura.MaterialBrandsModel
+    {
+        id: materialsModel
+        extruderPosition: Cura.ExtruderManager.activeExtruderIndex
+    }
+
+    Cura.FavoriteMaterialsModel
+    {
+        id: favoriteMaterialsModel
+        extruderPosition: Cura.ExtruderManager.activeExtruderIndex
+    }
+
+    Cura.GenericMaterialsModel
+    {
+        id: genericMaterialsModel
+        extruderPosition: Cura.ExtruderManager.activeExtruderIndex
+    }
 
     property var currentType: null
     property var currentBrand: null