{"id":22824549,"url":"https://github.com/csprance/brushsim","last_synced_at":"2025-03-31T00:19:46.131Z","repository":{"id":31774104,"uuid":"35340435","full_name":"csprance/brushsim","owner":"csprance","description":"brush simulation scripts","archived":false,"fork":false,"pushed_at":"2015-05-09T18:50:19.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T05:31:27.260Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csprance.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-09T18:37:16.000Z","updated_at":"2015-05-09T18:42:14.000Z","dependencies_parsed_at":"2022-09-10T09:41:13.253Z","dependency_job_id":null,"html_url":"https://github.com/csprance/brushsim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fbrushsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fbrushsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fbrushsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fbrushsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csprance","download_url":"https://codeload.github.com/csprance/brushsim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246396521,"owners_count":20770382,"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-12-12T17:07:38.159Z","updated_at":"2025-03-31T00:19:46.108Z","avatar_url":"https://github.com/csprance.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brush Simulation Scripts\n\nThese scripts will allow you to simulate the physics on a brush object. This is needed because normally you can not simulate a brush. You can only simulate a RigidBodyEx, so my script automates this lengthy process for you.\n\n## What it does:\n1. Gets the selected object.\n2. Create rigidbodyex and copy model of seleted object to rigidbodyex 'Model' Property\n3. set rigidbodyex xfroms to match xform of selected object\n5. hide selected object\n6. simulate rigidbody ex\n\n## You Must then Run the Next Script Which does this:\n\n7. after simulation is done copy original objects xfroms to new xforms of simulated rigid body\n8. delete rigid body.\n\n## Why this is useful:\nIt allows you to expedite item placement and makes complex objects with strange pivots easy to place in the world naturally. Once these scripts are bound to hotkeys you can simply select an object Press One key and then immediately press another key to get a perfectly placed brush in the world.\n\n### Run Them from the Python Scripts Panel\nView-\u003eOpen View Pane-\u003ePython Scripts\nSelect Simulatebrush.py to simulate the brush\nSelect setobj.py to set the transforms and delete the rigidbody\n\n### Run The Script Manually\nThe Script can be run manually from the python Script Terminal \nView-\u003eOpen View Pane-\u003e Script Terminal\n\nIn the terminal copy and paste\n\n`general.run_file(\"simulatebrush.py\")`\n\nSet Up Hotkeys For Super Speed!\nTools-\u003eConfigure Toolbox Macros\nCreate a New Macro by Clicking the ![Image](http://www.csprance.com/images/2015-02-06_04-11-39.png) and giving it a name simobject\nCopy The Below settings for Simulating the Object Make sure to click Assign!\n![Image](http://www.csprance.com/images/2015-02-06_04-09-14.png)\n`general.run_file(\"simulatebrush.py\")`\n\nCreate Another macro by clicking the  ![Image](http://www.csprance.com/images/2015-02-06_04-11-39.png) and giving it a different name setobj\nCopy the Below Settings for Setting the Objects Xforms and deleting the temporary RigidBodyEx named 'brush_sim_temp'\n![Image](http://www.csprance.com/images/2015-02-06_04-11-04.png)\n`general.run_file(\"setobj.py\")`\n\nCreate Another macro and give it the name simobjweight\nCopy the below settings This will allow you to Set the objects mass instead of just accepting the default mass of 45\n![Image](http://www.csprance.com/images/2015-02-06_05-00-31.png)\n`general.run_file_parameters(\"simulatebrush.py\", 'weight')`\n\nHit Ok.\nNow in the editor you can rapidly select a brush quickly simulate the physics and set the transforms all in just two key presses (I bound mine to Numpad 0 and Numpad 1 and Numpad 3 for setting the weight of the Physicalized object)\n\n## Tips On Use and Important Note!\nYou must ALWAYS run setobj.py after running simulatebrush.py so if you set up the above hotkeys you must always press 0 and then 1 every time.\n\nIt's also not a good idea to undo after you run the script. If you don't like the simulation still set the object by pressing 1 and then try again by replacing the object and running the simulation again.\n\nThe reason you shouldn't undo is because the script just automates a long process so it keeps that process in undo history.\n\nIf something goes wrong first unhide all your objects (Because I hide the original objects to simulate physics)\nthen look for brush_sim_temp entity and delete it.\n\nYou should then be good to go!.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsprance%2Fbrushsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsprance%2Fbrushsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsprance%2Fbrushsim/lists"}