-
Notifications
You must be signed in to change notification settings - Fork 128
Maya: Add OptionalPyblishPluginMixin
to all validators
#5575
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- See comment - all of the mixin inherited classes should do the
is_active
check to actually work as intended. - Also validators that ensure the correct behavior of the family for publishing should NEVER be optional. I noticed you've added the mixin to some of the classes that are actually validators that ensure the publishing works as expected like
ValidateLookContent
,ValidateModelContent
,ValidateStepSize
. I think for now you're best off ONLY changing those plugins that actually are exposed in settings currently?- You seem to have skipped
ValidateAnimationContent
which is ok because it should not be optional but I think you just 'forgot' that one? :)
- You seem to have skipped
) | ||
|
||
|
||
class ValidateOutRelatedNodeIds(pyblish.api.InstancePlugin): | ||
class ValidateOutRelatedNodeIds(pyblish.api.InstancePlugin, | ||
OptionalPyblishPluginMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the changes made of only adding the mixin does not suffice. The process
method should also be doing a self.is_active(instance.data)
check to make sure it's actually skipped if the instance is toggled off. (Note that for ContextPlugin it is self.is_active(context.data)
.
Like:
InstancePlugin
def process(self, instance):
if not self.is_active(instance.data):
return
ContextPlugin
def process(self, context):
if not self.is_active(context.data):
return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also validators that ensure the correct behavior of the family for publishing should NEVER be optional.
True, but to really make them optional, there is another step and that is defining that in the Settings. My point is that even if we add the mixin, it doesn't really make the plugin optional, only the existence of the switch in the Settings does. I would even go that far later on as to unify inheritance of all validator plugin to one class that will wrap it together. Because then it wouldn't be "confusing" in the code as you wouldn't see OptionalPyblishPluginMixin
in the signature of the validator class on non-optional plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true - the plug-ins are still lacking the |
Will try it out again to confirm. Thx |
@BigRoy well to be honest I did not tested every single validator but obviously the one I tested does take into account wether PublishValidation.mp4This being also true for This being also true for I can of course do more of them one by one but seems fine...at first glance. Could u give me some validator exactly not working for you so I can test that special one, pls? |
@BigRoy so I finally found first not working
@antirotor not sure why some validators work and some dont |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like some validators
doesnt respect the Enabled / Disabled
knob state.
Need to be addressed.
The reason they don't work is described here |
This will need merge conflict resolve before any further testing. |
Because we're splitting OpenPype into ayon-core and individual host addons, this PR would have to be re-created to target one of those. We're closing it down, but we'll he happy for a new PR to ynput/ayon-core or the host addon repository once it's up. |
Changelog Description
This PR is adding
OptionalPyblishPluginMixin
inheritance to all Maya validators. This fixes issues where validators are set as Optional in the Settings but that state is ignored on them.Additional info
Rationale to add
OptionalPyblishPluginMixin
to all validators is that it should be decided in the Settings if the plugin is optional or not - or at least on one place and currently there is no way to make Settings dynamic enough so that they will get that from the plugins itself. If this mixin is present, but the setting Optional in Settings is not, it won't allow anyone to disable even the important "must-run" validators. And at the same time, adding it to the Settings will make the validator settable to Optional state.This is also re-sorted imports with isort tools - for that I am truly sorry as it might complicate code review, but since I had to change import on most of these plugins anyway, I've chose to do it for the sake of consisten and more readable code. I've added default isort configuration in #5572.
Testing notes: