Activity › Forums › Maxon Cinema 4D › Xpresso increment?
-
Xpresso increment?
Posted by Andy Stokes on October 7, 2008 at 1:53 amHi all,
I’m doing some experiments with Xpresso and there’s something i’m stuck on.. I have an object that moves on it’s y axis. For the sake of argument let’s say it moves between 0 and 100.
Is there a way to have it “trigger” an event everytime it hits 100units or above and use this trigger to increment?
For example. I’d like to use it to offset another objects position and then increment with each subsequent trigger. Is something like this possible. Also, how might I do it for incrementing an objects rotation?
Any ideas?
Brian Jones replied 16 years, 4 months ago 3 Members · 7 Replies -
7 Replies
-
Brian Jones
October 7, 2008 at 3:01 amsomething moves up and down (repeatedly or randomly) and every time it’s above 100 something else moves and/or rotates. Definitely possible. Are you thinking that this other thing increments once for every time your trigger object is above 100 or increments as long as it’s above 100?
-
Andy Stokes
October 7, 2008 at 4:19 amHi Brian,
I want the second object to be incremented every time the source object reaches 100 or more. For example position could be offset +100 units everytime the source hits 100.. Is that clear?
I just want some idea on where I might start trying to achieve this.
Thx
-
Randy Johnson
October 7, 2008 at 9:48 amUntil Brian gives you a full answer I would look at the range mapper. Nice tutorial here.
https://www.c4dcafe.com/ipb/index.php?autocom=downloads&showfile=439/randy
-
Brian Jones
October 8, 2008 at 4:14 amHere’s a couple of examples. Been busy and didn’t have time for remarks inside the xpresso (I can add some tomorrow maybe) but the short story is – Trigger.c4d is an example where one cube increments position and one rotation as long as the trigger cube is at 100 or above (which it is for more than one frame).
-TriggerClick.c4d only increments the the position/rotation of the target cubes once for each time it gets to 100 regardless of how long it stays above 100. To do that I am using another cube in the scene to “remember” if the increment has been done yet for this cycle. Since I don’t have a variable to work with without C.O.F.F.E.E. (and I’d have to read the reference 🙂 I might not actually need the cube to remember if something has happened already if I’m missing something blindingly obvious but I was in a hurry. -
Brian Jones
October 10, 2008 at 4:38 amHere’s new ones with a better method (works the same but fewer nodes) for the second example that increments the targets only once as the trigger object goes over 100. With comments to hopefully explain a bit.
-
Andy Stokes
October 10, 2008 at 5:21 amHi Brian,
Thanks you so much for the demo scenes. That’s exactly what I wanted to achieve. I was looking for a few “pointers”, but the scene file is a fantastic help.
Thanks again and i’ll be sure to post an example of this in use.
Cheers,
Andy -
Brian Jones
October 12, 2008 at 5:06 amI got around to reading Per-Anders Edwards’ COFFEE Node Primer to get my syntax right. So just for completeness another example doing the same thing as the second example (TriggerClick). If you’re going to check out Coffee it helps to have some scripting under your belt but it’s not hard really if you don’t try do way too complex things right off the start.
Reply to this Discussion! Login or Sign Up