{"id":13840748,"url":"https://github.com/ikalevatykh/pybullet_rendering","last_synced_at":"2025-12-30T09:27:16.428Z","repository":{"id":55027421,"uuid":"232112275","full_name":"ikalevatykh/pybullet_rendering","owner":"ikalevatykh","description":"External rendering for PyBullet","archived":false,"fork":false,"pushed_at":"2022-11-21T21:40:19.000Z","size":213,"stargazers_count":85,"open_issues_count":2,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-02T22:06:30.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ikalevatykh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T13:58:58.000Z","updated_at":"2024-07-04T16:52:47.000Z","dependencies_parsed_at":"2023-01-22T17:00:56.350Z","dependency_job_id":null,"html_url":"https://github.com/ikalevatykh/pybullet_rendering","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikalevatykh%2Fpybullet_rendering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikalevatykh%2Fpybullet_rendering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikalevatykh%2Fpybullet_rendering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikalevatykh%2Fpybullet_rendering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikalevatykh","download_url":"https://codeload.github.com/ikalevatykh/pybullet_rendering/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225712683,"owners_count":17512459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T17:00:54.895Z","updated_at":"2025-12-30T09:27:16.363Z","avatar_url":"https://github.com/ikalevatykh.png","language":"C++","funding_links":[],"categories":["[PyBullet](https://github.com/bulletphysics/bullet3)"],"sub_categories":[],"readme":"# pybullet_rendering\nExternal rendering for [PyBullet](https://github.com/bulletphysics/bullet3/) simulator.\n\n## Install\n\n### Using pip\n\n```\npip install pybullet_rendering\n```\n\n### From source code\n\nInstall NumPy\n\n```\npip install numpy\n```\n\nInstall PyBullet from source code\n\n```\ngit clone https://github.com/bulletphysics/bullet3.git\ncd bullet3\npython setup.py install\nexport BULLET_ROOT_DIR=\"$PWD\"\n```\n\nInstall the package\n\n```\ncd ..\ngit clone https://github.com/ikalevatykh/pybullet_rendering.git\ncd pybullet_rendering\npython setup.py install --bullet_dir \"$BULLET_ROOT_DIR\"\n```\n\nRun tests\n\n```\npython -m unittest discover tests -v\n```\n\n## Run examples\n\nExample of using [Panda3D](https://www.panda3d.org/) for rendering in GUI mode:\n\n```\npython -m pybullet_rendering.examples.panda3d_gui --multisamples 8\n```\n    \nTest performance of diferent renderers:\n\n```\npython -m pybullet_rendering.examples.performance\n```\n\n## Renderers\n\nThis package provide example renderers based on [Panda3D](https://www.panda3d.org/) and [pyrender](https://github.com/mmatl/pyrender).\n\n### Example of usage\n\n```python\nimport pybullet as pb\nfrom pybullet_rendering import RenderingPlugin\nfrom pybullet_rendering.render.panda3d import P3dRenderer # panda3d-based renderer\nfrom pybullet_rendering.render.pyrender import PyrRenderer # pyrender-based renderer\n\nclient_id = pb.connect(pb.DIRECT)\n\n# bind your renderer to pybullet\nrenderer = P3dRenderer(multisamples=4) # or PyrRenderer(platform='egl', egl_device=1)\nplugin = RenderingPlugin(client_id, renderer)\n\n# render thru the standard pybullet API\nw, h, rgba, depth, mask = pb.getCameraImage(w, h, projectionMatrix=..., viewMatrix=...)\n```\n\n### Implement your own renderer in Python\n\nYour renderer should inherit from the `BaseRenderer` class and implement its `update_scene` and `render_frame` methods. To get an idea of their parameters, see examples and tests.\n\n```python\nfrom pybullet_rendering import BaseRenderer\n\nclass MyRenderer(BaseRenderer):\n\n    def __init__(self):\n        \"\"\"The base class initializer have to be called first.\"\"\"\n        BaseRenderer.__init__(self)\n\n    def update_scene(self, scene_graph, materials_only):\n        \"\"\"Update a scene using scene_graph description\n\n        Arguments:\n            scene_graph {SceneGraph} -- scene description\n            materials_only {bool} -- update only shape materials\n        \"\"\"\n        for uid, pb_node in scene_graph.nodes.items():\n            \"update nodes of your scene\"\n\n    def render_frame(self, scene_state, scene_view, frame):\n        \"\"\"Render a scene at scene_state with a scene_view settings\n\n        Arguments:\n            scene_state {SceneState} --  scene state, e.g. transformations of all objects\n            scene_view {SceneView} -- view settings, e.g. camera, light, viewport parameters\n            frame {FrameData} -- output image buffer\n        \"\"\"\n        w, h = scene_view.viewport        \n        if return_to_bullet:\n            frame.color_img[:] = ... # np.uint8, (h,w,4)\n            frame.depth_img[:] = ... # np.float32 (h,w)\n            frame.mask_img[:] = ... # np.int32 (h,w)\n            return True\n            \n        return False  \n```\n\n## Citation\nIf you find pybullet_rendering useful in your research, please cite the repository using the following BibTeX entry.\n```\n@Misc{kalevatykh2020pybullet_rendering,\n  author =       {Kalevatykh, Igor et al.},\n  title =        {pybullet_rendering - External rendering for the PyBullet simulator},\n  howpublished = {Github},\n  year =         {2020},\n  url =          {https://github.com/ikalevatykh/pybullet_rendering}\n}\n```\n## License\nmano_pybullet is released under the [GPLv3](https://github.com/ikalevatykh/pybullet_rendering/blob/master/LICENSE) license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikalevatykh%2Fpybullet_rendering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikalevatykh%2Fpybullet_rendering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikalevatykh%2Fpybullet_rendering/lists"}