Combining floating Complete and Unlimited licences

Hi all,

Here’s one for documenting the process of combining floating licences.

When purchasing a floating licence, you’ll get a floating licence server to go along with it. This is the software “leasing” licences to anyone making a request.

On the artist side, Ragdoll would look to the RAGDOLL_FLOATING environment variable for where to lease their licence.

import os
os.environ["RAGDOLL_FLOATING"] = "10.20.30.40:8001"

Where 10.20.30.40 is the IP of the machine running the licence server, and 8001 the port at which the licence server is listening.

One server can hold 1 product type at a time, either Ragdoll Unlimited or Ragdoll Complete. So in an environment where both licences need to be available, you’ll need 2 unique IP/Port combinations such that the RAGDOLL_FLOATING environment variable can point to which of the two product types it should lease from.

import os
from maya import cmds

# Ragdoll Unlimited
os.environ["RAGDOLL_FLOATING"] = "1.0.0.0:8001"
cmds.loadPlugin("ragdoll")

# Ragdoll Complete
cmds.file(new=True, force=True)
cmds.unloadPlugin("ragdoll")
os.environ["RAGDOLL_FLOATING"] = "2.0.0.0:8001"
cmds.loadPlugin("ragdoll")

The RAGDOLL_FLOATING environment variable is copied into the plug-in at the time of loading the plug-in.

Reference


Hotswap I - Shelf Buttons

From within a Maya context, here’s a few things you could do for artists to pick one over the other.

  1. Do not auto-load the plug-in on Maya startup
  2. Provide 2 shelf buttons
    • Set RAGDOLL_FLOATING to Ragdoll Unlimited and cmds.loadPlugin
    • Set RAGDOLL_FLOATING to Ragdoll Complete and cmds.loadPlugin

You’ll likely still want a default value for RAGDOLL_FLOATING upon launching Maya, or system-wide, such that artists who open scenes with Ragdoll but do not intend on directly interacting with it are still able to see the physics geometry and simulation.

Hotswap II - Application Launcher

Another option, if you have an application launcher to set the context within which to launch Maya/Blender, is to have 2 options for how to launch the application; one for Ragdoll Complete and another for Ragdoll Standalone.


Conclusion

Hope it helps! If you run into any issues, or have suggestions for alternative ways in which to manage multiple licence servers, feel free to share here!

Here’s some more troubleshooting tips and tricks to keep licences from being leased unless used, try to confirm each one in this order.

  1. Launch Maya/Blender
  2. Load plug-in
  3. Simulate
  4. Record ← Lease should happen

1. Launching Maya/Blender should not lease a licence

Launching Maya should not interact with the licence server.

  1. Launch Maya
  2. Plug-in should not be loaded

The licence server should not have been contacted, check the console output to make sure.

2. Loading plug-in should not lease a licence

Merely loading the plug-in should not interact with the licence server.

import os
from maya import cmds

# The IP and port combination of your running licence server
os.environ["RAGDOLL_FLOATING"] = "replace:me"

# Prevent "Welcome UI" from appearing, leasing a licence in the process
os.environ["RAGDOLL_NO_STARTUP_DIALOG"] = "1"

cmds.loadPlugin("ragdoll")

Once you’ve replaced the replace:me with the ip or hostname plus port number, run it. It should load the plug-in, the menu should be visible in Maya, and the licence server should lease no licence.

Normally, at first load, the user is greeted with a Welcome UI.

In order for the UI to display the product type and licence status, it first leases a licence such that it can query it.

This is also where you can manually lease/release a licence.

Add the RAGDOLL_NO_STARTUP_DIALOG environment variable to avoid this. It can also be avoided by manually setting the optionVar that Ragdoll would automatically set on first launch and saving the Maya preferences.

cmds.optionVar(intValue=("ragdollFirstLaunch2", 0))

3. Simulation should not lease a licence

Next, try simulating something.

  1. Make cube
  2. Assign Marker
  3. Play

No licence should have been leased still, confirm by looking at the output from your licence server or by running this command.

cmds.ragdollLicence(hasLease=True, query=True)

4. Recording should lease a licence

Next, try recording something.

  1. Ragdoll → Record Simulation

Now a licence will attempt to be leased. If none is found, recording will be cancelled and a message/dialog will appear for the user.

Hope it helps! :slight_smile: