Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
- Animation
- AnimationLibrary
- AnimationNode (6)
- AnimationNodeStateMachinePlayback
- AnimationNodeStateMachineTransition
- AudioBusLayout
- AudioEffect (17)
- AudioStream (10)
- BitMap
- BoneMap
- ButtonGroup
- CameraAttributes (2)
- ColorPalette
- Compositor
- CompositorEffect
- CryptoKey
- Curve
- Curve2D
- Curve3D
- EditorNode3DGizmoPlugin
- EditorSettings
- Environment
- Font (3)
- GDExtension
- GLTFAccessor
- GLTFAnimation
- GLTFBufferView
- GLTFCamera
- GLTFDocument (1)
- GLTFDocumentExtension (1)
- GLTFLight
- GLTFMesh
- GLTFNode
- GLTFPhysicsBody
- GLTFPhysicsShape
- GLTFSkeleton
- GLTFSkin
- GLTFSpecGloss
- GLTFState (1)
- GLTFTexture
- GLTFTextureSampler
- Gradient
- Image
- ImporterMesh
- InputEvent (6)
- JSON
- LabelSettings
- LightmapGIData
- Material (9)
- Mesh (4)
- MeshLibrary
- MissingResource
- MultiMesh
- NavigationMesh
- NavigationMeshSourceGeometryData2D
- NavigationMeshSourceGeometryData3D
- NavigationPolygon
- Noise (1)
- Occluder3D (5)
- OccluderPolygon2D
- OggPacketSequence
- OpenXRAction
- OpenXRActionMap
- OpenXRActionSet
- OpenXRBindingModifier (2)
- OpenXRHapticBase (1)
- OpenXRIPBinding
- OpenXRInteractionProfile
- PackedDataContainer
- PackedScene
- PhysicsMaterial
- PolygonPathFinder
- RDShaderFile
- RDShaderSPIRV
- RichTextEffect
- SceneReplicationConfig
- Script (3)
- Shader (1)
- ShaderInclude
- Shape2D (8)
- Shape3D (9)
- Shortcut
- SkeletonModification2D (7)
- SkeletonModificationStack2D
- SkeletonProfile (1)
- Skin
- Sky
- SpriteFrames
- StyleBox (4)
- SyntaxHighlighter (2)
- Texture (3)
- Theme
- TileMapPattern
- TileSet
- TileSetSource (2)
- Translation (1)
- VideoStream (1)
- VideoStreamPlayback
- VisualShaderNode (62)
- VoxelGIData
- World2D
- World3D
- X509Certificate
Table of contents
-
var lightmap_size_hint: Vector2i = Vector2i(0, 0) -
virtual const func _get_aabb() -> AABB -
virtual const func _get_blend_shape_count() -> int -
virtual const func _get_blend_shape_name(index: int) -> StringName -
virtual const func _get_surface_count() -> int -
virtual func _set_blend_shape_name(name: StringName) -> void -
virtual const func _surface_get_array_index_len(index: int) -> int -
virtual const func _surface_get_array_len(index: int) -> int -
virtual const func _surface_get_arrays(index: int) -> Array -
virtual const func _surface_get_blend_shape_arrays(index: int) -> Array[] -
virtual const func _surface_get_format(index: int) -> int -
virtual const func _surface_get_lods(index: int) -> Dictionary -
virtual const func _surface_get_material(index: int) -> Material -
virtual const func _surface_get_primitive_type(index: int) -> int -
virtual func _surface_set_material(material: Material) -> void -
const func create_convex_shape(simplify: bool = false) -> ConvexPolygonShape3D -
const func create_outline(margin: float) -> Mesh -
const func create_placeholder() -> Resource -
const func create_trimesh_shape() -> ConcavePolygonShape3D -
const func generate_triangle_mesh() -> TriangleMesh -
const func get_aabb() -> AABB -
const func get_faces() -> PackedVector3Array -
const func get_surface_count() -> int -
const func surface_get_arrays(surf_idx: int) -> Array -
const func surface_get_blend_shape_arrays(surf_idx: int) -> Array[] -
const func surface_get_material(surf_idx: int) -> Material -
func surface_set_material(material: Material) -> void -
const PRIMITIVE_POINTS = 0 enum PrimitiveType -
const PRIMITIVE_LINES = 1 enum PrimitiveType -
const PRIMITIVE_LINE_STRIP = 2 enum PrimitiveType -
const PRIMITIVE_TRIANGLES = 3 enum PrimitiveType -
const PRIMITIVE_TRIANGLE_STRIP = 4 enum PrimitiveType -
const ARRAY_VERTEX = 0 enum ArrayType -
const ARRAY_NORMAL = 1 enum ArrayType -
const ARRAY_TANGENT = 2 enum ArrayType -
const ARRAY_COLOR = 3 enum ArrayType -
const ARRAY_TEX_UV = 4 enum ArrayType -
const ARRAY_TEX_UV2 = 5 enum ArrayType -
const ARRAY_CUSTOM0 = 6 enum ArrayType -
const ARRAY_CUSTOM1 = 7 enum ArrayType -
const ARRAY_CUSTOM2 = 8 enum ArrayType -
const ARRAY_CUSTOM3 = 9 enum ArrayType -
const ARRAY_BONES = 10 enum ArrayType -
const ARRAY_WEIGHTS = 11 enum ArrayType -
const ARRAY_INDEX = 12 enum ArrayType -
const ARRAY_MAX = 13 enum ArrayType -
const ARRAY_CUSTOM_RGBA8_UNORM = 0 enum ArrayCustomFormat -
const ARRAY_CUSTOM_RGBA8_SNORM = 1 enum ArrayCustomFormat -
const ARRAY_CUSTOM_RG_HALF = 2 enum ArrayCustomFormat -
const ARRAY_CUSTOM_RGBA_HALF = 3 enum ArrayCustomFormat -
const ARRAY_CUSTOM_R_FLOAT = 4 enum ArrayCustomFormat -
const ARRAY_CUSTOM_RG_FLOAT = 5 enum ArrayCustomFormat -
const ARRAY_CUSTOM_RGB_FLOAT = 6 enum ArrayCustomFormat -
const ARRAY_CUSTOM_RGBA_FLOAT = 7 enum ArrayCustomFormat -
const ARRAY_CUSTOM_MAX = 8 enum ArrayCustomFormat -
const ARRAY_FORMAT_VERTEX = 1 enum ArrayFormatBitfield -
const ARRAY_FORMAT_NORMAL = 2 enum ArrayFormatBitfield -
const ARRAY_FORMAT_TANGENT = 4 enum ArrayFormatBitfield -
const ARRAY_FORMAT_COLOR = 8 enum ArrayFormatBitfield -
const ARRAY_FORMAT_TEX_UV = 16 enum ArrayFormatBitfield -
const ARRAY_FORMAT_TEX_UV2 = 32 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM0 = 64 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM1 = 128 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM2 = 256 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM3 = 512 enum ArrayFormatBitfield -
const ARRAY_FORMAT_BONES = 1024 enum ArrayFormatBitfield -
const ARRAY_FORMAT_WEIGHTS = 2048 enum ArrayFormatBitfield -
const ARRAY_FORMAT_INDEX = 4096 enum ArrayFormatBitfield -
const ARRAY_FORMAT_BLEND_SHAPE_MASK = 7 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM_BASE = 13 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM_BITS = 3 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM0_SHIFT = 13 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM1_SHIFT = 16 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM2_SHIFT = 19 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM3_SHIFT = 22 enum ArrayFormatBitfield -
const ARRAY_FORMAT_CUSTOM_MASK = 7 enum ArrayFormatBitfield -
const ARRAY_COMPRESS_FLAGS_BASE = 25 enum ArrayFormatBitfield -
const ARRAY_FLAG_USE_2D_VERTICES = 33554432 enum ArrayFormatBitfield -
const ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864 enum ArrayFormatBitfield -
const ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728 enum ArrayFormatBitfield -
const ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY = 268435456 enum ArrayFormatBitfield -
const ARRAY_FLAG_COMPRESS_ATTRIBUTES = 536870912 enum ArrayFormatBitfield -
const BLEND_SHAPE_MODE_NORMALIZED = 0 enum BlendShapeMode -
const BLEND_SHAPE_MODE_RELATIVE = 1 enum BlendShapeMode -
enum PrimitiveType -
enum ArrayType -
enum ArrayCustomFormat -
enum ArrayFormat -
enum BlendShapeMode
Mesh #
is_refcounted, is_instantiable, resource, core, not_builtin_classes
A Resource that contains vertex array-based geometry.
Mesh is a type of Resource that contains vertex array-based geometry, divided in surfaces. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. The maximum number of surfaces per mesh is RenderingServer.MAX_MESH_SURFACES.
Members #
var lightmap_size_hint: Vector2i = Vector2i(0, 0)#
Sets a hint to be used for lightmap resolution.
Methods #
virtual const func _get_aabb() -> AABB#
Virtual method to override the AABB for a custom class extending Mesh.
virtual const func _get_blend_shape_count() -> int#
Virtual method to override the number of blend shapes for a custom class extending Mesh.
virtual const func _get_blend_shape_name(index: int) -> StringName#
Virtual method to override the retrieval of blend shape names for a custom class extending Mesh.
virtual const func _get_surface_count() -> int#
Virtual method to override the surface count for a custom class extending Mesh.
virtual func _set_blend_shape_name(name: StringName) -> void#
Virtual method to override the names of blend shapes for a custom class extending Mesh.
virtual const func _surface_get_array_index_len(index: int) -> int#
Virtual method to override the surface array index length for a custom class extending Mesh.
virtual const func _surface_get_array_len(index: int) -> int#
Virtual method to override the surface array length for a custom class extending Mesh.
virtual const func _surface_get_arrays(index: int) -> Array#
Virtual method to override the surface arrays for a custom class extending Mesh.
virtual const func _surface_get_blend_shape_arrays(index: int) -> Array[]#
Virtual method to override the blend shape arrays for a custom class extending Mesh.
virtual const func _surface_get_format(index: int) -> int#
Virtual method to override the surface format for a custom class extending Mesh.
virtual const func _surface_get_lods(index: int) -> Dictionary#
Virtual method to override the surface LODs for a custom class extending Mesh.
virtual const func _surface_get_material(index: int) -> Material#
Virtual method to override the surface material for a custom class extending Mesh.
virtual const func _surface_get_primitive_type(index: int) -> int#
Virtual method to override the surface primitive type for a custom class extending Mesh.
virtual func _surface_set_material(material: Material) -> void#
Virtual method to override the setting of a material at the given index for a custom class extending Mesh.
const func create_convex_shape(simplify: bool = false) -> ConvexPolygonShape3D#
Calculate a ConvexPolygonShape3D from the mesh.
If clean is true (default), duplicate and interior vertices are removed automatically. You can set it to false to make the process faster if not needed.
If simplify is true, the geometry can be further simplified to reduce the number of vertices. Disabled by default.
const func create_outline(margin: float) -> Mesh#
Calculate an outline mesh at a defined offset (margin) from the original mesh.
Note: This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise).
const func create_placeholder() -> Resource#
Creates a placeholder version of this resource (PlaceholderMesh).
const func create_trimesh_shape() -> ConcavePolygonShape3D#
Calculate a ConcavePolygonShape3D from the mesh.
const func generate_triangle_mesh() -> TriangleMesh#
Generate a TriangleMesh from the mesh. Considers only surfaces using one of these primitive types: PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP.
const func get_aabb() -> AABB#
Returns the smallest AABB enclosing this mesh in local space. Not affected by custom_aabb.
Note: This is only implemented for ArrayMesh and PrimitiveMesh.
const func get_faces() -> PackedVector3Array#
Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
const func get_surface_count() -> int#
Returns the number of surfaces that the Mesh holds. This is equivalent to MeshInstance3D.get_surface_override_material_count.
const func surface_get_arrays(surf_idx: int) -> Array#
Returns the arrays for the vertices, normals, UVs, etc. that make up the requested surface (see ArrayMesh.add_surface_from_arrays).
const func surface_get_blend_shape_arrays(surf_idx: int) -> Array[]#
Returns the blend shape arrays for the requested surface.
const func surface_get_material(surf_idx: int) -> Material#
Returns a Material in a given surface. Surface is rendered using this material.
Note: This returns the material within the Mesh resource, not the Material associated to the MeshInstance3D's Surface Material Override properties. To get the Material associated to the MeshInstance3D's Surface Material Override properties, use MeshInstance3D.get_surface_override_material instead.
func surface_set_material(material: Material) -> void#
Sets a Material for a given surface. Surface will be rendered using this material.
Note: This assigns the material within the Mesh resource, not the Material associated to the MeshInstance3D's Surface Material Override properties. To set the Material associated to the MeshInstance3D's Surface Material Override properties, use MeshInstance3D.set_surface_override_material instead.
Annotations #
Constants #
const PRIMITIVE_POINTS = 0 enum PrimitiveType#
Render array as points (one vertex equals one point).
const PRIMITIVE_LINES = 1 enum PrimitiveType#
Render array as lines (every two vertices a line is created).
const PRIMITIVE_LINE_STRIP = 2 enum PrimitiveType#
Render array as line strip.
const PRIMITIVE_TRIANGLES = 3 enum PrimitiveType#
Render array as triangles (every three vertices a triangle is created).
const PRIMITIVE_TRIANGLE_STRIP = 4 enum PrimitiveType#
Render array as triangle strips.
const ARRAY_VERTEX = 0 enum ArrayType#
PackedVector3Array, PackedVector2Array, or Array of vertex positions.
const ARRAY_NORMAL = 1 enum ArrayType#
PackedVector3Array of vertex normals.
Note: The array has to consist of normal vectors, otherwise they will be normalized by the engine, potentially causing visual discrepancies.
const ARRAY_TANGENT = 2 enum ArrayType#
PackedFloat32Array of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
const ARRAY_COLOR = 3 enum ArrayType#
PackedColorArray of vertex colors.
const ARRAY_TEX_UV = 4 enum ArrayType#
PackedVector2Array for UV coordinates.
const ARRAY_TEX_UV2 = 5 enum ArrayType#
PackedVector2Array for second UV coordinates.
const ARRAY_CUSTOM0 = 6 enum ArrayType#
Contains custom color channel 0. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM0_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_SNORM, ARRAY_CUSTOM_RG_HALF, or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
const ARRAY_CUSTOM1 = 7 enum ArrayType#
Contains custom color channel 1. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM1_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_SNORM, ARRAY_CUSTOM_RG_HALF, or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
const ARRAY_CUSTOM2 = 8 enum ArrayType#
Contains custom color channel 2. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM2_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_SNORM, ARRAY_CUSTOM_RG_HALF, or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
const ARRAY_CUSTOM3 = 9 enum ArrayType#
Contains custom color channel 3. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM3_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_SNORM, ARRAY_CUSTOM_RG_HALF, or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
const ARRAY_BONES = 10 enum ArrayType#
PackedFloat32Array or PackedInt32Array of bone indices. Contains either 4 or 8 numbers per vertex depending on the presence of the ARRAY_FLAG_USE_8_BONE_WEIGHTS flag.
const ARRAY_WEIGHTS = 11 enum ArrayType#
PackedFloat32Array or PackedFloat64Array of bone weights in the range 0.0 to 1.0 (inclusive). Contains either 4 or 8 numbers per vertex depending on the presence of the ARRAY_FLAG_USE_8_BONE_WEIGHTS flag.
const ARRAY_INDEX = 12 enum ArrayType#
PackedInt32Array of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the i'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
const ARRAY_MAX = 13 enum ArrayType#
Represents the size of the ArrayType enum.
const ARRAY_CUSTOM_RGBA8_UNORM = 0 enum ArrayCustomFormat#
Indicates this custom channel contains unsigned normalized byte colors from 0 to 1, encoded as PackedByteArray.
const ARRAY_CUSTOM_RGBA8_SNORM = 1 enum ArrayCustomFormat#
Indicates this custom channel contains signed normalized byte colors from -1 to 1, encoded as PackedByteArray.
const ARRAY_CUSTOM_RG_HALF = 2 enum ArrayCustomFormat#
Indicates this custom channel contains half precision float colors, encoded as PackedByteArray. Only red and green channels are used.
const ARRAY_CUSTOM_RGBA_HALF = 3 enum ArrayCustomFormat#
Indicates this custom channel contains half precision float colors, encoded as PackedByteArray.
const ARRAY_CUSTOM_R_FLOAT = 4 enum ArrayCustomFormat#
Indicates this custom channel contains full float colors, in a PackedFloat32Array. Only the red channel is used.
const ARRAY_CUSTOM_RG_FLOAT = 5 enum ArrayCustomFormat#
Indicates this custom channel contains full float colors, in a PackedFloat32Array. Only red and green channels are used.
const ARRAY_CUSTOM_RGB_FLOAT = 6 enum ArrayCustomFormat#
Indicates this custom channel contains full float colors, in a PackedFloat32Array. Only red, green and blue channels are used.
const ARRAY_CUSTOM_RGBA_FLOAT = 7 enum ArrayCustomFormat#
Indicates this custom channel contains full float colors, in a PackedFloat32Array.
const ARRAY_CUSTOM_MAX = 8 enum ArrayCustomFormat#
Represents the size of the ArrayCustomFormat enum.
const ARRAY_FORMAT_VERTEX = 1 enum ArrayFormatBitfield#
Mesh array contains vertices. All meshes require a vertex array so this should always be present.
const ARRAY_FORMAT_NORMAL = 2 enum ArrayFormatBitfield#
Mesh array contains normals.
const ARRAY_FORMAT_TANGENT = 4 enum ArrayFormatBitfield#
Mesh array contains tangents.
const ARRAY_FORMAT_COLOR = 8 enum ArrayFormatBitfield#
Mesh array contains colors.
const ARRAY_FORMAT_TEX_UV = 16 enum ArrayFormatBitfield#
Mesh array contains UVs.
const ARRAY_FORMAT_TEX_UV2 = 32 enum ArrayFormatBitfield#
Mesh array contains second UV.
const ARRAY_FORMAT_CUSTOM0 = 64 enum ArrayFormatBitfield#
Mesh array contains custom channel index 0.
const ARRAY_FORMAT_CUSTOM1 = 128 enum ArrayFormatBitfield#
Mesh array contains custom channel index 1.
const ARRAY_FORMAT_CUSTOM2 = 256 enum ArrayFormatBitfield#
Mesh array contains custom channel index 2.
const ARRAY_FORMAT_CUSTOM3 = 512 enum ArrayFormatBitfield#
Mesh array contains custom channel index 3.
const ARRAY_FORMAT_BONES = 1024 enum ArrayFormatBitfield#
Mesh array contains bones.
const ARRAY_FORMAT_WEIGHTS = 2048 enum ArrayFormatBitfield#
Mesh array contains bone weights.
const ARRAY_FORMAT_INDEX = 4096 enum ArrayFormatBitfield#
Mesh array uses indices.
const ARRAY_FORMAT_BLEND_SHAPE_MASK = 7 enum ArrayFormatBitfield#
Mask of mesh channels permitted in blend shapes.
const ARRAY_FORMAT_CUSTOM_BASE = 13 enum ArrayFormatBitfield#
Shift of first custom channel.
const ARRAY_FORMAT_CUSTOM_BITS = 3 enum ArrayFormatBitfield#
Number of format bits per custom channel. See ArrayCustomFormat.
const ARRAY_FORMAT_CUSTOM0_SHIFT = 13 enum ArrayFormatBitfield#
Amount to shift ArrayCustomFormat for custom channel index 0.
const ARRAY_FORMAT_CUSTOM1_SHIFT = 16 enum ArrayFormatBitfield#
Amount to shift ArrayCustomFormat for custom channel index 1.
const ARRAY_FORMAT_CUSTOM2_SHIFT = 19 enum ArrayFormatBitfield#
Amount to shift ArrayCustomFormat for custom channel index 2.
const ARRAY_FORMAT_CUSTOM3_SHIFT = 22 enum ArrayFormatBitfield#
Amount to shift ArrayCustomFormat for custom channel index 3.
const ARRAY_FORMAT_CUSTOM_MASK = 7 enum ArrayFormatBitfield#
Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See ArrayCustomFormat.
const ARRAY_COMPRESS_FLAGS_BASE = 25 enum ArrayFormatBitfield#
Shift of first compress flag. Compress flags should be passed to ArrayMesh.add_surface_from_arrays and SurfaceTool.commit.
const ARRAY_FLAG_USE_2D_VERTICES = 33554432 enum ArrayFormatBitfield#
Flag used to mark that the array contains 2D vertices.
const ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864 enum ArrayFormatBitfield#
Flag indices that the mesh data will use GL_DYNAMIC_DRAW on GLES. Unused on Vulkan.
const ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728 enum ArrayFormatBitfield#
Flag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that ARRAY_BONES and ARRAY_WEIGHTS elements will have double length.
const ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY = 268435456 enum ArrayFormatBitfield#
Flag used to mark that the mesh intentionally contains no vertex array.
const ARRAY_FLAG_COMPRESS_ATTRIBUTES = 536870912 enum ArrayFormatBitfield#
Flag used to mark that a mesh is using compressed attributes (vertices, normals, tangents, UVs). When this form of compression is enabled, vertex positions will be packed into an RGBA16UNORM attribute and scaled in the vertex shader. The normal and tangent will be packed into an RG16UNORM representing an axis, and a 16-bit float stored in the A-channel of the vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed floats. When using this compression mode you must use either vertices, normals, and tangents or only vertices. You cannot use normals without tangents. Importers will automatically enable this compression if they can.
const BLEND_SHAPE_MODE_NORMALIZED = 0 enum BlendShapeMode#
Blend shapes are normalized.
const BLEND_SHAPE_MODE_RELATIVE = 1 enum BlendShapeMode#
Blend shapes are relative to base weight.
Constructors #
Enums #
PrimitiveType#
enum PrimitiveType {
PRIMITIVE_POINTS = 0,
PRIMITIVE_LINES = 1,
PRIMITIVE_LINE_STRIP = 2,
PRIMITIVE_TRIANGLES = 3,
PRIMITIVE_TRIANGLE_STRIP = 4,
}ArrayType#
enum ArrayType {
ARRAY_VERTEX = 0,
ARRAY_NORMAL = 1,
ARRAY_TANGENT = 2,
ARRAY_COLOR = 3,
ARRAY_TEX_UV = 4,
ARRAY_TEX_UV2 = 5,
ARRAY_CUSTOM0 = 6,
ARRAY_CUSTOM1 = 7,
ARRAY_CUSTOM2 = 8,
ARRAY_CUSTOM3 = 9,
ARRAY_BONES = 10,
ARRAY_WEIGHTS = 11,
ARRAY_INDEX = 12,
ARRAY_MAX = 13,
}ArrayCustomFormat#
enum ArrayCustomFormat {
ARRAY_CUSTOM_RGBA8_UNORM = 0,
ARRAY_CUSTOM_RGBA8_SNORM = 1,
ARRAY_CUSTOM_RG_HALF = 2,
ARRAY_CUSTOM_RGBA_HALF = 3,
ARRAY_CUSTOM_R_FLOAT = 4,
ARRAY_CUSTOM_RG_FLOAT = 5,
ARRAY_CUSTOM_RGB_FLOAT = 6,
ARRAY_CUSTOM_RGBA_FLOAT = 7,
ARRAY_CUSTOM_MAX = 8,
}ArrayFormat#
enum ArrayFormat {
ARRAY_FORMAT_VERTEX = 1,
ARRAY_FORMAT_NORMAL = 2,
ARRAY_FORMAT_TANGENT = 4,
ARRAY_FORMAT_COLOR = 8,
ARRAY_FORMAT_TEX_UV = 16,
ARRAY_FORMAT_TEX_UV2 = 32,
ARRAY_FORMAT_CUSTOM0 = 64,
ARRAY_FORMAT_CUSTOM1 = 128,
ARRAY_FORMAT_CUSTOM2 = 256,
ARRAY_FORMAT_CUSTOM3 = 512,
ARRAY_FORMAT_BONES = 1024,
ARRAY_FORMAT_WEIGHTS = 2048,
ARRAY_FORMAT_INDEX = 4096,
ARRAY_FORMAT_BLEND_SHAPE_MASK = 7,
ARRAY_FORMAT_CUSTOM_BASE = 13,
ARRAY_FORMAT_CUSTOM_BITS = 3,
ARRAY_FORMAT_CUSTOM0_SHIFT = 13,
ARRAY_FORMAT_CUSTOM1_SHIFT = 16,
ARRAY_FORMAT_CUSTOM2_SHIFT = 19,
ARRAY_FORMAT_CUSTOM3_SHIFT = 22,
ARRAY_FORMAT_CUSTOM_MASK = 7,
ARRAY_COMPRESS_FLAGS_BASE = 25,
ARRAY_FLAG_USE_2D_VERTICES = 33554432,
ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864,
ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728,
ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY = 268435456,
ARRAY_FLAG_COMPRESS_ATTRIBUTES = 536870912,
}BlendShapeMode#
enum BlendShapeMode {
BLEND_SHAPE_MODE_NORMALIZED = 0,
BLEND_SHAPE_MODE_RELATIVE = 1,
}