MAXON CINEMA 4D: Cinema 4D Forum Adobe After Effects Forum

Use Global Variables In Place of Values?

COW Forums : Maxon Cinema 4D

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jareb CoupeUse Global Variables In Place of Values?
by on Jun 23, 2016 at 2:54:57 pm

Hi guys!

I can't find much about this topic online - or anything on here - but I'm pretty sure it must have come up before.

When you're entering values into regular fields (like "P . X" coordinate on a simple primitive) is it possible to instead use a variable, and set those variables globally?

I have an intricate (yet simple) scene set up where nearly every single XYZ and Length/Width/Height value is relative to just FOUR constants. I was hoping there was a way to define these variables globally, so that I could simply change them, which would then propagate to any value/coordinate that utilizes the variable in a formula - without having to manually change the 250 affected locations.

So, for instance, I have an "OuterDiameter" global value of 4. I have 50 locations in the scene that have values all set relative to 4. Some specifically use 4, others use it in a formula (e.g., "4 * 0.25"), or an even more rugged formula (e.g., "(3.14 * 4 * 2) - 0.25").

Right now, as I set things up, I've just hard-coded the values, of course. But now this giant house of cards is ready to move to the next step, where I need to start animating these XYZ and Length/Width/Height, and wouldn't mind doing a run through to replace the values with vars+formula instead.

Any ideas?

Hobbyist level - R17

Return to posts index

Adam TrachtenbergRe: Use Global Variables In Place of Values?
by on Jun 23, 2016 at 11:44:22 pm

Generally you would use Xpresso for something like this. Setup can be a bit laborious but as you suggest, it can save time down the road.

In your case you may be able to use the Set Driver/Set Driven shortcut. So basically you would pick one object to control the others. Then you'd right-click on the parameter you want to change and select expression>set driver. Then multiselect all the objects that you want to be controlled, right click on the same parameter and choose expressions>set driven (either relative or absolute). That will create an Xpresso expression for each controlled object and when you change the master parameter all the other objects will also be changed.

Return to posts index

Jareb CoupeRe: Use Global Variables In Place of Values?
by on Jun 24, 2016 at 12:23:33 am

Holy crap, this is PERFECT! You nailed it, amigo!

Hobbyist level - R17

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved