XaiJu
Megan Fox
Megan Fox

patreon


Who wants a custom ProBuilder tool?

This one's gonna go out to everyone including source, since I'm not a monster and am not gonna package this into a DLL just to spite people. ;)

What you've got here is a partially baked ProBuilder tool for making arches. By which I mean, it adds a button called "Arch" to ProBuilder's window. It enables when you have a single face selected, like so, and turns this:

Into this:

You'll find the code is half-baked in a lot of ways, like right now, the arguments don't work. This is because I had a long, drawn-out fight with the math to make it work, and an even longer drag-out dig-in fight with ProBuilder itself. ProBuilder is very much not built to be custom tooled, apparently.

Which is why I'm moving to RealtimeCSG, and why I'm not gonna end up using this tool. But that's another post! Later! Suffices to say, if you have a tiny bit of code knowledge, you can fix this to work, and then you'll have a pretty neat thing. Even if you don't wanna fix it, it's a neat example in how you CAN make custom tooling for ProBuilder, which I don't think most realize. I sure didn't, until last week.

Please note that to make this work, you also need to create an AssemblyDefinition and put it in the same directory as the Arch.cs. Make it look like this:

and then that should, theoretically, work. No warranties or guarantees though. Have fun poking at it, see attached for source.

$3+ tier, I'm gonna do another post for y'all that digs a bit into the source to explain how you might want to fix and improve this!

Oh, and make sure you put this in its own folder. Just this, and the AssemblyDefinition. Nothing else in that folder. Otherwise you can cause massive issues. Cool? Cool.

Comments

Ah, and to make that option for SubDivs do something, you'll want your numFacets to instead look like this. Sorry, as stated, tons of bugs, just barely got it working before I abandoned it: int numFacets = EditorPrefs.GetInt("pb_Arch_subDivs", 2);

Megan Fox


More Creators