Inkscape Community

Help Using Inkscape => Inkscape Beginners' Questions => Topic started by: SimoB on April 10, 2019, 03:17:22 AM

Title: Filter random seed
Post by: SimoB on April 10, 2019, 03:17:22 AM
Hi, new Inkscape user here  :-$, I have a very strong programming background but my graphics skills are very poor  :-(

I am working on some game assets and I have an array of buttons with a filter applied (point engraving), if I understand correctly I can vary the end result altering the seed value in the turbulence component of the filter.

Is it possible to randomize the seed value without duplicate the filter for every button?

Thank you for any advice!



Title: Re: Filter random seed
Post by: Lazur on April 10, 2019, 02:29:31 PM
Hi.

As far as I know, you cannot do that with inkscape -since the seed value is part of the filter definition.
The xml code-wise that means when a filter is applied to an object, it points to the definition and calls the set chain with the set values.
Guessing with a script one could generate random filter variants but each would need their own definition.

However, if you wanted to achieve a similar graphical appearance:=the filter not repeating through the button instances,
then group those rectangles together before adding the filter, and add the filter to the group instead.
If the result is not looking random enough, you can also ungroup the filtered group. Then each objects inside will inherit the filtered look and you can rearrange their location in a random manner.
Should result with one filter definition but with random transformations interfering with them.

I'd be great to have handles representing the filter's transformations though as with the pattern fill and what not. Guess that won't happen in the near future.
Title: Re: Filter random seed
Post by: SimoB on April 10, 2019, 03:46:23 PM
Thank you for your advice, you are right, if I group all these rectangles and apply the filter to the group the effect is spread across all objects, but I can't preserve all the z-indexes of them (it's a mess).

I did a try using a "selection set" (to me seems like a way to group across the main objects tree) but looks like isn't possible to apply filters to the virtual groups the same way as normal groups (the filter is applied per object, would be nice if possible!)

I think I'll do it the hard way!

Peace.
Title: Re: Filter random seed
Post by: Lazur on April 10, 2019, 04:04:41 PM
Another thing to try:

Select one of the filtered buttons, press Ctrl+C;
select all the buttons and paste in style (Ctrl+Shift+V).