viro
viro copied to clipboard
Crash when render 3d object GLB
Requirements:
Please go through this checklist before opening a new issue
- [x] Review the documentation
- [x] Search for existing issues in: viromedia/viro & ViroCommunity/viro
- [] Use the latest ViroReact release
Environment
Please provide the following information about your environment:
- Development OS: Mac
- Device OS & Version: Android 12
- Version: ViroReact: 2.22.0 and React Native version 0.63.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?
are you using typescript ? if so, you need to add the extension files that are not common to the compiler
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?