Cloth in XSI? How??

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
maxloef
Major General
Major General
Posts: 654
Joined: Mon Jan 03, 2005 4:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Cloth in XSI? How??

Post by maxloef »

question people

ive got cloth SEMI working....

its ingame and it moves but it doesnt

- collide with the player
-follow you arround, as in it jsut sits in a certain locations, say you do a roll...it hoves at the original hieght...

any help on how to properly implement it??
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: cloth in xsi? how??

Post by Caleb1117 »

As far as I know, no one has ever made working cloth.

However, the Russian modding team did it with the ported Revan and Bastila, so it must be possible.
t551
General
General
Posts: 791
Joined: Sat Jul 16, 2005 3:23 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: cloth in xsi? how??

Post by t551 »

The cloth document says that to collide, a unit needs colth collision primitives.
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3284
Joined: Mon Aug 21, 2006 6:23 am
Contact:

How to set up cloth in XSI

Post by AceMastermind »

NOTE: This tutorial assumes:
A) that you have basic knowledge of how to use XSI
B) that you have your character and cloth geometry already made
C) that you have your character already enveloped to psych0fred's
Unit_Template_Beta
D) that you have a full version of XSI 5 (5.11 recommended) with the PandemicBF2.xsiaddon installed
D2) or install
Softimage Mod Tool 7.5 and the XSI ZETools plugin and follow the instructions for exporting scenes using XSI ZETools


Tutorial for setting up a simple cape in XSI

For the sake of this tutorial we'll name our cloth geometry in XSI to:
my_cloth
The cloth geometry should have been modeled in the "at rest" position.
Make my_cloth a child of "dummyroot".

Now let's set the envelope for my_cloth.
Select my_cloth then go:
  • Animate/Deform>Envelope>Set Envelope
You'll enter a pick session, select the bone that you want the cloth to attach to, then right click to end the pick session.
If you made a cape and it drapes down from the neck area just envelope the cape to both left and right clavicle bones (bone_l_clavicle/bone_r_clavicle) or maybe just the neck bone (bone_neck), play around with it to get the best results ingame.
If you made a kama then just envelope it to the pelvis bone (bone_pelvis).
This is so the cloth object will follow your unit properly, such as when jumping, rolling, crouching, etc.

Now we need to make some cloth collision:
  • Get>Primitive>Polygon mesh>sphere
    • Pandemic used cylinders also but sphere's always work, you could also use cubes if necessary.
  • Scale the sphere with the PPG to keep the primitive properties
    Use the default subdivisions
    Translate it into place
    Do not freeze their transforms
Add as many spheres as you think you need to keep the cloth from clipping through the legs, body, head and torso.
Rename your cloth collision spheres c_somename, c_somename1 etc or whatever and in the Explorer window make them a child to the bone that you want them to move with.
Most of the shipped cloth collision primitives made by Pandemic were named after the bone that they move with, such as:
c_ribcage, c_l_thigh, etc.

Now, in object selection mode (spacebar) select my_cloth and go to:
  • File>Pandemic Tools>Create Cloth
A property page (ppg) will appear.
At the top of the ppg you will see a section titled "Collision"
in that section you will also see a button that says "Select Collision Objects"
press that button and a picking session will begin.
Select all of your cloth collision primtives (ex: c_somename) then right click to end the picking session.

Now with the ppg still open you will see another section titled "Fixed Points".
Fixed points are the vertices on the cloth object that will attach to the player model, in other words these are the vertices that will ignore the cloth properties (deformation) making it look like the cloth is actually attached to the player.
For example, if you're making a cape that starts around the neck just select the top row of vertices on the cape object and that will be the fixed portion of the cape. Fixed points will obey your envelope weights unlike the non-fixed points, but the non-fixed points will follow the fixed points such as when jumping, rolling, crouching, etc.

Close the ppg and you're done, in an Explorer branch select (middle click) bone_root then press the H key to hide your hp_weapons, bones, roots, effectors, sv model, and collision primitives, then select and hide the dummyroot.
Branch select (middle mouse click) dummyroot and go to:
  • File>Pandemic Tools>Export
and check this in the window:
  • Export Selected Models Only
then export your model giving it a name and save destination.

Now you need to set up the cloth ODF, just copy one from the assets and rename it to whatever the name of your cloth object was in XSI which would be my_cloth in this tutorial.
Open my_cloth.odf and enter the msh name of your exported unit without ".msh" appended:

Code: Select all

attachedmesh = "name_of_unit_msh"
Don't forget to enter the code in the unit's ODF to enable the cloth ingame:

Code: Select all

ClothODF = "my_cloth" //my_cloth.odf


I also noticed that the more polygons your cloth has the better it will deform ingame, but don't overdo it!
There are a few other properties you can add to the cloth ODF to make it deform how you want.
BF2 Jedi Creation.doc wrote:

Code: Select all

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]

Additional Cloth Setup Notes:
Mike Zaimont (aka PAN-Fnord from Pandemic) claimed wrap around cloth geometry (sleeves, skirts, etc) would split ingame, but FragMe! has since discovered this is due to the arrangement of the UVs on the texture, here's an excerpt from the source post:
[color=#FFBF40]FragMe![/color] wrote:I also found out that when you are UVing the cloth anywhere the polies are not connected to another poly it creates a split in the cloth in game. Once again on the cone cloth, it is mean to be a total wrap around no breaks but if I just UV it so it is flat with the center front of the cloth at either edge of the TGA it splits in game but if I select those edges and do a "heal" so they join the split goes away.
You can have multiple cloth objects in a single msh, each one needs to be treated as a separate object each having their own cloth ODF with additional line in the unit ODF (one for each cloth ODF) calling for the individual cloth pieces.

Prop objects also support cloth, the ODFs should be set up the same way as outlined in the tutorial above, the only real difference being that you won't need cloth collision added to the prop.
maxloef
Major General
Major General
Posts: 654
Joined: Mon Jan 03, 2005 4:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: cloth in xsi? how??

Post by maxloef »

BIG thanx man im gonna try this out when im home (im in class atm) :D

EDIT
SLIGHTLY big problem...did that...and now it like crashes on startup....of the map
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3284
Joined: Mon Aug 21, 2006 6:23 am
Contact:

Re: cloth in xsi? how??

Post by AceMastermind »

You did something wrong then, run the game with the BF2_modtool.exe and see what errors you get in your Bfront2.log
maxloef
Major General
Major General
Posts: 654
Joined: Mon Jan 03, 2005 4:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: cloth in xsi? how??

Post by maxloef »

nvm fixed it :D

STICKY PLEASE :D
User avatar
AgentSmith_#27
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 302
Joined: Thu Feb 11, 2010 3:10 pm
Projects :: No Projects I am ready to unveil
Games I'm Playing :: SWBF2-MW2-Madden 08
xbox live or psn: No gamertag set
Location: Zeroeditor
Contact:

Re: Cloth in XSI? How??

Post by AgentSmith_#27 »

I've run into a small problem....
Now, in object selection mode(spacebar) select my_cloth and go to:

File>Pandemic Tools>Create Cloth

A property page(ppg) will appear.
All I get are export mesh or edit flags...
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Cloth in XSI? How??

Post by DarthD.U.C.K. »

then you arent using the latest version of the addon i suppose. use the one that comes with the swbf2-modtools.
User avatar
AgentSmith_#27
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 302
Joined: Thu Feb 11, 2010 3:10 pm
Projects :: No Projects I am ready to unveil
Games I'm Playing :: SWBF2-MW2-Madden 08
xbox live or psn: No gamertag set
Location: Zeroeditor
Contact:

Re: Cloth in XSI? How??

Post by AgentSmith_#27 »

I just realized that, how silly and epicly failishly noobish of me. Thanks :thumbs:
User avatar
ANDEWEGET
Ancient Force
Ancient Force
Posts: 1266
Joined: Tue Apr 01, 2008 8:42 am
Location: Germany
Contact:

Re: Cloth in XSI? How??

Post by ANDEWEGET »

Thats the only topic about cloth I could find in the XSI FAQ, so Im gonna add this here:
A diagram about how the cloth constraints are stored in the msh file. Its not really nice-looking or informative for anyone without experience with 3D(its more of a visualization for programmers/me), but I just wanted to "store" this information somewhere on GT where its possible to find it.
Hidden/Spoiler:
Image
SPRS/Stretch constraint: stores straight edges(not edges going through polygons nor edges connecting fixed points), if this constraint is enabled these edges will stay the same size(size of cloth will not change). Pretty much all edges you can see in your 3D app.
CPRS/Cross constraint: stores cross edges(crossing a polygon which is not completely "made of" fixed points), if enabled, there will be no shearing(think of the edges as sticky tape, glueing the points together). Edges across quads.
BPRS/Bend constraint: stores straight edges from one border-point to the other, across the cloth mesh, if enabled will keep the shape of the cloth(I suppose it disables bending along those edges).
This is not of very much use without the .MSH tables.
Last edited by ANDEWEGET on Mon Nov 11, 2013 9:29 am, edited 2 times in total.
icemember
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 318
Joined: Thu Jun 11, 2009 3:02 am
Projects :: Designated Days Chapter 1
Games I'm Playing :: SWBF2 Mortal Komabt
xbox live or psn: icemember x
Location: 6 planet of the Hoth system

Re: Cloth in XSI? How??

Post by icemember »

I got permission to post these in this tread.

Heres the stock collision primitives uses by pandemic to give you an idea how to set your collision primitives up.

NOTE: The capes are not primitives. They are actual models.

Stock Collision Primitives
--------------------------------------------------------
ep3 airborne
Hidden/Spoiler:
Image
Image
Image
ep3 heavy
Hidden/Spoiler:
Image
Image
Image
ep3 marine
Hidden/Spoiler:
Image
Image
Image
ep2 arc
Hidden/Spoiler:
Image
Image
Image
Post Reply