Deleting unused action channels

Animation tools, character animation, non linear animation

Moderators: jesterKing, stiv

ciacio
Posts: 5
Joined: Sun Sep 05, 2004 5:19 pm

Deleting unused action channels

Postby ciacio » Sun Sep 05, 2004 5:26 pm

Hi,

I'm using rvk to animate facial expressions of a character.
Now I want to remove unused channels from the action window, but the way described in the docs doesn't work.

I've tried to write a script (my first attempt in Blender) but the getActions() fuction returns a list of str instead of a list of actions.
Please, help me.

Thanks in advance,

ciacio

stiv
Posts: 3646
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Re: Deleting unused action channels

Postby stiv » Mon Sep 06, 2004 4:04 am

ciacio wrote:I've tried to write a script (my first attempt in Blender) but the getActions() fuction returns a list of str instead of a list of actions.


NLA.GetActions() returns a dictionary. The dictionary keys are the action names, the dictionary values are the actions.

My psychotic powers tell me you are using a for statement to print the return value of GetActions(). When used on a dictionary, a for statement iterates over the keys which in this case are strings.

Hos
Posts: 215
Joined: Wed Oct 16, 2002 12:06 am

Postby Hos » Mon Sep 06, 2004 4:41 am

RVK's use the action window, but they don't really use actions
at all ... they just reuse the interface of the action window.
Deleting a 'channel' really means deleting an ipo curve. Go to
the IPO window, select 'Vertex' for type, then select and
delete some horizontal lines until you delete the right one
(save your work first).

Chris

P.S. Yes, the user interface for doing this is probably the
worst one known to man.

ciacio
Posts: 5
Joined: Sun Sep 05, 2004 5:19 pm

Re: Deleting unused action channels

Postby ciacio » Mon Sep 06, 2004 3:41 pm

stiv wrote:
ciacio wrote:I've tried to write a script (my first attempt in Blender) but the getActions() fuction returns a list of str instead of a list of actions.


NLA.GetActions() returns a dictionary. The dictionary keys are the action names, the dictionary values are the actions.

My psychotic powers tell me you are using a for statement to print the return value of GetActions(). When used on a dictionary, a for statement iterates over the keys which in this case are strings.


Your psychotic powers are right. How can I iterate over the channels an delete the ones that I'm not using anymore?

I've also tried deleting ipos but that doesn't work because there aren't keys used. I can delete keys but not channels.

It isn't a very big problem, btw. I just want to keep my work clean and see if I can use python to do things I can't do with the interface. I really love blender.

I've tried this:

actions = Blender.Armature.NLA.getActions()

for a in actions:
a.removeChannel("Key 1")

I'm a hardcore coder in c and java, but quite new to python.

Thanks,

ciacio

ciacio
Posts: 5
Joined: Sun Sep 05, 2004 5:19 pm

Postby ciacio » Mon Sep 06, 2004 3:43 pm

It would be also great if I can access the vertex information of my various rvks in python. Is it possible? I haven't found anything about it in the docs.

Thanks again,

ciacio

ciacio
Posts: 5
Joined: Sun Sep 05, 2004 5:19 pm

Postby ciacio » Tue Sep 07, 2004 3:44 pm

done!

coltseaver
Posts: 48
Joined: Tue Apr 27, 2004 9:56 pm
Location: Brussels, belgium

Postby coltseaver » Tue Sep 21, 2004 1:04 am

you could give us the solution :)


Return to “Animation”

Who is online

Users browsing this forum: No registered users and 3 guests