by dcourtois » Wed Jul 24, 2019 11:13 am
Ok, understood.
A partial solution is to use the variable editor and create a `start_frame` and `end_frame` variables: then you'll be able to use their values directly in any expressions.
Note that it will even work if you reference another project: the expressions of the referenced project will use the `start_frame` value of the current one.
Edit: if you need to start and end frame values to stay local to a project even if it's referenced in another one with different start and end frame values, you can put the values in custom attributes of a locator somewhere in the scene, and get the values using get_double("project://path/to/the/locator.start_frame") ...
To summarize: you can create "global" control variables in 2 ways:
- in the variable editor: those are real globals. They apply to every expression, no matter where the expression comes from.
- create a settings object with custom attributes, and use get_*() methods to access them. When a project using this is referenced in another one, the expression will stay the same, even if the "parent" project has its own settings object with different values.
Regards,
Damien.