Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ofn-manual-stipple
#4
(12-23-2022, 03:13 AM)RobA Wrote:
(09-02-2021, 08:00 PM)Ofnuts Wrote: PS: Old timers will notice some likeness with RobA's "Random Density Map" script. Actually the ideas are similar. The main differences are...

Hiya Ofnuts!  Long time no see!

Joined the forum here just to post as I'm getting back into the world of Gimp.

Even though my "Random Density Map" script is still working under 2.10 it is tremendously slow.

As I'm still trying to figure out python, I decided to modify this plugin to add a brush spacing parameter (which I succeeded at!)
Many of the brushes I use are .gbr's that don't fill the entire brush area as returned by pdb.gimp_context_get_brush_size(), so I need the spacing to be adjusted by 50% or so.  This (of course) also required an adjustment to the jitter calculation, and also needed changing the jitter input slider to "tenths" rather than "ones".

Attached is an example of the map, with the default (100%) spacing which is what the plugin did originally, set to 50% spacing, and lastly with reduced spacing and jitter, showing how I use it with my brushes to quickly create dense forest areas having individual trees....


If interested, I'd be happy to provide my hack if you want to update your code.

P.S. I tried to leverage your OFN_DEBUG and debug trace code but your original plugin would just throw errors with that flag on, so I obviously had no idea what I was doing or how to use it properly...

P.P.S. Is this where all the cool gimp kids hang out now?

Cheers!

-RobA>
  • Same. Saw your registration before your post, so wondering about an imposter Smile
  • Glad to see you are at it again.
  • Instead of having a script parameter, maybe the script could be sensitive to the brush spacing (as it is to the brush size, etc...) using pdb.gimp_context_get_brush_spacing()?
  • Of course I'm interested
  • OFN_DEBUG is an environment variable in my Bash sessions. When I try something I start Gimp in a terminal, so OFN_DEBUG appears in the Gimp environment, and therefore in the Python plugin environment. This is converted into a global boolean by debug='OFN_DEBUG' in os.environ and the trace() function checks this debug to determine if it should output things (that I will then see it in the terminal). debug has other uses (such as putting the menu entry in a place easier to use when testing, and even in some rare cases adding parameters in the dialog). A side benefit is that the code doesn't print anything when not running on the machines of the illuminatus (illuminati, now that you know) and so avoids the process hang that occurs on windows if you print more than 4K of output.
  • Coolness is in the eye of the beholder Smile GC is still alive (but maybe not kicking as much since it changed hands). The gimp-user/gimp-developer mailing lists have been recently discontinued and are replaced by the general Gnome Discourse server.
Reply


Messages In This Thread
ofn-manual-stipple - by Ofnuts - 09-02-2021, 08:00 PM
RE: ofn-manual-stipple - by denzjos - 09-06-2021, 08:33 AM
RE: ofn-manual-stipple - by RobA - 12-23-2022, 03:13 AM
RE: ofn-manual-stipple - by Ofnuts - 12-23-2022, 08:56 PM
RE: ofn-manual-stipple - by RobA - 12-24-2022, 07:35 PM
RE: ofn-manual-stipple - by Ofnuts - 12-25-2022, 05:58 PM

Forum Jump: