FileInstancing QML Type
파일에서 인스턴스 테이블을 읽을 수 있게 해줍니다. 더 보기...
| Import Statement: | import QtQuick3D |
| Since: | Qt 6.2 |
| Inherits: |
속성
- instanceCount : int
(since 6.3) - source : url
상세 설명
FileInstancing 타입을 사용하면 파일에서 인스턴스 테이블을 읽을 수 있습니다.
지원되는 파일 형식은 XML과 Qt 전용 바이너리 형식의 두 가지입니다. 바이너리 파일 형식은 GPU로 업로드되는 테이블과 동일한 레이아웃을 사용하므로 메모리에 직접 매핑할 수 있습니다. 인스턴서 도구는 XML을 바이너리 형식으로 변환합니다.
다음은 XML 파일 형식의 예시입니다:
<?xml version="1.0" encoding="UTF-8" ?>
<InstanceTable>
<Instance position="0 200 0" scale="0.75 0.75 0.75" custom="20 20" color="#ffcf7f"/>
<Instance position="0 -100 0" scale="0.5 0.5 0.5" color="red"/>
<Instance position="0 -200 0" eulerRotation="0 0 60" color="darkred" custom="10 40 0 0"/>
</InstanceTable>XML 파일이 유효하려면 최상위 수준에 InstanceTable 요소가 있어야 합니다. 각 인스턴스는 InstanceTable 내부의 Instance 요소로 표현됩니다. 알 수 없는 요소는 아무런 오류 메시지 없이 무시됩니다.
Instance 요소에는 여러 속성이 있을 수 있습니다. color 속성은 일반적인 Qt SVG 색상 이름이나 16진수 표기법으로 지정됩니다. vector3d 및 {vector4d} 속성은 공백으로 구분된 숫자 문자열로 지정되며, 끝부분의 숫자가 누락된 경우 0으로 간주됩니다. 다음 속성이 지원됩니다:
| name | type |
|---|---|
position | vector3d |
scale | vector3d |
eulerRotation | vector3d |
quaternion | vector4d |
custom | vector4d |
color | color |
알 수 없는 속성은 아무런 메시지 없이 무시됩니다.
속성 설명서
instanceCount : int [since 6.3]
이 읽기 전용 속성은 인스턴스 테이블에 포함된 인스턴스의 수를 나타냅니다.
이 속성은 Qt 6.3에서 도입되었습니다.
source : url
이 속성은 인스턴스 데이터가 포함된 XML 또는 바이너리 파일의 위치를 저장합니다.
파일 이름에 ".bin" 확장자가 포함된 경우, 해당 파일은 바이너리 파일로 간주됩니다. 그렇지 않은 경우 XML 파일로 간주됩니다. XML 파일 foo.xml이 지정되었으나 foo.xml.bin 파일이 존재하는 경우, 대신 바이너리 파일 foo.xml.bin이 로드됩니다.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.