Improve project import
This commit is contained in:
@@ -61,7 +61,7 @@ class Project {
|
||||
for (m in UITrait.inst.materials) {
|
||||
var c = Reflect.copy(UINodes.inst.canvasMap.get(m));
|
||||
for (n in c.nodes) {
|
||||
if (n.type == "TEX_IMAGE") {
|
||||
if (n.type == "TEX_IMAGE") { // Convert image path from absolute to relative
|
||||
n.buttons[0].data = toRelative(UITrait.inst.projectPath, n.buttons[0].data);
|
||||
}
|
||||
}
|
||||
@@ -236,10 +236,13 @@ class Project {
|
||||
UITrait.inst.materials = [];
|
||||
for (n in project.material_nodes) {
|
||||
for (node in n.nodes) {
|
||||
if (node.type == "TEX_IMAGE") {
|
||||
if (node.type == "TEX_IMAGE") { // Convert image path from relative to absolute
|
||||
var abs = base + node.buttons[0].data;
|
||||
node.buttons[0].data = abs;
|
||||
}
|
||||
for (inp in node.inputs) { // Round input socket values
|
||||
if (inp.type == "VALUE") inp.default_value = Math.round(inp.default_value * 100) / 100;
|
||||
}
|
||||
}
|
||||
var mat = new MaterialSlot(m0);
|
||||
UINodes.inst.canvasMap.set(mat, n);
|
||||
|
||||
@@ -1301,7 +1301,9 @@ class UITrait extends iron.Trait {
|
||||
}
|
||||
}
|
||||
else {
|
||||
brushRadius = ui.slider(brushRadiusHandle, "Radius", 0.0, 2.0, true);
|
||||
if (selectedTool != ToolFill) {
|
||||
brushRadius = ui.slider(brushRadiusHandle, "Radius", 0.0, 2.0, true);
|
||||
}
|
||||
|
||||
if (selectedTool == ToolBrush ||
|
||||
selectedTool == ToolFill ||
|
||||
@@ -1319,7 +1321,7 @@ class UITrait extends iron.Trait {
|
||||
|
||||
brushOpacity = ui.slider(Id.handle({value: brushOpacity}), "Opacity", 0.0, 1.0, true);
|
||||
|
||||
if (selectedTool == ToolBrush || selectedTool == ToolEraser || selectedTool == ToolFill) {
|
||||
if (selectedTool == ToolBrush || selectedTool == ToolEraser) {
|
||||
brushHardness = ui.slider(Id.handle({value: brushHardness}), "Hardness", 0.0, 1.0, true);
|
||||
}
|
||||
if (selectedTool == ToolBrush || selectedTool == ToolEraser || selectedTool == ToolFill || selectedTool == ToolClone || selectedTool == ToolBlur) {
|
||||
@@ -1337,7 +1339,7 @@ class UITrait extends iron.Trait {
|
||||
}
|
||||
|
||||
if (selectedTool == ToolFill) {
|
||||
ui.combo(fillTypeHandle, ["Object", "Face"], "Fill");
|
||||
ui.combo(fillTypeHandle, ["Object", "Face"], "Fill Mode");
|
||||
if (fillTypeHandle.changed) {
|
||||
if (fillTypeHandle.position == 1) {
|
||||
ui.g.end();
|
||||
@@ -2305,9 +2307,9 @@ class UITrait extends iron.Trait {
|
||||
ui.g.begin(false);
|
||||
armory.data.Config.save();
|
||||
}
|
||||
ui.row([1/2, 1/2]);
|
||||
// ui.row([1/2, 1/2]);
|
||||
penPressure = ui.check(Id.handle({selected: penPressure}), "Pen Pressure");
|
||||
instantMat = ui.check(Id.handle({selected: instantMat}), "Material Preview");
|
||||
// instantMat = ui.check(Id.handle({selected: instantMat}), "Material Preview");
|
||||
}
|
||||
|
||||
#if arm_debug
|
||||
|
||||
Reference in New Issue
Block a user