Split rectangles into triangles?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Víctor Paredes
Site Admin
Posts: 5814
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Split rectangles into triangles?

Post by Víctor Paredes »

Hi, I have been using a lot of smart meshes for most of my characters and I normally prefer to create the triangles myself instead of using the "triangulate 2D mesh" option. The process is much longer, but gives me the chance to control exactly how I want the mesh to behave during the animation.
Now, most of the time while I'm creating this meshes, I create squares that then split into two triangles and paint each of them. Do you think there's a way to make that step quicker? I'm thinking about a script that automatically takes every for points connected, divide them into triangles and then paint them.
What do you think?
Thanks
Image Image Image Image Image Image
Moho co-owner

Previously Rigged animation supervisor: My father's dragon, Wolfwalkers & Star Wars Visions "Screecher's Reach"
My personal Youtube Channel
User avatar
A.Evseeva
Posts: 61
Joined: Wed Apr 08, 2015 8:43 am
Contact:

Re: Split rectangles into triangles?

Post by A.Evseeva »

Yes, I have a script, working such way:
make some filled shapes (any shape, not only square. But they have to be bulgy, without self-intersections) and run the script. It will split filled shapes (only filled) into triangles. The benefit is that none of existing edges will be deleted, while built-in command deletes them sometimes.
User avatar
Víctor Paredes
Site Admin
Posts: 5814
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Split rectangles into triangles?

Post by Víctor Paredes »

Wow! this is fantastic!
Thank you very much, Alexandra! I will use this script for a project right now!
Image Image Image Image Image Image
Moho co-owner

Previously Rigged animation supervisor: My father's dragon, Wolfwalkers & Star Wars Visions "Screecher's Reach"
My personal Youtube Channel
User avatar
hayasidist
Posts: 3845
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Split rectangles into triangles?

Post by hayasidist »

or you might consider my "shape" tool -- viewtopic.php?f=12&t=29621#p170024 -- that gives you a mesh from a click-drag rectangle.
Post Reply