1. The space forums use a separate registration system from the main virtual world. To comment on these forums, you need to create a separate forum account.
    Dismiss Notice
  2. Hey there, if you want some direct help without hopping inworld - try our Discord channel at https://discord.gg/mptfycQ
    Dismiss Notice

Bug Report EP12p4: Cloth Component

Discussion in 'Bug Reports' started by Trilo, Dec 27, 2017.

Share This Page

  1. Trilo

    By:TriloDec 27, 2017
    Active Member

    Joined:
    Dec 6, 2016
    Messages:
    307
    Likes Received:
    41
    Working on creating items in Editor Pack 12p4 in Unity 2017.2.1f1 for Mac, I am discovering that adding the cloth component appears to rotate either the item or its bounding box by 90 degrees. This is a problem that's been around a long time, and I never found a solid workaround - sometimes starting over would resolve it, other times it just kept persisting every time.

    Screen Shot 2017-12-26 at 3.57.28 PM.png

    I have not yet completed item setup on this piece, so I'm not yet sure whether the next couple hours of my time will be spent on a piece that can be made to work, or whether it will have been wasted... but for me, seeing the white bounding box flipped forward like that was the first big warning sign.

    The piece in question uses LOD models. My steps so far have been as follows.

    Create an empty gameobject and make sure it's set to 0,0,0 on x/y/z axis.
    Add LOD models as children of the empty gameobject.
    Add Clothing Item script to the gameobject.
    Pick slots/layers in Fitting tab.
    Go to rigging tab and drag in the LOD models from the Hierarchy into the LOD slots.
    I added a preservation zone to the piece (since I do not want the legs under the gown to be deleted).
    Click the convert to skinned button and wait while it prepares the three models.
    Go to one of the 3 LOD models, which should now have a skinned mesh renderer component on it (it does).
    Add cloth component.

    That's when it applies the rotation - I have not yet had a chance to apply any settings to the cloth component.

    What I expected to happen is to not see that bounding box at all, or if I saw it for it to be in the right place around the item and not rotated 90 degrees. I'll post followup in this thread once I get further along in the process, to let you know what happens.
     
  2. Trilo

    By:TriloDec 27, 2017
    Active Member

    Joined:
    Dec 6, 2016
    Messages:
    307
    Likes Received:
    41
    On the item I'm working on, it rotated each of the 3 models as I added the cloth component, though as in the picture above it did not rotate the model). I did a basic setup on each and went back to the Clothing Item script on the gameobject and started processing several minutes ago, fingers crossed that it will work (and won't take too much longer than the preparation step takes for LOD models without the cloth component).
     
  3. Trilo

    By:TriloDec 27, 2017
    Active Member

    Joined:
    Dec 6, 2016
    Messages:
    307
    Likes Received:
    41
    It prepared in the editor successfully - at least, it did not throw any errors. It appeared to take longer than the item did without cloth components, but that's to be expected. Checking the rigging tab and also inspecting the individual LOD models I do not see any information about stored colliders. Hopefully that's just information that's not currently being displayed, and not a problem with it not storing any colliders.
     
  4. Trilo

    By:TriloDec 27, 2017
    Active Member

    Joined:
    Dec 6, 2016
    Messages:
    307
    Likes Received:
    41
    Processing finally finished, but things don't appear to be working normally. Here's what I'm seeing in-world.

    Screen Shot 2017-12-26 at 6.45.57 PM.png

    Things appear to be bound to the avatar's bones (with separate leg bone splits being very pronounced), except on the very bottom.

    On the item, I set cloth constraints to 0 for the entire item, and then set different sections to between .001 and .005 in various areas (.005 at the bottom). Here's a shot of what the constraints maps look like on each LOD.

    Screen Shot 2017-12-26 at 6.46.35 PM.png
    Screen Shot 2017-12-26 at 6.46.50 PM.png
    Screen Shot 2017-12-26 at 6.47.08 PM.png

    Green in all three images represents the bit that's at .005. On the high LOD model (bottom pic), you can see a smoother graduation over a larger area. But in the very top pic, it appears that nothing is happening at all until the very bottom. Whatever it is that's happening in-world, it should be a very slight graduation from the other sections, but it appears to be a pretty abrupt change.

    Back to the drawing board, I want to test whether it's truly broken, or whether it's just only working in increments.
     
  5. Trilo

    By:TriloDec 27, 2017
    Active Member

    Joined:
    Dec 6, 2016
    Messages:
    307
    Likes Received:
    41
    After tinkering around some more, I discovered that the initial settings were way too conservative. Using larger max distance values got cloth working a little better, but revealed that neither preservation zones nor sphere colliders are working. I double-checked the item to make sure that I've got sphere collider pairs set up properly on each individual model, then on the main gameobject with clothing item settings component, I have a preservation zone set up for the legs.

    Screen Shot 2017-12-27 at 4.02.28 AM.png

    In theory, that should prevent the legs from being deleted, and the colliders I have set up should make the dress move around the legs and feet when walking, dancing, etc. In-world, I'm seeing this:

    Screen Shot 2017-12-27 at 3.59.57 AM.png

    On the right side of the dress, the black object that ends abruptly is the top of one of the boots the avatar is wearing.
     
  6. Adam

    By:AdamDec 29, 2017
    Developer
    Staff Member Moderator

    Joined:
    Aug 21, 2014
    Messages:
    693
    Likes Received:
    137
    We found a bug here where colliders weren't being recreated on the LOD models - that's been squashed, however deletion is still an issue - currently we don't delete from cloth physics enabled models, due to the fact that cloth moves around too much for it to be reliable (i.e. when stuff can move in any direction, it's hard to work out what is safe to delete)

    That said, I think it would make sense to at least allow deletion zones to run - since you're placing those explicitly.