{"record":{"id":"1e5caf8ec4bdedc6","repo":"Genesis-Embodied-AI/genesis-world","slug":"this-method-has-been-removed-because-links-invweig","errorCode":null,"errorMessage":"This method has been removed because links invweights are supposed to be a by-product.","messagePattern":"This method has been removed because links invweights are supposed to be a by-product\\.","errorType":"exception","errorClass":"DeprecationError","httpStatus":null,"severity":"error","filePath":"genesis/engine/entities/rigid_entity/rigid_entity.py","lineNumber":4546,"sourceCode":"        Parameters\n        ----------\n        mass : array_like, shape (n_links,) or (n_envs, n_links)\n            The mass of each link, in kg. Per-environment values require `RigidOptions.batch_links_info=True`.\n        links_idx_local : None | array_like, optional\n            The indices of the links. If None, all links are considered. Defaults to None.\n        envs_idx : None | array_like, optional\n            The indices of the environments. If None, all environments will be considered. Defaults to None.\n        \"\"\"\n        links_idx = self._get_global_idx(links_idx_local, self.n_links, self._link_start, unsafe=True)\n        self._solver.set_links_mass(mass, links_idx, envs_idx)\n\n    @gs.assert_built\n    def set_links_invweight(self, invweight, links_idx_local=None, envs_idx=None):\n        \"\"\"\n        Removed: Genesis computes the inverse weights of a link from its mass, its center of mass, its inertia and\n        the armature of the degrees of freedom above it, so write one of those instead.\n        \"\"\"\n        raise DeprecationError(\"This method has been removed because links invweights are supposed to be a by-product.\")\n\n    @gs.assert_built\n    def set_links_COM(self, com, links_idx_local=None, envs_idx=None):\n        \"\"\"\n        Set the center of mass (COM) of the given links, as an offset in their local frame.\n\n        Parameters\n        ----------\n        com : array_like, shape (n_links, 3) or (n_envs, n_links, 3)\n            The center of mass of each link. Per-environment values require `RigidOptions.batch_links_info=True`.\n        links_idx_local : None | array_like, optional\n            The indices of the links. If None, all links are considered. Defaults to None.\n        envs_idx : None | array_like, optional\n            The indices of the environments. If None, all environments will be considered. Defaults to None.\n        \"\"\"\n        links_idx = self._get_global_idx(links_idx_local, self.n_links, self._link_start, unsafe=True)\n        self._solver.set_links_COM(com, links_idx, envs_idx)\n","sourceCodeStart":4528,"sourceCodeEnd":4564,"githubUrl":"https://github.com/Genesis-Embodied-AI/genesis-world/blob/56e4aa5d82bdb83f2e532e4cc364cb69527acb06/genesis/engine/entities/rigid_entity/rigid_entity.py#L4528-L4564","documentation":"set_links_invweight() was removed for the same reason as its dof counterpart: link inverse weights are a by-product of mass, center of mass, inertia and dof armatures. The removed stub's docstring directs users to write one of those derived-from properties instead.","triggerScenarios":"Calling `entity.set_links_invweight(invweight, links_idx_local=..., envs_idx=...)` on a built RigidEntity, typically from legacy code or old tuning scripts.","commonSituations":"Version upgrade removing the setter; scripts that stabilized simulation by clamping link invweights now failing at runtime.","solutions":["Use `set_links_mass`, `set_links_COM`, `set_links_inertia` (and `set_dofs_armature` for the DOFs above the link) to shape the computed invweight.","Grep for `set_links_invweight` and migrate every call site."],"exampleFix":"# before\nentity.set_links_invweight(invweight, links_idx_local=[2])\n\n# after\nentity.set_links_mass(new_mass, links_idx_local=[2])\nentity.set_links_inertia(new_inertia, links_idx_local=[2])","handlingStrategy":"validation","validationCode":"if not callable(getattr(type(entity), \"set_links_invweight\", None)) or isinstance(getattr(type(entity), \"set_links_invweight\", None), property):\n    pass  # removed; must use set_links_mass / set_links_COM / set_links_inertia","typeGuard":null,"tryCatchPattern":"try:\n    entity.set_links_invweight(w, links_idx_local=[0])\nexcept DeprecationError:\n    entity.set_links_mass(m, links_idx_local=[0])","preventionTips":["Tune mass/COM/inertia/armature instead of invweights.","Codemod old call sites away when migrating Genesis versions."],"tags":["python","genesis","deprecation","api-migration","dynamics"],"backgroundTag":"removed-api-migration","analyzedSha":"56e4aa5d82bdb83f2e532e4cc364cb69527acb06","analyzedAt":"2026-08-28T15:15:07.922Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}