FileInstancing QML Type

파일에서 인스턴스 테이블을 읽을 수 있습니다. 더 보기...

Import Statement: import QtQuick3D
Since: Qt 6.2
Inherits:

Instancing

속성

상세 설명

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 속성은 일반적인 색상 이름 또는 16진수 표기법으로 지정되며, 및 {vector4d} 속성은 공백으로 구분된 숫자 문자열로 지정되며, 여기서 누락된 후행 숫자는 0을 나타냅니다. 지원되는 속성은 다음과 같습니다: Qt SVG vector3d

nametype
positionvector3d
scalevector3d
eulerRotationvector3d
quaternionvector4d
customvector4d
colorcolor

알 수 없는 속성은 자동으로 무시됩니다.

속성 문서

instanceCount : int [since 6.3]

이 읽기 전용 속성은 인스턴스 테이블의 인스턴스 수를 포함합니다.

이 프로퍼티는 Qt 6.3에 도입되었습니다.


source : url

이 프로퍼티는 인스턴스 데이터가 포함된 XML 또는 바이너리 파일의 위치를 저장합니다.

파일 이름의 확장자가 ".bin"인 경우 바이너리 파일을 참조하는 것으로 간주합니다. 그렇지 않으면 XML 파일을 참조하는 것으로 간주합니다. XML 파일 foo.xml이 지정되어 있고 foo.xml.bin 파일이 존재하는 경우 바이너리 파일인 foo.xml.bin이 대신 로드됩니다.


© 2025 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.