Tailor Swiftly - Dynamic cloth in Roblox

image
Check out the video!

Tailor Swiftly is a hackweek project I created that allows you to create dynamic cloth using common sewing paradigms. This tailoring can occur in Studio or during play time, allowing you or your players to tailor cloth into unique shapes in real-time.

If you’re interested in trying it out, check out the uncopylocked place and plugin:

Keep in mind that Tailor Swiftly is a 2024 hackweek project, so we can’t promise additional development, improvements, and bug-fixes.

How does Tailor Swiftly work? What are the main APIs?

The place provides a UI for creating and editing cloth using classic sewing paradigms. You can press the “Create Cotton” or “Create Spandex” button to make a new piece of fabric.

Each generated cloth is made of point masses and springs (for spandex) or ropes (for cotton), and the point positions are updated in each heartbeat to position the vertices of an EditableMesh.

The yellow box establishes where the new fabric is created. Click any side to reposition it.

Drape - move a point and drop it
Hold - move a point and it stays in midair where you lift it
Pin - move a point over another part and it will stay pinned to that part
Drop/Unpin - click a point to release it from being held or pinned
Tack - sew a point to any other point
Sew - drag over several points to sew each to the nearest point on another piece of fabric
Rip - undo sewing or tacking
Cut - click a point and drag through fabric to remove connections and triangles.

Additional Notes

  • Check out some demos in the Tailor Swiftly video!
  • If you want to use this same UI in a game, download the plugin and click “Inject in Game” before publishing. You’ll also need to enable Mesh Editing API in your game when you publish.
  • If you want to create fabric in Studio and have the fabric show up and react to physics in your game, click “Inject In Game” and also uncheck “Show GUI” before publishing. You’ll also need to enable Mesh Editing API in your game when you publish.
  • If you are publishing an experience with EditableMesh, keep in mind that your account needs to be verified as 13+ to enable the Allow Mesh / Image API toggles.
  • If you want to see/copy/modify the source code, download the plugin and click “Inject in Game” and you’ll see all the code under ReplicatedStorage.
  • Tailor Swiftly makes extensive use of DragDetectors. If you’ve worked with them and want to see advanced techniques, check out the source code.
  • There’s a special script to turn off the response to air resistance in characters, otherwise they can float away.
  • There’s no special physics code here. It just leverages the existing Roblox Physics engine using Parts and Constraints. In the future, Roblox would benefit from a world-class fabric engine, but we don’t have one now. Hence, it’s pretty hard to get good behavior, and Air Resistance is needed to stop the crazy motion of the spandex springs.

Thanks for dropping by! Leave a comment if you have any questions, suggestions, or feedback. What do you think you could do with this kind of concept?

50 Likes

I think we all need a place with many of these different tailors. “Tailor Swiftly: The Cloth Tour”

7 Likes

this is some amazing stuff rolo, thank you for releasing this for others to use! :smile:

1 Like

While I don’t plan to make any improvements or bug fixes, I’m happy to answer any questions about this and/or give advice to anybody who wants to work with the code for their own use.

Just reply to the article, I’ll be watching.

With shows in Jersey, Kashmir, Argyll, Damask(us) and various stops along the Silk Road…

1 Like

I was just making a joke off of Taylor Swift’s The Eras Tour, I didn’t actually make any of this. Gotta credit @PrinceTybalt for the hard work lol.

1 Like

i dont know how i mixed up a reply vs the op :sob:

thank you @PrinceTybalt then for this :speaking_head: :fire:

Ohh…

Still cool

The last few days I’ve been mentioning vertices and cloth and how you’d have to add more vertices for more quality.

In context of simulated cloth to skinning based animations, and converting it into a bone based animation. Not specifically for cloth, but anything in-general.

that amazing i was looking for something like this!
thank you so much :heart: :speaking_head:

1 Like