Make a GIF

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Make a GIF

Post by mario52 »

Hi

yes search by Name ... for the moment not possible many work to change

the command is:

Code: Select all

sel = FreeCAD.ActiveDocument.getObject("NameObject")
here little code see the Config (object in 0,0,0 point)

Code: Select all

#Macro_D_Un_Jour_Rotate_And_Save_Image_Without_Selection
#https://forum.freecadweb.org/viewtopic.php?f=3&t=58340
#Make a GIF
#20/05/2021
#Mario52
#
import FreeCAD, FreeCADGui
import time

#### begin Config ########
##
SaveNamefile  = "/home/mint/Documents/Tyty"                 # complete path and Name (without extension) the .png extenstion is in the loop
nameObject    =  FreeCAD.ActiveDocument.getObject("Box")    #name of object
##
beginRotation = 0                      # angle begin rotation
endRotation   = 360                    # angle end rotation
angleStep     = 40                     # angle step by step
##
Length        = 640                    # format image length
Heigth        = 480                    # format image heigth
##
backGroundColor = "Current"            #   # availlable: Current, Transparent or html color ex: #FFFFFF
##
#### end Config ########

BBCenter = nameObject.Shape.BoundBox.Center        # rotation on boundBox center of object
for i in range(beginRotation, endRotation + angleStep, angleStep):
    print(i)
    nameObject.Placement = FreeCAD.Placement(FreeCAD.Vector(0,0,0), FreeCAD.Rotation(0,0,i), FreeCAD.Vector(BBCenter))
    Gui.activeDocument().activeView().saveImage(SaveNamefile +"_"+str(i)+".png" , Length, Heigth, backGroundColor) 
    FreeCADGui.updateGui() 
    time.sleep(0.01) 


mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
BartR
Posts: 256
Joined: Tue Aug 10, 2021 10:59 am

Re: Make a GIF

Post by BartR »

Im' sorry, why don't you use OBS Studio? It's free and it runs also under Linux.
YOu screencapture the turntable while it's running ...
______________
Bart R.
User avatar
mhalil
Posts: 212
Joined: Tue Dec 01, 2020 6:42 pm
Location: İstanbul / Türkiye
Contact:

Re: Make a GIF

Post by mhalil »

https://github.com/phw/peek
Simple animated GIF screen recorder with an easy to use interface

Image
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Make a GIF

Post by drmacro »

mhalil wrote: Sat Nov 26, 2022 8:01 pm https://github.com/phw/peek
Simple animated GIF screen recorder with an easy to use interface

Image
Peek

Love it, use it all the time. :D
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply