04-08-2024, 10:06 AM
Alex3d, I am really happy to hear that all my models, static and animated work as expected.
But if I understand you correctly, then for everything to work, the 2 additional changes to the code are required on top of Assimp v5.4 changes.
The first change sets the default value of AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS property to false (from true). I do not like such a change. Therefore I have added a simple way to set those properties in the AssimpWpfImporter. There is now a SetConfig method where you can set all the importer properties, for example:
This will be part of the new Ab3d.PowerToys.Assimp library that will be released this week.
I am also curious about your second code change. There you add FixSceneRotation method that is called before call to TransferDataToScene.
I see that the new Assimp version already defines the correctRootTransform method that is the same as your FixSceneRotation method (see: #5494 PR). So the main difference between the official source and your recommendation is that in the official source the correctRootTransform method is called after the call to TransferDataToScene but in your change this method is called before the call to TransferDataToScene.
Are you sure that this is correct? In this case it would be good to create a PR on Assimp's GitHub so that others can also check that.
I am going to publish the compiled native Assimp library with the next version of Ab3d.PowerToys, but I am not sure if I should include the official version 5.4 (I will probably do that) or add your recommended change to the source and publish that version.
But if I understand you correctly, then for everything to work, the 2 additional changes to the code are required on top of Assimp v5.4 changes.
The first change sets the default value of AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS property to false (from true). I do not like such a change. Therefore I have added a simple way to set those properties in the AssimpWpfImporter. There is now a SetConfig method where you can set all the importer properties, for example:
Code:
assimpWpfImporter.SetConfig(new global::Assimp.Configs.FBXPreservePivotsConfig(preservePivots: false));
// this is the same as:
assimpWpfImporter.SetConfig(new global::Assimp.Configs.BooleanPropertyConfig("IMPORT_FBX_PRESERVE_PIVOTS", false));This will be part of the new Ab3d.PowerToys.Assimp library that will be released this week.
I am also curious about your second code change. There you add FixSceneRotation method that is called before call to TransferDataToScene.
I see that the new Assimp version already defines the correctRootTransform method that is the same as your FixSceneRotation method (see: #5494 PR). So the main difference between the official source and your recommendation is that in the official source the correctRootTransform method is called after the call to TransferDataToScene but in your change this method is called before the call to TransferDataToScene.
Are you sure that this is correct? In this case it would be good to create a PR on Assimp's GitHub so that others can also check that.
I am going to publish the compiled native Assimp library with the next version of Ab3d.PowerToys, but I am not sure if I should include the official version 5.4 (I will probably do that) or add your recommended change to the source and publish that version.
Andrej Benedik

