Bug 329809

Summary: Add "Random Offset" checkboxes.
Product: [Applications] krita Reporter: Paul Geraskin <paulgeraskin>
Component: Brush enginesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: halla, mohit.bits2011, ste.azza
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: First PAtch for this Feature Request
Second Patch submitted

Description Paul Geraskin 2014-01-10 13:46:07 UTC
Hi devs!

As we talked on IRC. Add Random Offset checkboxes would be cool. So that texture will not be repeated. 
The random value will be choosen only on start of the stroke.

Here is the screenshot explanation: http://i.imgur.com/pSQ4Vu1.png

Deevad, Animtim agreed.

Thanks.
Comment 1 Mohit Goyal 2014-02-14 13:27:32 UTC
Hi,
Can I start working on this or does it still need to be confirmed ?
Comment 2 Halla Rempt 2014-02-14 13:29:32 UTC
No, good idea -- I'm just slow with confirming wishes.
Comment 3 Mohit Goyal 2014-02-14 13:33:51 UTC
I'll start off :)
Comment 4 Paul Geraskin 2014-02-14 13:35:25 UTC
Yes, David Revoy also confirmed about this issue. The Random offset should be choosen when a user starts paint (not every frame, but only before painting).
Comment 5 Mohit Goyal 2014-02-15 13:02:29 UTC
So the random offset is just generated once. I have made it such that whenever the brush settings change, the random offset is generated. Is that okay ?
Comment 6 Mohit Goyal 2014-02-15 13:27:38 UTC
Just to confirm. Whenever I am changing any setting at all for the brush -- even the sensors, it changes the Horizontal offset and Vertical offset.
Comment 7 Paul Geraskin 2014-02-15 13:47:58 UTC
Hello man! 

Random offset should be generated every time when we start a new stroke for painting. I did a screenshot with explanation:
http://i.imgur.com/5BvPOEq.png

Is it possible to use any Register or Listener to get the brush state?
Comment 8 Mohit Goyal 2014-02-17 07:46:13 UTC
Created attachment 85187 [details]
First PAtch for this Feature Request

Hi,
This is the first patch submitted towards this feature request. Here, whenever the user starts with a new stroke ( or a mouse click to paint on the canvas ), it generates a random offset value.
Paul and David : Please test this one extensively as I don't know whether this one is according to the requirements :). Tell me if anything is wrong
Boud/ DmitryK : By mistake I left in a printf statement in the kis_paintop_settings.cpp file. Its in the function setRandomOffset(). I didn't know how to remove from the patch. I can submit another patch but then that will contain just that one line of deletion.
Lastly, do note -- random value is only generated if the mouse is not clicked for more than once per second. It has something to do with the srand() function. Again Boud/DmitryK -- if you can help out with that as well :)
Comment 9 Paul Geraskin 2014-02-17 13:06:00 UTC
I tested random offset it looks cool! I love it!
http://i.imgur.com/a5FMc8C.png
Comment 10 Mohit Goyal 2014-02-18 12:38:27 UTC
Created attachment 85215 [details]
Second Patch submitted

This is the corrected patch without the printf statement :)
Comment 11 Paul Geraskin 2014-02-18 13:03:15 UTC
Hello man! I was on my dinner. Just ping me in IRC again.
Comment 12 Halla Rempt 2014-02-19 09:23:24 UTC
Git commit 4abaeca1bc6ef735473e6389da099d1455eb8bdd by Boudewijn Rempt.
Committed on 19/02/2014 at 09:22.
Pushed by rempt into branch 'master'.

Patch by Mohit Goyal. Thanks!
CCMAIL:mohit.bits2011@gmail.com

M  +30   -4    krita/image/brushengine/kis_paintop_settings.cpp
M  +7    -0    krita/image/brushengine/kis_paintop_settings.h
M  +47   -2    krita/plugins/paintops/libpaintop/kis_texture_option.cpp

http://commits.kde.org/calligra/4abaeca1bc6ef735473e6389da099d1455eb8bdd
Comment 13 Stefano Azzalin 2014-06-25 13:08:06 UTC
I was wondering: is there any intention to implement in the near future this feature in Krita?
Because to me it is a very important feature to make texture brushes really useable....
Comment 14 Paul Geraskin 2014-06-25 13:19:17 UTC
it's already implemented and added.
Comment 15 Halla Rempt 2014-06-25 13:21:24 UTC
Hi Stefano,

You need to use the development version of Krita to get the feature -- that is, either one of the recent builds I announced on the Kickstarter page (https://www.kickstarter.com/projects/krita/krita-open-source-digital-painting-accelerate-deve) or the Krita Lime packages for *buntu. If you're not using Windows or *buntu, you can build Krita for yourself following http://www.davidrevoy.com/article193/building-krita-on-linux-for-cats.
Comment 16 Stefano Azzalin 2014-06-25 13:34:40 UTC
Sorry guys, I should have probably explained myself better.
I meant: will it be implemented in the official Windows release?
Since this is one of those small yet very important features that could make the difference on Krita brushes
Comment 17 Halla Rempt 2014-06-25 13:37:37 UTC
It will be part of the next release, which is 2.9. We expect to release 2.9 before the end of this year. It also already part of the official steam builds, by the way.
Comment 18 Stefano Azzalin 2014-06-25 13:40:34 UTC
Uh, thanks Boudewijn, always very helpful! ;)