CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 07-16-2013, 10:53 PM   #1
Troyan
Ice Cream Fanatic
 
Troyan's Avatar
portfolio
Troyan Turner
Creative Director
The Danse Multimedia
USA
 
Join Date: Dec 2003
Posts: 1,434
Send a message via AIM to Troyan
expresso to regulate rotation

Hey guys

After giving up on Cinema's motor to logically regulate rotational speed, is it possible to make a simply rotation controller in expresso whose speed can be regulated by a slider? Like I want to rotate an object 90° every second, but I'd like to ramp up from stationary and then after a bit of time make it rotate faster simply by increasing the degrees it rotates over time. Does that make sense? I'm using the old free gearbuilder plugin that works awesome on this complex gear system but it's motor is doing funky things, probably because it's really old. Thank you very much in advance if anyone has any ideas, my brain hurts after attempting to mostly figure out why Maxon would create a dynamics based motor to begin with.
__________________
2014 Reel
Company website
Behance Portfolio
HyperactiveVR
I reject your reality and substitute my own
 
Old 07-16-2013, 11:22 PM   #2
Horganovski
Freelance Animator/Rigger
 
Horganovski's Avatar
portfolio
Brian Horgan
Graphite9
Dublin, Ireland
 
Join Date: Apr 2007
Posts: 4,896
Hey Troyan, how about something like this, change the 'DegreesPerSecond' userdata slider on the Controller null to control the speed (defaults to 90 degrees per second).

[Edit - I notice the speed increase isn't completely smooth when the speed is animated, I guess it might need a more complex setup, I'd need to spend more time on it. Personally I'd just animate it if I was doing it myself, for me that's the most direct route to getting full control over speed/easing etc.

Cheers,
Brian

Last edited by Horganovski : 07-16-2013 at 11:40 PM.
 
Old 07-17-2013, 12:42 AM   #3
Horganovski
Freelance Animator/Rigger
 
Horganovski's Avatar
portfolio
Brian Horgan
Graphite9
Dublin, Ireland
 
Join Date: Apr 2007
Posts: 4,896
Another variant, a little smoother when accelerating but still not perfect. Might do the trick though. (I still think keyframes are the way to go though!).

The problem I see with driving absolute rotation values from an expression is when you increase the 'multiplier' (the amount it should rotate per frame/second etc) the driven object suddenly has to 'catch up' to that absolute rotation value, so the acceleration/deceleration will always look a little off. Possibly there's another way to approach it but with a simple animation curve driving the rotation that issue is resolved.

Cheers,
Brian

Last edited by Horganovski : 07-17-2013 at 12:51 AM.
 
Old 07-17-2013, 01:52 AM   #4
chi
Modernism at my brains
 
chi's Avatar
portfolio
Patrick Goski
Community Ambassador (North America)
MAXON Computer Inc.
Montreal, Canada
 
Join Date: Dec 2001
Posts: 1,753
Send a message via MSN to chi
http://www.youtube.com/watch?v=Zm3Ih5JV8Ss

check out this link and dig through the similar links.
The rotor tutorials are really helpful for figuring out smooth rotation control
__________________
The views expressed in this post are by no means the opinion of those making the post or of any one person in particular.
 
Old 07-17-2013, 03:37 AM   #5
Troyan
Ice Cream Fanatic
 
Troyan's Avatar
portfolio
Troyan Turner
Creative Director
The Danse Multimedia
USA
 
Join Date: Dec 2003
Posts: 1,434
Send a message via AIM to Troyan
Thanks guys! Been at a family function and just got in. About to look through these and see what I can figure out in the morning.

I really appreciate it.
__________________
2014 Reel
Company website
Behance Portfolio
HyperactiveVR
I reject your reality and substitute my own
 
Old 07-17-2013, 09:13 AM   #6
teleliq
Expert
 
teleliq's Avatar
portfolio
Simon Fiedler
Mainz, Germany
 
Join Date: Dec 2008
Posts: 239
What about the "rotate" node in the node presets? Here you can define how many times it rotates per seconds. Easy.

__________________
www.simonfiedler.de
 
Old 07-17-2013, 09:39 AM   #7
littledevil
Meh
 
littledevil's Avatar
portfolio
Ferdinand
Germany
 
Join Date: Aug 2002
Posts: 616
Quote:
Originally Posted by Horganovski
Hey Troyan, how about something like this, change the 'DegreesPerSecond' userdata slider on the Controller null to control the speed (defaults to 90 degrees per second).


the general problem of xpresso is that it is destructive and not content aware. such setup does not respect any keys set previously, you have to tailor that manually into the xpresso setup (where i personally think it is easier and more convenient to write a small python expression or plugin). the same goes of course for any other rotation approach in xpresso (rotation matrices and so on).

for a xpresso setup you would have to look back to the last key and sum that rotation up to the current rotation. you could do that for example by storing the rotation velocity and operate per frame (calculate the rotation difference to the last frame). but that will introduce interpolation problems for files with different frame rates in some cases. to make it 100% waterproof you'll need some python (or coffee). to make it visually more clear what i meant :

Code:
rotation = spd * t t 1 2 3 spd 45° 90° 90° >>> ------------------------------------ xpresso 45° 90° 270° aware setup 45° 90° 180°
__________________
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.

Last edited by littledevil : 07-17-2013 at 09:50 AM.
 
Old 07-17-2013, 11:29 AM   #8
chi
Modernism at my brains
 
chi's Avatar
portfolio
Patrick Goski
Community Ambassador (North America)
MAXON Computer Inc.
Montreal, Canada
 
Join Date: Dec 2001
Posts: 1,753
Send a message via MSN to chi
Quote:
Originally Posted by littledevil
the general problem of xpresso is that it is destructive and not content aware. such setup does not respect any keys set previously, you have to tailor that manually into the xpresso setup (where i personally think it is easier and more convenient to write a small python expression or plugin). the same goes of course for any other rotation approach in xpresso (rotation matrices and so on).

for a xpresso setup you would have to look back to the last key and sum that rotation up to the current rotation. you could do that for example by storing the rotation velocity and operate per frame (calculate the rotation difference to the last frame). but that will introduce interpolation problems for files with different frame rates in some cases. to make it 100% waterproof you'll need some python (or coffee). to make it visually more clear what i meant :

Code:
rotation = spd * t t 1 2 3 spd 45° 90° 90° >>> ------------------------------------ xpresso 45° 90° 270° aware setup 45° 90° 180°


That is actually covered in the video I posted. They show usage of the mempry node to calculate the current / last positions, etc.
__________________
The views expressed in this post are by no means the opinion of those making the post or of any one person in particular.
 
Old 07-17-2013, 12:05 PM   #9
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,246
But Gentlemen, all there is to it is to
add (not multiply) a value to itself, time has nothing to do with it.

Drag the item twice into xpresso and add a add node inbetwen
using the value of a userdataslider(divided by FPS).

Then use a compare node for current and prev time to actually
do the change only when time differs or it will rotate uncontrolled.

Make sure the nodes are in the correct order in xpresso manager (left pane)

Albeit more options, xperTIME xpresso setup via my sign in VariTime mode
works that way.

Cheers
Lennart
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Old 07-17-2013, 12:25 PM   #10
Srek
Some guy
 
Srek's Avatar
CGSociety Member
portfolio
Björn Dirk Marl
Technical Design
Maxon Computer GmbH
Friedrichsdorf, Germany
 
Join Date: Sep 2002
Posts: 11,334
Just use the preset node as Teleliq pointed out. This is the exact reason why i made it 10 years ago. It has no problems with scrubbing, changing FPS or rewind.
__________________
- www.bonkers.de -
The views expressed on this post are my personal opinions and do not represent the views of my employer.
 
Old 07-17-2013, 12:34 PM   #11
chi
Modernism at my brains
 
chi's Avatar
portfolio
Patrick Goski
Community Ambassador (North America)
MAXON Computer Inc.
Montreal, Canada
 
Join Date: Dec 2001
Posts: 1,753
Send a message via MSN to chi
Quote:
Originally Posted by Srek
Just use the preset node as Teleliq pointed out. This is the exact reason why i made it 10 years ago. It has no problems with scrubbing, changing FPS or rewind.

The problem is you never sold it as a preset
__________________
The views expressed in this post are by no means the opinion of those making the post or of any one person in particular.
 
Old 07-17-2013, 12:38 PM   #12
Srek
Some guy
 
Srek's Avatar
CGSociety Member
portfolio
Björn Dirk Marl
Technical Design
Maxon Computer GmbH
Friedrichsdorf, Germany
 
Join Date: Sep 2002
Posts: 11,334
Quote:
Originally Posted by chi
The problem is you never sold it as a preset

Yeah, i left that part to Maxon

I wish we had nearly as many Xpresso users then like we have today. We would have so many more usefull presets in the standard content delivered with the app.
__________________
- www.bonkers.de -
The views expressed on this post are my personal opinions and do not represent the views of my employer.
 
Old 07-17-2013, 01:02 PM   #13
chi
Modernism at my brains
 
chi's Avatar
portfolio
Patrick Goski
Community Ambassador (North America)
MAXON Computer Inc.
Montreal, Canada
 
Join Date: Dec 2001
Posts: 1,753
Send a message via MSN to chi
Quote:
Originally Posted by Srek
Yeah, i left that part to Maxon

I wish we had nearly as many Xpresso users then like we have today. We would have so many more usefull presets in the standard content delivered with the app.


Ugh. people are still so scared of it too.
It is almost impossible to not use some xpresso in a project now.
Lol. Next we should port xpresso to AE...
__________________
The views expressed in this post are by no means the opinion of those making the post or of any one person in particular.
 
Old 07-17-2013, 01:22 PM   #14
Troyan
Ice Cream Fanatic
 
Troyan's Avatar
portfolio
Troyan Turner
Creative Director
The Danse Multimedia
USA
 
Join Date: Dec 2003
Posts: 1,434
Send a message via AIM to Troyan
Quote:
Originally Posted by Horganovski
Another variant, a little smoother when accelerating but still not perfect. Might do the trick though. (I still think keyframes are the way to go though!).

The problem I see with driving absolute rotation values from an expression is when you increase the 'multiplier' (the amount it should rotate per frame/second etc) the driven object suddenly has to 'catch up' to that absolute rotation value, so the acceleration/deceleration will always look a little off. Possibly there's another way to approach it but with a simple animation curve driving the rotation that issue is resolved.

Cheers,
Brian


Cool, and it works almost identically to Gearbuilders motor, unfortunately it has the same issue, so there must be some fundamental flaw in this approach. Or Cinema processes it strangely. Try this simple test, at frame 0, set a key frame for the rotation to be 0. At 1 second, set a keyframe for the rotation to be 90° and watch what happens after 1 second. There's a nice ramp up like you would expect from 0 to 1 second, then as soon as it hits that 1 second mark the speed snaps down to a much lower rate of speed. It's not a visual temporal thing. Which is what you might be talking about? But it's not a "little" off, it's a lot off. I wholly agree to the manual rotation approach but there's a lot of issues there as well with wanting to ramp up, maintain a speed for an amount of time then vary the speed at different points along the animation. changes would be hell. I'm just thinking there must be a simple approach to controlling rotation speed for someone who is a lot better at math than me.
__________________
2014 Reel
Company website
Behance Portfolio
HyperactiveVR
I reject your reality and substitute my own

Last edited by Troyan : 07-17-2013 at 01:25 PM.
 
Old 07-17-2013, 01:28 PM   #15
tcastudios
Steady now!
 
tcastudios's Avatar
...
Sweden
 
Join Date: Jan 2003
Posts: 4,246
Please see my post again. The others are not understanding
What you are looking for.
__________________
MSA | OSX | xfiles ...Cinema4D Tools
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:37 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.