Procedural Recoil

   1600   1   3
User Avatar
Member
87 posts
Joined: Sept. 2019
Offline
I'm trying to automate the process of firing a rifle. I've got a rifle set up to emit a muzzle flash, and I'd like to sync that up with the rifle kicking back against the figure holding it. My current setup involves the rifle feeding into a DOP network (image 1) with a Motion DOP set to a Z velocity of -2 with activation of $F%20==0, so it "kicks back" every 20 frames. That part works just fine, but I'm having trouble with the procedural animation. My figure (image 2) is an agent with an animated rifle-holding idle, set up with ragdoll constraints, the rifle imported from the DOP and captured as packed geometry. This is fed into a second DOP network (image 3) where the ragdoll is solved. It seems like capturing the rifle voids the Motion DOP. This wouldn't be a problem if I could figure out how to bring the captured rifle into a DOP network and apply the motion there, but I haven't been able to do that. I suspect that I'm going to have to familiarize myself more with working in CHOPs, but I'm open to any suggestions you might have.

Attachments:
RifleDOP1.PNG (59.5 KB)
RifleSOP.PNG (51.8 KB)
RifleDOP2.PNG (86.9 KB)

User Avatar
Member
87 posts
Joined: Sept. 2019
Offline
So I've been experimenting quite a bit with CHOPs, and I've been able to achieve not only the same effect but better with a Pulse. The problem I'm having now is that the Pulse only has a single value, and I can pipe that into the Z translate of a Transform SOP, but that only gets me a Z translate. What I want is to read the rotation values of the transform node (currently it's just keyframed to a slow tilt up, but eventually it will be moving freely with the character's animation) and convert that to move backward relative to its current rotation. I'm having a hard time even conceptualizing the solution to that right now. I imagine it would have something to do with vector math, but that's something I have little experience with (or, if I'm being honest, understanding of). For example, say the rifle is rotated 90 degrees Y: that would mean that its "relative Z" would be the X axis. How would I go about converting rotation values to translate values?
  • Quick Links