Page 9 of 10

Re: Animations - Creating a Curve2IPO wizard

Posted: Mon Oct 20, 2008 11:58 pm
by Grogyan
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

Re: Animations - Creating a Curve2IPO wizard

Posted: Sun Oct 26, 2008 8:05 pm
by Grogyan
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 451 times

Re: Animations - Creating a Curve2IPO wizard

Posted: Tue Oct 28, 2008 10:09 pm
by Grogyan
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

Re: Animations - Creating a Curve2IPO wizard

Posted: Fri Oct 31, 2008 2:37 pm
by Grogyan
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

Re: Animations - Creating a Curve2IPO wizard

Posted: Sat Nov 01, 2008 10:48 am
by teedyo
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.

Re: Animations - Creating a Curve2IPO wizard

Posted: Mon Nov 03, 2008 12:31 am
by Grogyan
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?

Re: Animations - Creating a Curve2IPO wizard

Posted: Mon Nov 03, 2008 11:21 pm
by Grogyan
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 578 times

Path IPO.blend
(152.02 KiB) Downloaded 608 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?

Re: Animations - Creating a Curve2IPO wizard

Posted: Fri Nov 07, 2008 8:59 pm
by greypiffle
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.

Re: Animations - Creating a Curve2IPO wizard

Posted: Fri Nov 07, 2008 9:47 pm
by Grogyan
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.

Re: Animations - Creating a Curve2IPO wizard

Posted: Sat Nov 22, 2008 11:13 pm
by Grogyan
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