ID 560710 - Adding soft effects via Python does not place it in an appropriate sub-track, unless the sub-track is specified by the user

Follow

Problem summary
Adding soft effects via Python does not place it in an appropriate sub-track, unless it is specified by the user.
 
Customer reported version
Hiero 14.0v2
 
Customer reported platform
CentOS 7
 
Steps to reproduce
 
1) Open Nuke Studio/Hiero.
 
2) Import 3 clips (File > Import File(s)...) and drop them on to the timeline.
 
3) Open the Script Editor and execute the following code:

ti1 = hiero.ui.activeSequence().videoTracks()[0].items()[0] ti1.parentTrack().createEffect("Grade", trackItem=ti1) ti1.parentTrack().createEffect("Grade", trackItem=ti1) ti1.parentTrack().createEffect("Grade", trackItem=ti1) ti2 = hiero.ui.activeSequence().videoTracks()[0].items()[1] ti2.parentTrack().createEffect("Grade", trackItem=ti2) ti2.parentTrack().createEffect("Grade", trackItem=ti2) ti2.parentTrack().createEffect("Grade", trackItem=ti2) ti3 = hiero.ui.activeSequence().videoTracks()[0].items()[2] ti3.parentTrack().createEffect("Grade", trackItem=ti3) ti3.parentTrack().createEffect("Grade", trackItem=ti3) ti3.parentTrack().createEffect("Grade", trackItem=ti3)
 
Expected behaviour
Hiero should put the soft effects on the bottom-most sub-track that is available.
 
Actual behaviour
Hiero doesn't seem to determine which is the bottom-most available sub-track, if it is not specified by the user. This can result in "stepping", like so:
 

 
Workaround
You can do something like the following, to ensure that the soft effects are always placed on the bottom-most sub-track: 
ti = hiero.ui.activeSequence().videoTracks()[0].items()[0] # get the track item def getNumSoftEffects():     softEffects = []         for st in ti.parentTrack().subTrackItems():         for effect in st:             if effect.timelineOut() == ti.timelineOut() and effect.timelineIn() == ti.timelineIn():                 softEffects.append(effect)         num = len(softEffects)     return num ti.parentTrack().createEffect("Grade", trackItem=ti, subTrackIndex=getNumSoftEffects())
 
Reproduced by support
This bug has been reproduced in:
Nuke Studio 15.0v2 - Windows 10 - macOS 10.12 (Monterey)
Nuke Studio 10.0v1 - Windows 10 - macOS 10.13 (High Sierra)
 
Earliest version tested
Nuke Studio 10.0v1
- This issue appears to be in all tested versions of the product
 

    We're sorry to hear that

    Please tell us why