Trait godot::classes::IGltfDocumentExtension

pub trait IGltfDocumentExtension: GodotClass<Base = GltfDocumentExtension> + You_forgot_the_attribute__godot_api {
Show 27 methods // Provided methods fn init(base: Base<Self::Base>) -> Self { ... } fn to_string(&self) -> GString { ... } fn on_notification(&mut self, what: ObjectNotification) { ... } fn get_property(&self, property: StringName) -> Option<Variant> { ... } fn set_property(&mut self, property: StringName, value: Variant) -> bool { ... } fn get_property_list(&mut self) -> Vec<PropertyInfo> { ... } fn property_get_revert(&self, property: StringName) -> Option<Variant> { ... } fn import_preflight( &mut self, state: Option<Gd<GltfState>>, extensions: PackedStringArray, ) -> Error { ... } fn get_supported_extensions(&mut self) -> PackedStringArray { ... } fn parse_node_extensions( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, extensions: Dictionary, ) -> Error { ... } fn parse_image_data( &mut self, state: Option<Gd<GltfState>>, image_data: PackedByteArray, mime_type: GString, ret_image: Option<Gd<Image>>, ) -> Error { ... } fn get_image_file_extension(&mut self) -> GString { ... } fn parse_texture_json( &mut self, state: Option<Gd<GltfState>>, texture_json: Dictionary, ret_gltf_texture: Option<Gd<GltfTexture>>, ) -> Error { ... } fn generate_scene_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, scene_parent: Option<Gd<Node>>, ) -> Option<Gd<Node3D>> { ... } fn import_post_parse(&mut self, state: Option<Gd<GltfState>>) -> Error { ... } fn import_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, json: Dictionary, node: Option<Gd<Node>>, ) -> Error { ... } fn import_post( &mut self, state: Option<Gd<GltfState>>, root: Option<Gd<Node>>, ) -> Error { ... } fn export_preflight( &mut self, state: Option<Gd<GltfState>>, root: Option<Gd<Node>>, ) -> Error { ... } fn convert_scene_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, scene_node: Option<Gd<Node>>, ) { ... } fn export_preserialize(&mut self, state: Option<Gd<GltfState>>) -> Error { ... } fn get_saveable_image_formats(&mut self) -> PackedStringArray { ... } fn serialize_image_to_bytes( &mut self, state: Option<Gd<GltfState>>, image: Option<Gd<Image>>, image_dict: Dictionary, image_format: GString, lossy_quality: f32, ) -> PackedByteArray { ... } fn save_image_at_path( &mut self, state: Option<Gd<GltfState>>, image: Option<Gd<Image>>, file_path: GString, image_format: GString, lossy_quality: f32, ) -> Error { ... } fn serialize_texture_json( &mut self, state: Option<Gd<GltfState>>, texture_json: Dictionary, gltf_texture: Option<Gd<GltfTexture>>, image_format: GString, ) -> Error { ... } fn export_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, json: Dictionary, node: Option<Gd<Node>>, ) -> Error { ... } fn export_post(&mut self, state: Option<Gd<GltfState>>) -> Error { ... } fn setup_local_to_scene(&mut self) { ... }
}
Expand description

Virtual methods for class GltfDocumentExtension.

These methods represent constructors (init) or callbacks invoked by the engine.

See also Godot docs for GLTFDocumentExtension methods.

Provided Methods§

fn init(base: Base<Self::Base>) -> Self

Godot constructor, accepting an injected base object.

base refers to the base instance of the class, which can either be stored in a Base<T> field or discarded. This method returns a fully-constructed instance, which will then be moved into a Gd<T> pointer.

If the class has a #[class(init)] attribute, this method will be auto-generated and must not be overridden.

fn to_string(&self) -> GString

String representation of the Godot instance.

Override this method to define how the instance is represented as a string. Used by impl Display for Gd<T>, as well as str() and print() in GDScript.

fn on_notification(&mut self, what: ObjectNotification)

Called when the object receives a Godot notification.

The type of notification can be identified through what. The enum is designed to hold all possible NOTIFICATION_* constants that the current class can handle. However, this is not validated in Godot, so an enum variant Unknown exists to represent integers out of known constants (mistakes or future additions).

This method is named _notification in Godot, but on_notification in Rust. To send notifications, use the Object::notify method.

See also in Godot docs:

fn get_property(&self, property: StringName) -> Option<Variant>

Called whenever get() is called or Godot gets the value of a property.

Should return the given property’s value as Some(value), or None if the property should be handled normally.

See also in Godot docs:

fn set_property(&mut self, property: StringName, value: Variant) -> bool

Called whenever Godot set() is called or Godot sets the value of a property.

Should set property to the given value and return true, or return false to indicate the property should be handled normally.

See also in Godot docs:

fn get_property_list(&mut self) -> Vec<PropertyInfo>

Available on since_api="4.3" only.

Called whenever Godot get_property_list() is called, the returned vector here is appended to the existing list of properties.

This should mainly be used for advanced purposes, such as dynamically updating the property list in the editor.

See also in Godot docs:

fn property_get_revert(&self, property: StringName) -> Option<Variant>

Called by Godot to tell if a property has a custom revert or not.

Return None for no custom revert, and return Some(value) to specify the custom revert.

This is a combination of Godot’s Object::_property_get_revert and Object::_property_can_revert. This means that this function will usually be called twice by Godot to find the revert.

Note that this should be a pure function. That is, it should always return the same value for a property as long as self remains unchanged. Otherwise, this may lead to unexpected (safe) behavior.

fn import_preflight( &mut self, state: Option<Gd<GltfState>>, extensions: PackedStringArray, ) -> Error

fn get_supported_extensions(&mut self) -> PackedStringArray

fn parse_node_extensions( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, extensions: Dictionary, ) -> Error

fn parse_image_data( &mut self, state: Option<Gd<GltfState>>, image_data: PackedByteArray, mime_type: GString, ret_image: Option<Gd<Image>>, ) -> Error

fn get_image_file_extension(&mut self) -> GString

fn parse_texture_json( &mut self, state: Option<Gd<GltfState>>, texture_json: Dictionary, ret_gltf_texture: Option<Gd<GltfTexture>>, ) -> Error

fn generate_scene_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, scene_parent: Option<Gd<Node>>, ) -> Option<Gd<Node3D>>

fn import_post_parse(&mut self, state: Option<Gd<GltfState>>) -> Error

fn import_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, json: Dictionary, node: Option<Gd<Node>>, ) -> Error

fn import_post( &mut self, state: Option<Gd<GltfState>>, root: Option<Gd<Node>>, ) -> Error

fn export_preflight( &mut self, state: Option<Gd<GltfState>>, root: Option<Gd<Node>>, ) -> Error

fn convert_scene_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, scene_node: Option<Gd<Node>>, )

fn export_preserialize(&mut self, state: Option<Gd<GltfState>>) -> Error

fn get_saveable_image_formats(&mut self) -> PackedStringArray

fn serialize_image_to_bytes( &mut self, state: Option<Gd<GltfState>>, image: Option<Gd<Image>>, image_dict: Dictionary, image_format: GString, lossy_quality: f32, ) -> PackedByteArray

fn save_image_at_path( &mut self, state: Option<Gd<GltfState>>, image: Option<Gd<Image>>, file_path: GString, image_format: GString, lossy_quality: f32, ) -> Error

fn serialize_texture_json( &mut self, state: Option<Gd<GltfState>>, texture_json: Dictionary, gltf_texture: Option<Gd<GltfTexture>>, image_format: GString, ) -> Error

fn export_node( &mut self, state: Option<Gd<GltfState>>, gltf_node: Option<Gd<GltfNode>>, json: Dictionary, node: Option<Gd<Node>>, ) -> Error

fn export_post(&mut self, state: Option<Gd<GltfState>>) -> Error

fn setup_local_to_scene(&mut self)

Object Safety§

This trait is not object safe.

Implementors§