{"record":{"id":"ab5565950f0efe44","repo":"Genesis-Embodied-AI/genesis-world","slug":"morph-in-hybrid-entity-should-be-either-urdf-or","errorCode":null,"errorMessage":"`morph` in hybrid entity should be either URDF or Mesh","messagePattern":"`morph` in hybrid entity should be either URDF or Mesh","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"genesis/engine/entities/hybrid_entity.py","lineNumber":112,"sourceCode":"            # load mesh in the same way as the soft entity\n            mesh = load_mesh(morph.file)\n\n            # instantiate rigid part\n            if material.func_instantiate_rigid_from_soft is None:\n                func_instantiate_rigid_from_soft = default_func_instantiate_rigid_from_soft\n            else:\n                func_instantiate_rigid_from_soft = material.func_instantiate_rigid_from_soft\n            part_rigid = func_instantiate_rigid_from_soft(\n                scene=scene,\n                mesh=mesh,\n                morph=morph,\n                material_rigid=material_rigid,\n                material_hybrid=material,\n                surface=surface_rigid,\n            )\n\n        else:\n            raise ValueError(\"`morph` in hybrid entity should be either URDF or Mesh\")\n\n        if not material.use_default_coupling:\n            # get rigid-soft association function\n            if material.func_instantiate_rigid_soft_association is None:\n                if isinstance(morph, gs.morphs.URDF):\n                    func_instantiate_rigid_soft_association = default_func_instantiate_rigid_soft_association_from_rigid\n                elif isinstance(morph, gs.morphs.Mesh):\n                    func_instantiate_rigid_soft_association = default_func_instantiate_rigid_soft_association_from_soft\n            else:\n                func_instantiate_rigid_soft_association = material.func_instantiate_rigid_soft_association\n            muscle_group, link_idcs, geom_idcs, trans_local_to_global, quat_local_to_global = (\n                func_instantiate_rigid_soft_association(part_rigid=part_rigid, part_soft=part_soft)\n            )\n            if muscle_group is not None:\n                muscle_group = muscle_group.astype(gs.np_int, copy=False)\n\n            # set muscle group\n            material_soft.n_groups = len(link_idcs)","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/Genesis-Embodied-AI/genesis-world/blob/56e4aa5d82bdb83f2e532e4cc364cb69527acb06/genesis/engine/entities/hybrid_entity.py#L94-L130","documentation":"A HybridEntity is built from a `morph` that must describe the rigid part as either a URDF model or a Mesh; these are the only two morph types carrying the geometry needed to instantiate the rigid half. Any other morph type (plane, sphere, box, terrain, scene, SDF, ...) falls into the else branch and is rejected with this ValueError.","triggerScenarios":"`scene.add_entity(gs.entities.HybridEntity(morph=..., ...))` where morph is any gs.morphs type other than URDF or Mesh (e.g. gs.morphs.Plane, gs.morphs.Box, gs.morphs.Terrain, gs.morphs.Scene).","commonSituations":"Copy-pasting a plain rigid-entity example (often with morphs.Plane ground) and swapping the entity class to HybridEntity; trying to build a hybrid entity from primitives instead of a mesh/URDF asset.","solutions":["Use a `gs.morphs.Mesh(file=...)` or `gs.morphs.URDF(file=...)` morph for the hybrid entity's rigid part.","If you wanted a primitive rigid shape, use a plain RigidEntity instead of HybridEntity."],"exampleFix":"# before\nentity = scene.add_entity(\n    morph=gs.morphs.Box(size=(0.5, 0.5, 0.5)),\n    material=gs.materials.Hybrid,...\n)\n\n# after\nentity = scene.add_entity(\n    morph=gs.morphs.Mesh(file=\"part.obj\"),\n    material=gs.materials.Hybrid,...\n)","handlingStrategy":"type-guard","validationCode":"import genesis as gs\nmorph = gs.morphs.Box(size=(0.5, 0.5, 0.5))\nif not isinstance(morph, (gs.morphs.URDF, gs.morphs.Mesh)):\n    raise TypeError(\"HybridEntity morph must be URDF or Mesh\")","typeGuard":"def is_hybrid_morph(morph) -> bool:\n    import genesis as gs\n    return isinstance(morph, (gs.morphs.URDF, gs.morphs.Mesh))","tryCatchPattern":null,"preventionTips":["Validate the morph type before add_entity when building hybrid entities.","Keep hybrid-entity construction centralized in one helper so the URDF/Mesh constraint is checked once."],"tags":["python","genesis","invalid-argument","hybrid-entity","morph"],"backgroundTag":"invalid-argument-type","analyzedSha":"56e4aa5d82bdb83f2e532e4cc364cb69527acb06","analyzedAt":"2026-08-28T15:15:07.922Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}