EditorSceneFormatImporter

package
v0.0.0-...-c858641 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

graphics.gd/classdb/EditorSceneFormatImporter allows to define an importer script for a third-party 3D format.

To use graphics.gd/classdb/EditorSceneFormatImporter, register it using the graphics.gd/classdb/EditorPlugin.Instance.AddSceneFormatImporterPlugin method first.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsEditorSceneFormatImporter() Instance
}

type Expanded

func (Expanded) AddImportOptionAdvanced

func (self Expanded) AddImportOptionAdvanced(atype variant.Type, name string, default_value any, hint ClassDB.PropertyHint, hint_string string, usage_flags Flags)

Add a specific import option. This function can only be called from [Interface.GetImportOptions].

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsEditorSceneFormatImporter

func (self *Extension[T]) AsEditorSceneFormatImporter() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

type Flags

type Flags int
const ImportAnimation Flags = 2 //gd:EditorSceneFormatImporter.IMPORT_ANIMATION
const ImportDiscardMeshesAndMaterials Flags = 32 //gd:EditorSceneFormatImporter.IMPORT_DISCARD_MESHES_AND_MATERIALS
const ImportFailOnMissingDependencies Flags = 4 //gd:EditorSceneFormatImporter.IMPORT_FAIL_ON_MISSING_DEPENDENCIES
const ImportForceDisableMeshCompression Flags = 64 //gd:EditorSceneFormatImporter.IMPORT_FORCE_DISABLE_MESH_COMPRESSION
const ImportGenerateTangentArrays Flags = 8 //gd:EditorSceneFormatImporter.IMPORT_GENERATE_TANGENT_ARRAYS
const ImportScene Flags = 1 //gd:EditorSceneFormatImporter.IMPORT_SCENE
const ImportUseNamedSkinBinds Flags = 16 //gd:EditorSceneFormatImporter.IMPORT_USE_NAMED_SKIN_BINDS

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddImportOption

func (self Instance) AddImportOption(name string, value any)

Add a specific import option (name and default value only). This function can only be called from [Interface.GetImportOptions].

func (Instance) AddImportOptionAdvanced

func (self Instance) AddImportOptionAdvanced(atype variant.Type, name string, default_value any)

Add a specific import option. This function can only be called from [Interface.GetImportOptions].

func (Instance) AsEditorSceneFormatImporter

func (self Instance) AsEditorSceneFormatImporter() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Interface

type Interface interface {
	// Return supported file extensions for this scene importer.
	GetExtensions() []string
	// Perform the bulk of the scene import logic here, for example using [graphics.gd/classdb/GLTFDocument] or [graphics.gd/classdb/FBXDocument].
	ImportScene(path string, flags Flags, options map[string]interface{}) Object.Instance
	// Override to add general import options. These will appear in the main import dock on the editor. Add options via [Instance.AddImportOption] and [Instance.AddImportOptionAdvanced].
	//
	// Note: All [graphics.gd/classdb/EditorSceneFormatImporter] and [graphics.gd/classdb/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.
	GetImportOptions(path string)
	// Should return true to show the given option, false to hide the given option, or null to ignore.
	GetOptionVisibility(path string, for_animation bool, option string) any
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL