pyblish / pyblish-qml

Pyblish QML frontend for Maya 2013+, Houdini 11+, Nuke 8+ and more
GNU Lesser General Public License v3.0
114 stars 44 forks source link

"optional" instance data key not being interpreted #291

Closed darkvertex closed 6 years ago

darkvertex commented 6 years ago

In pyblish-lite it's easy enough to set .data['optional'] = False to make an instance mandatory, but it seems to not be handled any differently in pyblish-qml.

Is this a known issue? I couldn't find an open ticket about it.

Any hint where in the code the problem might be? (Unless it's an easy/obvious fix to do on your end.)

I looked a bit and maybe it's not here, but I thought it was weird that in: https://github.com/pyblish/pyblish-qml/blob/master/pyblish_qml/qml/List.qml#L24

        active: object.optional

It's strange to me that the listitem being "active" is driven by the object's "optional" attribute, no? (Forgive me if I'm misinterpreting as my QML chops are low.)

tokejepsen commented 6 years ago

Are you talking about a plugin or instance?

Plugins use optional and active data members to determine if the plugin is optional (togglable) and active (toggled by default or not)

Instances are always optional. The data member publish determines whether an instance is toggled by default or not.

darkvertex commented 6 years ago

I'm talking about an Instance.

Instances are always optional.

In the pyblish-lite UI they can be non-toggleable/non-optional/mandatory if instance.data['optional'] = False. (Usually this is combined with instance.data['publish'] = True to make sure they appear toggled ON.)

It can be pretty useful for mandatory publishes.

mottosso commented 6 years ago

I'm also quite surprised that functionality existed in Lite, but it sounds useful. Happy to see this implemented in QML.

darkvertex commented 6 years ago

I'm also quite surprised that functionality existed in Lite, but it sounds useful. Happy to see this implemented in QML.

Lite will not draw a checkbox for non-optional Instances. Sounds like maybe it was a happy accident in the way the models were abstracted, hehe.

darkvertex commented 6 years ago

I'm also quite surprised that functionality existed in Lite

pyblishlite_mandatory_instances

I found it by pure curiosity when making my first few Pyblish publishers (for which I initially used "lite") and when it worked as well as it did, I just assumed it was a feature! haha. :laughing:

darkvertex commented 6 years ago

Implemented by PR https://github.com/pyblish/pyblish-qml/pull/292 which has been merged and is part of the 1.7.4 release. (woohoo!)