Node
Methods
Methods Node 클래스는 Aspose.3D 씬 그래프에서 이름이 지정된 요소를 나타냅니다. 각 노드는 하나를 보유할 수 있습니다 Entity (예를 들어 Mesh, Camera, 또는 Light), 다른 노드와 부모‑자식 관계를 유지하고, 로컬 변환을 가지고 있습니다. 노드는 씬 계층 구조에서 3D 객체를 조직하는 주요 방법입니다.
from aspose.threed import Scene, Node
scene = Scene()
# Access the root node: root_node is a property on Scene
root = scene.root_node
# Create a child node
child = root.create_child_node("my_node")
# child_nodes is a property: access without parentheses
for node in root.child_nodes:
print(node.name)Methods
Methods Node 생성자는 선택적 이름으로 노드를 초기화합니다.
| Methods | Methods | Methods |
|---|---|---|
name | str | 노드의 선택적 이름 |
Methods
아래의 모든 노드 속성은 속성; 괄호 없이 접근할 수 있습니다.
| Methods | Methods | Methods |
|---|---|---|
name | str | 노드에 대한 사람이 읽을 수 있는 식별자 |
entity | `Entity | None` |
entities | list[Entity] | 이 노드에 연결된 모든 엔터티(읽기 전용). 노드는 하나 이상의 엔터티를 참조할 수 있습니다. |
material | `Material | None` |
materials | list[Material] | 이 노드에 할당된 모든 재질(읽기 전용). |
child_nodes | list[Node] | 자식 노드 목록. 사용 child_nodes: not children |
parent_node | `Node | None` |
parent_nodes | list[Node] | 모든 부모 노드(다음으로부터 상속됨 Entity; 인스턴싱 지원) |
visible | bool | Methods False, 해당 노드와 그 하위 트리는 가시성을 존중하는 뷰어에서 숨겨집니다. |
excluded | bool | Methods True, 이 노드는 렌더링에서 제외됩니다 |
transform | Transform | 로컬 변환(이동, 회전, 스케일) |
global_transform | GlobalTransform | 월드 공간 변환 행렬 |
asset_info | `AssetInfo | None` |
properties | PropertyCollection | 이 노드에 연결된 사용자 정의 속성 |
Methods
| Methods | 반환 타입 | Methods |
|---|---|---|
create_child_node(name) | Node | 주어진 이름으로 새로운 자식 노드를 생성하고 연결합니다 |
create_child_node(name, entity) | Node | 자식 노드를 생성하고 엔티티를 할당합니다 |
add_child_node(node) | None | 기존 노드를 이 노드의 자식으로 추가합니다 |
get_child(name) | Optional[Node] | 이름으로 직접 자식 노드를 찾습니다 |
add_entity(entity) | None | 추가 엔티티를 이 노드에 연결합니다 |
merge(node) | None | 다른 노드의 자식 및 엔티티를 이 노드에 병합합니다 |
evaluate_global_transform(with_geometric_transform) | Matrix4 | 월드 공간 변환 행렬을 반환합니다; pass True 기하학적 오프셋을 포함하도록 |
get_bounding_box() | BoundingBox | 월드 공간에서 노드의 축에 정렬된 경계 상자를 계산합니다 |
get_property(name) | Any | 이름으로 속성 값을 가져옵니다 |
find_property(name) | Optional[Property] | 이름으로 속성을 찾습니다 |
Methods
씬을 생성하고, 메쉬를 노드에 연결한 뒤, 씬 그래프를 순회합니다:
from aspose.threed import Scene, Node
from aspose.threed.entities import Mesh
from aspose.threed.utilities import Vector4
scene = Scene()
mesh = Mesh()
# Use _control_points to mutate the backing list (control_points returns a copy)
mesh._control_points.append(Vector4(0, 0, 0, 1))
mesh._control_points.append(Vector4(1, 0, 0, 1))
mesh._control_points.append(Vector4(0.5, 1, 0, 1))
mesh.create_polygon(0, 1, 2)
# Attach mesh to a child node
node = scene.root_node.create_child_node("triangle", mesh)
# Traverse child_nodes (property, not a method)
for child in scene.root_node.child_nodes:
entity = child.entity
if entity is not None:
print(f"Node '{child.name}': {type(entity).__name__}")
# excluded is a property
print(f" Excluded: {entity.excluded}")