New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple actions (e.g. score then cut) #45
Conversation
cc @EtherGraf Your overcut feature is awesome! It's been the difference between success and failure on more than one of my projects. I thought you might find this pull request interesting. |
Have not yet found time to test your patches. I like your idea of creating a second extension. This separates your extension from the cutting part. But on the other hand this means a near full duplication of the extension gui. Future modifications needs to be done on both extensions. My ongoing branch minimizetraveling will cause already the first conflict. The bugfix looks good. Lets test it. |
Yup, agreed. It kind of pained me to write it, especially the part where I had to copy-paste the whole tab 5 times. Here's what I really want to do: write a GUI in Python. It would pull all the stroke colors present in the document and present them to the user as a drop-down. It would parse I did something somewhat similar with inkscape-embroidery's params dialog. It reads the existing stitching parameters attached to each selected path and populates a wxGTK dialog. It all works pretty nicely and steps around the issue where we can't dynamically populate the extension settings dialog that inkscape itself displays. Anyway design is right there in my head, and it'd be awesome, but I just don't have the time to dedicate to writing it right now. So I did this semi-hack just to get something working so that I could cut some shapes out for my children. :) |
As to the bugfix, it seems to work for me, although I'm not quite sure how to test the viewbox thing. I think it's correct to multiply the docTransform on the left, but I'm not quite sure. I could pull the fix out into its own PR and base this one on that PR, if you'd prefer? |
Another thing a dedicated UI would make possible would be saving/loading presets. |
Still a WIP, but I found some free time and rewrote this as a standalone GUI! When started, this extension reads through the SVG and produces a list of stroke colors. It presents a window with those stroke colors and lets you choose what to do with each color. When you select a row, the settings pane is populated and allows you to fill in all of the normal parameters from "send to silhouette". You can repeat this for each color, and the parameters are saved separately for each. You can re-order the colors by selecting one and clicking the "move up" or "move down" buttons. You can tell it to ignore a color entirely by unchecking its "perform action?" box. Finally, you can save everything (including colors, order, checkboxes, and settings) as a preset by entering a preset name in the combo box and clicking "add". You can also load a preset by choosing one from the drop-down and clicking "load". To perform the actions, click "execute". This also saves a hidden preset called "__LAST__", which is automatically loaded next time you run the extension. To do:
|
Tested, found and fixed a few bugs, and then fixed up the issue with loading a preset with different colors. This is ready to merge! Future work that might be nice for a later PR: run |
Hello, is someone going to merge that some time? |
Hello, |
This requires "sudo apt-get install python-wxgtk3.0 python-xmltodict" |
I had the wrong branch sorry, now I have downloaded, run the setup.py and put the *.py *.inx and silhouette/ directory into /usr/share/inkscape/extensions (deleting the former silhouette extension files beforehand). I have opened the above triangles_lex.svg file and been through the steps. Now, after the last comment's dialog, I get the following error in a dialog:
|
Ok, my Ubuntu xmltodict package is somewhat too old. Here is a related ticket on the xmltodict project. |
This additional extension works well now, with added packages. Thank you! After some time using, I feel that it would be more practical if the first setup dialog regarding command output without running them, should be a console or checkbox somewhere on the main dialog (eg. below the Execute button), or after the execute button was clicked. |
Hi @myselfhimself, thanks for testing my branch! Sorry for my radio silence, but I'm glad you figured out the troubles you were having. I agree that a proper I see what you mean about the "trim margins" checkbox. The problem you're seeing is an artifact of the way This means that "trim margins" will effectively trim the margins on each color individually! You'll get a different amount of trimming per color which is almost certainly not what you want. I'd recommend not using that option with my "multiple actions" extension. If you really want the margins trimmed off, move the objects on the canvas. You're probably wondering, why does "multiple actions" present the trim option at all if it's a bad idea? Because "multiple actions" loads the option list from the extension definition file (
I see your point. That option is really only there for debugging the "multiple actions" extension itself. You're not likely to need it in day-to-day usage. I actually never see that little initial dialog because I've bound ctrl-shift-s to "Silhouette Multiple Actions (No Preferences)" in Inkscape's preferences under Keyboard Shortcuts. Hitting ctrl-shft-s brings me directly to the multiple actions extension's GUI window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of a separate tool with a separate GUI. Grat work!
Although this opens the portability question. What happens on windows and macos machines? Are there proper error messages that guide users to the needed dependencies?
Just tried to merge the extension into current trunk. After succesfull merging I had to We really need a install check and version check with proper error messages. Installation requirements should be mentioned in the README file. |
Indeed, by the way in Python, the standard is to have dependencies listed
in a requirements.txt file, which pip can install with -r filename
…On Friday, June 8, 2018, EtherGraf ***@***.***> wrote:
Just tried to merge the extension into current trunk. After succesfull
merging I had to
sudo apt remove python-xmldict
pip2 install --user python-xmldict
to get the current version 0.11 of xmldict and the extension running.
We really need a install check and version check with proper error
messages.
Maybe even an error message, if running on win or macos.
Installation requirements should be mentioned in the README file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNOws8BTdqAW1FIddAja9U4I4Hyq7J7ks5t6rK3gaJpZM4ODFSQ>
.
|
I am stuck in the same place as myselfhimself where I hit the apply button and can't get any further. I am running Ubuntu. I tried both in python2 and python3 (python3 errs due to some library incompatibilities). Not sure how to further debug. |
My Silhouette is back in its packaging box due to relocation. I do not know
when I will reset it up and restart working with it sorry :-/
ne 28. 4. 2019 v 13:40 odesílatel SWZ <notifications@github.com> napsal:
… I am stuck in the same place as myselfhimself where I hit the apply button
and can't get any further. I am running Ubuntu. I tried both in python2 and
python3 (python3 errs due to some library incompatibilities). Not sure how
to further debug.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJU5QR7JPQJSJPSX6TXSFLPSWEMDANCNFSM4DQMKSIA>
.
|
This adds a new extension, "Silhouette Multiple Actions". Much like in Silhouette Studio, you can assign different actions (cut, score, pen) to each color of object in your drawing. Of course, inkscape-silhouette is way better than Silhouette Studio. :)
How is this useful? Consider this SVG:
In the Action 1 tab, I set the color to red, the action to Cut, and the pressure to 2. This lightly scores the lines, making them easy to crease precisely.
In the Action 2 tab, I set the color to blue, the action to Cut, and the pressure and speed to 0. This cuts the shapes out.
The result is a nicely scored/cut page all in one go. Without this extension, I'd have to select all the red paths, run "send to silhouette", set it to score, select blue, etc. The result is a bunch of triangles with slots and tabs that you can put together into 3d shapes!
By setting the "pause" to a few seconds, you get enough time between actions to pause the machine and swap out tools. This way, you could change knife depth or switch to a pen.
How it works: this extension gathers up the parameters in each tab separately. It searches the document for objects with a matching stroke color, then invokes the "send to silhouette" extension directly once per action. Kind of a hack, but it gets the job done. :) In theory this functionality could simply be merged into "send to silhouette", but it's easier to understand how this works when it's in a separate file.
Note that I had to fix an existing bug while I was at it. If you selected individual paths in a group and used "send to silhouette", it didn't properly apply the group's transforms to the paths. This is because the groups weren't processed so their transforms weren't composed by the recursive algorithm. I borrowed a technique from inkscape-embroidery.