Loader Options - Loader Tool

Is there any documentation on how to use the LoaderPlugin’s options class attribute

Here is the only information about the LoaderPlugin that I can find.

I’m a bit confuse about how to use it. From reading some of the maya code, I was able to create this

    options = [
        qargparse.Boolean(
            "fix_missing_elements",
            label="Fix missing elements",
            default=True,
            help="Fix the missing elements in the harmony import folder"
        )
    ]

image

However, it seem like the fix_missing_element is not parsed correctly.

If the option is ticked, then the options return an empty dictionary {}. On the other hand, if the option is unticked, the options return a dictionary {"fix_missing_elements": True}

As a result, I can’t seem to get the correct state of the check box.

Please advise.

About Loader Options

Context for anyone unfamiliar with loader options.

The Loader Options window is a popup that allows users to configure loaders.

Animation_1016

Add Options on Your Loader

Options use the same definitions used for attribute definitions in publish plugins. These definitions are located inayon_core.lib.

For example, here’s the option shown in the previous GIF.

Get options’ values

In the load method of your loader class, options are passed by the plugin system when calling YourLoader.load(...).

Your focus should be on implementing the load method, where you can access options similar to this snippet from the plugin example above.

2 Likes