Forum
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

How can I check if it is properly licensed while running a batch process? 4 months 2 weeks ago #832

  • Mayu
  • Mayu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Hello.
I wrote a python script that execute carbon for houdini in batch mode.
I run the script in batch mode, then sometimes license checkout failure occurs.
License failure is not a problem as the number of licenses is less than the number of machines.

The problem is , it keeps rendering if it is not propery licensed.
I added a code to check if it is propery licensed , which gets a simulation node parameter like this.
##
if hou.parm(clothObjects["simulation"] + "/dopFeature"):
    DopF = hou.parm(clothObjects["simulation"] + "/dopFeature")
    result = DopF.evalAsString()
    if result == "Licensed":
        print "Numerion Carbon has successfully licensed"
    else:
        sys.exit(3)
else:
    print "failed to get Numerion Carbon license"
    sys.exit(3)
##
But it seems not working , in my log text, it shows that simulation node parameter is setted "Licensed",
Then after my check code , following error message is logged.

Carbon license checkout failed. Error code: 17
No SIM_CarbonTool license available. Please contact This email address is being protected from spambots. You need JavaScript enabled to view it. to add/renew/install your licenses.
Rendering 142 frames ( from 971 to 1112 by 1)
12:38:24 sim_rop_alembic frame 971 (1 of 142)
12:38:27 sim_rop_alembic frame 972 (2 of 142)
12:38:28 sim_rop_alembic frame 973 (3 of 142)
12:38:29 sim_rop_alembic frame 974 (4 of 142)
12:38:29 sim_rop_alembic frame 975 (5 of 142)

rendering was proceeded from start to end.
I would like to check if it is propery licensed and execute sys.exit() before render.
Is there any way to check if it is licensed?
Kind regards.
Mayu



    

Please Log in or Create an account to join the conversation.

Last edit: by Mayu.

How can I check if it is properly licensed while running a batch process? 4 months 2 weeks ago #833

  • Sebastian
  • Sebastian's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 122
  • Thank you received: 25
Hi Mayu,

I think there could be a few potential sources for your issues.

In order to run, e.g. a Cloth Simulation, you need the dopFeature to be licensed, and you need to have a Cloth license as well. Usually there are enough Cloth feature licenses for every dop feature license, so I think this is unlikely.

My best guess: The dopFeature UI parameter is set by a script, so maybe how or when you are running in batch, it might not have evaluated the script at the time you call your test?
I have just done a few small batch tests and it seems to work for me, but I only tested a very simple setup, so that doesn't mean all is well in your setup, clearly.
What you might want to try is to call the license check command directly. It's a hscript command that hooks into the c++ license check.
Something like this in python:
dopFeature = hou.hscriptExpression('execute("numerionsimcarbontoolhasfeature SIM_CarbonTool_Dop")')
sopFeature = hou.hscriptExpression('execute("numerionsimcarbontoolhasfeature SIM_CarbonTool_Sop")')
print('Licensed: '+ str(dopFeature and sopFeature))

Please let me know if this helps.

Cheers,
Sebastian

Please Log in or Create an account to join the conversation.

How can I check if it is properly licensed while running a batch process? 4 months 2 weeks ago #834

  • Mayu
  • Mayu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Thank you very much for helping me!
I tested replacing my licence check code with the one you taught me and it seems to work perfectly fine.
This is exactly what I wanted.
That was a really big help!

I would like to ask 2 more things for further information.
1, How can I access c++ command library?
2, How can I find out about what action is the trigger to execute the script which set dopFeature UI parameter?

Kind regards.
Mayu

Please Log in or Create an account to join the conversation.

How can I check if it is properly licensed while running a batch process? 4 months 2 weeks ago #835

  • Sebastian
  • Sebastian's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 122
  • Thank you received: 25
Hi Mayu,

Glad to hear it is working now.

Regarding your questions:

1)
We only have 4 commands that are accessible:
  1. numerionsimcarbontoolhasfeature: This is the one you are using.
  2. numerioncarbonversion: This gives you the version of the carbon libraries (all of our plugins are built on top of the Carbon Physics library).
  3. numerionsimcarbontoolversion: This gives you the version of the plugin.
  4. numerionsimcarbontoolcopyright: This gives you the copyright information.
These are all just for populating the About tab of the Carbon Simulation node.

2)
We are using the script in the default value of the Carbon Simulation hda's dopFeature parameter.
This should be called when the (UI) node is evaluated, at least that's my best guess.

I hope this helps.

Cheers,
Sebastian

Please Log in or Create an account to join the conversation.

How can I check if it is properly licensed while running a batch process? 4 months 2 weeks ago #836

  • Mayu
  • Mayu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Hi Sebastian,
Thanks for your answer, It is really helpful and solved the issue...
Thanks again for your support.

Kind regards
mayu

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.094 seconds