diff --git a/Assets/common/default_brush.json b/Assets/common/default_brush.json index 5de497ae..a2c0332b 100644 --- a/Assets/common/default_brush.json +++ b/Assets/common/default_brush.json @@ -1 +1 @@ -{"name":"Brush","nodes":[{"id":3,"name":"Input","type":"InputNode","x":83,"y":218,"color":-11959648,"inputs":[{"id":3,"node_id":3,"name":"Lazy Radius","type":"VALUE","color":-6184543,"default_value":0.0},{"id":3,"node_id":3,"name":"Lazy Step","type":"VALUE","color":-6184543,"default_value":0.0}],"outputs":[{"id":3,"node_id":3,"name":"Position","type":"VECTOR","color":-10238109,"default_value":null}],"buttons":[]},{"id":5,"name":"Brush Output","type":"BrushOutputNode","x":311,"y":192,"color":-11959648,"inputs":[{"id":5,"node_id":5,"name":"Position","type":"VECTOR","color":-10238109,"default_value":[0,0,0]},{"id":5,"node_id":5,"name":"Radius","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Scale","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Angle","type":"VALUE","color":-6184543,"default_value":0.0},{"id":5,"node_id":5,"name":"Opacity","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Hardness","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Stencil","type":"VALUE","color":-6184543,"default_value":1.0}],"outputs":[],"buttons":[{"name": "Directional","type": "BOOL","default_value": false,"output": 0}]}],"links":[{"id":0,"from_id":3,"from_socket":0,"to_id":5,"to_socket":0}]} \ No newline at end of file +{"name":"Brush","nodes":[{"id":3,"name":"Input","type":"InputNode","x":83,"y":218,"color":-11959648,"inputs":[{"id":3,"node_id":3,"name":"Lazy Radius","type":"VALUE","color":-6184543,"default_value":0.0},{"id":3,"node_id":3,"name":"Lazy Step","type":"VALUE","color":-6184543,"default_value":0.0}],"outputs":[{"id":3,"node_id":3,"name":"Position","type":"VECTOR","color":-10238109,"default_value":null}],"buttons":[]},{"id":5,"name":"Brush Output","type":"BrushOutputNode","x":311,"y":192,"color":-11959648,"inputs":[{"id":5,"node_id":5,"name":"Position","type":"VECTOR","color":-10238109,"default_value":[0,0,0]},{"id":5,"node_id":5,"name":"Radius","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Scale","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Angle","type":"VALUE","color":-6184543,"default_value":0.0,"max":360},{"id":5,"node_id":5,"name":"Opacity","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Hardness","type":"VALUE","color":-6184543,"default_value":1.0},{"id":5,"node_id":5,"name":"Stencil","type":"VALUE","color":-6184543,"default_value":1.0}],"outputs":[],"buttons":[{"name": "Directional","type": "BOOL","default_value": false,"output": 0}]}],"links":[{"id":0,"from_id":3,"from_socket":0,"to_id":5,"to_socket":0}]} \ No newline at end of file diff --git a/Sources/arm/ui/UISidebar.hx b/Sources/arm/ui/UISidebar.hx index f05ed506..150e2286 100644 --- a/Sources/arm/ui/UISidebar.hx +++ b/Sources/arm/ui/UISidebar.hx @@ -927,7 +927,11 @@ class UISidebar { // Show picked material next to cursor if (Context.tool == ToolPicker && pickerSelectMaterial) { var img = Context.material.imageIcon; + #if kha_opengl + g.drawScaledImage(img, mx + 10, my + 10 + img.height, img.width, -img.height); + #else g.drawImage(img, mx + 10, my + 10); + #end } var cursorImg = Res.get("cursor.k"); diff --git a/Sources/arm/util/RenderUtil.hx b/Sources/arm/util/RenderUtil.hx index 650831c9..7d7d7639 100644 --- a/Sources/arm/util/RenderUtil.hx +++ b/Sources/arm/util/RenderUtil.hx @@ -321,7 +321,11 @@ class RenderUtil { // scons[_si] = _scon; // mcons[_mi] = _mcon; Context.material = _material; - MaterialParser.parsePaintMaterial(); + function _parse(_) { + MaterialParser.parsePaintMaterial(); + iron.App.removeRender(_parse); + } + iron.App.notifyOnRender(_parse); // Restore paint mesh planeo.visible = false;