So I have somewhat found a way to run code when the project is paused, the issue is that it doesn’t work very well.
If you open a new wick project either by opening or reload the page, or by just clicking the “new” button create a single shape and stick the below code into the frame then the shapes color will start changing. Then if you pause the project you should see that it doesn’t stop. But if you do anything to interact with it, it will then stop. This includes things like selecting the shape.
window.test = {};
test.objs = project._children[0]._children[0]._children[0]._children;
let obj = test.objs[0].view.item;
obj.fillColor = "red";
test.func = function () {
this.fillColor.hue += 6;
};
test.func2 = function () {
this.fillColor.hue += 1;
};
// chnage the below test.func into test.func2 and it stops working...
obj.onFrame = test.func;
The issue that I am facing is not so much to do with it not being selectable but rather that if you do anything to the line in the above code obj.onFrame = test.func;
to obj.onFrame = test.func2;
after playing the project once, which should change which function the path object is executing every frame, it instead just stops doing anything at all and from what I tested. Even if you delete that shape make a new one and then run the project again, still does nothing. Or if you just remove that line of code and run the project again it will also stop.
This is the about the onFrame variable http://paperjs.org/reference/path/#onframe
Here is a example project of it that hasn’t been run yet My Project1-26-2022_20-28-15.wick (1.5 KB)