Moderator: Jim
by Jim » Wed Jun 24, 2009 8:18 pm
I posted a couple of videos on my blog about animating a Group's Transformation using easing functions.
To go from one transformation to the next, I am using Transformation.interpolate - and it works great for the position and rotation components.
I am unable to animate the scale using the same method. The scale just pops at the start of the animations, which is more evidence that SketchUp is storing scaling information in a non-standard way - as mentioned in
this topic .
Hi
Jim
Global Moderator
Posts: 4678Joined: Mon Nov 12, 2007 10:13 pmLocation: ohio
Name: Jim
Operating system: Windows
SketchUp version: 2017
License type: Pro
SketchUp use: hobby
Level of SketchUp: Intermediate
by thomthom » Wed Jun 24, 2009 8:42 pm
ah, that topic yea. nearly forgot about it. I still don't fully understand what SU does there. Would be nice if a Google-head could shed some light on this.
thomthom
PluginStore Author
Posts: 19496Joined: Tue Nov 13, 2007 12:47 pmLocation: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2019
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced
by Jim » Fri Jun 26, 2009 4:17 pm
For animating Groups and Instances, what should the API look like? In other words, you have a plugin in which you would like to incorporate animations; what is the syntax for defining and running an animation that makes sense to you? I'll leave the question intentionally open-ended.
Hi
Jim
Global Moderator
Posts: 4678Joined: Mon Nov 12, 2007 10:13 pmLocation: ohio
Name: Jim
Operating system: Windows
SketchUp version: 2017
License type: Pro
SketchUp use: hobby
Level of SketchUp: Intermediate
by thomthom » Fri Jun 26, 2009 4:30 pm
Just some quick brainstorming ideas. Will have to think more about this...
Code: Select all ani = Animation.new ani.add_entities(entities) kf1 = ani.add_keyframe kf1.move(x,y,y) kf1.scale(1.2) kf2 = ani.add_keyframe kf2.move(x,y,y) kf2.scale(1.2)
thomthom
PluginStore Author
Posts: 19496Joined: Tue Nov 13, 2007 12:47 pmLocation: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2019
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced
by Jim » Wed Jul 01, 2009 5:44 am
A little code
Code: Select all def shot1 a = Animator.new car = Sketchup.active_model.entities.instances[0] cam = Sketchup.active_model.active_view.camera cam1 = Sketchup.active_model.pages[0].camera cam2 = Sketchup.active_model.pages[1].camera anim = Anim.new(car, 'position', [-1000.feet, 0, 0], {'duration'=>200, 'from'=>ORIGIN}) a.register anim anim = Anim.new(cam, 'position', cam2.position+[0,100,0], {'from'=>cam1.position, 'duration'=>200 } ) a.register anim anim = Anim.new(cam, 'target', cam2.target, {'from'=>cam1.target, 'duration'=>200} ) a.register anim a.start end
A little video.
Hi
Jim
Global Moderator
Posts: 4678Joined: Mon Nov 12, 2007 10:13 pmLocation: ohio
Name: Jim
Operating system: Windows
SketchUp version: 2017
License type: Pro
SketchUp use: hobby
Level of SketchUp: Intermediate
by thomthom » Wed Jul 01, 2009 7:14 am
Is that working code?
thomthom
PluginStore Author
Posts: 19496Joined: Tue Nov 13, 2007 12:47 pmLocation: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2019
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced
by Jim » Wed Jul 01, 2009 7:22 am
Hi
Jim
Global Moderator
Posts: 4678Joined: Mon Nov 12, 2007 10:13 pmLocation: ohio
Name: Jim
Operating system: Windows
SketchUp version: 2017
License type: Pro
SketchUp use: hobby
Level of SketchUp: Intermediate
by Chris Fullmer » Wed Jul 01, 2009 7:23 am
Jim the top video is not available (maybe it will be shortly?) and the bottom one says its private. So I can't see either right now. Chris
Chris Fullmer
SketchUp Team
Posts: 6929Joined: Wed Nov 21, 2007 3:21 amLocation: Boulder, CO
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced
by thomthom » Wed Jul 01, 2009 7:24 am
Fantastic! btw, the two last videos are "unavailable"...
thomthom
PluginStore Author
Posts: 19496Joined: Tue Nov 13, 2007 12:47 pmLocation: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2019
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced
by Jim » Wed Jul 01, 2009 7:26 am
They should work shortly...
Here's a
demo of the easings I have been stealing.
Also been borrowing ideas from
here and
here .
Hi
Jim
Global Moderator
Posts: 4678Joined: Mon Nov 12, 2007 10:13 pmLocation: ohio
Name: Jim
Operating system: Windows
SketchUp version: 2017
License type: Pro
SketchUp use: hobby
Level of SketchUp: Intermediate
by thomthom » Wed Jul 01, 2009 7:34 am
Aah! That looks really good! Which remidns me, I need to talk to ASGVis, if maybe such a project would be of any use for them to be able to make V-Ray render object animations. I'll see what kind of data they need from the model.
thomthom
PluginStore Author
Posts: 19496Joined: Tue Nov 13, 2007 12:47 pmLocation: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2019
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced
by Jim » Wed Jul 01, 2009 8:08 am
It's fairly limited right now. You can not chain animations - that is, have an object perform 2 (or more) motions in sequence (yet.) And motion along a curve isn't working yet, so you basically can only move straight-line between 2 points. I think Fredo has done
most of the work for bezier curves already.
Hi
Jim
Global Moderator
Posts: 4678Joined: Mon Nov 12, 2007 10:13 pmLocation: ohio
Name: Jim
Operating system: Windows
SketchUp version: 2017
License type: Pro
SketchUp use: hobby
Level of SketchUp: Intermediate
by Ad Machine » 5 minutes ago
Ad Machine
Robot
Posts: 2012
Return to Skx Extension Library