AB4D Forum

Full Version: assimp importer error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

i need a help!!!

I needed to upgrade assimp to the latest version.


With the oldversion of assimp i can read with assimpwpfimporter and get a geometrymodel like:
Code:

Code:
Dim readmodel3d As GeometryModel3D = AssimpWpfImporter.ReadModel3D(mfile)

With the last version the code gives me an error (cannot cast objects  'System.Windows.Media.Media3D.Model3DGroup' on  'System.Windows.Media.Media3D.GeometryModel3D)

Why?
how i can read geometry using assimp?
I guess that the new version returns a Model3DGroup and not GeometryModel3D anymore.

To fix this you need to change your line of code into:
Dim readmodel3d As Model3D = AssimpWpfImporter.ReadModel3D(mfile)

(Model3D is a base class for both GeometryModel3D and Model3DGroup)
(01-12-2022, 10:55 AM)abenedik Wrote: [ -> ]I guess that the new version returns a Model3DGroup and not GeometryModel3D anymore.

To fix this you need to change your line of code into:
Dim readmodel3d As Model3D = AssimpWpfImporter.ReadModel3D(mfile)

(Model3D is a base class for both GeometryModel3D and Model3DGroup)

Ok but with a model3d i can't read geometry or set material...
How can I solve?