Making animations?
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
- Hirvonen91
- Posts: 10
- Joined: Mon Jan 25, 2016 1:02 pm
- Location: Joensuu, Finland
Making animations?
How can you make an animation or mechanism with freecad?
There is that video:
https://www.youtube.com/watch?v=KynMmsLJXV0
There is couple gear rotating, and that guy writes some kind of code.. is that really the only way?
The very same guy have done also a gearbox.. rotating one.
OS: Windows 8
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
There is that video:
https://www.youtube.com/watch?v=KynMmsLJXV0
There is couple gear rotating, and that guy writes some kind of code.. is that really the only way?
The very same guy have done also a gearbox.. rotating one.
OS: Windows 8
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
CAD makes people boring
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Making animations?
See my workbench with a lot of demo videos
http://freecadbuch.de/doku.php?id=Animation%20Wokbench
there is no need for programming
all components are parametric.
http://freecadbuch.de/doku.php?id=Animation%20Wokbench
there is no need for programming
all components are parametric.
- Hirvonen91
- Posts: 10
- Joined: Mon Jan 25, 2016 1:02 pm
- Location: Joensuu, Finland
Re: Making animations?
Thank you!microelly2 wrote:See my workbench with a lot of demo videos
http://freecadbuch.de/doku.php?id=Animation%20Wokbench
there is no need for programming
all components are parametric.
I didnt know there is a workbench for that.. i have to learnt that now!
(and i think i should have learn "the engineering" language .. that could be usefull now. After all you guys did invent almost everything engineering things..)
CAD makes people boring
Re: Making animations?
Hi!
microelly has created a nice workbench for animation, but if you learn how to code them in python directly, you will be able to achieve almost anything you want with FreeCAD (much more than animations).
It's not as hard as it seems, just watch the gear animation video (https://www.youtube.com/watch?v=KynMmsLJXV0) carefully.
Another animation example using python:
http://linuxforanengineer.blogspot.com. ... anism.html
Hope this helps.
Javier.
microelly has created a nice workbench for animation, but if you learn how to code them in python directly, you will be able to achieve almost anything you want with FreeCAD (much more than animations).
It's not as hard as it seems, just watch the gear animation video (https://www.youtube.com/watch?v=KynMmsLJXV0) carefully.
Another animation example using python:
http://linuxforanengineer.blogspot.com. ... anism.html
Hope this helps.
Javier.
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: Making animations?
Hello,
I really like the Animation WB created by microelly2. However, what I'm missing in this WB is the rotation of the objects about arbitrary axis (not only the origin axis).
For example, the rotation shown by the link below consist of three steps. It doesn't seem to be possible to repeat the step #3 in Animation WB as this rotation (step #3) is happening about the tilted axis Z. I would highly appreciate if someone could advise on how this can be done.
https://en.wikipedia.org/wiki/Euler_ang ... uler2a.gif
Thanks in advance.
I really like the Animation WB created by microelly2. However, what I'm missing in this WB is the rotation of the objects about arbitrary axis (not only the origin axis).
For example, the rotation shown by the link below consist of three steps. It doesn't seem to be possible to repeat the step #3 in Animation WB as this rotation (step #3) is happening about the tilted axis Z. I would highly appreciate if someone could advise on how this can be done.
https://en.wikipedia.org/wiki/Euler_ang ... uler2a.gif
Thanks in advance.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Making animations?
I both cases rotator or placer you can change the rotation axis direction and location.
If you want to contrall all 3 euler angles independently there is no direct way at them moment,
but we can do this. there was never before a request.
I use for 3 rotations in assembly an other way
http://freecadbuch.de/doku.php?id=blog: ... r_animiert
If you want to contrall all 3 euler angles independently there is no direct way at them moment,
but we can do this. there was never before a request.
I use for 3 rotations in assembly an other way
http://freecadbuch.de/doku.php?id=blog: ... r_animiert
-
- Posts: 3
- Joined: Sun Aug 19, 2018 11:37 am
Re: Making animations?
Hi.
I tried to rotate the gears which are shown in this site
https://www.youtube.com/watch?v=KynMmsLJXV0
But my code in python console looks like incorrect
Which is sent below. Is there any synthax error?
from PySide import QtCore
i= 0
def update (i):
global I
App.getDocument." Unnamed2": Body 001 Placement: AppPlacement:AppVector:(0,127.5,0), AppRotation AppVector (0, 0.1, 0), i, AppVector 0,0,0)
i=0.005
timer = QtCore.QTimer ()
timer. timeout.connect (Update)
timer.start (1)
I tried to rotate the gears which are shown in this site
https://www.youtube.com/watch?v=KynMmsLJXV0
But my code in python console looks like incorrect
Which is sent below. Is there any synthax error?
from PySide import QtCore
i= 0
def update (i):
global I
App.getDocument." Unnamed2": Body 001 Placement: AppPlacement:AppVector:(0,127.5,0), AppRotation AppVector (0, 0.1, 0), i, AppVector 0,0,0)
i=0.005
timer = QtCore.QTimer ()
timer. timeout.connect (Update)
timer.start (1)
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Making animations?
There is a section in the forum for getting help on python scripts. This post is in the section related to help using the FreeCAD Gui.Sharafatdin wrote: ↑Sun Aug 19, 2018 12:01 pm Hi.
I tried to rotate the gears which are shown in this site
https://www.youtube.com/watch?v=KynMmsLJXV0
But my code in python console looks like incorrect
Which is sent below. Is there any synthax error?
from PySide import QtCore
i= 0
def update (i):
global I
App.getDocument." Unnamed2": Body 001 Placement: AppPlacement:AppVector:(0,127.5,0), AppRotation AppVector (0, 0.1, 0), i, AppVector 0,0,0)
i=0.005
timer = QtCore.QTimer ()
timer. timeout.connect (Update)
timer.start (1)
You should surround code examples using the </> button/icon/tool. This will preserve indentation formatting, which is critical in python. Not preserving the indentation makes it difficult to read because it's impossible to see where a function definition ends without the indentation.
Yes, there are syntax errors.
Python functions are case-sensitive, thus 'update' function must be spelled exactly the same in both places. In other words, Update and update are not considered equal in python.
App.getDocument."Unnamed2" is not correct syntax. I would just use App.ActiveDocument instead unless I needed the Unnamed2 document in particular, in which case: App.getDocument('Unnamed2') is the way to go.
You should create a new macro and use the macro editor rather than entering directly into the python console. That way it is easier to make changes, save them, and run the macro again. I always import FreeCAD first, but I don't know if this is necessarily required in all cases.
You are misusing colons (:) in places where a dot (.) should be used and in places where neither should be used. In other places you are leaving out the dot or the parentheses.
I would separate the placement line something like this:
Code: Select all
object = App.ActiveDocument.getObject('NameOfObject')
object.Placement=App.Placement(App.Vector(x,y,z),App.Rotation(yaw,pitch,roll),App.Vector(centerX,centerY,centerZ))
If you cannot get it to work you should make a new post in the python scripting forum. Include the full code you are using along with the FreeCAD file you are trying to animate.
Edit: Link to example code: https://forum.freecadweb.org/viewtopic. ... 16#p246494
-
- Posts: 3
- Joined: Sun Aug 19, 2018 11:37 am
Re: Making animations?
Thanks a lot!
I learned how to create animation
I learned how to create animation
-
- Posts: 3
- Joined: Sun Aug 19, 2018 11:37 am
Re: Making animations?
Hi.
I would like to rotate an object by 45 degrees forward and 45 degrees backward like a lever.
But I do not know how to write the code in python console.
I would like to rotate an object by 45 degrees forward and 45 degrees backward like a lever.
But I do not know how to write the code in python console.