Forum Announcement, Click Here to Read More From EA_Cade.

Animated Trees

zap608zap608 Posts: 82 Member
edited March 5 in Nominated Threads
I have some questions about the trees and how to keep the animations after editing the uv map or making a new tree.
I recently found the wisteria tree in debug and made it bigger. The problem is of course that whatever tree I cloned had very different settings for the animations. After reading everything I could find that made sense to me, (I'm not a programmer) it confirmed that the animations are based on the uv map. When I make any changes to the uv it re-sets the bones and weights. I knew this as other objects I've made with animations have always had to be in the exact same place for them to work. But a tree is totally different.
My trees float, it appears that the trunk is being pulled up by the leaves, sounds odd I know but I sat and watched and this is the only way to describe it. I tried making the bounds the same as the hawthorn tree to see if this would make a difference, (its much smaller) it did stop the tree swaying half way across the lot and the leaf movements seem to be acceptable but the trunk still leaves the floor. I know the weights and bones are wrong but I don't know how to calculate new bounds to put them right.

My question is, how do I realign the animations to the both the leaves and truck after either making a new tree or simply making a change to an existing tree?
Find me; Freeasabird, The Shed @ Sims 4 Studio. Custom content for The Sims 4.
Post edited by EA_Cade on

Comments

  • zap608zap608 Posts: 82 Member
    So nobody knows how to do this, not even the guys who made the trees and plants? :( I've spent a lot of time reading about animations, watching You Tube for information and using Blenders animation feature, but this animates with the rig on each leaf/branch tip so is no help. From what I can see in S4S the animations are based on the size of the tree, starting from Z then becoming more pronounced at the highest point. I could change behaviours and strings in the Sims 2 but am at a loss in this game . I'll keep trying and if I work it out I will be happy to share the knowledge.
    I think a lot of creators would like to know how this could be done, new trees are always a welcome addition to the game. Thanks for reading anyway. :)
    Find me; Freeasabird, The Shed @ Sims 4 Studio. Custom content for The Sims 4.
  • IngeJonesIngeJones Posts: 3,247 Member
    You need to put @SimGuruModSquad if you want to be sure they will realise you're asking them directly
  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hey there @zap608,

    Swaying tree animation actually uses the model's vertex color data to do leaf rustle. It does not use skinning in the sense of setting up bones and weights the way typical objects do.

    So the short answer is that when cloning a tree, you cannot lose the any of the vert color data. I suspect whatever tool(s) you are using to do the cloning is losing this data, since this setup is somewhat unique to trees.

    Technical details:
    The vertex color layout for trees is as follows. Green and Blue are ignored for channels 1..4:
    Color 0     RGB     Surface color tint
    Color 1     R       Rustle direction X
    Color 2     R       Rustle direction Y
    Color 3     R       Rustle direction Z
    Color 4     R       Rustle phase (game generates two wind scales that change over time, this term interpolates between the two)
    
    The pipeline keeps the rustle information in a vertex color format for what the game engine will load, which means it’s in the range 0 and 1. The shader remaps this into a 0.5 to -0.5 range before scaling it and applying the offset to the leaves. Note that these directions are clamped but not normalized (they’re allowed to be different lengths). The WindMagnitude material parameter acts as a scaling factor.

    Hope that helps,
    SGMS
  • VulnnVulnn Posts: 131 Member
    Hey there @zap608,

    Swaying tree animation actually uses the model's vertex color data to do leaf rustle. It does not use skinning in the sense of setting up bones and weights the way typical objects do.

    So the short answer is that when cloning a tree, you cannot lose the any of the vert color data. I suspect whatever tool(s) you are using to do the cloning is losing this data, since this setup is somewhat unique to trees.

    Technical details:
    The vertex color layout for trees is as follows. Green and Blue are ignored for channels 1..4:
    Color 0     RGB     Surface color tint
    Color 1     R       Rustle direction X
    Color 2     R       Rustle direction Y
    Color 3     R       Rustle direction Z
    Color 4     R       Rustle phase (game generates two wind scales that change over time, this term interpolates between the two)
    
    The pipeline keeps the rustle information in a vertex color format for what the game engine will load, which means it’s in the range 0 and 1. The shader remaps this into a 0.5 to -0.5 range before scaling it and applying the offset to the leaves. Note that these directions are clamped but not normalized (they’re allowed to be different lengths). The WindMagnitude material parameter acts as a scaling factor.

    Hope that helps,
    SGMS

    When i try to clone a tree the whole thing seems to slide across the ground, how do i prevent this?
  • zap608zap608 Posts: 82 Member
    Thank you SGMS. I had forgotten about this but the info is valuable. I'm, a bit rubbish with numbers but it doesn't stop me trying :)
    Vulnn if you are using a tree with animations the clone will hover and float. I use the lollipop tree when I make a new tree because although it says its animated it isn't. Your tree should work but it wont sway in the wind.
    Find me; Freeasabird, The Shed @ Sims 4 Studio. Custom content for The Sims 4.
  • VulnnVulnn Posts: 131 Member
    zap608 wrote: »
    Thank you SGMS. I had forgotten about this but the info is valuable. I'm, a bit rubbish with numbers but it doesn't stop me trying :)
    Vulnn if you are using a tree with animations the clone will hover and float. I use the lollipop tree when I make a new tree because although it says its animated it isn't. Your tree should work but it wont sway in the wind.

    I wish i could figure out how to make the tree i have sway just not slide and float :P
This discussion has been closed.
Return to top