How to: Make a Cape

How to create models in XSI and other 3D applications and make them work in Battlefront 1 & 2. Post models, tips for application usage and share anything XSI, 3DMax, SketchUp, etc.

Moderator: Moderators

Post Reply
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

How to: Make a Cape

Post by Challenger33 »

I am new to XSI, and have made a cape model. But when I export it, the model (the Episode 2 Clone Trooper) shows up, but there is no cape. I guess what I am asking for is a tutorial on how to make a cape, since I haven't found any so far.

-:royal:
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3285
Joined: Mon Aug 21, 2006 6:23 am
Contact:

How to: Make a Cape

Post by AceMastermind »

Here is all of the cloth info that I have in my notes, some of it came from the docs, and some came from this site, just read through all of it and you'll get a better understanding of how cloth works.
As far as making a cape, just start with a grid and extrude the edges as needed to conform to the shape you want.



Cloth…
In Battlefront 2, cloth is a way to make a polygon mesh distort itself in real-time based on gravity and wind and things. In layman’s terms, it makes good looking skirts and capes. If your model has cloth on it, which our demo model does because Luke loves his skirt, then you will need to do 2 things to enable that cloth. (If you don’t enable it, it will not appear in-game at all, which means you can see London, and you can see France…)

Firstly, you need to create a cloth ODF for the cloth, in the ODFs directory. The ODF name is simply the name of the cloth piece with “.odf” appended – in our case, “all_inf_tatooinelukeskywalker_cloth.odf”. Inside, you will find…
// ****** A cloth ODF *******
// Top section, same as any other ODF
[GameObjectClass]
// this is cloth, so...
ClassLabel = "cloth"

// properties section – small for cloth
[Properties]

// This tells us the name of the model that the cloth piece is
// attached to. In our case, “all_inf_tatooinelukeskywalker”
AttachedMesh = "all_inf_tatooinelukeskywalker"

Secondly, in our soldier’s ODF, you need to tell it that it uses this cloth ODF, which gives us this line in our ODF above:
ClothODF = “all_inf_tatooinelukeskywalker_cloth”

And that’s it! Assuming your artist did the right thing and attached the cloth where it needed to be, as well as put in cloth collision for it (XSI primitives in the .msh, named c_whateverNameIWant) it should function.
Note: A soldier may have as many cloth ODFs as you wish – each one simply needs to be referenced. One ODF must be created per cloth piece on the model, and they can each have different properties.

There are other properties that you may have in a cloth ODF – we have rarely had occasion to use them, but they are:
(Note that [parameter] means a number, like 20.4, not [20.4])

// ---list of optional cloth parameters---

// Angle of the wind, phi and theta
WindDirection = “[angle1 in degrees] [angle2 in degrees]”

// Wind speed, in m/s
WindSpeed = [speed]

// Dampening coefficient – in some unit or other :^) Default is 0.5
Dampening = [number]

// Drag coefficient, also in some unit – default is -2.0
Drag = [number]

// Mass of each cloth “particle” (in Kg?) – default is 1.0
ParticleMass = [number]

// Maximum world acceleration, in m/s/s – default is 20
MaxAcceleration = [number]

// Priority – cloth with lower priority is skipped,
// if not enough time is left this frame – used for the Emperor
// Default is 0
Priority = [number]

// Does this cloth have an alpha channel? 1 or 0, Default is 0
Transparent = [value]

// BF2 has 3 different types of constraints it satisfies each frame
// when computing the cloth:
// “Bend” constraints keep the cloth’s shape.
// “Stretch” constraints keep the cloth’s size.
// “Cross” constraints keep individual pieces of cloth from shearing.
// You can turn these on or off individually by specifying a
// zero for the constraint.
// For example, if you turn off “stretch” constraints the cloth
// can grow longer or shorter…
CrossConstraint = [zero or one]
BendConstraint = [zero or one]
StretchConstraint = [zero or one]


-------------------


Cloth doesn't collide with the character's mesh - you have to add primitives (MUST be XSI primitives!) that it will collide with. Um...I don't recall what they have to be named, but they're in any mesh that has cloth so you can look for names. You just add them to the hierarchy, export the mesh and they work...as well as they will work. :^) Cloth has some "issues" with collision - cylinders don't work right all the time, but spheres and boxes do. Also, the shape you model the cloth in is the basepose for the cloth - if you model it sticking out behind the guy then it will try to always be sticking out, so model it in the at-rest position.

Also, the export process for cloth needs it to be deformable into a flat plane, so sleeves and cylinders etc are out - it will cut a seam in them. Otherwise Leia would have had a full dress.

Mike Z


---------


The cloth ODF MUST be named the same name as the cloth piece(cloth object in XSI).


-------



Cloth works like this:
The main model MSH has the cloth piece in it. The cloth piece in the MSH has a name. The ClothODF line in the soldier's ODF only tells it that that cloth piece exists, so the ODF must have the same name as the piece in the MSH. Both models are using the same cloth piece because both MSHs have the same name for the cloth piece. I don't know if you can hex-edit that name in the MSH and change the name of the ClothODF to match the new name, but that would be what you should try.
Last edited by AceMastermind on Fri Jul 20, 2007 4:56 pm, edited 1 time in total.
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

Thanks a ton, Ace! :D

-:royal:
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

Sorry for the double-post, but does anyone know specifically what primitives to add to the model and what to name them so the cape will be attached?

-:royal:
User avatar
minilogoguy18
Master Bounty Hunter
Master Bounty Hunter
Posts: 1512
Joined: Wed Nov 09, 2005 11:12 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by minilogoguy18 »

any primitive will work as long as it has the same volume as the mesh your using it for, dont freeze the primitive in XSI so that it doesnt lose the primitive property. as for the name it can be named whatever you want as long as it has the p_ prefix infront of it i.e. p_cube. the modtools documentation covers all of this.
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

OK thanks, I hadn't seen that doc.

-:royal:
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

Lol-this is how my model shows up in-game-the cape is missing for one, but look at the actual trooper :lol: . AceMastermind said I skipped a few steps in XSI, and I agree. I just don't know which steps. I am having problems with the bones, as when I use them, the texture gets messed up.

Image

-:royal:
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

Did you put the cape on the clone in XSI? better to just make the cape its self then attach it to a bone in the .odf.

looks like you never rigged/weighted the model.
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Qdin »

Penguin's right. The unit isn't rigged to any skeleton

but I don't see the cape... how are you attaching it again? AddGeometry could be a good idea.. rigging it so it matches the model, and then attaching it to a certain element like a null or bone which is in the skeleton by default, would probably also do the trick. It's done through the unit's .odf btw
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

I am redo-ing the cape now, I will post when it is finished.

@Penguin and Qdin-I am adding primitives to the model to attach the cape.

-:royal:
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

the primitive is for the collision
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

I know :? . Don't they get added to the model?

-:royal:
Post Reply