{"id":18077358,"url":"https://github.com/parisneo/qpanda3d","last_synced_at":"2025-05-07T05:51:16.332Z","repository":{"id":34635883,"uuid":"181057610","full_name":"ParisNeo/QPanda3D","owner":"ParisNeo","description":"Panda3D wrapper for PyQt5","archived":false,"fork":false,"pushed_at":"2024-10-02T08:38:11.000Z","size":66,"stargazers_count":22,"open_issues_count":6,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-01T12:41:48.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ParisNeo.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-12T17:49:47.000Z","updated_at":"2025-03-21T12:17:04.000Z","dependencies_parsed_at":"2024-10-31T11:25:47.175Z","dependency_job_id":"ba59c6d7-ed6e-4f48-aaf0-1be7e5f1dd47","html_url":"https://github.com/ParisNeo/QPanda3D","commit_stats":{"total_commits":43,"total_committers":8,"mean_commits":5.375,"dds":"0.34883720930232553","last_synced_commit":"380cadb1908f01f7db0b5afd391d033b619333d7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2FQPanda3D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2FQPanda3D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2FQPanda3D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2FQPanda3D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParisNeo","download_url":"https://codeload.github.com/ParisNeo/QPanda3D/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823693,"owners_count":21809709,"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-10-31T11:24:21.249Z","updated_at":"2025-05-07T05:51:16.252Z","avatar_url":"https://github.com/ParisNeo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# QPanda3D\n\nA working Panda3D wrapper for PyQt5\nThe objective is to be able to put on the same screen, panda3D and pyQT widgets.\n\nThis package is still a work in progress.\nWhat works :\n\n- Creating a panda3D world inside a seemlessly QWidget object that can be placed alog with other QT stuff\n- Full access to panda3D objects, lights ...\n- Keyboard press and up are supported starting from v 0.5\nWhat doesn't work yet:\n- Mouse and timed keyboard interactions\n\n## Installation\n\n```bash\npip install QPanda3D\n```\n\n## Usage\n\n1 - create your world by inheriting from Panda3DWorld\n\n```python\nfrom QPanda3D.Panda3DWorld import Panda3DWorld\nclass MyWorld(Panda3DWorld):\n        Panda3DWorld.__init__(self)\n        # from this point, act as if you are defining a classic panda3D environment\n        self.cam.setPos(0, -28, 6)\n        self.testModel = loader.loadModel('panda')\n        self.testModel.reparentTo(render)\n```\n\n2 - In your main, just create an instance of your world, create a Q\n\n```python\nfrom QPanda3D.QPanda3DWidget import QPanda3DWidget\nif __name__ == \"__main__\":\n    world = MyWorld()\n    \n    app = QApplication(sys.argv)\n    appw=QMainWindow()\n    appw.setGeometry(50, 50, 800, 600)\n\n    pandaWidget = QPanda3DWidget(world)\n    appw.setCentralWidget(pandaWidget)\n    appw.show()\n    \n    sys.exit(app.exec_())\n\n```\n\n## Widget resizing policy\n\nStarting from V 0.4, the widget is automatically resized without making any stretching artefacts. Resizing policy parameters (introduced in V 0.2) have been removed since they are no more needed.\n  \n```python\nfrom QPanda3D.QPanda3DWidget import QPanda3DWidget\nif __name__ == \"__main__\":\n    world = MyWorld()\n    \n    app = QApplication(sys.argv)\n    appw=QMainWindow()\n    appw.setGeometry(50, 50, 800, 600)\n\n    pandaWidget = QPanda3DWidget(world)\n    appw.setCentralWidget(pandaWidget)\n    appw.show()\n    \n    sys.exit(app.exec_())\n\n```\n\nyou can also tell the Panda3DWorld object what is the default view size that you prefer when creating it.\n\n```python\nfrom QPanda3D.Panda3DWorld import Panda3DWorld\nclass MyWorld(Panda3DWorld):\n        Panda3DWorld.__init__(self, width=1024, height=768)\n        # from this point, act as if you are defining a classic panda3D environment\n        self.cam.setPos(0, -28, 6)\n        self.testModel = loader.loadModel('panda')\n        self.testModel.reparentTo(render)\n```\n\nJust make sure that your ratio is adequate with your real widget size.\n\n## Mouse events handling\nMouse position is sent from PyQt interface to panda using messages. You can get these information using the following event handlers :\nmouse1 :Mouse Button 1 Pressed\nmouse2 :Mouse Button 2 Pressed\nmouse3 :Mouse Button 3 Pressed\nmouse1-up :Mouse Button 1 Released\nmouse2-up :Mouse Button 2 Released\nmouse3-up :Mouse Button 3 Released\nwheel_up :Mouse Wheel rolled upwards\nwheel_down :Mouse Wheel rolled downwards\n\nWhen you handle those events, starting from version 0.2.9, you can add an event argument to your event handler method to receive relevent information about the actual position of the mouse in the PyQt 2D canvas.\n\nhere is an example of how you can use this. You can also find a complete example in the examples list\n\n```python\n        #accept few mouse events\n        self.accept('mouse1', self.mousePressEventLeft)\n        self.accept(\"mouse2\", self.wheelEvent)\n        self.accept(\"mouse1-up\", self.mouseReleaseEventLeft)\n        self.accept(\"mouse-move\", self.mouseMoveEvent)\n\n    def mousePressEventLeft(self, evt:dict):\n        le_key_evt.setText(f\"press @ {evt['x']},{evt['y']}\")\n    def mouseReleaseEventLeft(self, evt:dict):\n        le_key_evt.setText(f\"release @ {evt['x']},{evt['y']}\")\n    def wheelEvent(self, evt:dict):\n        le_key_evt.setText(f\"Wheel with {evt['delta']}\")\n    def mouseMoveEvent(self, evt:dict):\n        le_key_evt.setText(f\"Mouse moved to  {evt['x']},{evt['y']}\")\n```\n## Special thanks\n\nI want to thank all the contributers to this little opensource project.\nIn chronological order :\n\n- Thanks to [fraca7](https://github.com/fraca7) for his commit (Change film size according to widget resize)\n- Many thanks to [nmevenkamp](https://github.com/nmevenkamp) for the valuable updates and bugfixes he apported to this project.\n- Also thanks to [augasur](https://github.com/augasur) for bringing to our knowledge problems he faced while using pyinstaller with qpanda3d (preblem solved).\n- Also thanks to [arthurpdesimone](https://github.com/arthurpdesimone) for bringing to our knowledge problems he faced while using mouse interaction.\n\nIf other people want to contribute to this project, the're welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisneo%2Fqpanda3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparisneo%2Fqpanda3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisneo%2Fqpanda3d/lists"}