Using fbx file as a static mesh

I have a fbx file that I would like to use as a static mesh in a static mesh component. If I import my fbx and save it as an uasset and then I try to construct it with ConstructorHelpers::FObjectFinder it does not work though. Thanx.

Would be great if you show some code instead of just naming the function. There are chances that you just made a typo, using the function wrong, putting it in the wrong function (beginplay for example) etc. So yeah, always show some code.

The code is pretty straightforward

static ConstructorHelpers::FObjectFinder Mesh(TEXT(“StaticMesh’/Game/StarterContent/9v2’”));
staticMesh = Mesh.Object;
PickupSM->SetStaticMesh(staticMesh);

When I use standard items that are included in the engine (say, TEXT(“StaticMesh’/Game/StarterContent/Shapes/Shape_Cube’”)), it works fine. Then either I do something wrong while saving fbx->uasset (I import fbx, drag it into the scene then select it and save) or it is not possible to do it at all.

Actually it compiles fine both ways, but with the standard item when I drag the actor with the static mesh component from the content browser into the scene I see the mesh, when I do it with my custom asset there is no mesh shown.

The code is in the constructor.

Thanks, now we know it must be the asset. What fbx version are you using? I’m still working with 2013 even though Unreal recommends 2016, but it still works.

Did you export the .fbx with default settings in Blender? Because yeah, that doesn’t work well :slight_smile:

It was created with Blender v2.78. I don’t know where to look it up. It turns out that the asset’s parent class happens to be an actor (it seems like it saves it this way) and the asset contains a camera, a lamp and the static mesh itself. Evidently it came from Blender and the static mesh itself is called Cube, which should be in the same folder where the asset itself is (though there is no such a file there, I assume that it implies that it is a part of the asset). I tried to pass this path with the Cube name to the function but without the result.

It seems that I indeed should have saved just the static mesh Cube. It was tiny and I had to scale it up a good deal to be able to see it (that was the problem), though when I saved the whole imported fbx (FbxScene, with lamps and a camera) the mesh was quite big when I dragged it into the scene frm the content browser.

It rather looks like the engine saves the .uasset with tiny dimensions cause the original imported .fbx looks normal on the scene.

I’m still not sure if you exported with default settings in Blender? Do you need the right export settings?