I have a object that has a lot of nearly-convex hulls inside of it, all unconnected from each other. I want to run the Convex Hull operator on all of those hulls individually to make them all perfectly convex. But I want the operator to affect each hull individually, otherwise they’ll all be combined into one big hull. Since the Convex Hull operator doesn’t have an “individual” option on it, I need Python to accomplish this.
So I was planning to do the following via script (note that I’m not a coder, so even something this simple is hard for me)
- Select random face
- Select linked
- Convex Hull
- Hide selected faces (so that they don’t get selected again)
Then repeat this in a loop, so that it goes through every hull one by one and convexifies it.
Then once every hull has been convex-ified and hidden, unhide everything.
I’m totally stumped though because I don’t know how to select a single random face via Python. The Select Random operator only allows selecting via a percentage value, and even if I set a very small %, it always ends up selecting more than 1 face. I want to select only one face at a time, without exception.
Does someone know what Python line would allow me to select 1 random face?