Hi,
I'd like to animate some object in freecad, but can this be specified in the script alone?
Is there a small example somewhere? Basically, I am just looking for some time variable,
and something that will update the view at regular intervals based on the time variable.
Thanks,
Denis
scripting animations?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: scripting animations?
hi
viewtopic.php?f=24&t=6815
viewtopic.php?f=24&t=6835
https://www.youtube.com/watch?v=mFyd3H75GvE
https://www.youtube.com/watch?v=Zmq5B9nRnpQ
https://www.youtube.com/watch?v=kzPeJnFNLPI
.......
mario
viewtopic.php?f=24&t=6815
viewtopic.php?f=24&t=6835
https://www.youtube.com/watch?v=mFyd3H75GvE
https://www.youtube.com/watch?v=Zmq5B9nRnpQ
https://www.youtube.com/watch?v=kzPeJnFNLPI
.......
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.
My macros on Gist.github here complete macros Wiki and forum.
Re: scripting animations?
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.
My macros on Gist.github here complete macros Wiki and forum.
Re: scripting animations?
hi
with the same principle, a spring
Open the 2 files (Spring.FCMacro and Spring.FCStd) in FreeCAD with 2 screens, then (Menu > Windows > tile menu) and click in the window and the macro and F6 (debug macro)
Spring.FCMacro
mario
with the same principle, a spring
Open the 2 files (Spring.FCMacro and Spring.FCStd) in FreeCAD with 2 screens, then (Menu > Windows > tile menu) and click in the window and the macro and F6 (debug macro)
Spring.FCMacro
Code: Select all
import FreeCAD, FreeCADGui, Draft, Part
from FreeCAD import Base
import time
ii = iib = FreeCAD.getDocument("Spring").getObject("Helix001").Pitch
i = ib = FreeCAD.getDocument("Spring").getObject("Helix001").Height
pas = 1
for ii2 in range(int(60)):
if pas == 0:
if ii > iib-1:
pas = 1
else:
ii += 1
i = (ii * 10)
else:
if ii < 2:
pas = 0
else:
ii -= 1
i = (ii * 10)
FreeCAD.getDocument("Spring").getObject("Helix001").Pitch = ii
FreeCAD.getDocument("Spring").getObject("Helix001").Height = i
App.Console.PrintMessage(str(ii2)+" " + str(ii)+" " + str(i)+" " + str(pas) +"\n")
time.sleep(0.1) # modify the time here
#FreeCAD.getDocument("Spring").getObject("Helix001").Pitch = iib
#FreeCAD.getDocument("Spring").getObject("Helix001").Height = ib
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.
My macros on Gist.github here complete macros Wiki and forum.