viro icon indicating copy to clipboard operation
viro copied to clipboard

Crash when render 3d object GLB

Open duyta7598 opened this issue 2 years ago • 2 comments

Requirements:

Please go through this checklist before opening a new issue

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: Android 12
  3. Version: ViroReact: 2.22.0 and React Native version 0.63.4
  4. Device(s): Pixel 4

Description

Viro React made crash when render GLB file, It only happen in some of GLB file. And when I check logcat in Android Studio, it show this error Failed to create an anchored node at position [0.0, 0.0, 0.0]

This is some off my code

    <ViroNode>
      <ViroSpotLight
        innerAngle={5}
        outerAngle={45}
        direction={[0, -1, -0.2]}
        position={[0, 3, 0]}
        color="#ffffff"
        castsShadow={true}
        influenceBitMask={2}
        shadowMapSize={2048}
        shadowNearZ={2}
        shadowFarZ={5}
        shadowOpacity={0.7}
      />
      <Viro3DObject
        source={require("./pet.glb")}
        position={randomPosition}
        scale={[0.02, 0.02, 0.02]}
        type="GLB"
        lightReceivingBitMask={3}
        shadowCastingBitMask={2}
      />
      <ViroQuad
        rotation={[-90, 0, 0]}
        width={0.5}
        height={0.5}
        arShadowReceiver={true}
        lightReceivingBitMask={2}
      />
    </ViroNode>

Remove ViroNode doesn't seem to help, I believe it only happen with some off my glb 3d object Can any one help me with this?

duyta7598 avatar Apr 29 '22 09:04 duyta7598

are you using typescript ? if so, you need to add the extension files that are not common to the compiler

randomtoni avatar May 29 '23 12:05 randomtoni

Can you provide the GLB 3D object you're using? And does https://viro-community.readme.io/docs/assets#supported-assets help with your issue?

robertjcolley avatar Jan 31 '24 15:01 robertjcolley