reckfellENGINE

EditorSceneFormatImporter

Imports scenes from third-parties' 3D files.

On this page
class EditorSceneFormatImporterReckfellSharpEditorInherits RefCounted

Imports scenes from third-parties' 3D files.

EditorSceneFormatImporter allows to define an importer script for a third-party 3D format. To use EditorSceneFormatImporter, register it using the EditorPlugin.AddSceneFormatImporterPlugin method first.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

EditorSceneFormatImporterConstructor
# EditorSceneFormatImporter
C#
public EditorSceneFormatImporter();

Methods6

AddImportOptionvoid
# AddImportOption
C#
public void AddImportOption(string name, Variant value);

Add a specific import option (name and default value only). This function can only be called from EditorSceneFormatImporter._GetImportOptions.

Parameters
NameTypeDefault
namestring—
valueVariant—
AddImportOptionAdvancedvoid
# AddImportOptionAdvanced
C#
public void AddImportOptionAdvanced(Variant.Type type, string name, Variant defaultValue, PropertyHint hint = PropertyHint.None, string hintString = "", int usageFlags = 6);

Add a specific import option. This function can only be called from EditorSceneFormatImporter._GetImportOptions.

Parameters
NameTypeDefault
typeVariant.Type—
namestring—
defaultValueVariant—
hintPropertyHintPropertyHint.None
hintStringstring""
usageFlagsint6
_GetExtensionsstring[]
# _GetExtensions
C#
public virtual string[] _GetExtensions();

Return supported file extensions for this scene importer.

Returns string[]
_GetImportOptionsvoid
# _GetImportOptions
C#
public virtual void _GetImportOptions(string path);

Override to add general import options. These will appear in the main import dock on the editor. Add options via EditorSceneFormatImporter.AddImportOption and EditorSceneFormatImporter.AddImportOptionAdvanced. Note: All EditorSceneFormatImporter and EditorScenePostImportPlugin instances will add options for all files. It is good practice to check the file extension when path is non-empty. When the user is editing project settings, path will be empty. It is recommended to add all options when path is empty to allow the user to customize Import Defaults.

Parameters
NameTypeDefault
pathstring—
_GetOptionVisibilityVariant
# _GetOptionVisibility
C#
public virtual Variant _GetOptionVisibility(string path, bool forAnimation, string option);

Should return true to show the given option, false to hide the given option, or null to ignore.

Parameters
NameTypeDefault
pathstring—
forAnimationbool—
optionstring—
Returns Variant
_ImportSceneReckfellObject
# _ImportScene
C#
public virtual ReckfellObject _ImportScene(string path, uint flags, Reckfell.Collections.Dictionary options);

Perform the bulk of the scene import logic here, for example using GltfDocument or FbxDocument.

Parameters
NameTypeDefault
pathstring—
flagsuint—
optionsReckfell.Collections.Dictionary—
Returns ReckfellObject

EditorSceneFormatImporter.ImportFlags

ValueDescription
Animation = 2

Import animations from the 3D scene. When importing a scene as an AnimationLibrary, this flag is always enabled.

DiscardMeshesAndMaterials = 32

Ignore meshes and materials on import. When importing a scene as an AnimationLibrary, this flag is always enabled.

FailOnMissingDependencies = 4

Unused flag (this has no effect when enabled).

ForceDisableMeshCompression = 64

If true, mesh compression will not be used. Consider enabling if you notice blocky artifacts in your mesh normals or UVs, or if you have meshes that are larger than a few thousand meters in each direction.

GenerateTangentArrays = 8

If true, generate vertex tangents using Mikktspace(http://www.mikktspace.com/) if the input meshes don't have tangent data. When possible, it's recommended to let the 3D modeling software generate tangents on export instead of relying on this option. Tangents are required for correct display of normal and height maps, along with any material/shader features that require tangents. If you don't need material features that require tangents, disabling this can reduce output file size and speed up importing if the source 3D file doesn't contain tangents.

Scene = 1

Unused flag (this has no effect when enabled).

UseNamedSkinBinds = 16

If checked, use named Skins for animation. The MeshInstance3D node contains 3 properties of relevance here: a skeleton EntityPath pointing to the Skeleton3D node (usually ..), a mesh, and a skin:

  • The Skeleton3D node contains a list of bones with names, their pose and rest, a name, and a parent bone.
  • The mesh is all of the raw vertex data needed to display a mesh. In terms of the mesh, it knows how vertices are weight-painted and uses some internal numbering often imported from 3D modeling software.
  • The skin contains the information necessary to bind this mesh onto this Skeleton3D. For each of the internal bone IDs chosen by the 3D modeling software, it contains two things. Firstly, a matrix known as the Bind Pose Matrix, Inverse Bind Matrix, or IBM for short. Secondly, the Skin contains each bone's name (if this flag is enabled), or the bone's index within the Skeleton3D list (if this flag is disabled). Together, this information is enough to tell Reckfell how to use the bone poses in the Skeleton3D node to render the mesh from each MeshInstance3D. Note that each MeshInstance3D may share binds, as is common in models exported from Blender, or each MeshInstance3D may use a separate Skin object, as is common in models exported from other tools such as Maya.
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.