New addon: Shape operations in costume editor - #8129
Conversation
…cratchAddons into paint-editor-shape-ops
…cratchAddons into paint-editor-shape-ops merge
…cratchAddons into paint-editor-shape-ops
|
actually, changes are straight up not applying on the stage when i do |
So only the merging operation has problems as far as you know? |
Samq64
left a comment
There was a problem hiding this comment.
Could the scratch-paint library be added to the addon.json?
| // kinda ugly solution to remove duplicate objects | ||
| /*for (const result of results) { | ||
| if (!result.parent) continue; | ||
| for (const result2 of results) { | ||
| if (!result2.parent) continue; | ||
| if (result === result2) continue; | ||
| if (result && result2 && result?.compare(result2)) { | ||
| result2.remove(); | ||
| } | ||
| } | ||
| }*/ |
There was a problem hiding this comment.
Is there a better solution for this now?
There was a problem hiding this comment.
i think it isn't needed anymore?
| if (Array.isArray(item)) { | ||
| const newArray = []; | ||
| for (const child of item) { | ||
| newArray.push(...recursiveDecompose(child, dryRun)); |
There was a problem hiding this comment.
This can fail when one of the selected objects is grouped.
There was a problem hiding this comment.
Good catch, forgot about grouping.
There was a problem hiding this comment.
This function is supposed to ungroup all grouped objects, though that might not be what the user wants sometimes, and I might not be flattening the returned array correctly (in the bottom case).
There was a problem hiding this comment.
This function is supposed to ungroup all grouped objects, though that might not be what the user wants sometimes
I would think it's reasonable to ungroup them.
What do you mean by "the bottom case" though?
paint-skew could also have scratch-paint added to its libraries in that case (iirc it copies a lot of ScaleTool's code) |
Sure, it can be added as part of this PR |
|
there's also the issue of handling items with the different properties (like color) when merging in some ways (like masking) |
By this do you mean, the issue of deciding how it should behave in those cases? |
By this i mean just implementing support for it in general. (for example, having several shapes with different properties and then subtracting one shape from them. IIRC this will cause all the other shapes to have their properties changed to one of them) |
|
Is this still in development? |
ummmm no |
You should probably close it then, if it's abandoned. Or do you mean it's done? |
|
abandoned (i just don't feel like fixing the remaining bugs) |
I thought it was mostly done though :( |
|
It would be great if someone finished this |
What was left? If you could just write it out I could finish it. |
|
@CST1229 Feel free to mute notifications, but I think it's better if we keep it open, since it's almost working. |
mainly just this
and testing to ensure it's stable with different types of objects and outlines and stuff (i think it should just ignore non-shapes like text and bitmap images, not sure if it currently does?) |
There's only so much you can do about that, but these are some simple ways to intuitively merge properties:
Also, if some shapes are completely transparent, like if two shapes are being combined and one of them only has a fill and the other only has an outline, their properties could be combined. |
|
I tried it too 😃 |
|
probs |
Resolves #8052
Changes
Adds an addon for boolean shape operations in the costume editor. Mostly complete, aside from maybe behavior when undoing stuff and when dealing with more than 2 shapes (feedback is welcome!).
Reason for changes
It's a frequently requested feature that's common in vector image editors, and is in PenguinMod.
Tests
Tested on Firefox.