fablabnbg / inkscape-silhouette

An extension to drive Silhouette vinyl cutters (e.g. Cameo, Portrait, Curio series) from within inkscape.
GNU General Public License v2.0
495 stars 113 forks source link

Cameo 5 #296

Closed JWBlackman69 closed 3 months ago

JWBlackman69 commented 4 months ago

Anything I can do to assist with Cameo 5 compatibility? I read that the entire architecture was re-worked for this unit. Does that mean they are using a different style of driver? With the Cameo 5 connected and powered on, I get the message saying: "No Graphtec Silhouette devices found. Check USB and Power."

t0b3 commented 4 months ago

@JWBlackman69 you may start at https://github.com/fablabnbg/inkscape-silhouette/blob/05c74b6cf75bcb8d947928632762b4bd0825bcb9/silhouette/Graphtec.py#L133 and add the usb id and adapt the code from there as needed...

JWBlackman69 commented 4 months ago

Adding the Cameo 5 information to Graphtec.py was successful. Mostly everything seems to be working correctly. I forgot to mention that I am running Inkscape on Windows, so I also needed to replace the libusb driver again.

Right now, having issues getting Silhouette_Multi to work. Is it compatible with Windows? The error I get is:

File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette_multi.py", line 292, in if unblock_inkscape: pid = os.fork() ^^^^^^^ AttributeError: module 'os' has no attribute 'fork'

t0b3 commented 4 months ago

@JWBlackman69 which python version and windows version are you running?

nb: you may try to work around by checking

JWBlackman69 commented 4 months ago

I'm using Python 3.11.6, installed by Inkscape.
Windows Pro 19045.4412 build

Checking the box did get me past the previous error, but now it gives me this:

File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette_multi.py", line 315, in <module>
    e.run()
  File "c:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 250, in run
    self.save_raw(self.effect())
                  ^^^^^^^^^^^^^
  File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette_multi.py", line 158, in effect
    self.frame = MultiFrame(
                 ^^^^^^^^^^^
  File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette\MultiFrame.py", line 269, in __init__
    self.notebook = ParamsNotebook(self, wx.ID_ANY, logger=self.logger)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette\MultiFrame.py", line 39, in __init__
    self.create_tabs()
  File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette\MultiFrame.py", line 92, in create_tabs
    self.tabs.append(ParamsTab(self, wx.ID_ANY, name=pagename, title=attrs['title'], params=attrs['param']))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette\MultiFrame.py", line 142, in __init__
    self.__do_layout()
  File "c:\Program Files\Inkscape\share\inkscape\extensions\silhouette\MultiFrame.py", line 228, in __do_layout
    input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wx._core.wxAssertionError: C++ assertion "!(style & 0x0020) && !(style & 0x0010) && !(style & 0x0004)" failed at ..\..\src\msw\choice.cpp(62) in wxChoice::Create(): this style flag is ignored by wxChoice, you probably want to use a wxComboBox

No windows appear after that, it just goes back to the debugging dialog.

t0b3 commented 4 months ago

@JWBlackman69 this issue seems to be specific to wx on Windows. can you try edit the file

silhouette/MultiFrame.py and change lines 227-228 to

                input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=wx.LB_SINGLE|wx.CB_READONLY)

... and report back incl a visual screenshot of the Cutting Mat dropdown list opened from within SilhouetteMulti ?

and secondly what happens on

                input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=wx.LB_SINGLE|wx.CB_DROPDOWN)

... and what about combining those to

                input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=wx.LB_SINGLE|wx.CB_READONLY|wx.CB_DROPDOWN)

It'll be interesting to see how you get things to work on Windows :+1:

t0b3 commented 4 months ago

Adding the Cameo 5 information to Graphtec.py was successful. Mostly everything seems to be working correctly.

@JWBlackman69 you're welcome to share your changes for Cameo 5 ... so others may benefit from your experience :smile:

JWBlackman69 commented 4 months ago

Adding the Cameo 5 information to Graphtec.py was successful. Mostly everything seems to be working correctly.

@JWBlackman69 you're welcome to share your changes for Cameo 5 ... so others may benefit from your experience 😄

No problem, but I'm new here, do I just commit changes to main, or paste them here?

JWBlackman69 commented 4 months ago

@JWBlackman69 this issue seems to be specific to wx on Windows. can you try edit the file

silhouette/MultiFrame.py and change lines 227-228 to

                input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=wx.LB_SINGLE|wx.CB_READONLY)

... and report back incl a visual screenshot of the Cutting Mat dropdown list opened from within SilhouetteMulti ?

and secondly what happens on

                input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=wx.LB_SINGLE|wx.CB_DROPDOWN)

... and what about combining those to

                input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=wx.LB_SINGLE|wx.CB_READONLY|wx.CB_DROPDOWN)

It'll be interesting to see how you get things to work on Windows 👍

I'll need to do more digging, because no matter which style is specified, the Silhouette Multi frame still doesn't open at all.

t0b3 commented 4 months ago

@JWBlackman69 maybe I found a solution for you:

                 import sys
                 input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=(not(sys.platform.lower().startswith("win")) and wx.LB_SINGLE))

does this work for you?

nb: ideally you open an new issue per issue and contribute the solution with a PR :+1:

t0b3 commented 4 months ago

@gwhitney would you mind if we set style=0 ? (or drop style?)

gwhitney commented 4 months ago

As it happens, haven't had to do much cutting lately. I understand style is just supposed to be a UI look-and-feel thing, but my recollection is on Linux it wasn't quite as simple as that. That said, since I haven't been an active user of this lately, I don't want to stand in the way and sadly I just won't have time in the next couple weeks (exhibiting at OpenSauce in SF) to test on Linux with and without style. So if it works without style for the people currently involved, I'd say go ahead; and if in the future I have problems, I will file a new issue/PR, respecting the concerns in this one.

JWBlackman69 commented 4 months ago

@JWBlackman69 maybe I found a solution for you:

                 import sys
                 input = wx.Choice(self, wx.ID_ANY, choices=choice_list,
                                  style=(not(sys.platform.lower().startswith("win")) and wx.LB_SINGLE))

does this work for you?

nb: ideally you open an new issue per issue and contribute the solution with a PR 👍

This worked like a champ!