ID 533146 - [MSC] Internal MSC plugins are being prioritized over custom ones added to the KATANA_RESOURCES path

Follow

Problem summary:

When loading custom MSC plugins on the KATANA_RESOURCES path, internal plugins will be prioritized over the custom ones.

Steps to reproduce:

  1. Create a directory named "Plugins", e.g C:/dump/support/MSC_order/Plugins
  2. Add the Plugins parent directory to the KATANA_RESOURCES path:
    • On windows: set KATANA_RESOURCES=%KATANA_RESOURCES%;C:/dump/support/MSC_order
    • On linux: export KATANA_RESOURCES=$KATANA_RESOURCES;/dump/support/MSC_order
  3. Create a MSC plugin file in the Plugins dir with a very similar 3Delight color MSC to the internal 3Delight MSC, e.g:

from PluginAPI.BaseMaterialSoloingConverter import BaseMaterialSoloingConverterimport NodegraphAPIclass BaseDeprioritized3DelightMSC(BaseMaterialSoloingConverter):def getName(self):    return str(type(self).__name__)def getBaseShadingNodeType(self):    return "DlShadingNode"def _checkCompatibleRaise(self, portToSolo):    if self.isCompatible(portToSolo):        return    raise RuntimeError(f"Port to solo, with tags {portToSolo.getTags()}, is incompatible " +                       f"with {type(self).__name__}.")class Deprioritized3DelightColorMSC(BaseDeprioritized3DelightMSC):def isCompatible(self, portToSolo):    return ("color" in portToSolo.getTags()            and (portToSolo.getNode().getType() == self.getBaseShadingNodeType()))def createConversionNetwork(self, portToSolo, mscContainerGroup):    self._checkCompatibleRaise(portToSolo)    surfaceShader = self._createShadingNode("surfaceShader", mscContainerGroup)    return (surfaceShader.getInputPort("i_color"), {        "dlSurface": surfaceShader.getOutputPort("outColor")    })PluginRegistry = [ ("MaterialSoloingConverter", 1, "Deprioritized3DelightColorMSC", Deprioritized3DelightColorMSC), ]

4. Launch Katana (confirm plugin path is picked up)
5. Create an NMC with a dlColor node inside it
6. In the python tab run the following:

from PyUtilModule.MaterialSoloingConverterPlugins import ( GetMaterialSoloingConverters, GetPreferredMaterialSoloingConverterByPortType )colorPort = NodegraphAPI.GetNode('dlColor').getOutputPort('outColor') print(GetMaterialSoloingConverters())

6. And then run the following:

print(GetPreferredMaterialSoloingConverterByPortType(colorPort))

Expected behaviour:

The output of GetPreferredMaterialSoloingConverterByPortType should be: <__plugins4__.Deprioritized3DelightMSC.Deprioritized3DelightColorMSC object at 0x000001979F7EBBE0>

Actual behaviour:

The output of GetPreferredMaterialSoloingConverterByPortType is: <__plugins5__.MaterialSoloingConverters3Delight.ColorToDlSurfaceMSC3Delight object at 0x000001979F7F1640>

Workaround:

No known workaround.

Tested versions/platforms:

  • 6.0v1 - Affected

Customer version/platform:

Not supplied

    We're sorry to hear that

    Please tell us why