Animations - Creating a Curve2IPO wizard

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Mon Oct 20, 2008 11:58 pm

Oh bugger, I found a new feature in 2.48 that can really screw things up, to do with curves, i'm going to keep quiet about that and hope nobody else notices that feature
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Sun Oct 26, 2008 8:05 pm

i'm just going to upload the .blend file for those that are interested, but note that the queries I have made over the last couple of months are not coded, as I don't yet have a solid idea of what i'm doing
Scripting.blend
(180.94 KiB) Downloaded 349 times
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Tue Oct 28, 2008 10:09 pm

I think I have an idea of how to do this, but its going to need 3 sets of vectors, but i'm going to double check it with some simple trigonometry.

The 3 sets of vectors are split like this
The last set
The current set
The next set or the set that states direction from the current

By analyzing the last set relative to the current will determine the degree angle of the next if it folds behind the current at a slight angle but is obtuse
Confused? I am!

I am going to have to write down this logic somehow, as I am going bananas.

Still working on the trig for the example in the previous entry, for 3 lots of 90 degrees, especially how to sort out the relationships
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Fri Oct 31, 2008 2:37 pm

I hope everyone understands the nightmares that am having about this project, i've learned a lot, and I mean A LOT, and i'm still learning A LOT.

For instance I woke up early this morning for some strange reason, yes its the weekend for me, and I often sleep till late morning, this morning however I woke up at 6:30 am, and immediately my mind was working on this project.

A suggestion from a topic I created at Blender artists shows that I needed to go back and try again doing the same thing I was doing but use 3 pivot vectors, where each pivot has a length and this is called a vector, see I always thought a vector was a point in space, WRONG!!!

So i've been doing more research into these vectors, and realising that I have to use 3 pivots to get the correct result at the end, and once verified, I can finally start to code it.
I found this page to have the best understanding of vectors and angles between vectors as this is the line of research i'm doing right now.
http://programmedlessons.org/VectorLessons/index.html

Which I found rather quickly on Google, with the search parameter "angle between vectors" not to be mistaken what I did before with "anglebetweenvecs" cause that is a BlenderAPI thing that I can't get to work.

The Blender Artists topic
http://blenderartists.org/forum/showthr ... ost1245702
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby teedyo » Sat Nov 01, 2008 10:48 am

When working with spacial vectors; I find it useful just to think of them as offsets. Of course when working with the angles between them, you still need to find a some origin to work from.
teedyo
 
Posts: 212
Joined: Tue Oct 09, 2007 5:47 pm

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Mon Nov 03, 2008 12:31 am

The origin isn't a problem as I can just do matrix addition eg vector A = (1,2), Vector B = (-3,-5)
from an origin of (0,0) the new vector will be from A = (0,0) = (-2,-3)

I believe I can wok out the direction of turn either clockwise or anti clockwise from the associated handles that go with the knot of the segment in question.

I've just gone back to the Blender API, which has changed a little since I last read it, and I still think the easiest way to work out the vector angles as a workable number with
MathUtils.AngleBetweenvecs
and I still woukld need to normailise the vector to a value between 1 and -1 with
MathUtils.Vector.normalise()

Past experiments when I started failed, so anyone an idea of how these two functions would work together?
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Mon Nov 03, 2008 11:21 pm

I've just modified someone elses code which I admit works.
It works with NURBS splines ONLY

I'll let you all play with it

Path2IPO.zip
(887 Bytes) Downloaded 489 times

Path IPO.blend
(152.02 KiB) Downloaded 520 times


I'll go back to my script, if there is any point to it now, I feel like an idiot, but the script does produce loads of keyframes, and I don't know where the guy got setmatrix, getMatrix and InsertIPOKey from, and even if I did, I wouldn't have come to the same simple script, I just don't know how it works

Comment?
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby greypiffle » Fri Nov 07, 2008 8:59 pm

as long as it works and does what you want it to do, then all is well... no matter who made it. Someone else coming up with something that works does not invalidate the hard work and effort YOU put in to the problem. I applaud your persistence.
TrueSpace and Harry Potter. like Peanut butter and jelly.
greypiffle
 
Posts: 48
Joined: Fri Nov 16, 2007 9:45 pm

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Fri Nov 07, 2008 9:47 pm

It almost works perfectly, except when it approaches an angle near 270 degrees, then it throws a wobbly, if you use it as is, be warned.

I don't know if its a problem with the program or something omitted int the code, i'm going on the latter which means it is likely to use the same code that i'll write for angles.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animations - Creating a Curve2IPO wizard

Postby Grogyan » Sat Nov 22, 2008 11:13 pm

I'm officially giving up on this project, the new script requires just a small tweek to work near flawlesly, and i'm just plain mentally exhausted

I intend to use the script for my next project which will include a ride, and will try and do a loop de loop subworld animation
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

PreviousNext

Return to Grogyan's Journal

Who is online

Users browsing this forum: No registered users and 0 guests

cron