Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Set is deleted when its custom keys are removed?
  RSS 2.0 ATOM  

Set is deleted when its custom keys are removed?
Rate this thread
 
62344
 
Permlink of this thread  
avatar
  • Total Posts: 8
  • Joined: 12 October 2011 01:47 PM

Create an empty set, add an animated attribute, then delete the key(s).  The set itself is deleted along with the key.  Why is this happening?  Is it expected?  If the set contains any objects, then it not deleted.

Thanks!

from pymel.core import *

select(clear True)
testSet sets(name "the_set")
testSet.addAttr("animated_attribute"at "bool"keyable True)
setKeyframe(testSet.animated_attribute5True)
#this next line results in the set itself being deleted!!
cutKey(testSet.animated_attributeoption "keys"clear True)


Replies: 0
avatar
  • ldunham1
  • Posted: 28 November 2011 09:04 PM

I really did not expect that actually.
I was certain there must be something wrong with the code, but it seems not. It happens no matter how many curves are connected either, it will delete those too.
Will have to look further into this.

You can avoid it by disconnecting the attribute first, then cutting the key from the curve node instead (I have already tried this whilst connected, but same results)

disconnectAttr(testSet+'_animated_attribute.output'testSet.animated_attribute)
cutKey(testSet+'_animated_attribute'option "keys"clear True)


Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 0