Unreal Engine 4, import with c++? - unreal-engine4

I need to import an fbx into UE4 using c++. This is to eventually write a batch importer that sets up material connects etc upon import.
I am, however, stuck at the first hurdle.
I cannot find any info on this anywhere.
How can I load an fbx model into the editor using c++ ?
edit:
I do not need to do this at runtime, I just need to import the models into the editor, and adjust their location/material settings as I do so..

Parse the .fbx (there are enough docs), then create the mesh at runtime would be one way.
If you only need the editor stuff, check out the FbxMainImport.cpp
FFbxImporter::OpenFile
FbxNode* GetFirstFbxMesh(FbxNode* Node, bool bIsSkelMesh)
etc...

Related

where to model in unity

I'm a new game dev and I want to start creating object, character, environment. what should I use
a built in editor like proBuilder or separate editors like blender, which one is better for the long run or I should design simple object in probuilder and complex shapes in blender because of time required to import from blender or importing doesn't make a difference
thanks in advance
ProBuilder let you create 3D assets right in the editor but imo it fits mostly for prototypes or lowPoly style. If you need smth better then these, my choice is Blender3D. Also Maya is good and affordable

why do my object files look weird when imported to Unity?

I have made some heart models on medical software Materialise Mimics and have exported them as .obj files because the software doesnt support exporting as .fbx.
I've tried other Unity developed programs with the exact same models and they look really good, but I dont know what they've done to process the files.
I'm quite new to unity and have tried following some guides on making materials and shaders, but nothing seems to work.
Thanks!
Object file in 3D viewer
Object file directly imported to Unity
Object file with Material added
I think the model's normals got inverted. Try using a double sided shader like this https://gist.github.com/naojitaniguchi/62ccf37c801ea55517b7 (not mine) and see if it's works
I hope it do

UE4 Is it possible to import a model from sketchfab plugin or site directly into the scene

I apologize for the English, because I am writing through a translator. When importing a model using the sketchfab plugin, all content is imported as separate objects, and it will take a very long time to arrange them manually. If I import with the merge meshes checkbox, then when baking the light, I get a warning UV are overlapping by 100.0%. Please adjust content - Enable Error Coloring to visualize and the light is baked with countless artifacts. I would like to know if it is possible to import all objects at once into the scene?

Unity: export to gltf 2.0 format

Is there a way to get a Unity store asset downloaded (consisting of a folder containing FBX model + separate animations in FBX + separate textures in png etc) as a gltf binary?
If so, can someone guide me. Thanks.
I know this is late to the party, but hopefully it can help someone else in the future.
You can export from Unity to glTF easily using the Plattar glTF Exporter.
It does not seem to be possible to export in glB (the binary form), only glTF, though there are tools to convert from glTF to glB, some of them available online.
You can also convert an FBX from ASCII to binary format easily, from within Unity, using the Unity FBX Exporter package, available from the Package Manager.
I am even later to the party with Blender 2.82, but also for future reference:
import base fbx model
rename animation in inspector to base
import walk fbx model
rename animation in inspector to walk
go to animation tab, select dope sheet, then action editor
select base animation and 'push down'
select walk animation and 'push down'
delete walk model and mesh
export to gltf/glb
check in https://gltf-viewer.donmccurdy.com/
This was tested with Malbers fox model.
I can provide a video if needed.
Use UniVRM. It supports editor time export as well as runtime export. It supports the VRM format, as well as gltf. This is the only asset that supports runtime export out of the box, to my knowledge.

How to modify parts of 3D model imported in Unreal Engine?

I need to find the parts of a 3D model imported in Unreal Engine through fbx importer in order to change something (e.g. a texture, a color, etc.) using Unreal Engine and C++.
I was already able to do so with other open source libraries (e.g. OpenSceneGraph) using the Visitor design pattern to find a pointer to the part and then modifying it but I don't yet know how to do so in Unreal Engine.
Does exist a class to analyze an imported model to find parts? Or is it better to use another approach to modify textures or color of an imported 3D model (e.g. import the parts of the model in an independent manner)?
Generally people reccomended to start poking around the engines FBXImport class since you'll have to homeroll your own FBX conversion code to do anything other than say, change the material during runtime (obvsiously), assuming you mean changing the geometry or such things of an asset thats already been imported.