Adding custom "Kind"

   3268   6   2
User Avatar
Member
48 posts
Joined: 7月 2009
オフライン
Hello,

is there a easy way to add new "Kind" types to Solaris?
Or is it only possible with HDK or replacing Houdinis USD Library?

Cheers Martin
User Avatar
スタッフ
4259 posts
Joined: 9月 2007
オフライン
It's done using USD's plugin mechanism, but doesn't require any compiling. You register additional kinds via the plugInfo.jsonand add it's directory to $PXR_PLUGINPATH_NAME. As long as that env var has the directory to your plugin folder, Solaris will include your custom kinds in the kind-based menus/parameters (i.e. Kind-based selections,

Here are some links for more details/examples:

I'm o.d.d.
User Avatar
Member
48 posts
Joined: 7月 2009
オフライン
goldleaf
It's done using USD's plugin mechanism, but doesn't require any compiling. You register additional kinds via the plugInfo.jsonand add it's directory to $PXR_PLUGINPATH_NAME. As long as that env var has the directory to your plugin folder, Solaris will include your custom kinds in the kind-based menus/parameters (i.e. Kind-based selections,

Here are some links for more details/examples:


Thanks for the explanation.
I followed the descriped procedure, but couldt get it to work.

I added this line to my houdini.env
PXR_PLUGINPATH_NAME=/home/user/houdini19.0/usd_plugin

The plugInfo.json ( /home/user/houdini19.0/usd_plugin/plugInfo.json ) contains following lines.
{
    "Plugins": [
        {
            "Type": "python",
            "Name": "TestKindModule",
            "Info": {
                "Kinds": {
                    # Add "test_model_kind" as a kind of model.
                    "test_model_kind": {
                        "baseKind": "model"
                    },
                    # Add "test_root_kind" as a root kind.
                    "test_root_kind": {
                    }
                }
            }
        }
    ]
}


I tested the Result via the Kind Menu on the configPrimitive Node and with the Pxr Kind.Registry ( Kind.Registry.GetAllKinds() ).

Any hints what I'm missing?

Thanks in advance,
Martin
Edited by louisx - 2022年5月13日 17:12:29
User Avatar
スタッフ
4560 posts
Joined: 7月 2005
オフライン
The json looks fine to me, but it's possible that setting PXR_PLUGINPATH_NAME in houdini.env isn't working? If you just put your plugInfo.json in `/home/user/houdini19.0/dso/usd_plugins` you actually wouldn't have to explicitly set anything in your environment. That path will get picked up automatically. If it still doesn't work, try setting the env var `TF_DEBUG=PLUG_*` before starting Houdini (again, it's probably safest to not rely on houdini.env while you're trying to get these issues worked out). Setting this env var will make USD spit our all kinds of information about all the plugInfo.json files it is loading.
User Avatar
Member
48 posts
Joined: 7月 2009
オフライン
mtucker
The json looks fine to me, but it's possible that setting PXR_PLUGINPATH_NAME in houdini.env isn't working? If you just put your plugInfo.json in `/home/user/houdini19.0/dso/usd_plugins` you actually wouldn't have to explicitly set anything in your environment. That path will get picked up automatically. If it still doesn't work, try setting the env var `TF_DEBUG=PLUG_*` before starting Houdini (again, it's probably safest to not rely on houdini.env while you're trying to get these issues worked out). Setting this env var will make USD spit our all kinds of information about all the plugInfo.json files it is loading.

Thanks that was helpful. I had to set the env var before starting Houdini, didtn work via houdini.env and packages.

Is there a way to set an Icon for my new Kind types? Like the one appearing in the ScneGraph when selecting the buildin Kinds.
Couldnt find any information about it.
Edited by louisx - 2022年5月16日 05:49:16

Attachments:
kind4.png (33.8 KB)

User Avatar
スタッフ
4560 posts
Joined: 7月 2005
オフライン
Houdini is already looking for a custom icon for your custom kind... If you create a "config/Icons/SCENEGRAPH/kind_mykind.svg" file in your $HOUDINI_PATH, it should get picked up and used as the icon for "mykind". You can alternatively re-implement the usdprimicons.py module, and add it to the pythonX.Ylibs subdirectory of your HOUDINI_PATH, which lets you rewrite the code the tells Houdini what icon to use for each primitive kind.
User Avatar
Member
48 posts
Joined: 7月 2009
オフライン
mtucker
Houdini is already looking for a custom icon for your custom kind... If you create a "config/Icons/SCENEGRAPH/kind_mykind.svg" file in your $HOUDINI_PATH, it should get picked up and used as the icon for "mykind". You can alternatively re-implement the usdprimicons.py module, and add it to the pythonX.Ylibs subdirectory of your HOUDINI_PATH, which lets you rewrite the code the tells Houdini what icon to use for each primitive kind.

Thanks it worked perfectly.
Just had to name the file SCENEGRAPH_kind_mykind.svg not put it in a subfolder.

Appreciate the amazing help.
Cheers Martin
Edited by louisx - 2022年5月17日 10:06:00
  • Quick Links