Previous Thread  Next Thread

chat icon Deleting unused action channels

ciacio

Posted: Sun Sep 05, 2004 4:26 pm
Joined: 05 Sep 2004
Posts: 5
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
Reply with quote


stiv

Posted: Mon Sep 06, 2004 3:04 am
Joined: 05 Aug 2003
Posts: 3493
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.
Reply with quote


Hos

Posted: Mon Sep 06, 2004 3:41 am
Joined: 15 Oct 2002
Posts: 215
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.
Reply with quote


ciacio

Posted: Mon Sep 06, 2004 2:41 pm
Joined: 05 Sep 2004
Posts: 5
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
Reply with quote


ciacio

Posted: Mon Sep 06, 2004 2:43 pm
Joined: 05 Sep 2004
Posts: 5
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
Reply with quote


ciacio

Posted: Tue Sep 07, 2004 2:44 pm
Joined: 05 Sep 2004
Posts: 5
done!
Reply with quote


coltseaver

Posted: Tue Sep 21, 2004 12:04 am
Joined: 27 Apr 2004
Posts: 48
you could give us the solution Smile
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group