Curve2IPO -> Y axis bezier handles

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Curve2IPO -> Y axis bezier handles

Postby Grogyan » Wed Aug 06, 2008 10:52 pm

Well as you may or may not know, I have pretty much stopped working on other projects save for my shell because I really want to get this wizard that i'm writing to work.

Plasma apparently uses IPO curves to animate objects.

The wizard when run, will take the selected 3D curve and produce 2D Interpolation curves, in the IPO window bezier curves are pretty much the standard for smooth curves.

While I have the points in the 3D curve plotted into the IPO window, I have a problem with the Y-Axis bezier handles in that they are not uniform with the X and Z axes handles, even though the code is the same.

Could someone please help, this is sending me bonkers.

BTW I am only tackling locations of the knots (and handles of those knots) on the curve not rotation as I have little idea of how to do that.

The code I have is available on the SVN but under a different partition to that of GoW-PyPrp
http://svn.guildofwriters.com/Curve2IPO

or just extract this zip file to the Blender scripts directory the same as you'd do for PyPrp
Curve2IPO.zip
This version has the problem with the Y axis handles
(2.42 KiB) Downloaded 225 times


To execute the script first you need to make a 3D bezier curve
Make one window a scripts window
Select Scripts -> Wizards -> Curve2IPO

Make sure that you have the curve selected in object mode before you start or you could get strange results
Change the window to IPO curve editor and use the drop down box to see the curves.

Just for testing add to your scene an empty, then open the "Transform Properties" window in the 3D window, and with the Empty selected, make all locations and rotations to zero

Add a constraint to the Empty of "Childof" and enter the name of the Curve in the box.
Continuing with the Empty still selected in object mode, go to the IPO curve editor and use the drop down box to select the generated IPO curves from the 3D curve you just made.

Look in top down (numpad key 7) and compare with side and front (numpad 1 and 3) and use the cursor keys to play the animation forwards and backwards to see what i'm talking about witht he handles of the 3D curve in the yAxis not matching those in the IPO curve Editor


If you want to see the animation in game just add in the AlcScript for the animation, and put in object(s) relative to the WORLD origin and add constraints to each of "Childof" and enter the name of the Empty in the box

Me thinks I need to make a tutorial on how to do this to save myself from typing it all out each time.
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: Curve2IPO -> Y axis bezier handles

Postby Grogyan » Thu Aug 07, 2008 9:40 pm

Well I think I have found the problem, and thankfully its not my script.

Still i'd like someone to verify that the FIRST handle in each bezier curve is having the same value as X coordinate on the same handle, please?
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: Curve2IPO -> Y axis bezier handles

Postby ardent red » Fri Aug 08, 2008 3:35 am

Wow, this is shaping up very nicely Grogyan, well done! The animation works properly from the first handle to the second handle, but then it jumps way off the curve and touches on each handle briefly, though this is probably the y-axis problem you mentioned.

I can confirm that the first handles x location is the same as the first xLoc keyframe (and on the position of the empty object at frame one), so I don't think there are any problems there.
ardent red
 
Posts: 150
Joined: Fri Apr 18, 2008 3:41 pm
Location: The big little New Zealand

Re: Curve2IPO -> Y axis bezier handles

Postby Trylon » Fri Aug 08, 2008 3:53 am

Grogyan, if the problem is in the blender api, how about modifying the code, so that it writes the values directly to the plasma objects?
the plasma export doesn't have the api problem blender has...

It'd be neat to just have to do something like:
Code: Select all
[object]:
    animation:
        curvepath:
            tag/name: <tag/name>
            curve: <curve to follow>
            speedtype: [smooth|pointtopoint]    // curve is followed at equal speed, or the time
                                                // from one point to another is equal
            pointinterval: <time between points>           // only on speedtype: pointtopoint
            duration: <total duration of the animation>    // only on speedtype: smooth
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: Curve2IPO -> Y axis bezier handles

Postby Grogyan » Fri Aug 08, 2008 1:41 pm

Two immeditiate problems I see with that

1) The Plasma API is even less documented than the Blender API
2) I think that Plasma will still need the IPO curves


Besides, when this script is done, i'm going to see if I can get the Blender Devs to have it packaged with Blender
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: Curve2IPO -> Y axis bezier handles

Postby Lontahv » Sat Aug 09, 2008 8:32 pm

Grogyan wrote:1) The Plasma API is even less documented than the Blender API


Yes, but PyPRP is managed by people who are willing to help.

And about your plans to get it packaged into Blender: I think it'll be an uphill battle especially since the code may be a little... odd since you don't have too much experience with Python.

Also, Blender doesn't always seem to include feature-patches that are submitted. >.>

I think that building it into PyPRP would be your best bet. Then it's just one fewer steps to take when making an age.
Currently getting some ink on my hands over at the Guild Of Ink-Makers (PyPRP2).
User avatar
Lontahv
Councilor of Artistic Direction
 
Posts: 1331
Joined: Wed Oct 03, 2007 2:09 pm

Re: Curve2IPO -> Y axis bezier handles

Postby Grogyan » Sun Aug 10, 2008 5:06 pm

As you say, my python coding skills aren't too good, which I know if I start tailoring it specifically with PyPrp I would not be able to work on it at all.
Not your fault its just Plasma, I enjoy attempting to read the code that you guys write and knowing that i'll never get to that level of understanding

I know that i'll have to implement functions, but learning how to pass parameters to them will be a challenge I know that I'll eventually be able to do

Pm me if you can show me a way that is both user friendly and we can code 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: Curve2IPO -> Y axis bezier handles

Postby Lontahv » Sun Aug 10, 2008 9:11 pm

If you need help, feel free to PM me. I think your code is great (as long as it works pretty well and you know how it functions) ! :)

In that post I kinda guess I meant to say that Blender would most likely pick it to pieces if it was submitted to them.

Keep on learning. :D
Currently getting some ink on my hands over at the Guild Of Ink-Makers (PyPRP2).
User avatar
Lontahv
Councilor of Artistic Direction
 
Posts: 1331
Joined: Wed Oct 03, 2007 2:09 pm

Re: Curve2IPO -> Y axis bezier handles

Postby Grogyan » Mon Aug 11, 2008 4:10 am

I do at this stage, but I need to implement rotations next, ie Pitch, Bank and Yaw

Got a few ideas on how to do this, all of them require the existing FOR loop to be made into a function


Its ate right now, so i'll send you a PM on Plasma implementation of the code
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


Return to Scripting

Who is online

Users browsing this forum: No registered users and 6 guests