If a mesh is created from a .DuplicateMesh, and the mesh that is being duplicated was loaded via .LoadSkinMesh the mesh does not render. If it were a 3ds loaded via .Load3Ds it works fine. I eliminated most every variable in a test project until I realized it was the .DuplicateMesh causing a problem.
I preload my meshes on load, as I reuse them repeatedly
'cache mesh
Dim objMeshToDupe as TVMesh
Set objMeshToDupe = g_objScene.CreateMeshBuilder
'this will work
'objMeshToDupe.Load3DsMesh App.Path & "\media\test.3ds"
'this will not
objMeshToDupe.LoadSkinMesh App.Path & "\media\test.x"
objMeshToDupe.Enable False
Then I use them later, something like this:
'duplicate and use cached mesh
dim objMesh as TVMesh
Set objMesh = objMeshToDupe.DuplicateMesh
objMesh.Enable = true
With objMesh
.SetMaterial GetMat("mat0")
.SetMatrix mtxOrigin
End With
Any ideas?
Michael