Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gimp-item-transform-rotate question
#1
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 Smile

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.
Reply
#2
Sometimes you have to tell Gimp to update its display. Try a (gimp-displays-flush) before exiting.
Reply
#3
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 ...
Reply
#4
(01-12-2024, 02:54 PM)box_noise Wrote: 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 ...

In practice I don't use it that much (14 out of 91 scripts).
Reply


Forum Jump: