about sharing gradients between/among objects

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

about sharing gradients between/among objects

Postby brynn » Fri Jun 17, 2011 11:02 am

Hi Friends,
I know that there is a setting in Inkscape Prefs where you can choose to have objects share gradients or not. What I'm wondering, is if there is a way to temporarily reverse or disable whatever you've opted for (like how the Shift key used to temporarily disable snapping)? Because it doesn't make sense (to me) to have to change a global setting for individual documents. Or maybe that setting should belong in Doc Props instead of Inks Prefs??

If there is no way to do it, I'm curious if anyone else would consider it a worthwhile new feature? It seems to me like not a difficult chore as far as coding, but I really don't know. I just always like to balance how useful the Inkscape community would find a potential new feature, before adding it to developers' already full plates.

Thanks for any comments :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: about sharing gradients between/among objects

Postby ~suv » Fri Jun 17, 2011 9:11 pm

What the option "[x] Prevent sharing of gradients' currently does:
Release Notes 0.46 wrote:Automatic duplication of gradients

When copy/pasting or duplicating an object with gradient, it now automatically gets a copy of the original gradient, so modifying it does not affect the source object's gradient anymore (before, you had to press the Duplicate button on the Gradient controls bar for this). The Duplicate button is therefore removed.

However, to accommodate the needs of users who have relied on sharing the same gradient definition across objects, this behavior can be optionally suppressed [1]. The Prevent sharing of gradient definitions checkbox on the Misc tab of Inkscape Preferences is by default checked; if you uncheck it, Inkscape does not automatically copy gradient definitions for new objects, which means that copy/pasting, duplicating, pasting style, and explicit assignment of a gradient to an object via the Gradient tool controls results in a shared gradient definition, so that changing the colors or mid-stop positions of the gradient on one object (but not changing the coordinates of the end handles) affects all other objects that share the same definition.


Note that you can no longer prevent forking of gradient definitions when copy&pasting (or pasting style) within the same document or pasting into a new document due to a change in 0.47 (prevent ID clashes on import and paste):
Release Notes 0.47 wrote:Notable bug fixes
  • No more ID clashes on import and paste: previously, importing or pasting SVG objects might sometimes distort their colors, because the imported objects referred to gradients with the same IDs as those that already exist in the document but look different. Now, IDs of all gradients in the pasted document are checked for clashes with those in the host document, and if necessary changed with all their users updated correspondingly, so such unexpected color changes will never happen.


[1] emphasis mine

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: about sharing gradients between/among objects

Postby Xav » Fri Jun 17, 2011 11:30 pm

~suv wrote:Note that you can no longer prevent forking of gradient definitions when copy&pasting (or pasting style) within the same document or pasting into a new document due to a change in 0.47 (prevent ID clashes on import and paste)...


Which is just one reason why I would love to have a tool or mechanism to remap gradients - i.e. map all uses of gradient1234 to gradient9324 instead.

In the case of our comics, we usually create new characters something like this:

1) Find an existing character in an older comic
2) Copy it into the new comic being drawn
3) Modify their clothes, hairstyle and so on, to suit the new comic
4) Repeat with each character

In most cases we don't touch the grey-white gradient we use for the bodies and heads. But for each character we've imported, we end up with two more copies of the same gradient. In a busy strip, this can lead to _lots_ of identical gradients filling up the gradients list and bulking up the SVG file. I used to go through an remap them all manually, but that adds potentially hours to each comic, which I no longer have time for.


So personally I'd love something like the "Replace Color" extension, but with more options:

* Replace colour with colour
* Replace colour with a gradient
* Replace a gradient with a colour
* Replace a gradient with a gradient

It strikes me that something like this would make the original question - and the corresponding Inkscape option - a little redundant anyway. If it's easy to fix-up your shared gradients after the fact, there's little to lose in allowing duplicates to be spawned in the first place.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: about sharing gradients between/among objects

Postby brynn » Sun Jun 19, 2011 12:10 pm

Whoa, ok you guys lost me!
So the answer is, there is no way to temporarily disable it, that it has to be done by changing the Inks Prefs > Misc setting. Right?

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: about sharing gradients between/among objects

Postby flamingolady » Sun Jun 19, 2011 1:19 pm

Brynn,
I agree with you and I'd like to see this as a feature either in Doc Prefs or somewhere else, especially since the gradient over one large group of objects versus a gradient being copied into each object inside of a grouped object gives 2 very different results, and I get annoyed dealing with it as well. I'd love to see some sort of toggle switch or short cut for it.


Return to “Help with using Inkscape”