Can you provide a screenshot of the final image with the dynamic lighting layer active? Did you rotate or resize any of the lines on the DL layer? That doesn't actually work, it will retain its former orientation for how it blocks light. You can run this script and it will fix that if it is the problem: on('ready',function(){
"use strict";
var bounds = function(p){
return _.reduce(p,function(m,p){
m.minX=Math.min(p[1],m.minX);
m.minY=Math.min(p[2],m.minY);
m.maxX=Math.max(p[1],m.maxX);
m.maxY=Math.max(p[2],m.maxY);
return m;
},{minX:Infinity,maxX:0,minY:Infinity,maxY:0});
},
center = function(bounds){
return {
x: bounds.minX + ((bounds.maxX-bounds.minX)/2),
y: bounds.minY + ((bounds.maxY-bounds.minY)/2)
};
},
rotate = function(p,theta){
var b=bounds(p),
c=center(b),
sinT=Math.sin( theta*Math.PI/180.0),
cosT=Math.cos( theta*Math.PI/180.0),
newBounds={
minX:Infinity,
minY:Infinity,
maxX:0,
maxY:0
},
points =_.chain(p)
.map(function(point){
var pointPrime=_.clone(point);
pointPrime[1]=cosT*(point[1]-c.x) - sinT*(point[2]-c.y) + c.x;
pointPrime[2]=sinT*(point[1]-c.x) + cosT*(point[2]-c.y) + c.y;
newBounds.minX=Math.min(pointPrime[1],newBounds.minX);
newBounds.minY=Math.min(pointPrime[2],newBounds.minY);
newBounds.maxX=Math.max(pointPrime[1],newBounds.maxX);
newBounds.maxY=Math.max(pointPrime[2],newBounds.maxY);
return pointPrime;
})
.map(function(p){
p[1]-=newBounds.minX;
p[2]-=newBounds.minY;
return p;
})
.value(),
newCenter=center(newBounds);
return {
path: points,
bounds: newBounds,
center: newCenter,
offset: {
x: newCenter.x-c.x,
y: newCenter.y-c.y
}
};
};
_.chain(findObjs({
type: 'path',
layer: 'walls'
}))
.filter((o)=>o.get('rotation')!==0)
.each((path)=>{
let details=rotate(JSON.parse(path.get('path')),path.get('rotation'));
let newpath = createObj('path', {
pageid: path.get('pageid'),
fill: path.get('fill'),
stroke: path.get('stroke'),
rotation: 0,
layer: path.get('layer'),
stroke_width: path.get('stroke_width'),
width: details.bounds.maxX-details.bounds.minX,
height: details.bounds.maxY-details.bounds.minY,
path: JSON.stringify(details.path),
top: path.get('top')+details.offset.y,
left: path.get('left')+details.offset.x,
scaleX: 1,
scaleY: 1
});
if(newpath){
path.remove();
}
})
.tap((o)=>sendChat('',`/w gm Fixed ${o.length} Dynamic Lighting paths with rotation.`));
});