Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only export material from mesh with geometry #12694

Merged
merged 2 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/dev/serializers/src/glTF/2.0/glTFExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2062,8 +2062,9 @@ export class _Exporter {
if (!this._options.shouldExportNode || this._options.shouldExportNode(babylonNode)) {
exportNodes.push(babylonNode);

if (babylonNode instanceof AbstractMesh) {
const material = babylonNode.material || babylonNode.getScene().defaultMaterial;
const babylonMesh = babylonNode as AbstractMesh;
if (babylonMesh.subMeshes && babylonMesh.subMeshes.length > 0) {
const material = babylonMesh.material || babylonMesh.getScene().defaultMaterial;
if (material instanceof MultiMaterial) {
for (const subMaterial of material.subMaterials) {
if (subMaterial) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ declare type Material = import("core/Materials/material").Material;
declare type StandardMaterial = import("core/Materials/standardMaterial").StandardMaterial;
declare type PBRBaseMaterial = import("core/Materials/PBR/pbrBaseMaterial").PBRBaseMaterial;
declare type PBRMaterial = import("core/Materials/PBR/pbrMaterial").PBRMaterial;
declare type PBRMetallicRoughnessMaterial = import("core/Materials/PBR/pbrMetallicRoughnessMaterial").PBRMetallicRoughnessMaterial;

/**
* Interface for storing specular glossiness factors
Expand Down