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

fix: simplify VRM extension checks in ModelConverter by using op… #1524

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
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
12 changes: 6 additions & 6 deletions src/foundation/importer/ModelConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ export class ModelConverter {

if (rnMaterial.materialTypeName.indexOf('MToon') !== -1) {
const VRMProperties = gltfModel.extensions.VRM;
const rnExtension = VRMProperties.rnExtension;
if (rnExtension != null) {
if (VRMProperties?.rnExtension != null) {
const rnExtension = VRMProperties.rnExtension;
const renderPassOutline = rnExtension.renderPassOutline;
const outlineMaterial = primitive.materialObject?.extras?.outlineMaterial?.deref();
if (outlineMaterial != null) {
Expand Down Expand Up @@ -807,8 +807,8 @@ export class ModelConverter {

// outline
let renderPassOutline;
const rnExtension = VRMProperties.rnExtension;
if (Is.exist(rnExtension)) {
if (Is.exist(VRMProperties?.rnExtension)) {
const rnExtension = VRMProperties.rnExtension;
renderPassOutline = rnExtension.renderPassOutline;
renderPassOutline.isVrRendering = true;
renderPassOutline.tryToSetUniqueName('VRM Outline RenderPass', true);
Expand Down Expand Up @@ -983,8 +983,8 @@ export class ModelConverter {

// outline
let renderPassOutline;
const rnExtension = VRMProperties.rnExtension;
if (Is.exist(rnExtension)) {
if (Is.exist(VRMProperties?.rnExtension)) {
const rnExtension = VRMProperties.rnExtension;
renderPassOutline = rnExtension.renderPassOutline;
renderPassOutline.isVrRendering = true;
renderPassOutline.tryToSetUniqueName('VRM Outline RenderPass', true);
Expand Down
Loading