Begin layer groups

This commit is contained in:
luboslenco
2020-01-26 13:54:27 +01:00
parent e4220b1765
commit 4a8af01940
7 changed files with 221 additions and 67 deletions
+4 -4
View File
@@ -34,7 +34,7 @@ class MakeMesh {
vert.write('float height = 0.0;');
var numLayers = 0;
for (l in Project.layers) {
if (!l.visible) continue;
if (!l.isVisible() || l.getChildren() != null) continue;
if (numLayers > 16) break;
numLayers++;
vert.add_uniform('sampler2D texpaint_pack_vert' + l.id, '_texpaint_pack_vert' + l.id);
@@ -85,7 +85,7 @@ class MakeMesh {
frag.write('mat3 TBN = cotangentFrame(n, -vVec, texCoord);');
#end
if (Project.layers[0].visible) {
if (Project.layers[0].isVisible()) {
if (Context.layer.paintBase) {
frag.add_shared_sampler('sampler2D texpaint');
@@ -207,14 +207,14 @@ class MakeMesh {
if (start == 1) break;
start--;
var l = Project.layers[len - i];
if (l.visible) {
if (l.isVisible() && l.getChildren() == null) {
count++;
if (count >= maxLayers) break;
}
}
for (i in start...len) {
var l = Project.layers[i];
if (!l.visible) continue;
if (!l.isVisible() || l.getChildren() != null) continue;
var id = l.id;
if (l.objectMask > 0) {
+5 -1
View File
@@ -50,13 +50,17 @@ class BrushOutputNode extends LogicNode {
// Do not paint over fill layer
var fillLayer = Context.layer.material_mask != null && Context.tool != ToolPicker && !Context.layerIsMask;
// Do not paint over groups
var groupLayer = Context.layer.getChildren() != null;
// Paint bounds
if (UITrait.inst.paintVec.x < right && UITrait.inst.paintVec.x > left &&
UITrait.inst.paintVec.y < 1 && UITrait.inst.paintVec.y > 0 &&
!UITrait.inst.ui.isHovered &&
!UITrait.inst.ui.isScrolling &&
!fillLayer &&
(Context.layer.visible || UITrait.inst.paint2d) &&
!groupLayer &&
(Context.layer.isVisible() || UITrait.inst.paint2d) &&
!arm.App.isDragging &&
!arm.App.isResizing &&
@:privateAccess UITrait.inst.ui.comboSelectedHandle == null &&