PDA

View Full Version : Filtering Custom Attributes in Curve Editor


StephG
08-04-2010, 11:52 PM
I'm trying to make a tool which allows me to make a list of custom attributes in an attribute holder, and to display only those attributes that are selected in the Curve Editor. I have no problem with conventional transform attributes, but the custom attributes seem to be a completely different animal.

The attribute paths looks like this:
$mouthMain_CTRL.Attribute_Holder.custom_attributes.right_frown

It would be too simple if something like this would work:
trackviews.current.setFilter #hierarchy #objects #selectedObjects #modifiedObjects #Attribute_Holder #Custom_Attributes #right_frown
Of course it does not work.

I could possibly use the "selected tracks" option, but I haven't figured out a way to select $mouthMain_CTRL.Attribute_Holder.custom_attributes.right_frown as a track through Maxscript. And it doesn't have an ".isSelected" property, but I can make a Selection Set with the selected tracks.

I've tried this:trackviews.current.selectTrack $mouthMain_CTRL.Attribute_Holder.custom_attributes.right_frown clearSelection:true
...but I get an "-- Argument count error: selectTrack wanted 2, got 1" error. (also, there's no space between "custom_attributes" and ".right_frown", but for some reason it's adding a space here).

EDIT: and if I try this:trackviews.current.selectTrack $mouthMain_CTRL.Attribute_Holder.custom_attributes.right_frown trueI get this FAIL: "-- Unable to convert: 0.0 to type: MaxObject"

Thanks in advance for any clarity that can be offered.
StephG

bclark
08-05-2010, 07:12 PM
I am a little MS rusty right now but..


trackviews.current.selectTrack $mouthMain_CTRL.Attribute_Holder.custom_attributes[1] True


Because the custom attrs/params are subanims you need to get them by their index from what I can tell.

This bit of code works where 1 is the first attribute in the list.

you can always get the name of the index of the attribute. use
$mouthMain_CTRL.Attribute_Holder.custom_attributes[1].name


Hope that helps get you going in the right direction.
Brad

denisT
08-05-2010, 08:15 PM
I'm trying to make a tool which allows me to make a list of custom attributes in an attribute holder, and to display only those attributes that are selected in the Curve Editor. I have no problem with conventional transform attributes, but the custom attributes seem to be a completely different animal.

...


the "selectTrack" method works for MaxObjects. So in your case you have to specify the SubAnim or it's controller to be selected:
trackviews.current.selectTrack $mouthMain_CTRL.Attribute_Holder.custom_attributes[#right_frown] true


the second argument of the "selectTrack" is a boolean to clear or not currently selected tracks.

Warning: The track to select has to be opened and visible in current trackview. Hidden trackview nodes can't be selected.

StephG
08-05-2010, 11:02 PM
Dudes, YOU ROCK!

I NEVER would have figured that out. Thank you, thank you, thank you, thank you, thank you, thank you, thank you.

BTW, here's what the code looks like to just get the channels you want in the box, unadorned.trackviews.current.clearFilter #all
trackviews.current.setFilter #default
trackviews.current.selectTrack $.Attribute_Holder.custom_attributes[2] True
trackviews.current.selectTrack ($ [#transform][#position][#x_position]) false
trackviews.current.selectTrack ($ [#transform][#position][#z_position]) false
trackviews.current.selectTrack ($ [#transform][#rotation][#y_rotation]) false
trackviews.current.clearFilter #hierarchy
trackviews.current.setFilter #selectedTracks
The result in the objects section of the curve editor looks like this:
()World
[]X Position
[]Z Position
[]Y Rotation
[]nostrils_narrow

CGTalk Moderation
08-05-2010, 11:03 PM
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.