It is currently 19 Feb 2018, 19:34

GIMP Python Fu ScriptsBA Conbagui's Lighter Animation script (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
Post Reply
User avatar
animicule

Script Coder
View: Showcase | Slideshow
Topic Posts: 5/6
Posts: 614
Joined: 10 Jan 2017, 15:25
Cash on hand: 148.06 GLP
Bank: 56,999.00 GLP
Gender: Guy
Location: South Dakota
Operating System: Windows
GIMP Version: 2.9.5
x 169
United States of America

BA Conbagui's Lighter Animation script

Post#1 by animicule » 23 Jul 2017, 01:23


###################################################################
This script follows Conbagui's How to Create A Lighter
=== === === === === === === === === === === === === === === === === === === ===
=== === === === === === === === === === === === === === === === === === === ===
Script of Conbagui's How to Create a Lighter - with animation option
=== === === === === === === === === === === === === === === === === === === ===
=== === === === === === === === === === === === === === === === === === === ===
First I would like to give thanks to Conbagui for creating these great tutorials!
You should go to GimpLearn.net and get a copy of the tutorial. There are
some very good things to learn about Gimp in every one of them.
=== === === === === === === === === === === === === === === === === === === ===
=== === === === === === === === === === === === === === === === === === === ===
I have included copies of the gradients Conbagui uses in his tutorial.
You should move these into your Gimp Brushes folder.
-- -- -- -- -- -- -- -- -- -- -- --
Brownwood.ggr
Metal6.ggr
Metal7.ggr
Silver.ggr
Silver-plate.ggr
-- -- -- -- -- -- -- -- -- -- -- --
=== === === === === === === === === === === === === === === === === === === ===
=== === === === === === === === === === === === === === === === === === === ===
He also uses these 2 patterns, and you should move them into your
-- -- -- -- -- -- -- -- -- -- -- --
Gimp Patterns folder.
SPANISH CEDAR V.jpg
SPANISH CEDAR.jpg
-- -- -- -- -- -- -- -- -- -- -- === === === === === === === === === === === === === === === === === === === ===
=== === === === === === === === === === === === === === === === === === === ===
I have included copies of the brushes Conbagui uses in his tutorial.
You should move these into your Gimp Brushes folder.
-- -- -- -- -- -- -- -- -- -- -- --
Ring hardness 075.gbr
Screw7.gbr
Shape3.gbr
Shape4.gbr
Shape5.gbr
Tube.gbr
-- -- -- -- -- -- -- -- -- -- -- --
=== === === === === === === === === === === === === === === === === === === ===
=== === === === === === === === === === === === === === === === === === === ===
When you have the essentials ready to go, this plug-in should be moved into your
Gimp plug-ins Folder.
Restart Gimp so that it finds everything and you're ready.

=== === === === === === === === === === === === === === === === === === === ===
This plug-in will run without an image file open.
If you choose to use it without an image file open, make sure to NOT select
'My Background' -- you can choose 'None' or Conbagui's Background.
You will also see boxes for Input Image and Input Drawable in the Dialog,
they will say (Empty), or will have items found in the Gimp cache.
Just ignore them. I did not add functionality for them.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
It will also run with an image open. You can select the option 'My Background'
and it will use the open image. The image size will be scaled to 1024 x 768
for use in the script.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
If you choose the option of Conbagui's background, it will generate the
background used in his tutorial. That covers the Background Choice.
=== === === === === === === === === === === === === === === === === === === ===
Cap Angle is an option only if you are not generating layers for a GIF file.
It has no effect if you select an angle and Generate Gif Layers.
It will rotate the lighter cap from the standard in the tutorial on an image
file.
=== === === === === === === === === === === === === === === === === === === ===
Cutout black on the Cam is an option. Easy, try it and see... works
on single image and also Gif layer generation.
=== === === === === === === === === === === === === === === === === === === ===
Make shadows in the background works for single image or Gif layer generation.
=== === === === === === === === === === === === === === === === === === === ===
Generate GIF layers does exactly that. It will generate a layer for every
1 degree of rotation. There are many tutorials on makeing GIF's. I will
give only the basics. When the layers are generated, you choose:
FILE > EXPORT AS and type in a file name wotj the file extention .GIF
click EXPORT and you will get a gif dialog box.
Check the AS ANIMATION box, Check LOOP FOREVER (it should already be),
Enter 30 into the milliseconds box. Set FRAME DISPOSAL to
ONE FRAME PER LAYER (replace). and check
USE DELAY ENTERED ABOVE FOR ALL FRAMES and also
USE DISPOSAL ENTERED ABOVE for all frames.
Then click on EXPORT.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Now after it has completed the save, and it does take a bit, there are
about 270 frames and the default size if large for a gif. Sometimes,
the screen turns white and it says Export is not responding, but just go
get a glass of water or something, it will finish in a while.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
After it has saved, then goto FILE > OPEN RECENT and open the GIF
file you just created. Here is where you need to chance a couple
things to make the GIF run the way you like. You will be using this
command once again after you have edited the GIF TAGS as you like.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The midpoint whee the lighter is fully shut is frame 134 -- in the layer window
go to frame 134 and you will see the GIF TAG. Right click on the layer
and from the top of the dropdown menu take Edit Layer Attributes.
If you chose 30ms as the default frame rate when you saved it you can just
edit the TAG to Frame 134 (2000ms) (replace)
This will allow the cap to rest for about 2 seconds before continuing.
Also goto the bottom layer and do the same so that the cap will rest
for a moment in the Open position.
If you did not select 30ms on the first save, It is a lot less work
to go back and do it over, putting the 30 into the ms box and selecting
USE DELAY ENTERED ABOVE FOR ALL FRAMES... This one will be very slow
at 100ms delay. So you may play with it as you will!
****** NOW ON THE BOOTOM FRAME ---
my method is to make it read 'Background (2000ms) (replace)' the spaces
are important, they must have only 1 space in each place.
If you do not do this, when the loop starts again it may jerk or shutter.
You can experiment as you will!
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
NOW time for the important 2nd save, you saw the created tags from the
first save and have edited them as you like, now when you save a 2nd time
your option choices should be slightly different.
Again, go to file export and type in your file name.. on the 2nd save
I usually just put a number after the original name Test.gif goes to
Test2.gif. If you do not change the file name, it will overwrite using
the same default values that you set the first time, so change the
file name. Make sure the AS ANIMATION is still checked,
LOOP FOREVER is still checked. 30 is still in milliseconds,
ONE FRAME PER LAYER (REPLACE) is stil the choice, but this time,
take the check out of the USE DELAY ENTERED ABOVE FOR ALL FRAMES --
or your editing the frame times will be lost.
Also have the USE DISPOSAL ENTERED ABOVE FOR ALL FRAMES should be checked.
=== === === === === === === === === === === === === === === === === === === ===
A note, if you view your new GIF from with in GIMP
FILTERS > ANIMATION > PLAY BACK it doesn't always look the same as if
you open your Internet Browser and watch it from there...
=== === === === === === === === === === === === === === === === === === === ===
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
That is about everything that I know, so have some fun. Oh, one more thing,
If you want to extend the layer stack, so you could start in the middle instead
of the beginning, right after the script runs, take FILTERS > Python-FU > CONSOLE
it gives you a window with a command prompt of 3symbols >>>
Cut and paste exactly the following down to and including the space but not the arrow.
also, make sure there is no space after the prompt of >>> this will double your
stack so you can edit any point you wish as the start and end point, although
sometimes being in GIF format, it may not run all the way through because of
too large a size (as far as I can tell. I'm no expert on GIF's.)

image2 = gimp.image_list()[0]
for i in image2.layers[::-1]:
new_layer = pdb.gimp_layer_new_from_drawable(i,image2)
pdb.gimp_image_insert_layer(image2,new_layer,None,0)

pdb.gimp_display_new(image2)
<-- include one space to the left of the arrow for a line feed!
=== === === === === === === === === === === === === === === === === === === ===
if you are viewing your layer stack, you should see the size double.
=== === === === === === === === === === === === === === === === === === === ===
==================================================================================================
####################
# COPYRIGHT NOTICE #
###############################################################################
# You should have received a copy of the GNU General Public License #
# along with this program if not, you can view the GNU General Public #
# License version 3 at the web site http://www.gnu.org/licenses/gpl-3.0.html #
# Alternatively you can write to the Free Software Foundation, Inc., 675 Mass #
# Ave, Cambridge, MA 02139, USA. #
###############################################################################
"""
Attachments
ba_Conbagui_Lighter Animation Release Instructions.zip #
(535.26 KiB) Downloaded 11 times
Last edited by animicule on 26 Jul 2017, 22:50, edited 2 times in total.
0 x




Registered members enjoy ads-free content
User avatar
animicule

Script Coder
View: Showcase | Slideshow
Topic Posts: 5/6
Posts: 614
Joined: 10 Jan 2017, 15:25
Cash on hand: 148.06 GLP
Bank: 56,999.00 GLP
Gender: Guy
Location: South Dakota
Operating System: Windows
GIMP Version: 2.9.5
x 169
United States of America

Post#2 by animicule » 23 Jul 2017, 01:27


Here is an example gif file of the layer stack outcome using the animate option.
Attachments
ButterflyLighter_180.gif
ButterflyLighter_180.gif # (7.3 MiB) Viewed 286 times (Watermarked | Thumbnail)
0 x




User avatar
animicule

Script Coder
View: Showcase | Slideshow
Topic Posts: 5/6
Posts: 614
Joined: 10 Jan 2017, 15:25
Cash on hand: 148.06 GLP
Bank: 56,999.00 GLP
Gender: Guy
Location: South Dakota
Operating System: Windows
GIMP Version: 2.9.5
x 169
United States of America

Post#3 by animicule » 23 Jul 2017, 01:28


And another if it is not too large...
oops, it didn't go through. to large.
Last edited by animicule on 23 Jul 2017, 01:30, edited 1 time in total.
0 x




User avatar
animicule

Script Coder
View: Showcase | Slideshow
Topic Posts: 5/6
Posts: 614
Joined: 10 Jan 2017, 15:25
Cash on hand: 148.06 GLP
Bank: 56,999.00 GLP
Gender: Guy
Location: South Dakota
Operating System: Windows
GIMP Version: 2.9.5
x 169
United States of America

Post#4 by animicule » 23 Jul 2017, 01:29


Tried again...
Attachments
SmallTest2.gif
SmallTest2.gif # (6.01 MiB) Viewed 286 times (Watermarked | Thumbnail)
0 x




User avatar
Pat625
Script Tester
View: Showcase | Slideshow
Topic Posts: 1/6
Posts: 2227
Joined: 28 Sep 2016, 03:35
Cash on hand: 13,233.70 GLP
Gender: Gal
Location: USA
Operating System: Windows
GIMP Version: 2.8.22
x 8
x 468
United States of America

Post#5 by Pat625 » 23 Jul 2017, 01:39


That is pretty cool! Like that quick opening and smooth closing.
0 x




User avatar
animicule

Script Coder
View: Showcase | Slideshow
Topic Posts: 5/6
Posts: 614
Joined: 10 Jan 2017, 15:25
Cash on hand: 148.06 GLP
Bank: 56,999.00 GLP
Gender: Guy
Location: South Dakota
Operating System: Windows
GIMP Version: 2.9.5
x 169
United States of America

Post#6 by animicule » 23 Jul 2017, 01:49


Try it, pretty easy with the script, it builds the lighter, you provide your background ( or not)! -- Smooth because of 1 degree movement per layer rotation so there are lots of layers. Hope everything works right, tested a lot! (so I know something will show up right away hahha).
Thank you!
0 x




Post Reply

Last 20 Members Who Visited This Topic

User avatar Conbagui (1), User avatar PhotoMaster (1), User avatar Pat625 (3), User avatar animicule (17), User avatar Issabella (1)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: tim
2: dinasset
3: david
4: animicule
5: david
6: Ella
7: gnerd

Who is online

Users browsing this forum: No registered users and 1 guest