That's very interesting.
Is your gif running in a loop? if so how do you control it?
Which element/part/constraint of your assembly did you animate?
That's very interesting.
There is a comment in the last line of the script:
Code: Select all
ffmpeg -framerate 25 -i %00d.png -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4
The script loops the animation, until I type
Code: Select all
animation.stop()
Code: Select all
App.getDocument("fixedgear").Spreadsheet.set("A2", str(self.an))
Thank you,
Number of steps or some other value that increments every step. I posted an example in this thread https://forum.freecadweb.org/viewtopic. ... 01#p541101
Code: Select all
import FreeCAD as App, FreeCADGui as Gui, Part, time
from PySide2 import QtGui,QtCore
class Animation(object):
def __init__(self):
App.Console.PrintMessage('Animation started\n')
App.ActiveDocument.recompute()
self.timer = QtCore.QTimer()
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.my_update)
self.timer.start(100) #a step every 0.1s (100 ms)
self.val = 0.0 #start value
self.step = 1.0 #step value
self.end = 360.0 #end value
def my_update(self):
App.ActiveDocument.Spreadsheet.set("A2", str(self.val)) #write value to A2 cell
self.val = self.val + self.step #next value will be incremented by the step
App.ActiveDocument.recompute()
if self.val > self.end: #stop updating after 360
self.timer.stop()
App.Console.PrintMessage('Animation ended\n')
def stop(self):
self.timer.stop()
App.Console.PrintMessage('Animation stopped\n')
animation = Animation()
Thank you! That looks very useful.kwahoo wrote: ↑Sat Dec 04, 2021 8:56 am ....I posted an example in this thread https://forum.freecadweb.org/viewtopic. ... 01#p541101...
You can do what you want with these values: change dims in sketches, constraints values in an assembly, dimensions of objects, transparency, colors, manipulate camera position...
Thank you,
How would it handle the "solve constraints" command needed after every single step in my assembly?