Click or drag to resize
Ab4d.SharpEngine logo

ObjImporterImportAsync Method

Imports the 3D models from objFileName in the background thread. When generateGpuBuffers parameter is true (by default), then the vertex and index buffers will be also generated on the background thread. The file returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes. The method will not return null but an empty GroupNode in case no model is read.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntax
C#
public Task<GroupNode> ImportAsync(
	string objFileName,
	string? texturesDirectory = null,
	StandardMaterial? defaultMaterial = null,
	bool generateGpuBuffers = true
)

Parameters

objFileName  String
obj file name
texturesDirectory  String  (Optional)
textures directory
defaultMaterial  StandardMaterial  (Optional)
material that is used if no material is defined in obj file
generateGpuBuffers  Boolean  (Optional)
when true (by default), then vertex and index buffers will be generated in the background thread. This requires that the ObjImporter is created by passing a Scene object to the constructor.

Return Value

TaskGroupNode
GroupNode that contains MeshModelNodes and other GroupNodes
See Also