sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Closed Thread
 
Thread Tools
WWWWolf WWWWolf is offline
Member
 
Join Date: Aug 2002
Location: Oulu, Finland
Posts: 7
Hello, I just had some questions about the NLA Action API.

Specifically, I ran into some problems when writing the animation exporter for Neverblender. You can check out nwnmdlexport.py and lib/Animation.py to see what I've done so far. Sorry, not very well commented. Not had time to touch the code much I left the code a few weeks ago to wait for 2.34, but looks like 2.34 doesn't help much.

The idea is simple: I need to get orientation and position lists, all along the Action timeline, on keyframes (either based on constant intervals or possibly based on the keyframes on Action).

Anyway, I have this problem: I can figure out what Actions are there in the scene. I can figure out what IPO channels are there in an Action (getAllChannelIpos()).

But how do I find out what objects are animated in Actions, and how?

I get a dictionary of Ipos keyed by Action channel names, which may or may not correspond to Armature Bone names. I can get IpoCurves out of the Ipo, but their names aren't related in anyway to objects themselves.

I can build a list of Objects in the scene, and the only information I can get from them is that they're linked to the Armature! The objects are supposed to be linked to individual Bones. How do I get which Bone the Object is linked to - or the other way around? (Armature Bone only knows its children and parent.)

I have this terribly stupid idea of doing this the big, stupid inelegant way - linking the Action, stepping through it and recording each and every object's location over the course of the animation. Is this the only way to do this?
#1   Old 14-Aug-04, 13:50   


WWWWolf WWWWolf is offline
Member
 
Join Date: Aug 2002
Location: Oulu, Finland
Posts: 7
Did some "thinking" here. Is this Elegant, or is it a Hopelessly Ugly but the Only Way to Do It, or, perhaps, is it Incoherent Rubbish?

(in pseudocode)

Code:
actionlist = list of actions armlist = list of armatures locdata, oridata = dictionary of (objectname: emptylist) foreach action from actionlist: length = action.getlength othercooldata = action.getothercooldata foreach armature from armlist: action.setactive(armature) foreach object from childrenof(armature): step_through_animation(0, length, stride): oridata[object].push(object.getorientation) locdata[object].push(object.getlocation)
#2   Old 15-Aug-04, 18:25   
ascotan's Avatar
ascotan ascotan is offline
Member
 
Join Date: Jun 2003
Location: maryland
Posts: 255
Actions are object-indepent armature IPO curve groups. The action contains a group of names. Each name is associated with an IPO. Each name corresponds to a bone name in an armature (any armature). The IPO will then move a bone (with the same name) according its IPO data.

Actions are linked internally to objects not armatures so when an object is of type armature and the armature has appropriately named bones. You can link the action to it and move the object. All objects with armatures can be destroyed and the action will remain because it is object - indepent.
............................................
Failure is not an option. It's bundled with your software.
#3   Old 30-Aug-04, 15:05   
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 15:34.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Blender Headlines
Featured Artwork
Crocodile by Julia Korbut
Classic vintage look renders by HANGAR
Blending life - Old George by bigbad
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Social BlenderArtists