Un-toggle Plugin by default


#1

How can you un-toggle a plugin by default?


#2

You can give it the attribute active=False, but it isn’t fully implemented in QML yet.

It will appear un-toggled, and it won’t run, as expected. But the user can toggle it back on, and it still won’t run.

class MyPlugin(...):
  active = False

Sorry I can’t given an estimate on when it will be fully supported in QML yet.


#3

This is now easily possible on instances. Any chance it’s working on plugins?


#4

Is the above not working for you?

For completeness, here’s how it works on Instances.

instance.data["publish"] = False

#5

It doesn’t.

import pyblish.api

class ValidateFail(pyblish.api.Validator):
    """ This plugin will fail"""

    optional = True
    label = 'FAIL'
    active = False

    def process(self, instance):

        assert False, 'This plugin is designed to fail'

This works as if the active attribute wasn’t there.

This would also be a problem if it’s still like that. What I need to use it for is optional extractors. Publishing model, most of the time we’d want .ma and .obj formats. But sometimes .fbx or .abc is needed, so I want the extractors to be there but turned off by default. If modeler want’s to export it, he toggles it on and publishes.


#6

Yes agreed; the intended behaviour is as you expect. This must be a bug. Feel free to make an issue of it.


#7

Without an issue, this may never be solved. :frowning:


#8

Damn. Care to elaborate?


#9

When you encounter or get confirmation of a problem, make sure to make an issue of it so it can be resolved.


#10

:smiley: :smiley:

didn’t click you’re talking about github issue. I though you ran into some problem solving it :).

Morning brain not quite started yet.


#11

Haha, it also didn’t click for me that an issue could be anything other than a GitHub issue. :slight_smile:


#12

Are there any news about this topic? It would be super-handy to be able to untoggle by default :slight_smile:


#13

The above active and publish attributes should work, is it not working for you?


#14

No, active=False doesn’t do anything


#15

Could you let me know which version of Pyblish QML you are running?

import pyblish_qml
print(pyblish_qml.version)

#16

Oh ok, that could be it. 1.3.2


#17

Yeah, it works! Thanks!


#18

What worked? I didn’t suggest any solutions? :slight_smile: How did you fix it?


#19

I’ve updated pyblish/pyblish to the latest projects, including a newer version of Pyblish QML.

You can update with this.

cd pyblish
git pull

#20

yup, that’s what I did :slight_smile: