This has been driving me NUTS all day, mainly due to the sheer randomness of the results.
I (like a few others in old threads) am trying to write a quick script that opens a new trackview, with only some custom attributes shown. I kinda thought it would be easy, but am just fining no consistency from max session to max session, file to file. Sometimes it works, sometimes it doesn't, sometimes it finds some of the CAs...
I guess the big caveat I'm fighting is that the track for selection needs to be visible in the track view... what is the best way to ensure that it is?
(commented out lines have been tried in various configurations)
(axs.baseObject.axis_Params[#load] does return a subAnim...)
if (trackviews.isOpen "All: Basic Parameters") do trackviews.close "All: Basic Parameters"
if (trackviews.exists "All: Basic Parameters") do trackviews.delete "All: Basic Parameters"
trackviews.open "All: Basic Parameters" pos:[6,100] width:1400 height:600
trackviews.current.ui.loadLayout "Function Curve Layout (Classic)"
trackviews.current.manualNavigation = false
--trackviews.current.autoExpandObjects = true
--trackviews.current.autoScrollToSelected = true
for axs in STK.axisList do -- list of objects that has apropriate attributes applied
trackviews.current.selectTrack axs.baseObject.axis_Params[#axisPos] false
trackviews.current.selectTrack axs.baseObject.axis_Params[#speed] false
trackviews.current.selectTrack axs.baseObject.axis_Params[#accel] false
trackviews.current.selectTrack axs.baseObject.axis_Params[#load] false
trackviews.current.manualNavigation = true