Pre Render Note Track Cleaner

Hi all,

I've had the note tracks issue for a while and know how to clean it with this handy script

*****

t=trackviewnodes;n=t[#Max_MotionClip_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Retimer_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Anim_Layer_Control_Manager];deleteTrackViewController t n.controller

*****

But I've been trying to make a startup script that will run this cleaner before every render, the reason being that merging items into an "infected" scene will bring the note tracks over and it's not easy opening the thousands of furniture scenes I have and cleaning them one by one.

I have the script below so far but often I will get the error -- Unknown property: "controller" in undefined and so forth.

I'm rather lost as I don't do that much scripting at all, any help would make me a very happy chappie.

If it's easier to make this a #PostOpenProcess so it runs every time a scene is opened then that would be fine too.

Many thanks for reading if you got this far.

*****

(
callbacks.removescripts id:#Extra_Clean
t=trackviewnodes;n=t[#Max_MotionClip_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Retimer_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Anim_Layer_Control_Manager];deleteTrackViewController t n.controller
gc()

callbacks.addscript #preRender txt id:#Extra_Clean
t=trackviewnodes;n=t[#Max_MotionClip_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Retimer_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Anim_Layer_Control_Manager];deleteTrackViewController t n.controller
gc()

callbacks.addscript #postRender txt id:#Extra_Clean
)

*****

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
CGough88's picture

Hi Just to say that there was

Hi

Just to say that there was a "fix" for this, using a script I blatantly stole from a post Anubis made the cleaner script was made as a macro.

****

macroscript EXTRA_CLEAN category: "CLEAN"

(
try
(t=trackviewnodes;n=t[#Max_MotionClip_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Retimer_Manager];deleteTrackViewController t n.controller
t=trackviewnodes;n=t[#Anim_Layer_Control_Manager];deleteTrackViewController t n.controller
)
catch
(
print "CLEAN"
)
)

****

And then a startup script (from Anubis) was set up to run the macro before every save and after every merge.

****

callbacks.removeScripts id:#Auto_Clean

fncb_code = "macros.run \"CLEAN\" \"Extra_Clean\""

callbacks.addScript #filePreSave fncb_code id:#Auto_Clean
callbacks.addScript #filePostMerge fncb_code id:#Auto_Clean

****

obaida's picture

Thanks

Thank you very much for this info.

miauu's picture

.

Try to put each:

n=t..........

in try()catch(). It is not a good pratise, but you can see if this works or not.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.