GNOME Bugzilla – Bug 129529
Allow random seed to be specified in PDB call
Last modified: 2004-12-22 21:47:04 UTC
Several plug-ins changed their API in the PDB to remove the parameter "use_time" or similar. This parameter should be added back, since it was very useful for scripts. The plug-ins which use gimp_random_seed_new (), and which are therefore likely to be affected, are: plug-ins/common/blur.c plug-ins/common/plasma.c plug-ins/common/randomize.c plug-ins/common/sinus.c plug-ins/common/snoise.c plug-ins/gflare/gflare.c plug-ins/maze/maze_face.c Of these only the pdb calls installed by randomize and blur had criteria in 1.2 for setting a random seed, so these are probably the only ones that require a PDB change. Dave.
Fixed in CVS: 2003-12-17 Dave Neary <bolsh@gimp.org> * libgimpwidgets/gimpwidgets.[ch]: Change signature of gimp_random_seed_new() to allow caller to specify that he wants to use a random seed rather than the specified seed. Previously it was up to the caller to initialise the seed. * plug-ins/gflare/gflare.c * plug-ins/maze/maze_face.c * plug-ins/common/plasma.c * plug-ins/common/sinus.c * plug-ins/common/snoise.c: Trivial modifications of call to gimp_random_seed_new() with FALSE. * plug-ins/common/blur.c * plug-ins/common/randomize.c: Modify PDB routines and tool options to allow a random seed to be specified. Useful for scripts. Reverts PDB to 1.2 state. Fixes bug #129529.
Following some discussion on this, I've reopened it. I'll attach a couple of screenshots of the modified, almost finished, interface as it is now. Comments welcome. Dave.
Created attachment 22596 [details] random seed with randomize toggle off
Created attachment 22597 [details] Same thing with "Randomize" toggled. Notice that the seed value is changed, and the adjustment and "New seed" buttons are insensitive.
For the record, I don't think we should do this. But it could be done pretty quickly if others decided it were desirable. Cheers, Dave.
Given that there's been no comment on this, I'm re-closing this bug as fixed. If there's a problem with this it can be dealt with in a month or so when we fork a maintenance branch. Cheers, Dave.
Sorry, I missed the closing of this bug because I was mostly offline during the christmas holidays. I still think the random seed should look like in the screenshots above.
Sorry - I missed the closing of this bug as well. I agree with mitch.
Hi, Setting milestone to 2.2 as duscussed in the comment above. Hopefully I can find this patch again. For the record, I'm still against this change. Cheers, Dave.
Resetting milestone to 2.0. We can't change the API nor the behaviour of the random seed during the 2.x cycle. Bolsh, we sould not restrict what the user is able to do with random values. We just need to make sure we have sane defaults that don't need to be changed to get "run with last values" working.
Can I just clear up what the expected behaviour should be, then? 1) Default situation: A random seed is set in the random seed entry, and "Use random seed" is unchecked. When the plug-in is applied, "run with last vals" produces exactly the same result as the first time it was run, by using the same random seed. 2) Rather than specify a random seed, the user clicks "use random seed", and then "run with last values" produces a different random result. Is that all there is? In which case, am I the only one who finds this interface confusing? Cheers, Dave.
Yes, that's exactly what I meant. It may be not the easiest possible UI but IMHO we sould not trade features for easiness of use. And btw, I don't really see why the screenshots above are confusing.
OK - I'll do the change. I just want to point out that the PDB changes that this would have needed have already been done, so there was no reason to insist on this being in 2.0. That said, I'll get a minute somewhere to do up the patch I had so that it works properly. Dave.
2004-02-01 Dave Neary <bolsh@gimp.org> * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgets.h: Modify random seed widget to allow the user to specify that a seed should be chosen randomly for them (useful to allow re-running random plug-ins several times to get several different results). * plug-ins/common/blur.c * plug-ins/common/plasma.c * plug-ins/common/randomize.c * plug-ins/common/sinus.c * plug-ins/common/snoise.c * plug-ins/gflare/gflare.c * plug-ins/maze/algorithms.c * plug-ins/maze/maze.c * plug-ins/maze/maze.h * plug-ins/maze/maze_face.c: Changed appropriately. This fixes bug #129529.