Implement A Usage Counter?
-
Hi,
Is it possible to implement a usage counter to plug-ins?
Nothing too complicated.
Basically, everytime the plug-in is opened (not even how many buttons are clicked). Just opened. And it will classify as 1 usage counter.I'm not entirely sure how to implement. I'm guessing I have to set-up a webserver of some sort to send some pings?
Any help would be appreciated.
-
Hello @bentraje,
Thank you for reaching out to us. Sure, this is possible, but the broadness of your question is in violation of our scope of support rule:
If necessary, we will provide code examples, but we will not provide full solutions or design applications.
There are three million and one ways to do this, and you must design your application yourself. A very straight forward implementation could be:
- Every time
MyCommandData.Execute
is being invoked read and write an incremented usage count, with one of these options:- the builtin function and module
open()
andjson
, - the HyperFile format of Cinema 4D,
- the function WritePluginInfo,
- or, if you do not want to do it locally, you could also send a request to a web service, as for example a REST service. Python's builtin
urllib
should be up to that task, including handling the response.
- the builtin function and module
Please understand that we cannot provide support for subjects that are not part of our APIs, e.g., how to set up a (REST) web service, so that your plugin can send commands to it.
Cheers,
Ferdinand - Every time
-