raul.salas Posted January 23, 2019 Posted January 23, 2019 (edited) Hello, I found a problem with the animations when you combine animations and LOD. I will explain the attached photo and how I got there. I'm working on 2.7.2.2 version. The problem happened to me in a scene where I had a door system with animations and LODs, but I was seeing something weird. When I walked away from a door that I had just opened and approached another of the same type, I noticed that when loading the same LOD (Near), the door kept the same frame in the animation of the previous door. It seems like the engine optimizes the load of a certain LOD and when I pick it up, it returns the one that had the other door, without taking into account the frame of the animation. I will explain how I created the example below so that you can simulate it: I have put two doors, both have a loaded animation, I have put the LODs at a little distance and added to one of the doors an oscillating expression, forcing the door to change the LOD. Second LOD I have deactivated so that the change is noticed at a glance. Now I have a static door and another that oscillates from the first LOD to the second. Well, at the first door I gave it to play and I put it in a loop. Usually the error appears, but sometimes it does not. To force it, you can give play to the second door and then stop, stopping the animation at once. However, as the example shows, loading the first LOD, it takes the same one that uses the first door. That's my expression if anyone wants to simulate fastly: { float frequence = 0.02f; float amplitude = 1.0f; double time = cos(engine.game.getFrame()*frequence)*amplitude; Node node = getNode(); node.setPosition(dvec3(time,0,0)); } Thank you for your attention. Edited January 23, 2019 by raul.salas
silent Posted January 23, 2019 Posted January 23, 2019 Hi Raul, Could you please provide a small working test scene with your code? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
raul.salas Posted January 23, 2019 Author Posted January 23, 2019 (edited) Hi, here's the test scene, just copy all the content on the data folder on a new 2.7.2.1 base project. data.7z If the error not appears on running, please, open the editor and press play and stop on the second door, you'll see. EDIT: The first time i open the project the error not appears, i delete the door, clone the first one, sets as child on expression, reset the position, disabled the loop check, and stops the animation, and you can force it to appear. Edited January 23, 2019 by raul.salas
silent Posted January 23, 2019 Posted January 23, 2019 Hi Raul, At the first glance it looks like a bug. We will investigate further. Thanks for the test scene! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
werner.poetzelberger Posted January 23, 2019 Posted January 23, 2019 Why do you use a skinned animation for this simple rotation? I also would apply the rotation to a dummy rather then to the mesh itself and then just put the mesh as a child of the dummy.
raul.salas Posted January 23, 2019 Author Posted January 23, 2019 Thank's for your response, i'll be waiting for some news about the future fix. Werner, in the example you can not see but in this case, the full animation includes a sequence with the door handler animated.
alexander Posted January 24, 2019 Posted January 24, 2019 Hi Raul, Yes, there is a bug. Temporary workaround: 1) Refresh current animation state every frame void update() { // ObjectMeshSkinned door; door->setFrame(0, door->getFrame(0)); } 2) Play looped "idle" animation on every door in the scene void init() { door->setAnimation(0, "idle"); door->setLoop(1); door->play(); } Best regards, Alexander 1
raul.salas Posted January 24, 2019 Author Posted January 24, 2019 (edited) It works. It can be a good solution until it is solved. But, the project where i'm working ends near the possible date of the next version. If you could prepare a patch when you have it ready , I would be very grateful. Thanks Alexander! Edited January 24, 2019 by raul.salas
silent Posted April 5, 2019 Posted April 5, 2019 Hi Raul, You can also try to patch engine sources: source/engine/framework/direct3d11/D3D11MeshSkinned.cpp source/engine/framework/opengl/GLMeshSkinned.cpp Just find following line: if (buffer.frames[is.vertex_index] != frame) and replace it with: if (buffer.frames[is.vertex_index] == is.frame) This fix will be availble in 2.8 SDK update. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
javier.serrano Posted April 5, 2019 Posted April 5, 2019 Hi, Silent. This are great news! As we can't move now the project to 2.8 (project is in final stages) we will patch 2.7.2 sources. We will let you know if it works fine. Regards, Javier
javier.serrano Posted April 11, 2019 Posted April 11, 2019 HI, I have recently patched 2.7.2 sources and everything is working fine. Thanks for solving this issue, Javier
javier.serrano Posted May 30, 2019 Posted May 30, 2019 Hi, we have recently faced some problems that might be related with the previous issue. In this case, animating one ObjectMeshSkinned inside a NodeReference makes other NodeReference pointing to same file to make strange behaviours. I attach a sample with reproduces this issue following these steps: Open editor Edit mode on DOOR_1 NodeReference Play the animation of 760x1850__a-lh_door ObjectMeshSkinned Move camera The sample does not have bin/ folder but I left patched Unigine_double_x64.dll and patched cpps to make sure my patch was correct. Is a good practice to animate ObjectsMeshSkinned inside NodeReference? Thanks, Javier animation_lod_patch.7z
silent Posted June 3, 2019 Posted June 3, 2019 Hi Raul, What do you mean by "strange behaviours"? When I play animation for a DOOR_1 the DOOR_2 also will play the same animation (since both NodeReferenes are pointed to a single mode). I've checked in 2.8.0.1 release. Could you please send us a video? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
javier.serrano Posted June 3, 2019 Posted June 3, 2019 Hi, there is the video. In our application, the same LOD issue appears in runtime. We have many NodeReference pointing to same node (as DOOR_1 and DOOR_2). We place them in scene as NodeReference and when we play (by code) an animation for one, the others begin to 'close' for LOD 1. I think that this might be a bad patch by our side, can you send us the 2.7.2 patched dlls so we can test in our app? Regards 2019-06-03 08-43-13.mp4
silent Posted June 3, 2019 Posted June 3, 2019 Javier, Is there any chance that you can try to do the same in 2.8.0.1? There might be some additional fixed applied (not related to the initial issue) that in combination gives me a good result. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
raul.salas Posted June 3, 2019 Author Posted June 3, 2019 Hi Silent, Don't worry, we tried to recompile the dll on another pc and the fix still works. Thanks!
silent Posted June 3, 2019 Posted June 3, 2019 Hi Raul, Great! So everything is working right now? :) How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
javier.serrano Posted June 7, 2019 Posted June 7, 2019 Hi Silent, it is working fine right now. We came up again with the issue because Assemble tool in SDK Browser did not copy Unigine_double_x64.dll from our project bin/ folder, it copies DLL from project's SDK. When we tested versions after assembling and before sending to client, issue pop again. Right now we added DLL manual copying to our 'version making' pipeline but it might be useful for Assemble tool to make that for us. Regards, Javier
aie Posted July 1, 2019 Posted July 1, 2019 Hi! I have problem with animation in LODs too. I have anten with animation and 4 LODs. I tried: linked LODs objects(without animation) to one object(with animation). But the parent does not inherit the animation to children( I tried: to export all LODs with animations(all LODs has the same animation) and setting LODs "Visibility". But the animation on the different LODs is not the same(in 3dmax animation all lods is the same). Question 1: How to inherit the animation to children(add animation dummy and linking LODs object)? Question 2: How can I do when when switching LODs animation will coincide??
silent Posted July 2, 2019 Posted July 2, 2019 aie Not sure that I've understand your issue correctly, but maybe adding this Node to the force update list via method addUpdateNode() will help to update animations when surfaces are disabled? If this doesn't help - could you please send us a minimal test scene (only data folder content will be enough). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
aie Posted July 2, 2019 Posted July 2, 2019 Hi! I can do simple object animation with LODs without programming??? For example: I want to have a animated object all time. How about Q1?? P.S. We have only ver. 2.7.3.1. Test_animation.zip
aie Posted July 2, 2019 Posted July 2, 2019 This parameter("Time") is current animation key??? If i change this parameter("Time"), the object should change its position\rotation\.. according to the animation???
silent Posted July 2, 2019 Posted July 2, 2019 Quote I can do simple object animation with LODs without programming??? For example: I want to have a animated object all time. In that case with LODs you need to add custom logic that will continue animation play on disabled node (addUpdateNode()). Quote Question 1: How to inherit the animation to children(add animation dummy and linking LODs object)? Not sure that I've understand this question correctly. Could you please give us more information on this? If your objects has the same bone hierarchy you can just play the same .anim file on multiple objects. Quote If i change this parameter("Time"), the object should change its position\rotation\.. according to the animation??? Yes, that's animation time. When you change this field nothing happens, but when you press Play animation will continue playing from that specific time. You can also modify Tracker tool to control the animation more precisely: Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts