gimp-item-transform-rotate question - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: gimp-item-transform-rotate question (/Thread-gimp-item-transform-rotate-question) |
gimp-item-transform-rotate question - box_noise - 01-12-2024 I am working on my first script-fu project on gimp 2.10 and have a problem using the gimp-item-transform-rotate procedure. I can use this directly in the Script-Fu Console and it works correctly: (gimp-item-transform-rotate 2 -0.009593 0 907 73 ) When I try to use this same command in my script, the script will execute and I can see the status bar showing it do the rotate calculations, but when it finishes the layer is not actually rotated. What's odd is that once I manually click anywhere on the image with the fuzzy tool ... then the image will rotate correctly. I tried putting a fuzzy select and bucket-fill command after the rotate command in my script ... the script finishes, but I have to manually click on the image before it does the rotate and bucket fill. So my question is, what do I need to do in the script to apply the rotate command directly (and rotate the image without waiting for me to manually click on the image)? Again, this is my first attempt with script-fu, so I am probably missing something pretty basic Note: I also tried a (gimp-image-rotate image 0) command. It works correctly in the Script-Fu Console. When I run it in my script, it acts similar to above: the layer rotates correctly, but the photo does not rotate to fit the layer until I manually click somewhere on the image. RE: gimp-item-transform-rotate question - Ofnuts - 01-12-2024 Sometimes you have to tell Gimp to update its display. Try a (gimp-displays-flush) before exiting. RE: gimp-item-transform-rotate question - box_noise - 01-12-2024 Thank you very much ... that worked like a charm. I was looking for a command with "cache" in it. Looks like there are several gimpdisplay functions. I'll have to play around with those to get a better idea of their concept of "display". In the procedure description for (gimp-displays-flush) they state: "It should be called whenever appropriate." That certainly makes things clear ... RE: gimp-item-transform-rotate question - Ofnuts - 01-12-2024 (01-12-2024, 02:54 PM)box_noise Wrote: Thank you very much ... that worked like a charm. In practice I don't use it that much (14 out of 91 scripts). |