tdu.collapsePath: What should be returned when inputting the project root path?

Hey there,

It seems that the returned value for tdu.collapsePath when inputting the project root path did change.

In version 2018.27840 this returns “$TOUCH”
In version 2020.20625 this returns the inputted project root path.

I could not find a documentation that this behaviour changed in the Changelog. So it’s either a bug or the change was not documented. Or a behaviour that was never documented and some people relied on :wink:

How did I find this issue?
@raganmd 's save external component uses a check to $TOUCH to determine if the path is at the project root. So it now puts an absolute path for all saved components.
https://github.com/raganmd/touchdesigner-save-external/blob/master/dev/td-modules/base_save/saveEXT.py#L160

Nice catch here @manuel_mitasch. Does that save external component need to be updated as well?

@raganmd Yes, I guess changing that check would make sense. I think the check can simply be changed from “$TOUCH” to project.folder. The path handling afterwards would need small changes.

If you want I can make a PR on github.

Sorry about this. Yes $TOUCH is a TScript variable so tdu.collapsePath should never have been returning that :frowning: