[Bf-python] RE: action / NLA api

Toni Alatalo antont at kyperjokki.fi
Wed Nov 16 13:34:42 CET 2005


On Tuesday 15 November 2005 19:23, Ed Blake wrote:
> I'm not knowledgeable about the implementation but I've been thinking about
> how I would like to use NLA strips.  The following is a users perspective

thanks for input. i'll add a few comments from the implementation point of 
view, which seems to luckily coincide which much of what you wished (i guess 
because they both reflect the GUI).

> Lastly strips and actions belong to objects, so objects have to give access
> to the strip instances they are using.

actions do not actually belong to objects - a single action can be used by 
many objects, and actions exist independently as themselves. but object can 
have an active action, and strips refer to actions too.

currently strips are only object properties indeed. Ton was thinking that 
might change, 'cause there has been ideas about NLA use which would mix 
strips from many objects. perhaps even metastrips that contain strips of 
different objects? but that does not stop us from designing of Strip bpy 
objects themselves:

> walk = NLA.New(DictOfTimeActionPairs) # how to get existing strips?

mimicing current internal Blender code existing strips would be as a list (or 
a dict if we get with names) in object.strips. dunno how the api should be 
designed, i.e. if e.g. NLA.getStrips(object) would make sense, or if it's 
better to do object.strips['walk']

> walk.start = 5 # new start (move or scale?)
> walk.end = 30 # new end

those are the first i had in mind too, and are straightforward to implement 
as .start and .end are attributes of the internal c strips.

> walk2.move(25) # should be absolute time value of strip start
> walk.leadout = 5 # in frames
> walk2.leadin = 5 # may have curve type in future?

that part of the NLA code i dont know but i guess would be simple enough.

like already mentioned, am now testing making some of the animations needed 
for Elephants dream using just object.pose.fromAction() so actually dont need 
to create strips, so am not planning to implement it, but can imagine that 
they'll be useful sometimes.. if someone has a need / want, feel free to give 
it a shot :)

and Ton actually recommends to wait a little with the NLA:

< antont> kaito: i guess you are not planning to change the NLA/strips
                 data model in near future .. i mean the thing you mentioned
                 about NLA having strips regarding many objects at the same
                 time, metastrips that contain strips dealing with many   
objects or whatever it was?
< kaito> not for 2.40.... but probably i'll do later yes
< antont> am wondering if its safe to recommend implementing strip access to 
python via object, like it is in current current internal code (wont do that 
myself now 'cause dont need but someone else might)
< antont> kaito: "later" as in december or in 2007?-)
< kaito> i suggest to not add it to 2.40 specs
< antont> (does orange needs such nla features?-)
< kaito> python can better wait for blender code to stabilize before
               supporting it
< kaito> i only touched nla stuff a little, it has several issues     pending
< antont> ok
< antont> well i add that remark to that mail and forget about for now
                then :)
< kaito> orange project might not 'need' it yes
< kaito> it has to be checked on in practice

~Toni



More information about the Bf-python mailing list