Maximum Licenses

Viewing 5 posts - 1 through 5 (of 5 total)
  • 17th September 2019 at 4:15 pm #21993

    Hello,

    we are using only one Template per Application (and versions) in Muster (i.e. one for Maya, one for Cinema4D…). Everything works nicely, application executables are selected in the template in onGetApplicationPath and onGetApplicationStartingFolder depending on a custom template field like this:

    MTemplateAPI.MTemplateItemString("SOFTWARE_VERSION", "Software version", "Software version", "", 0, 0, 0)

    We have one problem with this approach though: We have a different number of licenses for certain versions of the softwares (e.g. unlimited licenses for Cinema4D R18, but only 10 licenses for R19.

    I tried to do the same as for selecting the correct executable depending on the SOFRWARE_VERSION template field, but it seems that

    self.setMaximumLicenses(NUM_LICENSES)

    only works when called in the __init__ method of the template, because I guess it is then run in Dispatcher Context and not in Instance Context as the other functions. Am I right?

    So my questions are:

    * Is there a possibility to call setMaximumInstances or setMaximumLicenses in any other Method in a Template.
    * Do you have any recommendations to manage the maximum instance count depending on version from within a template?

    Best
    Claus

    18th September 2019 at 11:08 am #22032

    Hi Claus

    Best thing under that circumstances is to use multiple templates for multiple versions. Otherwise, you can check the licensing limits on your own using onValidateJobDependancies , in that function, you can check how many clients are rendering a certain engine on the jobs, and allow on deny the job/chunk.

    18th September 2019 at 5:52 pm #22045

    Hello Leonardo,

    thanks for your reply. The way with the multiple templates is what I ended up doing. To make it as simple as possible (for anyone interested), I derived the new templates with different license restrictions from the base template class, so it inherits everything. The only thing I do* then is to call setMaximumLicenses in the __init__() of the template (after a super() call, of course).

    Works great.

    Best
    Claus

    * Of course, there are other things to do, like assign a different template name and ID to it, and set a different license group (depending on if the different versions have the same license group or not.

    18th September 2019 at 5:53 pm #22046

    …that way, the new template file is only a couple of lines long and changes with the original due to the inheritance.

    18th September 2019 at 7:56 pm #22051

    nice one, but you have the base class into another template file ? or you just import it from another module ? Be aware that templates are synchronised and loaded in alphabetical order 😉

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.