songtao.han Posted March 31, 2021 Share Posted March 31, 2021 Hi, I see the ObjectMeshSkinned class has a "Play()" method to play the animations of skinned mesh. Why there isn't a method to play animations reverse? Like "PlayReverse()" for example. Link to comment
karpych11 Posted March 31, 2021 Share Posted March 31, 2021 Hello, You can use negative playback speed for this (https://developer.unigine.com/en/docs/future/api/library/objects/class.objectmeshskinned?rlang=cpp#setSpeed_float_void) Link to comment
songtao.han Posted March 31, 2021 Author Share Posted March 31, 2021 54 minutes ago, karpych11 said: Hello, You can use negative playback speed for this (https://developer.unigine.com/en/docs/future/api/library/objects/class.objectmeshskinned?rlang=cpp#setSpeed_float_void) I've tried, but it's not working when I'm using C#. Link to comment
silent Posted March 31, 2021 Share Posted March 31, 2021 songtao.han Can you show us your code? It looks like we can't reproduce this. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
songtao.han Posted April 1, 2021 Author Share Posted April 1, 2021 15 hours ago, silent said: songtao.han Can you show us your code? It looks like we can't reproduce this. It's a component. Here's playing the animation : using System; using System.Collections; using System.Collections.Generic; using Unigine; [Component(PropertyGuid = "2b2f38e9cd42ad3423e877034df33086d433ce2d")] public class AnimTest : Component { private ObjectMeshSkinned Landgear; private void Init() { // write here code to be called on component initialization Landgear = node.GetChild(node.FindChild("Landgear")) as ObjectMeshSkinned; } private void Update() { // write here code to be called before updating each render frame if (Landgear != null) { if(!Landgear.IsPlaying) Landgear.Play(); } } } And here's trying to play the animation reverse like the dude said upside but not working : using System; using System.Collections; using System.Collections.Generic; using Unigine; [Component(PropertyGuid = "2b2f38e9cd42ad3423e877034df33086d433ce2d")] public class AnimTest : Component { private ObjectMeshSkinned Landgear; private void Init() { // write here code to be called on component initialization Landgear = node.GetChild(node.FindChild("Landgear")) as ObjectMeshSkinned; Landgear.Speed = -1.0f; } private void Update() { // write here code to be called before updating each render frame if (Landgear != null) { if(!Landgear.IsPlaying) Landgear.Play(); } } } Link to comment
silent Posted April 1, 2021 Share Posted April 1, 2021 More likely you need to increase the framerate of your animation to be more or less 30 fps: Landgear.Speed = -30.0f; How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
songtao.han Posted April 1, 2021 Author Share Posted April 1, 2021 2 hours ago, silent said: More likely you need to increase the framerate of your animation to be more or less 30 fps: Landgear.Speed = -30.0f; It is working now. Thanks! But you guys really don't think about adding a play reverse method? Link to comment
silent Posted April 1, 2021 Share Posted April 1, 2021 Right now we don't have any plans, but it doesn't look like a very hard thing to add, so maybe in the future versions it will be implemented. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts