Hey, guys.
My coding background is C / C++ / C#, so I'm picking up the Python as I go. Apologies if this is a dumb question.
I'd like to build a library of commonly used routines that I can then call in my other macros. For example, it would be great if I could call a home grown DeslectAll() rather than copying the loop into each macro. Additionally, If I need to change the function I would only have to do it in one place.
If this is possible, where would I put these routines so that they would be available in to all my Dmxis macros?
Thanks!
Can you create global functions?
-
- Posts: 379
- Joined: Sat Sep 14, 2013 9:35 pm
- Location: Atlanta GA / USA / Earth / Milky Way / The 'Verse
- Been thanked: 1 time
Can you create global functions?
Christopher Duncan
Author of
Have Fun, Get Paid: How to Make a Living With Your Creativity
http://www.ChristopherDuncan.com
Author of
Have Fun, Get Paid: How to Make a Living With Your Creativity
http://www.ChristopherDuncan.com
-
- Posts: 2123
- Joined: Sat Sep 15, 2012 4:53 pm
- Has thanked: 5 times
- Been thanked: 17 times
Re: Can you create global functions?
Look at System/Startup.py, System/RGB.py and Colours/Blue/Blue.py for an example of a global colour function.
Following this model, you could simply create Chris/CommonStuff.py to contain a bunch of common functions. Then add import Chris/Common.py at the start of your macros to access your global functions.
Following this model, you could simply create Chris/CommonStuff.py to contain a bunch of common functions. Then add import Chris/Common.py at the start of your macros to access your global functions.
Dave Brown - db audioware
Author of Show Buddy Setlist | Show Buddy Active | ArtNetMon
Author of Show Buddy Setlist | Show Buddy Active | ArtNetMon
-
- Posts: 379
- Joined: Sat Sep 14, 2013 9:35 pm
- Location: Atlanta GA / USA / Earth / Milky Way / The 'Verse
- Been thanked: 1 time
Re: Can you create global functions?
Thanks, man. I'm really a python newbie.
By the way, can you let me know what the Macro lane exposed in the vst automation does? If it fires a macro based on the value, how do I relate that to the directory structure of macros to tell it to fire a particular one?
By the way, can you let me know what the Macro lane exposed in the vst automation does? If it fires a macro based on the value, how do I relate that to the directory structure of macros to tell it to fire a particular one?
Christopher Duncan
Author of
Have Fun, Get Paid: How to Make a Living With Your Creativity
http://www.ChristopherDuncan.com
Author of
Have Fun, Get Paid: How to Make a Living With Your Creativity
http://www.ChristopherDuncan.com