Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

SOLVED Wrong version of script running due to folder locn confusion

Tue May 19, 2020 5:13 pm

[Edit: jump to the end on this one. What I thought was an interaction-error with a script "that used to work, a long time ago" was in fact a problem with my cavalier attitude about script "versions" and "locations." Your wish to run vN may be frustrated by GIMP's finding vN-1--where you told it too!--and running that instead. Thanks to the helpful folks of GimpChat who toil on in the pattern of those good ones who've gone before and ahead.]

Hi, everyone,

(Handshakes, back-claps, all around.)

I'm working on a project and need to fill an area with grayscale bumps which will resemble treetops from above when interpreted as a heightmap. [Incidentally recommendations for how to do trees in this way so that the result looks like a natural tree canopy; i.e., neighbors' tops blending naturally into each other also cordially sought... My approach will be to make a number of randomly filled layers with differently spaced brush, change the dynamic range on each, and stack them all over a black layer with modes "Lighten only", and then Copying those Visible layers into one which, finally, is "Addition"ed onto a heightmap representing mountains. Intending to advantage myself of "Groups", I poke all the layers into a Group (set to "Addition") but setting the constituent layers to "Normal".]

I have successfully used both Ofnut's (excellent) Fill Brush to Density plug-in and RobA's (excellent) Random Density Map script successfully in the past, as well as the former most recently in GIMP 2.10.

However when I've tried Rob's Random Density Map, using a new layer, and indicating a grayscale "density map" in the dialog while leaving the other _3_ visible options (#points, border margin, bailout threshold) at their defaults, running it with "OK" results in an error message:

"Error: not enough arguments"

Donning a welding helmet to bumble around inside Rob's Scheme magic, I blindly sense vibrations that there might be other option settings which are not appearing in the Tool dialogue, like "Jitter."

I confess to first trying this with both layers poked into a "Layer Group", but afterward tried it with both free to the open sky, with the same error.

I also confess to not trying it in GIMP 2.8 because... <too lazy>.

But I would appreciate to know if it really works in GIMP 2.10, and what troubleshooting recommendations I ought to be following.

Oh hail. O & R--which is not to say O && R. (gives Roman salute)
--
Gr'mp

P.S. ALSO appreciated are suggestions for B&W "tree" brushes of the heightmap type.

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Tue May 19, 2020 10:12 pm

Hi gramp. I have version 2 and it work on GIMP 2.10.18. on the bottom of this reply I posted the version 2.

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Wed May 20, 2020 6:03 am

Thanks, Pocholo.

I forgot to mention that I'm using v2.1, which I'll attach for good measure.

I should have thought to attach a screen shot too, for comparison, and I'll remedy that as well.

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Wed May 20, 2020 9:34 am

Hi gramp. I downloaded the version V2.1 that you uploaded and it gave me a complete dialog with all the options. There is something is wrong, with either your GIMP or OS, your dialog is different and missing a few options. The script works as it should, this what I get on my end:

Image

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Wed May 20, 2020 9:48 am

gramp be very careful that you don't have two versions of the script as one will overwrite the other when they are loaded.

BUT as the v2.1 version is effectively a completely different procedure it will register in the menu at /Filters/Map/Random Density Map v2.1... it should be obvious which is which, so you need to check you've put the .scm file in the correct place.
Untitled.png
Untitled.png (88.48 KiB) Viewed 2126 times

Kevin

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Wed May 20, 2020 7:10 pm

paynekj wrote:gramp be very careful that you don't have two versions of the script as one will overwrite the other when they are loaded.
Kevin


While it's true I don't know exactly which (of v1, v2, v2.1) version actually is in play when I call it (via Filters->Map->RandomDensityMap), I at least tried to "control" the election by setting the "execute" bit on only the one I wanted. And I did try all three that way.

However now I'll "sequester" the versions outside the ".gimp-2.10/scripts/" folder before trying again to assure that only one CAN be chosen.

Thank you for the admonition.
--
David

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Wed May 20, 2020 7:17 pm

Pocholo wrote:Hi gramp. I downloaded the version V2.1 that you uploaded and it gave me a complete dialog with all the options. There is something is wrong, with either your GIMP or OS, your dialog is different and missing a few options. The script works as it should...


Pocholo, Thank You for subjecting yourself to a completely unproductive exercise to demonstrate this for me!

I have NO idea how either GIMP, or my OS, could have torqued itself into such a state; I fire up GIMP from the command-line and don't see much in the way of complaint when it loads (aside from the complaints that certain 2.x filter conventions spell doom for those filters in 3.x), and nothing helpful when RandomDensityMap fails.

I suppose the prognosis is to un/re install GIMP 2.10 in my current OS, Ubuntu 18.04 LTS.
--
David

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Thu May 21, 2020 7:03 am

..I have NO idea how either GIMP, or my OS, could have torqued itself into such a state; I fire up GIMP from the command-line and don't see much in the way of complaint when it loads (aside from the complaints that certain 2.x filter conventions spell doom for those filters in 3.x), and nothing helpful when RandomDensityMap fails.

I suppose the prognosis is to un/re install GIMP 2.10 in my current OS, Ubuntu 18.04 LTS.


There is even less reason to re-install Gimp in linux than there is in Windows. Rarely does any good.

You are using random_density_map.scm version 1 - (any one interested can get it from here: viewtopic.php?f=11&t=530&start=10)

...but the filter you posted is version 2.1 Difference is easily seen in the dialog. Both versions can be installed, they both register individually in /Filters/Map

compare.jpg
compare.jpg (58.58 KiB) Viewed 2064 times


Using Gimp 2.10.14 / (k)ubuntu 18.04: A try out of version 1 does fail part way through. As far as I can tell it is the random location section. It does work with Gimp 2.8 Maybe it can be fixed by one of the clever guys but better to use the later version.

Back to your linux installation. Why the (on alfred) designation? Are you using a networked Gimp ?

However: Linux is provided with a search function. In a terminal try

Code:
find / -type f -iname "*random_density_map*.*"


Which (hopefully) will find the file(s) in your home folder. You might need to expand the search, this for example is my home + a data partition.

find.jpg
find.jpg (71.81 KiB) Viewed 2064 times


best of luck.

Re: Random Density Map script (RobA), in GIMP 2.10 (wrong #args?)

Thu May 21, 2020 9:53 am

Rich,

Thanks for identifying the version as 1.0.

@paynekj was dead-on in his suspicions that I had multiple copies of scripts. But I already knew that, I foolishly thought: I'm looking right at them.

Actually, I was looking at part of them--the IRRELEVANT ones! The ones that GIMP ACTUALLY registered at startup were in completely different directories/folders! (which I finally identified in Edit->Preferences->Folders->Scripts as:
~/.config/GIMP/2.10/scripts/ # individual user's
/usr/share/gimp/2.0/scripts/ # all-users'

Missing was the one I had lazily assumed was going to be identical to the 2.8 approach, and CREATED:
~/.gimp-2.10/scripts/

The upshot was that ANYTHING I did in the lattermost folder was ignored. And how long have I been running 2.10 under the mistaken impression that ~/.gimp-2.10/scripts/ mattered?

Hold a second, I only checked this AFTER reinstalling GIMP 2.10, which as you predicted didn't fix anything. I think it's probable that I had added MY lazy-made custom config directory to that list. That being likely, Kevin's warning about multiple scripts was still in play. Although I kept attempting to ISOLATE the v2.1 script to be the one found, several versions of Random Density Map were still being found in
~/.config/GIMP/2.10/scripts/
(NONE of which had an execute bit set btw, further nullifying one of my other assumptions) and v1 was front-and-center there, and being loaded.

Having re-arranged things (and I'll still probably replace ~/.gimp-2.10/ with a link to ~/.config/GIMP/2.10/) the v2.1 script (now the only one in ~/.config/GIMP/2.10/scripts/) upon Filters->Map->Random Density Map. (Hovering over that would prob. have shown me I was constantly launching v1, but who's got time to read, amirite? :^( )

Thank you all. I'll fix my subject title too.
--
GraMP

Re: SOLVED Wrong version of script running due to folder locn confusio

Thu May 21, 2020 11:23 am

Pleased you found the problem.

While the last time I had to program anything in anger, it was as a student and used punched card and line printers ;)

However a "maybe fix" of the original version 1 script for Gimp 2.10 Who knows, some one might prefer the 'number-of-points' rather than 'density' This with a clipboard-brush

script.jpg
script.jpg (154.38 KiB) Viewed 2033 times


No idea what the margin parameter does. Other than zero gives an error.

It is worth looking at the background for the script: https://www.cartographersguild.com/show ... php?t=2443
Post a reply