Skip to content

Warning B0004 (“InheritedVisibility”) when loading a glTF exported from Blender with shape keys #21666

@ThibaultEbroussard

Description

@ThibaultEbroussard

Bevy version and features

Bevy version 0.17.2

[Optional] Relevant system information

rustc version 1.90.0
OS: Windows 11

What you did

  1. Created a simple model in Blender with shape keys and exported it to glTF (.gltf or .glb)
  2. Loaded this model in Bevy

What went wrong

  • Expected behavior: No warnings.
  • Actual behavior: Warning in the console:

warning[B0004]: Entity 18v0 with the InheritedVisibility component has a parent (19v0) without InheritedVisibility. This will cause inconsistent behaviors! See: https://bevy.org/learn/errors/b0004

Additional information

.gltf content (the binary .bin file referenced by the glTF cannot be included here):

{
	"asset":{
		"generator":"Khronos glTF Blender I/O v4.5.48",
		"version":"2.0"
	},
	"scene":0,
	"scenes":[
		{
			"name":"Scene",
			"nodes":[
				0
			]
		}
	],
	"nodes":[
		{
			"mesh":0,
			"name":"Cube"
		}
	],
	"materials":[
		{
			"doubleSided":true,
			"name":"Material",
			"pbrMetallicRoughness":{
				"baseColorFactor":[
					0.800000011920929,
					0.800000011920929,
					0.800000011920929,
					1
				],
				"metallicFactor":0,
				"roughnessFactor":0.5
			}
		}
	],
	"meshes":[
		{
			"extras":{
				"targetNames":[
					"Key 1"
				]
			},
			"name":"Cube",
			"primitives":[
				{
					"attributes":{
						"POSITION":0,
						"NORMAL":1,
						"TEXCOORD_0":2
					},
					"indices":3,
					"material":0,
					"targets":[
						{
							"POSITION":4,
							"NORMAL":5
						}
					]
				}
			],
			"weights":[
				0
			]
		}
	],
	"accessors":[
		{
			"bufferView":0,
			"componentType":5126,
			"count":24,
			"max":[
				1,
				1,
				1
			],
			"min":[
				-1,
				-1,
				-1
			],
			"type":"VEC3"
		},
		{
			"bufferView":1,
			"componentType":5126,
			"count":24,
			"type":"VEC3"
		},
		{
			"bufferView":2,
			"componentType":5126,
			"count":24,
			"type":"VEC2"
		},
		{
			"bufferView":3,
			"componentType":5123,
			"count":36,
			"type":"SCALAR"
		},
		{
			"bufferView":4,
			"componentType":5126,
			"count":24,
			"max":[
				0.5434878468513489,
				0,
				0.5434878468513489
			],
			"min":[
				-0.5434878468513489,
				0,
				-0.5434878468513489
			],
			"type":"VEC3"
		},
		{
			"bufferView":5,
			"componentType":5126,
			"count":24,
			"type":"VEC3"
		}
	],
	"bufferViews":[
		{
			"buffer":0,
			"byteLength":288,
			"byteOffset":0,
			"target":34962
		},
		{
			"buffer":0,
			"byteLength":288,
			"byteOffset":288,
			"target":34962
		},
		{
			"buffer":0,
			"byteLength":192,
			"byteOffset":576,
			"target":34962
		},
		{
			"buffer":0,
			"byteLength":72,
			"byteOffset":768,
			"target":34963
		},
		{
			"buffer":0,
			"byteLength":288,
			"byteOffset":840,
			"target":34962
		},
		{
			"buffer":0,
			"byteLength":288,
			"byteOffset":1128,
			"target":34962
		}
	],
	"buffers":[
		{
			"byteLength":1416,
			"uri":"test.bin"
		}
	]
}

main.rs content:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, setup)
        .run();
}

/// set up a simple 3D scene
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    // load gltf
    commands.spawn(SceneRoot(
        asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/test.gltf")),
    ));

    // light
    commands.spawn((
        PointLight {
            shadows_enabled: true,
            ..default()
        },
        Transform::from_xyz(4.0, 8.0, 4.0),
    ));
    // camera
    commands.spawn((
        Camera3d::default(),
        Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y),
    ));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-glTFRelated to the glTF 3D scene/model formatC-BugAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions