SVG Gradient Support in R8 SR7

Hi @Gijs, @stevebaer,

i’ve been following this YT item with enthusiasm and today installed (8.7.24101.10001, 2024-04-10) to test it. Here is a simple Rhino example file which i exported as 48x48 svg file:

TestGradient.3dm (55.3 KB)
TestGradient

The gradient seems to be exported in the xml file which is great !!!

However, it seems, only discourse can display the result. Trying to read the svg file into Rhino’s button editor results in a black square.

Trying to imort the svg back into Rhino 8 results in a fully transparent hatch. Importing it into Illustrator results in a black square too.

The YT item seems to be set to “Announce” and you wrote “working well in 8.7.24091.14001 and 8.7.24091.14002”, are these changes in the current downloadable RC 8.7 (8.7.24101.10001, 2024-04-10) yet ?

thanks,
c.

@clement what I tested is to export an existing Rhino button that has a gradient to svg and import that again in the button editor. I assumed that was the scope of the change. That seems to work, and the svg opens well in a browser, but as you noticed, not in illustrator.
I reopened the yt.

Thanks @Gijs for re-opening the issue.

I thought it was obvious that users may be interested to create button icons for Rhino 8 with it’s own svg export including gradients. Imho Rhino itself should be able to import what it has exported, either in the button editor or in the application. My exitement was founded on the fact that i now can create more lively button icons for / in Rhino 8.

btw, check out the results when hatches using “linear reflected” or “radial reflected” gradients are exported…

thanks,
c.

Hi @Gijs, McNeel team,

Fixing this is a must, along with all the other custom toolbars issues making using V8 a non-starter for people with custom workspaces.

We need to be able to import/export SVGs created/edited in Photoshop / Illustrator / Rhino’s built-in icon editor.

I’d like to switch to V8 sometime, maybe this year?

G

2 Likes

Does “Rhino toolbar editor” refer to this dialog ? It doesn’t work in SR7 (it never worked) and according to RH-79892 “this issue seems to gone”

_
c.

Hi @clement, yes I meant to say the icon editor. Last time I checked it was only half working, which makes it useless. But I’m hoping McNeel will fix this, along with everything else broken in V8.

First priority for me is having an import/export of SVG working flawlessly, which is also at a useless state right now.

I know they don’t like it when I use the ‘useless’ word, but that’s the level of use that a lot of what’s been shipping right now is at; and we need to be very clear about that.

It’s getting tiresome to chase them for every single touch point to their software that has been shipped broken and unchecked.

G

I see what is going on. If you add a closing parentheses to the end of line 11 in your svg file, it should start working. I’ll get this simple fix in right away.

As an aside, we are rewriting the button editor but haven’t gotten it to a point where we can replace what is currently there. If you run TestSvgEdit you can see our current work in progress for this editor.

5 Likes

Thank you @stevebaer, i’ve tried that, maybe you should show an example, just tried closing the <path> using </path> but that does not seem to work.

grafik

The new button editor looks promising and does not have the issues reported from the old one, i love how i can repeat the drawing with RMB.
_
c.

url(#gradient1
should be changed to
url(#gradient1)

1 Like

This works! I didn’t see it, thanks, c.

1 Like

Btw. @stevebaer, you might please check the result when “repeat” in Rhino is not 1 or when Fill Style is not set to the default “Linear Reflected” or when the gradient is not from left to right, eg. when it is a diagonal or when gradient is not from 0% to 100% … all these seem to fail.

Edit: one reason for the failure seems to be the comma as the decimal in the gradient percent values:

Edit2: <stop> color does not support transparency. Could you please include stop-opacity attributes to all <stop> nodes and set their value based on the alpha values assigned in Rhino if they are not opaque ?

thanks,
c.

This is a great improvement! Thanks for sharing! The ability to edit the curves after drawing them, set the cap styles etc. Great! Thanks for this!

Got it; I’ll get these fixed before next week’s WIP

https://mcneel.myjetbrains.com/youtrack/issue/RH-81531

https://mcneel.myjetbrains.com/youtrack/issue/RH-81532

2 Likes

Thanks; I stopped working on this for a bit as we are bringing on another developer in a week that can focus specifically on this project and hopefully get it in a much better place.

2 Likes

Great news! I see the enum toggle for dark/light mode switching. Will that remain or will the UI default to the current Rhino theme of dark or light?

Or is that so you can create icons for dark mode and for light mode more easily by seeing how the icon graphics would contrast against the differing UI?

I hope you can create both light and dark mode at the same time. There’s still a lot of work that needs to be done here.

2 Likes

I thought GH Icon would be the thing. So there will be two separate icon creators? One for Grasshopper 2 and one for Rhino?

GH2 does not ship with Rhino 8. The project being referred to here is meant as a tune up for the existing button editor.

And, there will be lots of people who will want to modify or create icon images that do not use Grasshoppper 1 or 2.

RH-81531 and RH-81532 are fixed in Rhino 8 Service Release 7 Release Candidate

1 Like