Setting a custom kind can hang on recomposition.
Description of Issue
Setting a custom kind on a prim that already has a kind assigned can cause USD to hang on stage recomposition.
Steps to Reproduce
Register a plugin with custom kinds defined :
plugInfo.json :
{
"Plugins": [
{
"Type": "python",
"Name": "TestKindModule",
"Info": {
"Kinds": {
# Add "lights" as a kind of model.
"lights": {
"baseKind": "lights"
},
# Add "lightrig" as a root kind.
"lightrig": {
}
}
}
}
]
}
TestKindModule.py -> just left empty...
Then load the plugin.. and set a custom kind. IMPORTANT : only hangs when setting the kind of a prim that already has a kind set.
Here I am using the kitchen set...
import sys
from pxr import Plug
from pxr import Kind
plugRegistry = Plug.Registry()
plugRegistry.RegisterPlugins("D:\\tmp\\customkind")
plug = plugRegistry.GetPluginWithName("TestKindModule")
sys.path.insert(0, "D:\\tmp\\customkind")
plug.Load()
p = usdviewApi.stage.GetPrimAtPath("/Kitchen_set/Props_grp/DiningTable_grp/ChairB_2")
p.SetKind("lights")
Running this from the interpreter in USDVIEW hangs while attempting to recompose the stage (initially discovered elsewhere, but reproduced in usdview to confirm the issue)
System Information (OS, Hardware)
Windows
Package Versions
0.24.05
Hi @deboisj, I don't know if it was just a transcription error, but the plugInfo.json you provided sets up an infinite loop for KindRegistry::IsA() queries, by making "lights" be its own "baseKind". Now, we really should be checking for that, but I wonder if fixing that issue will fix the problem?
Also the comment says you want "light" to be a kind of model-kind... there is code that assumes that any given "model" kind is either derived from "component" or "group", i.e. it is either singular or a container. So could you please derive from one of those rather than directly from "model"? Again, that's likely something we should enforce during registration!
@spiffmon Thanks for the answer - That makes alot of sense..!
So for context, this is not actual data that we use - I am working on the USD plugin for 3dsMax, and this came up in QA when testing the property editor that we have. Indeed, data looks bad... (but still seems suspicious that it would hang!). Our QA grabbed this plugin definition somewhere on the Houdini/Solaris forums to test setting custom kinds from our prop editor.
Filed as internal issue #USD-9984