Merge pull request #5886 from ynput/bugfix/houdini-license-validator

This commit is contained in:
Ondřej Samohel 2023-11-14 11:13:54 +01:00 committed by GitHub
commit 05bbff0790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,32 +1,39 @@
# -*- coding: utf-8 -*-
import pyblish.api
from openpype.pipeline import PublishValidationError
import hou
class ValidateHoudiniCommercialLicense(pyblish.api.InstancePlugin):
"""Validate the Houdini instance runs a Commercial license.
class ValidateHoudiniNotApprenticeLicense(pyblish.api.InstancePlugin):
"""Validate the Houdini instance runs a non Apprentice license.
When extracting USD files from a non-commercial Houdini license, even with
Houdini Indie license, the resulting files will get "scrambled" with
a license protection and get a special .usdnc or .usdlc suffix.
USD ROPs:
When extracting USD files from an apprentice Houdini license,
the resulting files will get "scrambled" with a license protection
and get a special .usdnc suffix.
This currently breaks the Subset/representation pipeline so we disallow
any publish with those licenses. Only the commercial license is valid.
This currently breaks the Subset/representation pipeline so we disallow
any publish with apprentice license.
Alembic ROPs:
Houdini Apprentice does not export Alembic.
"""
order = pyblish.api.ValidatorOrder
families = ["usd"]
families = ["usd", "abc"]
hosts = ["houdini"]
label = "Houdini Commercial License"
label = "Houdini Apprentice License"
def process(self, instance):
import hou
if hou.isApprentice():
# Find which family was matched with the plug-in
families = {instance.data["family"]}
families.update(instance.data.get("families", []))
disallowed_families = families.intersection(self.families)
families = " ".join(sorted(disallowed_families)).title()
license = hou.licenseCategory()
if license != hou.licenseCategoryType.Commercial:
raise PublishValidationError(
("USD Publishing requires a full Commercial "
"license. You are on: {}").format(license),
"{} publishing requires a non apprentice license."
.format(families),
title=self.label)