Timeline hierarchical transformation and fixing some issues - #665
Conversation
Codecov Report
@@ Coverage Diff @@
## master #665 +/- ##
==========================================
+ Coverage 50.37% 50.41% +0.03%
==========================================
Files 120 120
Lines 26360 27215 +855
Branches 2934 3007 +73
==========================================
+ Hits 13280 13720 +440
- Misses 12626 13031 +405
- Partials 454 464 +10
|
| def set_actor_center(actor, center): | ||
| """ Change the center of an actor to a custom position. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| actor: Actor | ||
| The actor object. | ||
| center: ndarray | ||
| The new center. | ||
| """ | ||
| vertices = vertices_from_actor(actor) | ||
| vertices[:] -= center | ||
| update_actor(actor) |
There was a problem hiding this comment.
Can you move this function to fury.utils. Also, add a test.
Thank you.
| # Adding the callback function that updates the animation. | ||
| showm.add_timer_callback(True, 10, timer_callback) | ||
|
|
||
| interactive = 1 |
| ############################################################################### | ||
| # Setting the rotation interpolator to Slerp. | ||
| timeline.set_rotation_interpolator(slerp) | ||
|
|
There was a problem hiding this comment.
can you also remove the import of slerp. otherwise, pep8
| @@ -28,33 +28,41 @@ | |||
| ############################################################################### | |||
There was a problem hiding this comment.
-
in this tutorial, I always encounter a segmentation fault when I try to run the complex scene. it seems, that it works perfectly when I remove
showm.initialize(). Can you removeshowm.initialize()everywhere. -
Complex scene title has a typo (scene Twice instead of one)
There was a problem hiding this comment.
It works and renders only one time , but time callback functions do not work in case of not initializing
| import numpy as np | ||
| from fury import actor, window | ||
| from fury.animation.timeline import Timeline | ||
| from fury.lib import Actor |
| showm = window.ShowManager(scene, | ||
| size=(900, 768), reset_camera=False, | ||
| order_transparent=True) | ||
| showm.initialize() |
| # Adding Timelines in hierarchical order | ||
| tl_main.add(tl_child) | ||
| tl_child.add(tl_grand_child) | ||
| tl_main.add_child_timeline(tl_child) | ||
| tl_child.add_child_timeline(tl_grand_child) |
|
I will go ahead and merge this PR. Thank you @m-agour |
commit 9751457 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sat Oct 1 20:23:59 2022 +0200 updated tests commit 117c270 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sat Oct 1 20:23:34 2022 +0200 making Timeline independent commit 5c23ece Author: Mohamed Agour <mo.aggour@gmail.com> Date: Fri Sep 30 15:18:16 2022 +0200 Added loop property commit 426936b Author: Mohamed Agour <mo.aggour@gmail.com> Date: Wed Sep 28 12:42:17 2022 +0200 sleep time is not accurate and fails the tests on some OSs commit 2682f5b Author: Mohamed Agour <mo.aggour@gmail.com> Date: Wed Sep 28 12:28:39 2022 +0200 updated tests commit 8b35e9a Author: Mohamed Agour <mo.aggour@gmail.com> Date: Wed Sep 28 11:26:19 2022 +0200 assert actor is not already added to animation commit cc806e4 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Wed Sep 28 11:21:39 2022 +0200 Optimized motion path and some docs commit 097cb3f Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 18:07:34 2022 +0200 fixed glTF animation test commit 5a8c805 Merge: fc67551 0c85d04 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 16:58:21 2022 +0200 Merge remote-tracking branch 'upstream/master' into Seperating-`Timeline`-into-`Timeline`-and-`Animation` commit fc67551 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 14:59:52 2022 +0200 Fixed one letter param commit bf1ab65 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 14:49:17 2022 +0200 Too long dash fixed commit 965daa1 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 14:47:46 2022 +0200 get_keyframes doc typo commit 373268e Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 14:46:31 2022 +0200 Impl `get_camera_data` method commit 0d602f4 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Tue Sep 27 14:39:44 2022 +0200 @skoudoro review - pep and doc issues commit 0c85d04 Merge: 438ff85 a857d10 Author: Serge Koudoro <skab12@gmail.com> Date: Tue Sep 27 00:28:25 2022 -0400 Merge pull request fury-gl#689 from xtanion/gltf-colors GLTF actor colors from material commit a857d10 Author: Serge Koudoro <skab12@gmail.com> Date: Mon Sep 26 21:32:21 2022 -0400 typo commit ecc1859 Merge: 82554b0 438ff85 Author: Serge Koudoro <skab12@gmail.com> Date: Mon Sep 26 16:41:38 2022 -0400 Merge branch 'master' into gltf-colors commit 438ff85 Merge: 748a7fa bab54fa Author: Serge Koudoro <skab12@gmail.com> Date: Mon Sep 26 16:37:05 2022 -0400 Merge pull request fury-gl#643 from xtanion/gltf-animation-data [WIP] Adding ability to load glTF animations commit bab54fa Author: Serge Koudoro <skab12@gmail.com> Date: Mon Sep 26 15:54:34 2022 -0400 add_timeline to add_child_timelime commit 7d5615b Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 21:20:22 2022 +0200 Set back playback_panel to False untill tutorials are edited commit f255501 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 21:09:59 2022 +0200 Update duration in case of hard setting the length commit 83e716c Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 21:01:53 2022 +0200 Tutorials adapt to new method commit c4a0c6d Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 20:59:13 2022 +0200 pep fixing commit e6952d4 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Mon Sep 26 23:56:43 2022 +0530 renaming functions commit 5a99994 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Mon Sep 26 23:47:57 2022 +0530 adding doc string, removing comments commit 82554b0 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Mon Sep 26 22:05:14 2022 +0530 updaing function names commit af350a1 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 12:37:33 2022 +0200 updated robot arm tutorial commit fb9df0d Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 12:07:56 2022 +0200 parent animation impl and doc commit 2105548 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 12:07:36 2022 +0200 Animation playable on its own commit e158720 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 12:06:28 2022 +0200 Duration should be initialized commit 03c14d2 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 12:05:23 2022 +0200 Added more docs commit 49d0d73 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 26 09:03:17 2022 +0200 Fixed some docs commit a97754a Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Sep 25 16:12:39 2022 +0200 Modifing tests commit c219c40 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Sep 25 16:12:26 2022 +0200 Seperating Timeline into Timeline and Animation commit 748a7fa Merge: 1cba674 e5258ca Author: Serge Koudoro <skab12@gmail.com> Date: Fri Sep 23 11:01:16 2022 -0400 Merge pull request fury-gl#665 from m-agour/Timeline-Transformation-matrices-integration Timeline hierarchical transformation and fixing some issues commit 1cba674 Merge: 85accd6 bde544e Author: Serge Koudoro <skab12@gmail.com> Date: Fri Sep 23 10:49:46 2022 -0400 Merge pull request fury-gl#686 from xtanion/gsoc-blogs Adding week 13 blog post commit 85accd6 Merge: b39a678 2226dc2 Author: Serge Koudoro <skab12@gmail.com> Date: Fri Sep 23 10:43:26 2022 -0400 Merge pull request fury-gl#684 from ganimtron-10/week-14 Adding Week 14 Blogpost commit b39a678 Merge: 5448027 6e713e8 Author: Serge Koudoro <skab12@gmail.com> Date: Thu Sep 22 16:31:20 2022 -0400 Merge pull request fury-gl#692 from m-agour/Auto-resize-PlaybackPanel-to-fit-screen Set position and width of the `PlaybackPanel` commit 5448027 Merge: 0384dbb cc318dc Author: Serge Koudoro <skab12@gmail.com> Date: Thu Sep 22 16:28:24 2022 -0400 Merge pull request fury-gl#691 from m-agour/week-13 Added week 13 post commit 6e713e8 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Thu Sep 22 21:17:47 2022 +0200 Pep issues commit d205417 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Thu Sep 22 21:14:17 2022 +0200 Documented some methods commit cc318dc Author: Mohamed Agour <mo.aggour@gmail.com> Date: Wed Sep 21 12:58:55 2022 +0200 Added week 13 post commit 9f804c6 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Wed Sep 21 12:32:40 2022 +0200 Set position and width of the PlaybackPanel commit cee2182 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Mon Sep 19 02:01:16 2022 +0530 fixing lighting issues commit 818d74b Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Mon Sep 19 00:20:17 2022 +0530 colors from material commit b5725c2 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sat Sep 17 23:03:34 2022 +0530 fixing gltf tests commit 89b3014 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 16 20:24:49 2022 +0530 fixing tests commit 447d34a Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 16 17:52:42 2022 +0530 moved interpolators to `interpolator.py` commit d364444 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 16 17:40:03 2022 +0530 adding tests for transform function commit b021370 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 16 17:16:36 2022 +0530 Upddated tutorial and function names commit bde544e Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 16 17:03:18 2022 +0530 removing the completed tasks commit 2226dc2 Author: Praneeth Shetty <praneethshetty10@gmail.com> Date: Fri Sep 16 06:59:05 2022 +0530 updating week-13 blogpost commit 17d2c97 Merge: 82a45b7 0384dbb Author: Praneeth Shetty <praneethshetty10@gmail.com> Date: Fri Sep 16 06:56:56 2022 +0530 Merge branch 'master' into week-14 commit 81c8616 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Sep 15 23:24:36 2022 +0530 warning fix commit 43c9d0b Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Sep 15 23:20:34 2022 +0530 adding video commit 2371881 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Sep 15 23:15:11 2022 +0530 adding week 13 blog commit 82a45b7 Author: Praneeth Shetty <praneethshetty10@gmail.com> Date: Wed Sep 14 21:47:22 2022 +0530 adding commas commit e5258ca Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 12 03:31:25 2022 +0200 fix segmentation fault commit 182ee96 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 12 02:56:46 2022 +0200 Missing init commit 08958c2 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 12 02:53:34 2022 +0200 duplicate line commit a416081 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 12 02:52:27 2022 +0200 modified robot arm tutorial commit d16deec Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 12 02:30:05 2022 +0200 set_actor_origin commit 0033d71 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sun Sep 11 20:04:14 2022 +0530 updating tutorials commit fe087c7 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sun Sep 11 20:02:53 2022 +0530 fixing tests commit 23be1c1 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sun Sep 11 19:50:25 2022 +0530 Removing skinning functions and tests commit f31fc96 Author: Praneeth Shetty <praneethshetty10@gmail.com> Date: Sun Sep 11 09:49:14 2022 +0530 adding content commit e6562cb Author: Praneeth Shetty <praneethshetty10@gmail.com> Date: Sat Sep 10 08:29:23 2022 +0530 adding template commit 0c93234 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 9 14:26:56 2022 +0530 removing skinning tutorials commit c248363 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 9 14:25:19 2022 +0530 adding docs and removing skinning tutorials commit 8600e41 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Sep 9 11:22:53 2022 +0530 adding bone actors and pre multiplying transforms commit 1f53e47 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Sep 5 04:51:48 2022 +0200 Added readme commit ebbec41 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Sep 1 22:53:21 2022 +0530 tests for skinnning data commit dfd9765 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Wed Aug 31 23:01:00 2022 +0530 adding simple animation tests commit 606e949 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Wed Aug 31 22:59:37 2022 +0530 Fixing skin matrix formation from ibms reference:https://www.gamedev.net/forums/topic/703803-gltf-skinning-matrix-calculation/ commit 9f123bb Author: Mohamed Agour <mo.aggour@gmail.com> Date: Mon Aug 29 16:24:14 2022 +0200 Add `update_callback` commit 1d149d6 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 28 16:49:19 2022 +0200 Extra set interpolator statement commit 4673fd3 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 28 16:48:06 2022 +0200 Modified cubic bezier tutorial commit b7644a1 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 28 16:34:36 2022 +0200 Slerp by default for rotation commit 7feb8e3 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 28 16:34:02 2022 +0200 No need set interpolator to slerp for rotation commit 9f783e4 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sun Aug 28 01:46:30 2022 +0530 multiplying previous transforms for same timestamp commit 8356b2b Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sat Aug 27 14:55:48 2022 +0200 Default interpolator for rotation to slerp commit 58a478d Merge: 76c3cf7 e5b2b9b Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Aug 26 19:07:59 2022 +0530 Merge branch 'gltf-skin-test' into gltf-animation-data commit 837989a Author: Mohamed Agour <mo.aggour@gmail.com> Date: Thu Aug 25 19:55:46 2022 +0200 Renamed `add_child_timelines` references commit 8552551 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Thu Aug 25 19:54:23 2022 +0200 Changed `add_timeline` to `add_child_timeline` commit d7d0ad1 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Thu Aug 25 19:48:11 2022 +0200 Fixed typos commit e5b2b9b Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Aug 25 20:39:19 2022 +0530 fixed bytestride issue and joint animation issue commit b413847 Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 21 20:15:07 2022 +0200 fixed tests commit 12ec3fb Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 21 19:31:33 2022 +0200 updated timing commit 06b9c3a Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 21 18:18:22 2022 +0200 animating robot arm examble commit b5dcaee Author: Mohamed Agour <mo.aggour@gmail.com> Date: Sun Aug 21 15:24:48 2022 +0200 Added hierarchical support commit 76c3cf7 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sat Aug 20 22:59:02 2022 +0530 viz_gltf.py back to original commit 02ba67a Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sat Aug 20 22:07:40 2022 +0530 Added new tutorial commit d239911 Merge: 2eba0b2 db9771c Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sat Aug 20 05:33:44 2022 +0530 Merge branch 'master' into gltf-skin-test commit b5c3f23 Merge: df56c02 db9771c Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sat Aug 20 05:04:52 2022 +0530 Merge branch 'master' into gltf-animation-data commit 2eba0b2 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sat Aug 20 03:47:14 2022 +0530 applying ibms per node on animation commit d8a9790 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Aug 18 04:02:16 2022 +0530 adding lerp interpolator commit fb6af35 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Tue Aug 16 03:08:13 2022 +0530 working skinning prototype commit 541f626 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Fri Aug 12 23:13:28 2022 +0530 skeletal animation but wrong commit 5be5963 Merge: 409db15 a014b6e Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Aug 11 20:08:30 2022 +0530 Merge remote-tracking branch 'm-agour/Interpolators-using-closures' into gltf-skin-test commit 409db15 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Aug 11 20:07:28 2022 +0530 adding skin matrix commit 980f8e1 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Wed Aug 10 03:20:47 2022 +0530 loading all skin data commit 75e7a14 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Sun Aug 7 23:33:04 2022 +0530 Changing transformation after actor is formed commit 5ed7071 Merge: db46118 d8b5459 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Aug 4 04:38:07 2022 +0530 Merge remote-tracking branch 'm-agour/Interpolators-using-closures' into gltf-animation-interps commit db46118 Author: Shivam Anand <74976752+xtanion@users.noreply.github.com> Date: Thu Aug 4 04:35:03 2022 +0530 ding method for animated gltf commit df56c02 Author: xtanion <anandshivam54321@gmail.com> Date: Wed Jul 27 14:16:44 2022 +0530 Extracting skinning data commit 22896ba Author: xtanion <anandshivam54321@gmail.com> Date: Mon Jul 25 21:59:01 2022 +0530 fixing example commit cef3961 Author: xtanion <anandshivam54321@gmail.com> Date: Mon Jul 25 21:49:01 2022 +0530 Return property of node to be transformed commit c8e7ae9 Author: xtanion <anandshivam54321@gmail.com> Date: Mon Jul 25 21:35:21 2022 +0530 Return nodes and actor relation commit 0fa1b1a Author: xtanion <anandshivam54321@gmail.com> Date: Sun Jul 24 13:03:12 2022 +0530 Get data from animation accessors
Implementing hierarchical support for transformation.
This optimizes setting transformation data since it composes them into a single matrix.
Also this feature is a must in the field of robotics. And it's required by @xtanion's Project (
glTF animations)I included a tutorial showing a basic robot arm that has 3 joints. I will include more details in the tutorial while fixing issues @skoudoro mentioned in #664
robot.arm.mp4