zanoni-mbdyn / blendyn

MBDyn (https://www.mbdyn.org/) graphical post-processor for blender (https://www.blender.org/)
GNU General Public License v2.0
40 stars 8 forks source link

Rotation problem in animation #44

Closed ZhangRunsen closed 2 years ago

ZhangRunsen commented 3 years ago

Hello, everyone.
I am a new user of blendyn. It looks insteresting to render MBDyn model in blender.
However, when I tried to render a rotating beam, I find the beam will rotate 360deg (eg. from -180 to 180) druing the rotation, resulting in a flip in the animation, such as the one in the gif.
Is it about the description of rotation in two softwares? And do you have any idea to fix it, or any suggestion ? Thanks, Best regards, Runsen. rotation_mode1_withoutpd

zanoni-mbdyn commented 3 years ago

Hi Runsen, nice to hear that you are using Blendyn!

The problem you are experiencing is almost surely due to the rotation parametrization that you are using (i presume it is the default, Euler angles). Try using the orientation vector representation, instead, adding

default orientation: orientation vector;

to your control data. That should fix your problem.

ZhangRunsen commented 3 years ago

Hi, Andrea, Thanks for your suggestion. Sorry for the late reply, I struggled with blender and the GPU drivers in weekends. For the rotation problem, I tried your suggestion, but I still see the problem at some key frames (Btw, I used a released blender2.92/stable from snap now. Although I tried it with different versions, including blender 2.79, 2.83lts, and 2.92, the same problem is observed.) rotation_problem And here is the MBDyn script I used. beam.zip

Another problem is that when I quit blender, there seems to be an unregistered problem about the blendyn add-on, as shown in the figure. blender_quit_problem.

Thanks for your help again, Best regards, Runsen.

zanoni-mbdyn commented 3 years ago

Runsen, thank you for your feedback. As for the latest problem, I had a fix already committed in devel, but it had not been merged in master yet. Now it should be fine.

For the first problem, actually I initially misunderstood it for an issue on nodes' rotations, but now inspecting the output myself I get that it is really about the orientations of the beam3 sections... I will investigate further.

ZhangRunsen commented 3 years ago

Thanks, Andrea. Best regards, Runsen.

zanoni-mbdyn commented 3 years ago

Hi Runsen, I played a little bit more with your model and in the end I think that the problem relies on the way in which Blender handles the curve twist, which in turn is related to the tilting of the sections of the curve bevel object (in this case, the NACA profile curve).

I think that the tilt should be really set at each time-step in the animation in a way that is consistent with the beam deformations. However, at the moment I do not have time to implement and test this... We'll see, maybe we can find some willing GSoC student ;)

As an alternative, my advice for you is to try the new, eXperimental feature components. Since it is not yet documented, I thought of getting the opportunity and upload a video on YouTube, creating the stub for the Blendyn channel. You can find it here: let me know if it clear enough!

zanoni-mbdyn commented 3 years ago

Oh, sorry, I forgot to mention that I also took the opportunity for fixing a couple of bugs here and there. In the video, I use the latest Blendyn version that can be found on the devel branch.

ZhangRunsen commented 3 years ago

Thanks for your guidance, Andrea. That's helpful to me. The video is very clear, and I see the procedure to add a new component to beam3 elements. A little suggestion is that it would be more helpful to beginners if there is narration for operations in the video. I will test it soon, and give you feedback. Happy holidays ! Runsen.

ZhangRunsen commented 3 years ago

Thanks, Andrea. I tested it following the video, and there is no problem about the rotation.

Happy holidays! Runsen.

zanoni-mbdyn commented 3 years ago

Thank you for trying it out, Runsen.

And yes you are right, commentary would be useful in the videos.I did this one very quickly and I did not manage to record also the audio. The future ones will be the compete package!

zanoni-mbdyn commented 3 years ago

Oh, and happy holidays to you, too ;)