11-20-2019, 03:46 PM (This post was last modified: 11-21-2019, 09:04 AM by Tjommas.)
Hi,
I'm working on crowd simulation of skiers along a slope. The final aim is to have skiers, following a spline (and bound on surface), and having different animation wether they turn right or left.
I could already detect what direction particles turn via a property test (spinZ) connected to the actor node (and only to this node, it didn't work in main event, particles seem not to have any spin).
Now my actor has a color change depending on its spin.
But I need to extend this to an "actor animation" node depending the direction of turn.
Naively I thought I could add an actor animation node after actor output, but it doesnt work.
I tried to use Custom Properties and get the values in the main event but it didn't work either.
11-21-2019, 10:21 AM (This post was last modified: 11-21-2019, 10:31 AM by Tjommas.)
As you can see on this new capture, it displays 2 different spin datas. The one above is the particle spin, and the other one is the actor spin.
You can notice that particle spin sticks to 0 while actor spin seems good : spinZ has positive value when turning left and negative when turning right.
I tried to add a spin node by travel direction but it gives me incorrect values.
How can I copy the actor spin to particle spin data or collect the correct data, or can I use actor spinZ to send to next event to change the actor animation by spin value?
11-21-2019, 11:46 AM (This post was last modified: 11-21-2019, 11:48 AM by Tjommas.)
I could enter the events with an other graph configuration. As you can see the property test works. But for some reason the "actor animation" node still does not work.
With this graph if I put the node in event_009 it plays the animation, but it does not in any other event, so it won't play after a property test.
Is it a kind of bug or something I miss?
I really really need help
11-21-2019, 11:59 PM (This post was last modified: 11-21-2019, 11:59 PM by tyFlow.)
Actor animation must be set on the actor root particle, not its rig particles. From your screenshot it seems that you send out the root particles from the Actor operator, so you're then trying to apply the animation to the rig particles which won't work.
If you want to trigger an animation in the root, by some event that happens in a rig particle, you can use an Actor Collect operator to get the actor parent/root....and immediately send it to an event where the new animation happens (set the 'collect' setting to 'collect actor (parent)' and the 'test TRUE" setting to "collected particles"). Basically that tells the rig particle "grab my actor parent and send it to another event"....from there you set the new animation on it in the other event.
Thank you, it works... on most particles... but some particles have weird behaviors, jittering, or as if some particles don't blend the animations.
The capture is a mix between 2 frames. The surrounded particle "jumps" from "Left Anim" to "Front Anim" in 1 frame while other particles just do a perfect blend.
11-23-2019, 04:30 PM (This post was last modified: 11-23-2019, 04:31 PM by tyFlow.)
Hey Tjommas,
So I looked at your file.
Firstly, the jittering is caused by the fact that skiiers are allowed to move between events immediately, as soon as their spin crosses a certain threshold. This means that if the spin values waver over the threshold, the skiiers will jump between events quickly. A simple solution to this is just to prevent skiiers from immediately switching between events as soon as they change their direction. So in your Property Tests, instead of "Continuous", set their timing to "Event Age" with a range of something like 5-1000...that means they cannot switch to another event until they've stayed in the current event for at least 5 frames...which completely gets rid of any jitter.
As for the animation blending issue, that's caused by a different thing....basically because your blend is set to 20 frames, there are times when skiiers won't be finished blending between animation A and B before they've been told to start playing animation C (ie, they moved through events so quickly that the first blend hasn't finished before the next one is set to begin)....which is causing the animation to jump because the blend isn't designed to work between 3 or more animation clips...but that's what is required in your setup. This is technically a bug in tyFlow that I will have to find a solution to. I will hopefully have this resolved in the next build, which I hope to post sometime this weekend.
Next build got delayed a bit but it's almost ready.
As you can see here...silky smooth. Couple of extra tips to smooth out the file you sent: further Turbosmooth the hill geometry, turn 'rotation' bind off in all the Object Bind operators, and reduce the Rotation operator interpolation (try 0.5).
12-03-2019, 05:16 PM (This post was last modified: 12-03-2019, 06:26 PM by Tjommas.)
Hi Tyson!
I'm close to finnish but I have a couple of questions:
1- Can I tell tyflow not to render the bones of my skiiers? and keep render other hierarchical objects (helmet, goggles, skis...) ... Edit : OK I could do this with a transparent material but I still have some shadows
2- Since skinned mesh are not treated like other meshes, it won't inherit its material, and therefore, I can't randomize the material of my skiiers by particleID... Is there a simple method ?
OK I got it... a simple Material ID (random) connected to the actor output, and a material (with randomization by mat ID) applied to the tyflow skinned mesh.
Then, I could get it done I'm satisfied with the result
There are 3 kinds of skiiers (bad,medium and good skilled), the animations could be even better. Also, skiiers could be converted to ragdolls when they collide one to an another. But I'm stopping there because I won't have time to do more research and it would be useless for my purpose.
And I'm glad to share my work (textures, helmet and goggles not included).
12-11-2019, 06:40 AM (This post was last modified: 12-11-2019, 06:40 AM by tyFlow.)
Quote:Can I tell tyflow not to render the bones of my skiiers? and keep render other hierarchical objects
Yes, you can filter them into another non-renderable event. Do this by setting appropriate properties on them that you use to filter them later using the tyActor Properties window, or if they are actual max bones, there is a specific Property Test available to test for them that you can use.
Quote: Since skinned mesh are not treated like other meshes, it won't inherit its material, and therefore, I can't randomize the material of my skiiers by particleID... Is there a simple method ?
Future tyFlow versions will have an improved workflow for this. In the meantime you have to duplicate your actor and do it all manually, then import multiple actors into your flow.
12-11-2019, 11:50 AM (This post was last modified: 12-11-2019, 11:53 AM by Tjommas.)
(12-11-2019, 06:40 AM)tyFlow Wrote: In the meantime you have to duplicate your actor and do it all manually, then import multiple actors into your flow.
As you can see in the video, it worked without doing that, just with a simple material ID (random) connected to the actor node output and I used a vraymultisubtex map filtered by material ID