PDA

View Full Version : Stickysurface screwing up stupidly



DonJMyers
03-09-2016, 06:56 PM
The motion modifiers sticky and stickysurface are supposed to let you animate a bug crawling over an apple (aka in an arc). The bug has sticky applied and the apple has stickysurface applied. If the apple doesn't move it works great and is interactive. But the apple in my animation is being held and moved around.

Now the bug pops and boings and has difficulty keeping up with the apple's fast motion. Yet if I toggle the motion modifier on and off the bug snaps to exactly where it is supposed to be.

I think this is because these motion plugins are old and the rest of lw doesn't really talk to them well.

I can't believe this motion modifier was added in LW 9.x and I never used it!

Help help what to do? Any suggestions?

Using the raycast node won't work because that is for plopping things on an axis. This is a perfect sphere. Perhaps I could parent the bug to a null in the center of the sphere and move the bug by rotating the center null, but that is awkward.

RebelHill
03-09-2016, 07:08 PM
raycast can work... you just get the vector from the sticker to the sticky (sticky pos - sticker pos) and cast along that vector. As for the update thing... its probs just one of those interactivity bugs... turn on studio live (itll slow down ur scene interactivity but make everything interactive)... Else, once ur done and want to lock it all down... use the motion baker on my animation toolbox.

DonJMyers
03-10-2016, 12:18 PM
Those are good ideas. Unfortunately turning on virtual studio did not help at all so I tried the raycast node. I am "nodally naive" but I figured out how to do what you say. A screenshot of the nodes is attached.

But now the bug may stick to the surface of the sphere but I can't move it around to animate it. It is stuck at the ten o'clock position on the sphere. Aaargh!

I'm a LW wiz but some of the newer features like raycasting nodally I'm not up to speed with.132848132849

DonJMyers
03-10-2016, 12:22 PM
Uncoupling the "rotation" output lets me move the bug around but I still can't keyframe it properly. Moving from one keyframe to the other across the surface results in the bug flying off the sphere completely which is not supposed to happen.

MonroePoteet
03-10-2016, 02:00 PM
Here's an example scene that has a "lady bug" wandering a "golden delicious apple". You're very close to the right node setup.

To have the bug's orientation match the surface of the apple at the hit point, you need to use a "helper node" provided with the 11.6 content called ConvertHitNormaltoHPB, where HPB is Heading, Pitch and Bank. Second, to correctly calculate the Ray Direction, you need to subtract the position of the bug from the position of the target geometry. Here's the nodal setup I used:

132851

The second hint is that the bug's keyframed Y location should always be above any geometry in the apple. So, if your bug starts flying off the apple, try raising it's Y value. The Nodal Motion will "attach" it to the apple regardless, but apparently the RayCast node gets confused if the original location is inside the target geometry.

Hope this helps!
mTp

P.S. when I download the ZIP file I uploaded, the issue with the bug's Y value being too low is inherent. So, when you unzip it and try moving the ladybug around, FIRST raise it's Y value above the apple! I think when the scene is saved and packaged, the initial Y value of the bug is captured from it's *calculated* value, which is on the side of the apple.

DonJMyers
03-10-2016, 02:26 PM
Thanks for taking the time to make that scene Monroe. It sticks the bug to the apple but, unfortunately, just moving or rotating the apple makes the bug constantly slide around. It's probably trying to line up with it's start position so this isn't going to work at all :(

MonroePoteet
03-10-2016, 03:14 PM
Yes, that does seem to be a problem. Unfortunately, from my rudimentary experimenting the only way I found that avoids the slip-sliding when the apple moves is to:

1) parent the bug to the apple
2) set up the motion you want on the apple with the apple not moving
3) step through the animation frame-by-frame, keyframing each frame with Nodal Motion enabled
4) then disable Nodal Motion

When doing step (3), continue to be sure the bug's Y coordinate is above the apple, modifying it if required.

When stepping to each subsequent frame, the bug's position is updated via the nodal motion, which is then captured with the keyframe. The Motion Baker(s) don't seem to capture the bug's motion parameters *after* the Nodal Motion has been applied, although there may be some way of making them do so (I'm no expert at baking motion).

Then, the bug's motion is keyframed relative to the apple and the apple can move or rotate and the bug will stick. If you can find a way for the Motion Baker facilities available to capture the bug's position / orientation relative to the apple after the Nodal Motion is applied, then you could use that.

mTp

RebelHill
03-10-2016, 06:43 PM
like this...


https://www.youtube.com/watch?v=zjS6hOZHdSE

MonroePoteet
03-11-2016, 03:23 AM
Thanks for the great tutorial. I tried the setup you describe, but still get skating on the bug when the master Null is moved away from the origin. I think it has to do with the target geometry not being exactly spherical. As well, the Motion Panel option to target the bug to the Apple doesn't work well on a non-spherical object. The ConvertHitNormalToHPB works better, IMO.

I've attached my scene which I think is the same setup you describe, but with the LadyBug and (non-spherical) Apple. When I move the master Null away from the origin, the stick Null and LadyBug skate on the surface. If the master Null is away from the origin by any significant amount, the stick Null and LadyBug actually leap off the surface. As well, if the master Null isn't exactly at the origin, then rotating it causes the stick Null and LadyBug to skate on the surface.

mTp

DonJMyers
03-11-2016, 03:53 PM
Meanwhile I tried animating the bug with the sticky motion modifier and it worked because I did not move the apple. Then I baked the bug motions so I could turn off the sticky motion modifier. But when I did that it only baked the "non-sticky" part of the motion. The baking process doesn't see the sticky plugin's actions.

I will try turning on virtual studio. Groan!

DonJMyers
03-11-2016, 04:11 PM
I can force the movement of the bug to be baked properly only if I select the bug, which is parented to nothing, open the motion panel and click the "x" on the PARENT button. This deletes a parenting relationship but there is no parent. This seems to force LW to do a full scene evaluation. But I have to do it for every frame one at a time by hand. Arrggh!

Could a script be written to do this?

RebelHill
03-11-2016, 04:16 PM
Use the motion baker on my animation toolbox.

DonJMyers
03-11-2016, 04:28 PM
In fact if I click on any of the "X"s in the motion panel the motion path is baked properly. I have played with all kinds of settings and modules and I can't seem to force the baking process into being automatic. I will have to go frame by frame and click "X" on each frame. Ouch. 7 bugs x 115 frames is too many clicks on Xs.

MonroePoteet
03-11-2016, 04:39 PM
It looks like this Motion Baker:

http://mentalfish.com/2009/09/motion-baker/

actually works in the scenario using RayCastGeometry. Be sure to set the frame range you want to bake, and it then creates a separate keyframe for each frame of the bug's sticky walk. You still have to "freeze" the bug's motion before moving the Apple, but in my scene, it works fine.

To be able to adjust the bug's motion, I'd recommend saving the bug's un-frozen motion keyframes as a Motion File using File=>Save=>Motion File. You can then re-load the Motion file (deleting all frozen keys in the process), adjust as required, and re-freeze the sticky bug motion.

It might work with Sticky Motion as well, but I didn't try it.

P.S. Forgot to mention: you still need the bug parented to the Apple for the bug's frozen motion to move with the Apple.

mTp

RebelHill
03-11-2016, 05:22 PM
7 bugs x 115 frames is too many clicks on Xs.

Hello... use my motionbaker... for the third time.

DonJMyers
03-11-2016, 06:42 PM
Use the motion baker on my animation toolbox.

Is it more accurate than the motion baker built into LW?

RebelHill
03-11-2016, 07:07 PM
If it can be baked... mine'll bake it.


https://www.youtube.com/watch?v=oQeWfXi6ZEI

MonroePoteet
03-11-2016, 08:13 PM
Hello... use my motionbaker... for the third time.

Perhaps you could post a link?

mTp

RebelHill
03-11-2016, 08:30 PM
You see the "Rigging and animation tools" link in my sig...

BokadCastle
03-11-2016, 10:16 PM
Co-ord system? World, Parent, Local.

DonJMyers
03-12-2016, 04:34 PM
If it can be baked... mine'll bake it.


That is good to know. I think I squeaked by with my brute force technique but if I had more shots to do like this I would def pick up your toolbox. We re-tracked the shot in 3D and made all the motion in the scene on the LW camera so I could bring the apple in and put it at 0,0,0 and animated the bugs that way. With the apple not moving the job was much easier to animate.

RebelHill
03-12-2016, 05:06 PM
Well... if you're doing any animation work you should grab it, it speeds things up massively for a whole bunch of tasks... Gives you multi item type keying, multi item curve type setting, animation curve filtration, pose and motion copying/pasting/mirroring, motion baking, etc.

DonJMyers
03-14-2016, 03:45 PM
Well... if you're doing any animation work you should grab it, it speeds things up massively for a whole bunch of tasks... Gives you multi item type keying, multi item curve type setting, animation curve filtration, pose and motion copying/pasting/mirroring, motion baking, etc.

You folks work so hard on these plugins. I wish newtek would license them from you as an official part of LW.