So I think I have a weird one here. A project I’m working on requires an animated Rubiks cube that goes from complete scramble to a solve.
I’ve made my animation in 3ds Max and exported and FBX. The trouble is the animation seems to be breaking down when converted to JSON by Playcanvas.
Here is what the animation looks like in 3ds Max:
As you can see the subcubes rotate around the origin normally. Unfortunately, within Playcanvas I get this result:
Editing the import sample rate had no effect.
Thinking it might have been an issue with using quaternions for my rotation and a problem with the FBX export, I tried opening the file in Blender and still got a good result:
As a Hail Mary, I then imported the FBX into Blender and reexported as a DAE file to upload to PC. After adjusting the sample rate, it actually worked in Playcanvas!
Even though it is working with the DAE file, I can’t help but think there might be an issue with the FBX importer. I have created a repro here with both the DAE and FBX models:
If needed, I can provide the model files if someone is curious enough to take a look.
That’s really weird It looks like there are some blocks that just plain don’t animate.
I also noticed that the animations are different sizes in the project:
Would you be able to try increasing the sample rate or disabling the Sample Rate to see if that helps?
Neither raising the the sample rate nor disabling it and then reimporting changed the behavior.
Regarding the size difference in animation, I exported a 3rd iteration of the animation as FBX in ASCII format. The resulting converted animation was much closer in size to the DAE animation, but the issue still persists.
Thanks for checking!
If you reimport the FBX animation into 3D Max and / or another engine like Unity, does it play correctly? I’m asking to try to isolate if it’s an issue with the FBX export or our FBX importer.
for the record: I tried to import the fbx using glb template and then used render & anim component and get the same issue.
I wonder if all the cubes / faces from the fbx could be deleted apart from the one that does not work (any one of those) … to see if it still does not work … and also that could be an easy repro to fix it.
Opening the FBX in 3ds Max was tested and working yesterday. I just put the cube into Unity just now and got this result:
It seems to be an issue with the importer on the PC side.
Thank you for the suggestion! I will try and see if I can get that put together in just a bit.
I found the issue! Seeing the video in Unity showed a 1 after some of the cube names. This made me realize that I must have gotten confused when naming all of them and had two repeats. Unity, Blender, and 3ds Max got around this by just changing the name of the repeats and adding a number to them. That explains why the DAE file worked since Blender would have just renamed the cubes before the 2nd export.
I went ahead and added the corrected fbx to the repro. Maybe Playcanvas should consider doing the same thing with their importers and just rename any repeats sequentially?
Ah interesting, that makes sense in terms of targeting the node to animate. Good catch!
@slimbuck What do you think about @eproasim’s suggestion?
@Elliott - lets at least make sure the warning in the debug version of the engine gets printed when this is the case (two nodes with the same names animated). I just tried my fork with render / anim component and no warning.