You are here

Rotation Animation

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
AttachmentSize
animation-rotation.scm5.03 KB

This script helps create simple rotating animations.

It asks for the desired number of animation frames (between 4 and 24 frames in increments of 4), and generates the corresponding number of layers each containing a rotated version of the image's background layer.
A choice of animation motion (circular and pendulum) is provided.

It has been tested in Gimp 2.6.11 on GNU/Linux and 2.8 on Windows XP.

Released v1.11 on 2012-07-02.

* Added pendulum motion
* fixed issue from lingering test code

Known Issue: Some layers appear slightly off center when rotated. This is a side effect of the gimp rotation function. Currently working on a metthod to minimize this unwanted effect.

Code License: 
GIMP Version: 
Scripting Engine: 

Comments

Thanks, nice script. But there is a problem.
I cropped a round logo from image and expanded the canvas proportionally. Then used the script to create 15 layers. In playback window closer inspection shows that the animation is slightly shifting towards the right bottom corner. I think it´s not caused by your script, because if I duplicate & rotate without using script, it still happens.
Gimp 2.8 partha 64-bit, Win7 64-bit.

Thanks for your input Evilsson.

Hmm, will look into it. My first guess is that when the GIMP rotation function is called, it is getting some kind of rounding error when calculating the center of the rotated image.

Currently the script duplicates the background layer, then rotates the duplicated layer. Perhaps copying the image, rotating it and putting the rotated image in a new layer would solve the problem. I'll see what I can do.

Try specifying the center in ''gimp-drawable-transform-rotate' (rather than using auto-center).

(gimp-drawable-transform-rotate 
    layer-rotate ; drawable 
    (degrees->radians (car rotate-motion))  ; angle 
    FALSE         ; auto-center 
    (+ (car (gimp-drawable-offsets layer-rotate)) 
       (/ (car (gimp-drawable-width layer-rotate)) 2)) ; center-x 
    (+ (cadr (gimp-drawable-offsets layer-rotate)) 
       (/ (car (gimp-drawable-height layer-rotate)) 2)) ; center-y 
    (cadr rotate-motion)     ; transform-direction 
    TRUE         ; interpolation 
    TRUE         ; supersample 
    3            ; recursion-level 
    1            ; clip-result
    )

Just today i asked for a script to take a set of animated layers (rotation animation) ,and copy them and paste them in reverse into the same xcf file for a ping pong type of effect.

This will go right along with what i was trying to achieve. A rotation that spins one way and back the other. :)
Nicely done and right on time.

-Rod

Hi Rod,

Hope my rotation script proves useful. Please let me know if you run into any problems. I'd be interested to know what OS and version of Gimp you use to run it.

Thanks for your comment. It has given me some ideas for options to add to it. A pendulum option (your ping pong idea), and a semi-circle option.

cheers,

Roan

with Gimp-2.8 (parthas portable version)

-Rod

Subscribe to Comments for "Rotation Animation"