there is a big thing in the mxs publishing mechanism - value local macros
before 2017 it was more or less clear:
you could create ‘value locals’ using for example:
one_value_local (or one_typed_value_local),
two_value_locals (or one_typed_value_locals), … etc.
but you must pop local back after that using:
pop_value_locals(), or
return_value
since 2017 there another mechanism with using MAXScript_TLS, where we can create local and ‘don’t care about their pop’ (in theory)
so we can do something like:
MAXScript_TLS* _tls = (MAXScript_TLS*)TlsGetValue(thread_locals_index);
one_value_local_tls();
and we can not do pop_value_locals… and there are many samples in SDK we they don’t do it. Fine…
But there are another samples where they do return_value_tls instead. (there is an explanation for it in the SDK, and it makes sense).
So, I have questions:
#1 why do we not use return_value_tls every time when we create ‘local values’?
#2 why old mechanism still exists ( one_value_local(), … , return_value() ) but pop_value_locals (and some other old macros) are deprecated?
shortly:
what is THE SAFE WAY of using local_values mechanism in 2017+ , and does anyone know where I can read about it.
Thanks!