CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-06-2013, 11:30 AM   #1
Uncle-Ox
That guy with the hair
 
Uncle-Ox's Avatar
portfolio
Francois de Swardt
Design Engineer
Epiphany Sound & Imagery
Pretoria, South Africa
 
Join Date: Jul 2004
Posts: 976
Add/Remove Keyframes with Xpresso/Coffee

Hi

I've got an object with numerous userdata sliders. Now, I would like to do an Xpresso setup where I use a boolean userdata entry to add (and one to remove) keyframes to/from all of the userdata sliders of that object. I've gone through all the nodes in the help file but I could have missed it along the way. Is it possible to add or remove key frames with Xpresso? If so, could you please tell me how? I don't know C.O.F.F.E.E. at all, so if there isn't a way with Xpresso but there is with C.O.F.F.E.E., could someone please tell me what the scripting should be?
__________________
Software Used:
3D: Cinema 4D, MotionBuilder
Finished Work:
My pet project: 3DAngelique
 
Old 03-06-2013, 12:15 PM   #2
littledevil
Meh
 
littledevil's Avatar
portfolio
Ferdinand
Germany
 
Join Date: Aug 2002
Posts: 616
1. simply open the context menu on a attribute manger element (works with selections
over multiple elments and objects) and execute Animation>DeleteTrack

2. if it has to be for some unknown reason a script here is a possible approach. it will
flush all userdata keys for all currently selected objects while keeping all other keys.
you could also use it from within an xpresso setup as a python node, but this would
require some modifications. this is a simple script version.

Code:
import c4d def main(): selection = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHIL DREN) for obj in selection: for id, bc in obj.GetUserDataContainer(): trackdata = obj.FindCTrack(id) if trackdata != None: trackdata.GetCurve().FlushKeys() c4d.EventAdd() if __name__=='__main__': main()


edit: meh the board adds a typo to the code. remove the whitespace at
GETACTIVEOBJECTFLAGS_CHIL_DREN
 
Old 03-06-2013, 06:21 PM   #3
Uncle-Ox
That guy with the hair
 
Uncle-Ox's Avatar
portfolio
Francois de Swardt
Design Engineer
Epiphany Sound & Imagery
Pretoria, South Africa
 
Join Date: Jul 2004
Posts: 976
Thank you for the reply.

I think I might not have been as clear as I could've been in my question. I know how to add and delete keyframes (even on multiple parameters) manually but what I would like to do is to have 2 boolean 'buttons' that will take all of the userdata sliders specified in the Xpresso setup and add or remove keyframes from them all at once. So, in effect, it will serve the same purpose as the "Record Sliders" button in the pose morph tag except that it will have one that adds keyframes for sliders specified in the Xpresso setup and one to delete keyframes. The reason I'd like to have this, is because it would save me huge amounts of time during animation.

I don't know COFFEE or Python at all and, as a result, I don't think I'll be able to modify code without instructions. However, from what I gather, COFFEE is the simpler of the 2 so if COFFEE can do it, and you could give me a basic COFFEE script, that'd be awesome.
__________________
Software Used:
3D: Cinema 4D, MotionBuilder
Finished Work:
My pet project: 3DAngelique
 
Old 03-06-2013, 07:58 PM   #4
littledevil
Meh
 
littledevil's Avatar
portfolio
Ferdinand
Germany
 
Join Date: Aug 2002
Posts: 616
1. there are no button elements for userdata/xpresso. you would have to use checkboxes
as a substitutes.

2. it is not possible to get hold of the currently selected element in the attribute manger.
you have either to add/flush the user data keys of all currently selected objects or none.

3. my snippet shows how to delete keys, adding is almost the same. try it for yourself,
i will help you, when you get stuck while trying
 
Old 03-06-2013, 07:58 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:56 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.