Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Did you know that in Blender you can easily animate oscillating objects with a single driver expression? ✨ 1. Select your object 2. In its rotation write: "# sin(frame / 300 * pi * 2 * 3) * 0.5" where 3 is the number of swings it does, and...

295,946 Aufrufe • vor 3 Jahren •via X (Twitter)

11 Kommentare

Profilbild von passivestar
passivestarvor 2 Jahren

wait I can repost old stuff and still get likes? 😳

Profilbild von Quackers
Quackersvor 3 Jahren

Great tip! Another thing you might want to know is that "2 * pi" is a value that pops up quite often in formulas that there's a name for it. It's called "tau", and Blender actually recognizes it as a constant, which is pretty sweet as it makes a lot of expressions simpler.

Profilbild von passivestar
passivestarvor 3 Jahren

yeah I checked and tau actually works, good catch! 👍

Profilbild von SMOUSE 🔸
SMOUSE 🔸vor 3 Jahren

I'm relatively new to drivers... Sin(frame/15.9)*0.5 gives the exact same result. Are the extra variables just for human readability and control?

Profilbild von passivestar
passivestarvor 3 Jahren

yes, exactly! those kind of micro-optimizations aren't relevant even in realtime code anymore (like gamedev), let alone blender driver expressions that only run once per frame. compilers are smart enough to do those optimizations for you in most cases anyways

Profilbild von Bleddy
Bleddyvor 3 Jahren

Oi! Blender is hard enough already! No need to throw math in there as well.

Profilbild von passivestar
passivestarvor 3 Jahren

😅

Profilbild von Carlos Barreto
Carlos Barretovor 3 Jahren

Great tip. You are not passive star, you are active for sure, so many tips 😍

Profilbild von passivestar
passivestarvor 3 Jahren

Thanks 😅

Profilbild von kureii
kureiivor 3 Jahren

For optimization, you should simplify your formula: frame /300 * pi *3 * 2 can be simplified to frame/50 * pi. This will remove 2 multiplications from what the CPU has to do per frame.

Profilbild von passivestar
passivestarvor 3 Jahren

No need to, python precalculates those for you

Ähnliche Videos