ke.scene¶
Scene graph, prim hierarchy, components, resource mirrors, and debug drawing.
API overview¶
USD-like scene graph node with hierarchy, transform, and mesh data. |
|
View camera used by KangEngine applications. |
|
Infinite-distance light used as the scene's main sun light. |
|
Finite local scene light. |
|
Finite cone-shaped scene light. |
|
Abstract scene backend interface for native and USD scenes. |
|
Scene resource manager mirrored into metadata-only /.Resources prims. |
|
Static mesh payload with vertex attributes and triangle indices. |
|
Mesh payload with skinning attributes for skeletal animation. |
|
Helpers for creating debug lines, arrows, and coordinate axes. |
- class kangengine.scene.Token[native]¶
Interned-style attribute key used by scene prims.
- class kangengine.scene.Prim[native]¶
USD-like scene graph node with hierarchy, transform, and mesh data.
- add_articulation_binding_component(
- self: Prim,
Attach and return this prim’s articulation binding component.
- add_articulation_component(
- self: Prim,
Attach and return this prim’s articulation root component.
- add_camera_component(
- self: Prim,
Attach and return this Camera prim’s camera component.
- add_child(
- self: Prim,
- name: str,
- type: kangengine.scene.PrimType,
Create and return a child prim.
- add_collision_shape_component(
- self: Prim,
Attach and return this prim’s collision shape metadata component.
- add_light_component(self: Prim) kangengine.scene.LightComponent¶
Attach and return this Light prim’s light component.
- add_material_binding_component(
- self: Prim,
Attach and return this prim’s material binding component.
- add_mesh_component(self: Prim) MeshComponent¶
Attach and return this Mesh/MeshInstance prim’s mesh component.
- add_render_component(
- self: Prim,
Attach and return this prim’s render component.
- add_resource_component(
- self: Prim,
Attach and return this Resource prim’s resource component.
- add_rotate_quaternion_op(
- self: Prim,
- rotation: glm::qua<float,
- (glm: :qualifier)0>,
Compatibility alias for local quaternion rotation.
- add_scale_op(
- self: Prim,
- scale: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Compatibility alias for local scale.
- add_translate_op(
- self: Prim,
- translation: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Compatibility alias for local translation.
- compute_local_matrix(
- self: Prim,
Compute this prim’s local transform matrix.
- compute_model_matrix(
- self: Prim,
Compute this prim’s model matrix.
- compute_world_matrix(
- self: Prim,
Compute this prim’s world transform matrix.
- static create_capsule_data(
- radius: float,
- height: float,
- up_axis: kangengine.UpAxis = <UpAxis.Y: 1>,
- segments: int = 32,
Create capsule mesh data.
- static create_cylinder_data(
- radius: float,
- length: float,
- up_axis: kangengine.UpAxis = <UpAxis.Y: 1>,
- segments: int = 32,
Create cylinder mesh data.
- static create_plane_data(
- scale: float,
- up_axis: kangengine.UpAxis = <UpAxis.Y: 1>,
Create plane mesh data.
- static create_rectangle_data(
- x_scale: float,
- y_scale: float,
- z_scale: float,
Create box/rectangle mesh data.
- static create_sphere_data(
- radius: float,
- num_longitudes: int,
- num_latitudes: int,
Create sphere mesh data.
- static create_square_data(scale: float = 1.0) KE::Scene::MeshData¶
Create square mesh data.
- static define_manipulation_group(
- scene: KE::Scene::SceneBackend,
- path: str,
Create an Xform prim that manipulates as a group.
- get_articulation_binding_component(
- self: Prim,
Return this prim’s articulation binding component, or None.
- get_articulation_component(
- self: Prim,
Return this prim’s articulation root component, or None.
- get_attribute_quat(
- self: Prim,
- name: str,
Get a quaternion attribute.
- get_attribute_vec3(
- self: Prim,
- name: str,
Get a vec3 attribute.
- get_attribute_vec4(
- self: Prim,
- name: str,
Get a vec4 attribute.
- get_camera_component(
- self: Prim,
Return this prim’s camera component, or None.
- get_collision_shape_component(
- self: Prim,
Return this prim’s collision shape component, or None.
- get_directional_light(
- self: Prim,
Return directional light data from this Light prim.
- get_display_color(
- self: Prim,
Return RGB display color metadata if present.
- get_display_color_alpha(
- self: Prim,
Return RGBA display color metadata if present.
- get_light_component(self: Prim) kangengine.scene.LightComponent¶
Return this prim’s light component, or None.
- get_light_type(
- self: Prim,
- default_type: kangengine.scene.LightType = <LightType.POINT: 1>,
Return the light subtype for a Light prim.
- get_local_rotation(
- self: Prim,
Return the effective parent-relative quaternion rotation.
- get_local_translation(
- self: Prim,
Return the effective parent-relative translation.
- get_manipulation_policy(
- self: Prim,
Return this prim’s manipulation policy.
- get_material_binding_component(
- self: Prim,
Return this prim’s material binding component, or None.
- get_mesh_component(self: Prim) MeshComponent¶
Return this prim’s mesh component, or None.
- get_point_light(self: Prim) PointLight¶
Return point light data from this Light prim.
- get_render_component(
- self: Prim,
Return this prim’s render component, or None.
- get_resource_component(
- self: Prim,
Return this prim’s resource component, or None.
- get_transform_component(
- self: Prim,
Return this prim’s mandatory transform component.
- get_world_rotation(
- self: Prim,
Return the effective world-space quaternion rotation.
- get_world_translation(
- self: Prim,
Return the effective world-space translation.
- has_articulation_binding_component(self: Prim) bool¶
Return whether this prim has an articulation binding component.
- has_articulation_component(self: Prim) bool¶
Return whether this prim has an articulation root component.
- has_collision_shape_component(self: Prim) bool¶
Return whether this prim has a collision shape component.
- has_material_binding_component(self: Prim) bool¶
Return whether this prim has a material binding component.
- remove_articulation_binding_component(self: Prim) bool¶
Detach this prim’s articulation binding component.
- resolve_manipulation_target(self: Prim) Prim¶
Resolve which prim should be manipulated from this prim.
- resolve_mesh_data(self: Prim) KE::Scene::MeshData¶
Return direct mesh data or resolved source mesh data.
- set_attribute_quat(
- self: Prim,
- name: str,
- value: glm::qua<float,
- (glm: :qualifier)0>,
Set a quaternion attribute.
- set_attribute_vec3(
- self: Prim,
- name: str,
- value: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set a vec3 attribute.
- set_attribute_vec4(
- self: Prim,
- name: str,
- value: glm::vec<4,
- float,
- (glm: :qualifier)0>,
Set a vec4 attribute.
- set_directional_light(
- self: Prim,
- light: DirectionalLight,
Attach directional light data to this Light prim.
- set_display_color(
- self: Prim,
- color: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set RGB display color metadata.
- set_display_color_alpha(
- self: Prim,
- color: glm::vec<4,
- float,
- (glm: :qualifier)0>,
Set RGBA display color metadata.
- set_local_matrix(
- self: Prim,
- matrix: glm::mat<4,
- 4,
- float,
- (glm: :qualifier)0>,
Set local transform matrix.
- set_local_rotation(
- self: Prim,
- rotation: glm::qua<float,
- (glm: :qualifier)0>,
Set local quaternion rotation.
- set_local_rotation_axis_angle(
- self: Prim,
- axis: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- angle_radians: float,
Set local rotation from an axis and an angle in radians.
- set_local_scale(
- self: Prim,
- scale: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set local scale.
- set_local_translation(
- self: Prim,
- translation: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set local translation.
- set_manipulation_policy(
- self: Prim,
- policy: kangengine.scene.ManipulationPolicy,
Set this prim’s manipulation policy.
- set_material(self: Prim, material: kangengine.Material) None¶
Bind a non-owned material to this prim at the scene level.
- set_point_light(
- self: Prim,
- light: PointLight,
Attach point light data to this Light prim.
- set_world_matrix(
- self: Prim,
- matrix: glm::mat<4,
- 4,
- float,
- (glm: :qualifier)0>,
Set world transform matrix.
- set_world_rotation(
- self: Prim,
- rotation: glm::qua<float,
- (glm: :qualifier)0>,
Set world quaternion rotation.
- set_world_rotation_axis_angle(
- self: Prim,
- axis: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- angle_radians: float,
Set world rotation from an axis and an angle in radians.
- class kangengine.scene.Camera[native]¶
View camera used by KangEngine applications.
- get_camera_look_dir(
- self: Camera,
Return the normalized forward/look direction.
- get_camera_right_dir(
- self: Camera,
Return the normalized right direction.
- get_camera_up_dir(
- self: Camera,
Return the normalized up direction.
- get_target_pos(
- self: Camera,
Return the current camera target point.
- class kangengine.scene.DirectionalLight[native]¶
Infinite-distance light used as the scene’s main sun light.
- property ambient¶
- property color¶
- property direction¶
- property intensity¶
- class kangengine.scene.PointLight[native]¶
Finite local scene light.
- property color¶
- property intensity¶
- property position¶
- property range¶
- class kangengine.scene.SpotLight[native]¶
Finite cone-shaped scene light.
- property color¶
- property direction¶
- property inner_cone_angle¶
- property intensity¶
- property outer_cone_angle¶
- property position¶
- property range¶
- class kangengine.scene.TransformComponent[native]¶
Local/world transform state attached to every scene prim.
- property attached¶
Return whether this component is attached.
- compute_local_matrix(
- self: TransformComponent,
Return the cached/computed local matrix.
- compute_model_matrix(
- self: TransformComponent,
Return the model matrix, currently equal to world matrix.
- compute_world_matrix(
- self: TransformComponent,
Return the cached/computed world matrix.
- get_local_rotation(
- self: TransformComponent,
Return the effective parent-relative quaternion rotation.
- get_local_translation(
- self: TransformComponent,
Return the effective parent-relative translation.
- get_world_rotation(
- self: TransformComponent,
Return the effective world-space quaternion rotation.
- get_world_translation(
- self: TransformComponent,
Return the effective world-space translation.
- property owner¶
Return the owning prim, or None after detach.
- set_local_matrix(
- self: TransformComponent,
- matrix: glm::mat<4,
- 4,
- float,
- (glm: :qualifier)0>,
Set the local transform matrix.
- set_local_rotation(
- self: TransformComponent,
- rotation: glm::qua<float,
- (glm: :qualifier)0>,
Set local rotation.
- set_local_rotation_axis_angle(
- self: TransformComponent,
- axis: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- angle_radians: float,
Set local rotation from an axis and an angle in radians.
- set_local_scale(
- self: TransformComponent,
- scale: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set local scale.
- set_local_translation(
- self: TransformComponent,
- translation: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set local translation.
- set_world_matrix(
- self: TransformComponent,
- matrix: glm::mat<4,
- 4,
- float,
- (glm: :qualifier)0>,
Set the world transform matrix.
- set_world_rotation(
- self: TransformComponent,
- rotation: glm::qua<float,
- (glm: :qualifier)0>,
Set world rotation.
- set_world_rotation_axis_angle(
- self: TransformComponent,
- axis: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- angle_radians: float,
Set world rotation from an axis and an angle in radians.
- set_world_translation(
- self: TransformComponent,
- translation: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Set world translation.
- property version¶
Return the transform state version.
- class kangengine.scene.MeshComponent[native]¶
Geometry payload/reference attached to a renderable mesh prim.
- property attached¶
Return whether this component is attached.
- property mesh_data¶
Get or set directly attached mesh data.
- property mesh_source_path¶
Get or set the source path for MeshInstance prims.
- property owner¶
Return the owning prim, or None after detach.
- resolve_mesh_data(
- self: MeshComponent,
Return direct mesh data or resolved source mesh data.
- property resource_handle¶
Get or set the optional SceneResourceManager handle.
- property version¶
Return the mesh component version.
- class kangengine.scene.RenderComponent[native]¶
Renderer-independent visual state attached to one scene prim. Renderer handles are owned by SceneRenderSystem, not by this object.
- property alpha_cutoff¶
Return the alpha-mask cutoff.
- property alpha_mode¶
Return the alpha rendering mode.
- property attached¶
Return whether this component is attached.
- property casts_shadow¶
Get or set shadow casting. Registered components sync this change to the renderer.
- property double_sided¶
Get or set double-sided rendering. Registered components sync this change to the renderer.
- property mesh_data¶
Resolve mesh data from the owning prim.
- property owner¶
Return the owning prim, or None after detach.
- property transform_source¶
Get or set the transform data source.
- property version¶
Return the visual state version.
- property visible¶
Get or set local render visibility. Registered components sync this change to the renderer.
- class kangengine.scene.MaterialBindingComponent[native]¶
Scene-level non-owning binding from one prim to a renderer material.
- property attached¶
Return whether this component is attached.
- clear_material(
- self: MaterialBindingComponent,
Clear the material binding.
- property material¶
Get or set the bound material. The component does not own it.
- property owner¶
Return the owning prim, or None after detach.
- property version¶
Return the material binding version.
- class kangengine.scene.ArticulationComponent[native]¶
Root-level metadata for an articulated object subtree.
- property asset_path¶
Imported articulation asset path or URI.
- property attached¶
Return whether this component is attached.
- property body_count¶
Number of body frame prims.
- property mesh_asset_base_path¶
Shared mesh resource base path, if any.
- property owner¶
Return the owning prim, or None after detach.
- property render_prim_count¶
Number of renderable visual prims.
- property root_path¶
Scene root prim path for this articulation.
- set_articulation_metadata(
- self: ArticulationComponent,
- root_path: str,
- asset_path: str,
- mesh_asset_base_path: str,
- body_count: int,
- render_prim_count: int,
- split_visual_geoms: bool,
Set all root articulation metadata fields at once.
- property split_visual_geoms¶
Whether visual geoms were instantiated as split child prims.
- property version¶
Return the articulation metadata version.
- class kangengine.scene.ArticulationBindingComponent[native]¶
Metadata binding a Prim to an articulated body/frame.
- property articulation_root_path¶
Root prim path of the owning articulation.
- property attached¶
Return whether this component is attached.
- property body_index¶
Articulation body index this prim belongs to.
- property body_name¶
Articulation body name this prim belongs to.
- property owner¶
Return the owning prim, or None after detach.
- property role¶
Role of this prim inside the articulation.
- set_binding(
- self: ArticulationBindingComponent,
- role: kangengine.scene.ArticulationPrimRole,
- body_index: int,
- body_name: str,
- articulation_root_path: str,
Set all binding fields at once.
- property version¶
Return the articulation binding version.
- class kangengine.scene.CollisionShapeComponent[native]¶
Scene-side metadata for a collision shape debug prim.
- property attached¶
Return whether this component is attached.
- property condim¶
Imported MuJoCo contact dimensionality, if any.
- property dynamic_friction¶
Reference PhysX dynamic friction.
- property from_position¶
Body-local from endpoint when has_from_to is true.
- property has_from_to¶
Whether this shape was authored by from/to.
- property local_position¶
Body-local collision shape position.
- property local_rotation¶
Body-local collision shape rotation.
- property margin¶
Imported MuJoCo margin mapped to contactOffset, if any.
- property owner¶
Return the owning prim, or None after detach.
- property restitution¶
Reference PhysX restitution.
- property shape_type¶
Primitive collision shape type.
- property size¶
Shape size descriptor. Interpretation depends on shape type.
- property source_geom_index¶
Index of the source collision geom inside the body descriptor.
- property static_friction¶
Reference PhysX static friction.
- property to_position¶
Body-local to endpoint when has_from_to is true.
- property version¶
Return the collision shape metadata version.
- class kangengine.scene.ResourceComponent[native]¶
Lightweight resource metadata attached to a Resource prim.
- property attached¶
Return whether this component is attached.
- property display_name¶
Get or set a user-facing resource name.
- property handle¶
Get or set the SceneResourceManager handle.
- property owner¶
Return the owning prim, or None after detach.
- property type¶
Get or set the resource type.
- property uri¶
Get or set the resource URI/path.
- property version¶
Return the resource metadata version.
- class kangengine.scene.SceneResourceManager[native]¶
Scene resource manager mirrored into metadata-only /.Resources prims.
- add_external_usage(
- self: SceneResourceManager,
- handle: int,
- path: str,
Track a non-scene consumer of a resource.
- bind_scene(
- self: SceneResourceManager,
- scene: KE::Scene::SceneBackend,
Bind the scene used for Resource prim mirrors.
- clear(self: SceneResourceManager) None¶
Clear all registered resource records and their metadata mirror prims.
- invalidate_usage_cache(
- self: SceneResourceManager,
Mark cached resource usage counts dirty after direct scene or material mutation.
- is_used(
- self: SceneResourceManager,
- handle: int,
Return whether at least one scene prim binding references this resource.
- material(
- self: SceneResourceManager,
- handle: int,
Return material for a handle, or None.
- mesh(
- self: SceneResourceManager,
- handle: int,
Return mesh data for a handle, or None.
- pipeline(
- self: SceneResourceManager,
- handle: int,
Return authored pipeline metadata, or None.
- register_material(
- self: SceneResourceManager,
- name: str,
- material: kangengine.Material,
- uri: str = '',
Register a non-owned material and return a resource handle.
- register_mesh(
- self: SceneResourceManager,
- name: str,
- mesh: KE::Scene::MeshData,
- uri: str = '',
Register mesh data and return a resource handle.
- register_pipeline(
- self: SceneResourceManager,
- name: str,
- pipeline: kangengine.scene.PipelineResource,
- uri: str = '',
Register an authored graphics or compute pipeline definition.
- register_shader_source(
- self: SceneResourceManager,
- name: str,
- shader_source: kangengine.scene.ShaderSourceResource,
- uri: str = '',
Register authored shader source metadata and return a resource handle.
- register_texture(
- self: SceneResourceManager,
- name: str,
- texture: kangengine.Texture,
- uri: str = '',
Register a non-owned texture and return a resource handle.
- remove_external_usage(
- self: SceneResourceManager,
- handle: int,
- path: str,
Stop tracking a non-scene consumer of a resource.
- resource_prim(
- self: SceneResourceManager,
- handle: int,
Return mirrored Resource prim for a handle, or None.
- shader_source(
- self: SceneResourceManager,
- handle: int,
Return authored shader source metadata, or None.
- texture(
- self: SceneResourceManager,
- handle: int,
Return texture for a handle, or None.
- usage_count(
- self: SceneResourceManager,
- handle: int,
Return how many scene prim bindings currently reference this resource.
- usage_paths(
- self: SceneResourceManager,
- handle: int,
Return scene prim paths that currently reference this resource.
- class kangengine.scene.MeshData[native]¶
Static mesh payload with vertex attributes and triangle indices.
- property indices¶
Triangle index buffer.
- property normals¶
Vertex normals.
- property uvs¶
Vertex texture coordinates.
- property vertices¶
Vertex positions.
- class kangengine.scene.SkinnedMeshData[native]¶
Mesh payload with skinning attributes for skeletal animation.
- property bone_node_indices¶
Skeleton node index for each bound bone.
- has_valid_vertex_skinning(
- self: SkinnedMeshData,
Return true when vertex bone data matches the mesh vertex count.
- property mesh¶
Base static mesh data.
- class kangengine.scene.SceneBackend[native]¶
Abstract scene backend interface for native and USD scenes.
- define_prim(
- self: SceneBackend,
- path: str,
- type: kangengine.scene.PrimType,
Define and return a prim at a scene path.
- get_backend_type(
- self: SceneBackend,
Return the backend implementation type.
- get_prim_at_path(
- self: SceneBackend,
- path: str,
Return a prim at a scene path, or None if it does not exist.
- get_root_prim(self: SceneBackend) Prim¶
Return the scene root prim.
- list_meshes(self: SceneBackend) list[str]¶
Return mesh prim paths known by this scene.
- load_mesh(
- self: SceneBackend,
- prim_path: str,
Load mesh data for a prim path.
- load_scene(self: SceneBackend, path: str) bool¶
Load a scene from a file.
- remove_prim(self: SceneBackend, path: str) bool¶
Remove a prim subtree. Components registered by an App detach their renderer resources during destruction.
- save_scene(self: SceneBackend, path: str) bool¶
Save a scene to a file.
Return and ownership rules¶
API |
Return and lifetime contract |
|---|---|
|
A runtime |
|
A handle for copied authored metadata; compiled backend objects are not stored here. |
|
A shared mesh payload, or |
|
Borrowed engine objects, or |
|
Authored metadata retained by the manager, or |
|
A scene-owned mirror prim, valid until removal, |
|
A Python list converted from the current usage cache. |
clear() removes manager records and their /.Resources mirror prims. Keep a
separate owned reference when a non-owned material or texture must
outlive its resource registration.
Debug geometry¶
Use app.scene.debug_geometry for mesh-based debug lines, arrows, and axes.
These objects are ordinary SceneGraph renderables and return
DebugPrimitiveView instances.
ke.scene.DebugDraw is the low-level native implementation used by that
facade:
- class kangengine.scene.DebugDraw[native]¶
Helpers for creating debug lines, arrows, and coordinate axes.
- static log_component_arrows(
- app: KE::App,
- material: kangengine.Material,
- path: str,
- starts: npt.ArrayLike | torch.Tensor,
- ends: npt.ArrayLike | torch.Tensor,
- colors: object = None,
- radius: float = 0.019999999552965164,
- segments: int = 12,
Create instanced debug arrow geometry and return its RenderComponent.
- static log_component_lines(
- app: KE::App,
- material: kangengine.Material,
- path: str,
- starts: npt.ArrayLike | torch.Tensor,
- ends: npt.ArrayLike | torch.Tensor,
- colors: object = None,
- radius: float = 0.004999999888241291,
- segments: int = 8,
Create instanced debug line geometry and return its RenderComponent.
- static log_coordinate_axes(
- app: KE::App,
- material: kangengine.Material,
- path: str,
- origin: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- orientation: glm::qua<float,
- (glm: :qualifier)0>,
- length: float = 1.0,
- radius: float = 0.004999999888241291,
- segments: int = 8,
Create instanced XYZ coordinate axes.
- static log_scene_arrows(*args, **kwargs)¶
Overloaded function.
log_scene_arrows(scene: KE::Scene::SceneBackend, path: str, starts: npt.ArrayLike | torch.Tensor, ends: npt.ArrayLike | torch.Tensor, colors: npt.ArrayLike | torch.Tensor, radius: float = 0.019999999552965164, segments: int = 12) -> list[kangengine.scene.Prim]
Create scene-backed arrow prims from numpy arrays.
log_scene_arrows(scene: KE::Scene::SceneBackend, path: str, starts: collections.abc.Sequence[glm::vec<3, float, (glm::qualifier)0>], ends: collections.abc.Sequence[glm::vec<3, float, (glm::qualifier)0>], colors: collections.abc.Sequence[glm::vec<4, float, (glm::qualifier)0>], radius: float = 0.019999999552965164, segments: int = 12) -> list[kangengine.scene.Prim]
Create scene-backed arrow prims.
- static log_scene_coordinate_axes(
- scene: KE::Scene::SceneBackend,
- path: str,
- origin: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- orientation: glm::qua<float,
- (glm: :qualifier)0>,
- length: float = 1.0,
- radius: float = 0.004999999888241291,
- segments: int = 8,
Create scene-backed XYZ coordinate axes.
- static log_scene_lines(*args, **kwargs)¶
Overloaded function.
log_scene_lines(scene: KE::Scene::SceneBackend, path: str, starts: npt.ArrayLike | torch.Tensor, ends: npt.ArrayLike | torch.Tensor, colors: npt.ArrayLike | torch.Tensor, radius: float = 0.004999999888241291, segments: int = 8) -> list[kangengine.scene.Prim]
Create scene-backed line prims from numpy arrays.
log_scene_lines(scene: KE::Scene::SceneBackend, path: str, starts: collections.abc.Sequence[glm::vec<3, float, (glm::qualifier)0>], ends: collections.abc.Sequence[glm::vec<3, float, (glm::qualifier)0>], colors: collections.abc.Sequence[glm::vec<4, float, (glm::qualifier)0>], radius: float = 0.004999999888241291, segments: int = 8) -> list[kangengine.scene.Prim]
Create scene-backed line prims.
- static make_arrow_transform(
- start: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- end: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Return the arrow transform, or None for a zero-length arrow.
- static make_line_transform(
- start: glm::vec<3,
- float,
- (glm: :qualifier)0>,
- end: glm::vec<3,
- float,
- (glm: :qualifier)0>,
Return the centered line transform, or None for a zero-length line.
- static update_component_arrows(
- app: KE::App,
- component: RenderComponent,
- starts: npt.ArrayLike | torch.Tensor,
- ends: npt.ArrayLike | torch.Tensor,
- colors: object = None,
Update component-backed debug arrow geometry.
- static update_component_lines(
- app: KE::App,
- component: RenderComponent,
- starts: npt.ArrayLike | torch.Tensor,
- ends: npt.ArrayLike | torch.Tensor,
- colors: object = None,
Update component-backed debug line geometry.
Resource Prim lifecycle¶
SceneResourceManager is the source of truth for scene-local shared resources.
Registering a mesh/material/texture or authored shader-source/pipeline assigns
a runtime ResourceHandle and creates a metadata-only mirror prim under
/.Resources/....
Resource prims are not renderable world objects:
they are created, updated, and removed by
SceneResourceManager;they carry
ResourceComponentmetadata: type, handle, display name, and URI;they do not own a
TransformComponent;they do not own mesh/GPU payloads;
they are not manipulation targets;
renderable prims draw through their own
MeshComponent.mesh_datacache and keepMeshComponent.resource_handleonly as resource identity.
ResourceHandle is a runtime identifier. Use URI/path metadata for persistent
asset identity when saving or rebuilding a scene.
Resource usage counts are editor diagnostics. SceneResourceManager exposes
usage_count(handle) / is_used(handle) to report current scene bindings, and
keeps the result in a lazy cache. Normal engine paths invalidate the cache when
resources or renderable bindings change; direct material/component mutation can
call invalidate_usage_cache() explicitly.
Articulation collision metadata¶
Articulation scene prims use components for metadata rather than a dedicated
PrimType::Articulation.
ArticulationComponentbelongs on the articulation root prim and stores source/root/mesh-asset metadata.ArticulationBindingComponentrecords whether a generated prim is a body frame, visual geom, or collision geom and which body it belongs to.CollisionShapeComponentis attached only to optional collision debug prims created byPhysicsBridge.add_collision_visuals(...).
CollisionShapeComponent mirrors reference collision data for inspection. It
does not own PhysX shapes/materials. When collision debug prims are not created,
physics collision still runs normally but there is no scene component to inspect.