Python IPO questions... (help for Midi_Import_X)

Hi guys…

I have been working hard at makeing improvements for Midi_Import_X recently and I seem to have worked myself in to a bit of a pickle, by not fully understanding certain things. I have faught against it all for too long on my own and figured the best thing I could do was to run it by you all.

  1. I know I can find the currently selected object using
ob = Object.GetSelected()

and from here I know I can say

ipo=ob.getIpo()

which should tell me the Ipo attached to that object. However, it apparently returns “None if there’s no linked ipo.” But if there is no linked IPO ther still may be IPO curves? How so, and how do I reference them? If I link a new IPO to this object, will it’s none-link IPO curves get lost? Can I / Should I still be able to call

ipo.getCurves()

on a IPO if it has come back as none?

  1. I think an object can have more than one IPO associated with it. For instance, you can have an OBJECT IPO and a POSE IPO… how do i get to the POSE IPO in this case?

  2. Basically, I don’t care about the object to much… If the user selects an object, then goes to the IPO screen and chooses an IPO curve, I want the script to deal with just that curve… If this is the case do I even need to care about the selected object? I can’t seem to find a way to grab the currently selected IPO / IPO curve from blender…

Ideasman42 has added Ipocurves.sel for the 2.43 API (http://blenderartists.org/forum/showthread.php?t=85977) and I am hopeing this will help, but I figured i need to understand a bit more of the background to nail it.

  1. Also, Id like to be able to offer a feature that allows you to take the current ipo curve values and add an offset to them… i.e. if object is sliding down a hill and I want it to jump on every beat, I want to ADD a (jump) value to the curve’s current value. Anyone tried this sort of thing?

If any of you have done work with the above and have found ways around it, your help would be appreciated. My goal is to be able to allow the user to choose ANY IPO curve to import to, be it OBJECT, POSE, SHAPE, SEQUENCE, LAMP whatever…

Thanks, J

aawwww c’mon guys…
someone must know something about this?

IPOs are stored on their respective parents. In programming parlance they are part of the ‘struct’ of an object.

Certain C structs have IPOs others don’t.

In the case of “Pose IPOs”. These are really IPO curves stored in the Actionchannels inside the Action object.

If you want to find all the IPOs that affect the object, you would first need to see what is ‘bound’ to the object. e.g. Pose, Action, w/e… At that point you need to see which of these object contain IPO curves themselves.