Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.

Commit

Permalink
update readme, add dota 2 cloth example
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Davis committed Apr 23, 2013
1 parent 4a01537 commit f6ab610
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
@@ -1,5 +1,10 @@
If you are updating to this version from a previous version, try to remove the files from the previous version to avoid any conflicts; there aren't be any specific problems that I am aware of, but just to be sure.

### Changes since last update
* bullet_server is no longer needed. Just run the scripts and go!
* better automatic rigging for ragdolls, and more configurable joint constraints
* soft-body physics, with an emphasis on cloth (and the possibility for some other limited applications)

#SFM Physics Scripts
### What does this do?
* Incorporates physics simulation into SFM via python scripts
Expand Down Expand Up @@ -37,7 +42,7 @@ If you are updating to this version from a previous version, try to remove the f
### Some notes on ragdolls etc.
* Animation with ragdolls is difficult since you have to use the physics handles. I'll add an option to use the model's normal bones for fully-kinematic objects in the future.
* Ropes use the positions of bones at the start of the time selection to determine how joints should line up. So for the best results, leave the model in its default position (ie, t-pose for ragdolls, straight line for ropes) and then animate any kinematic bones into position before the scene starts and give the sim a second to stabilize.

* You *need* a .physics.txt file to create cloth bodies. An example cloth model is included in the /usermod/models/narry/ folder. Another file, windrunner_cape.physics.txt is also included as an example of rigging a cloth model from DOTA 2. The "width" and "height" parameters are self-explanatory; the "boneformat" parameter is described in more detail at http://docs.python.org/2/library/string.html#format-examples. The script iterates each variable {0}, {1}, ..., {n} over the ranges provided in "formatranges" and creates a bone for each. The order of iteration is to increment {0} first, then {1}, etc. The cloth is assumed to always be a 2D plane with dimensions defined by the "width" and "height" parameters regardless of how many variables are in the "boneformat" string.
### Videos
Day 1 http://www.youtube.com/watch?v=LDMB95El9GA
Day 2 http://www.youtube.com/watch?v=a99sJrXWOxo
Expand All @@ -50,6 +55,7 @@ Day cloth: http://www.youtube.com/watch?v=zY2TTc0GKh4
Day cloth2: http://www.youtube.com/watch?v=uy2ICpS0znw
Cloth Parameters Reference: http://www.youtube.com/watch?v=AxK6saPpbW8

This project uses the bullet physics library. Check out http://bulletphysics.org for more info.
The included python bindings for bullet are based on https://github.com/ousttrue/swigbullet
See the bindings plus modifications at https://github.com/btdavis/swig-bullet
This project uses the bullet physics library. Check out http://bulletphysics.org for more info.
The included python bindings for bullet are based on https://github.com/ousttrue/swigbullet
See the bindings plus modifications at https://github.com/btdavis/swig-bullet
Credit for the included example cloth model goes to OSFM member "Narry Gewman"
16 changes: 16 additions & 0 deletions windrunner_cape.physics.txt
@@ -0,0 +1,16 @@
{
"cloths": [
{
"width": 3,
"height": 3,
"boneformat": "cape_R{0}C{1}",
"formatranges": [
[0, 2],
[0, 2]
],
"stretch": 0,
"shear": 0.6,
"bend": 0.9
}
]
}

0 comments on commit f6ab610

Please sign in to comment.