Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 18 15:24
    jiachangsheng starred pyblish/pyblish.github.io
  • Aug 16 13:44
    Ahmed-Hindy starred pyblish/pyblish
  • Aug 09 09:56
    studiovc starred pyqt/python-qt5
  • Jul 29 09:53
    tdard edited #72
  • Jul 29 09:52
    tdard opened #72
  • Jul 25 16:11
    hannesdelbeke opened #390
  • Jul 25 13:22
    britisharmy starred pyqt/python-qt5
  • Jul 21 22:26
    dependabot[bot] labeled #27
  • Jul 21 22:26
    dependabot[bot] opened #27
  • Jul 21 22:26

    dependabot[bot] on bundler

    Bump tzinfo from 1.2.2 to 2.0.5… (compare)

  • Jul 21 19:10
    gabrieljreed starred pyblish/pyblish-qml
  • Jul 19 06:30
    mottosso commented #43
  • Jul 18 20:19
    Event-Horizon-Labs edited #43
  • Jul 18 20:18
    Event-Horizon-Labs opened #43
  • Jul 11 16:58
    KentMrng starred pyblish/pyblish
  • Jul 11 16:57
    KentMrng starred pyblish/pyblish-base
  • Jul 11 16:57
    KentMrng starred pyblish/pyblish-houdini
  • Jul 11 15:37
    gjeevana27 commented #67
  • Jul 09 21:17
    hannesdelbeke edited #389
  • Jul 09 03:32
    mickey3721 starred pyqt/python-qt5
Hannes
@hannesdelbeke

yes in current setup it makes no sense,
if there is a scenario where you would want to do this. maybe make instances dynamically outside of pyblish
then the following would not be intuitive IMO

implement the bool of a AbstractEntity to run bool(self._data)

because an instance might exist, but have no data

But I think we might be steering away slightly, hopefully Michael get's back to us since I don't understand exactly what the issue is .
Michael Aldrich
@MichaelAldrich
I think the problem is that I've been using instance.data basically only, and never doing instance.append

how do you currently store data in your instance?

instance.data["chocolateData"] = ["cocoa", "milk"]
instance.data["iceData"]=["cold", "water"]

Hannes
@hannesdelbeke
turns out there is a page on the wiki for instance.append https://api.pyblish.com/pyblish.api/instance/instance.append
i've never used data myself. trying to see if the docs mention it
https://api.pyblish.com/pyblish.api/instance
this page explains the diff between the data in the list, and the metadata in data
Michael Aldrich
@MichaelAldrich
Yeah! This makes lots of sense, thanks for the help and sorry for the confusion folks :)
Marcus Ottosson
@mottosso

this page explains the diff between the data in the list, and the metadata in data

Couldn't have said it better myself :blush:

Xinjie Hu
@kosam0913
Hi guys, an quick question~ are there any specific reason that in class MetaPlugin definition, we are using init(cls, *args) instead of new?
Xinjie Hu
@kosam0913
some background story: I was trying to make some modification on the source code (hope you don't mind Marcus>:) ), so we can bind context into plugin instance itself
class MyPyblishBasePlugin(api.Plugin): 

    order = api.ValidatorOrder

    def __init__(self, instance=None, context=None):
        super().__init__(instance=instance, context=context)

    def process(self):
        print(f"current context data: {self.context.data}")
        self.context.data["global_attr"] = "test"

    def repair(self):
       print(self.context.data['global_attr'])
Marcus Ottosson
@mottosso

Hi guys, an quick question~ are there any specific reason that in class MetaPlugin definition, we are using init(cls, *args) instead of new?

I can't remember :blush: Also not quite sure what you mean by binding the context, maybe you can elaborate? What is the usecase or problem?

Xinjie Hu
@kosam0913
wah, so happy you are online! currently pyblish is using context and instance to transfer data among plugins (e.g. ValidateDIWithRepair_Current below), I was wondering if it is possible to set context or instance as plugin properties? (e.g. ValidateDIWithRepair_Lookingforward below)
class ValidateDIWithRepair_Current(pyblish.api.Plugin):

    def process(self, instance):
        assert False, "I was programmed to fail, for repair"

    def repair(self, instance):
        self.log.info("Repairing %s" % instance.data("name"))


class ValidateDIWithRepair_Lookingforward(pyblish.api.Plugin):

    def process(self):
        print(f"current context data: {self.context.data}")
        print(f"current instance data: {self.instance.data}")

    def repair(self):
       self.log.info("Repairing %s" % self.instance.data("name"))
Xinjie Hu
@kosam0913

then when I read the source code, I found out that before the actual plugin is instantiated during pyblish, following code will be executed:

class MetaPlugin(type):

    def __init__(cls, *args, **kwargs):

        # cls.__pre11__ = False
        # evaluate_pre11(cls)
        evaluate_enabledness(cls)

        # Compute once
        cls._id = str(uuid.uuid4())
        cls.id = lib.classproperty(lambda self: self._id)

        # may I add set some custom atttribute here?

        return super(MetaPlugin, cls).__init__(*args, **kwargs)

hence I was about to ask 1. are there any concerns that we are using init() not new() here? 2. generally is it possible to set context/instance as an attribute of plugin? 3. or maybe I can add customize attribute for our own purpose? ( hope I state myself clearly, and pardon me if I make any confusion

Marcus Ottosson
@mottosso

What is the different to accessing context as an argument versus a member attribute? :O

# Current
print(context.data)

# Proposed
print(self.context.data)

I'm not seeing the advantage

Xinjie Hu
@kosam0913
I agree with you :< (whispering), but we were trying to see if we could potentially wrap it more 'developer friendly'. so developers can just care about the plugin object itself when they are developing and no need to put any other arguments.
Marcus Ottosson
@mottosso
Ah, then no I can't remember any specific reason. Give it a try!
Xinjie Hu
@kosam0913
Okie! thanks for your time. honestly I've been doing some 'experiments' around, and found everything is such well-designed so it is not that easy to modify without mess it up(at least for me), haiyaya.
Marcus Ottosson
@mottosso
Heheh, well if you do manage to improve upon it, pull-requests are still open
Xinjie Hu
@kosam0913
roger that, let me try >:D
Michael Aldrich
@MichaelAldrich
Has anyone seen the case where Exact does not work as a matching algorithm? Here's the code I'm testing with:
from pyblish import api
import pyblish_lite

class FakeCollector(api.ContextPlugin):
    order = api.CollectorOrder
    def process(self, context):
        context.create_instance("foo_single", family="boo")
        context.create_instance("foo_multi", families=["boo"])

class FakeContextValidator(api.ContextPlugin):
    order = api.ValidatorOrder
    label = "Fake context validator"
    def process(self, context):
        from pyblish import logic
        self.log.info(str(logic.instances_by_plugin(context, FakeInstanceValidator)))


class FakeInstanceValidator(api.InstancePlugin):
    order = api.ValidatorOrder
    families = ["boo"]
    match = api.Exact
    label = "Fake Instance validator"
    def process(self, instance):
        self.log.info(instance.data["label"])
        self.log.info(str(instance.data.get("families")))
        self.log.info(str(instance.data.get("family")))

pyblish_lite.show()
image.png
Which is giving me this result, as you can see my instance validator never runs
Michael Aldrich
@MichaelAldrich
for completeness, this doesn't seem unique to pyblish lite, if I use pyblish.util.publish() and inspect the context.data["results"] I also see that the instance validator is never run.
Marcus Ottosson
@mottosso
Hm, looking at the algorithm itself: https://github.com/pyblish/pyblish-base/blob/master/pyblish/logic.py#L23 it does look like it should match? I wonder whether it's got to do with any default family in there. Which families are being printed?
Michael Aldrich
@MichaelAldrich
I am shame. With the clarity of a night of sleep I realized this was a mistake with targets, which do not seem to affect the collector or context plugin, but do affect the instance plugin.
Michael Aldrich
@MichaelAldrich
Aha! I found it! The targets also obey the match algorithm. That was my missing piece. I don't see that mentioned in the docs.
Nik Shankar-Noble
@nikshankarnoble
Hi all! :) I'm trying to familiarise myself with Pyblish at the moment and was interested in some of the Intermediate topics listed at https://learn.pyblish.com/#content but I've been getting a 502 error when trying to access the forum over the last two days. Does anyone here know if that information is available elsewhere?
Marcus Ottosson
@mottosso
Oh no, investigating the forum now. Thanks for letting me know
Nik Shankar-Noble
@nikshankarnoble
Thank you so much! :) Very much appreciated
Marcus Ottosson
@mottosso
It's back up
Nik Shankar-Noble
@nikshankarnoble
Thank you!!
Marcus Ottosson
@mottosso
Aaaaand it's down again :blush: Looks like the machine is out of disk space, working on a fix now.
Marcus Ottosson
@mottosso
Allright, here's to the next 7 years of uptime :beers:
Hannes
@hannesdelbeke

in qml, (server.py) we pass the absolute minimum of environment variables to the server, to avoid issues on invalid types

we do pass PYTHONPATH.,

# Append PyQt5 to existing PYTHONPATH, if available
        environ["PYTHONPATH"] = os.pathsep.join(
            path for path in [os.getenv("PYTHONPATH"), pyqt5]
            if path is not None
        )

but we don't pass sys.path.

so python modules accessible to our software (ex. blender), but which are not in the PYTHONPATH, are thus not accessible to our server.

which means QML cant run if it's installed in your user script path.

passing sys.path fixes the issue. is this too specific to create a PR for?
# Append sys.path to PYTHONPATH
        if environ["PYTHONPATH"] is not None:
            environ["PYTHONPATH"] += os.pathsep + os.pathsep.join(sys.path)
        else:
            environ["PYTHONPATH"] = os.pathsep.join(sys.path)
Marcus Ottosson
@mottosso
Heya, before you make a PR, just to clarify a common misconception about QML; the PYTHONPATH used by QML are unrelated to your collector/validator plug-ins. They only relate to finding the PyQt5/PySide2 to draw the UI. Plug-ins are still run in your local environment, with your local sys.path
Hannes
@hannesdelbeke

yes the issue is not with the plugins. those all work fine.

the server needs to import the QML module.
if pyblish_qml is not in PYTHONPATH, but only in your sys.path, it will fail to launch qml.

ordinc
@ordinc
Hello everyone, I'm learning how to use the pyblish framework, and I'm currently encountering some problems, I'm asking for your help, thanks in advance.
I found some open source plugins on the Internet, put them on my disk, and used the 'api.register_plugin_path' method to add this path to pyblish, but when I started pyblishformaya, the plugin I defined was not loaded, How can I register the plugin to pyblish?
image.png
Hannes
@hannesdelbeke
You are mixing pymel and cmds. They are not compatible by default
You also register a plug in paths inside of your collect plugin. Which might create a loop
Hannes
@hannesdelbeke
It might be easier to create a simple hello world setup and learn how pyblish works. Before using plugin from the Internet.
ordinc
@ordinc
Thanks for your answer.
I added 'import pymel.core as pm' to the head of the script file.
The code snippet that is actually saved and executed in the collect plugin does not register the plugin path, that is just a temporary comment to explain how I register the plugin.
Currently learning how to use it on the pyblish forum.
sjt-rvx
@sjt-rvx

Morning!

I have been trying to get pyblish working on windows machine on python3, and getting the qml side running is proving troublesome. A quick google tells me this is a pyside vs pyqt5 thing? Anyone seen this?
File "C:\dev\pyblish-qml\pyblish_qml\control.py", line 309, in Controller @QtCore.Property(bool, constant=True) TypeError: A constant property cannot have a WRITE method or a NOTIFY signal.

getting this when running python -m pyblish_qml --demo
(and from within maya fwiw)
Marcus Ottosson
@mottosso
Likely too new of a PyQt5 or PySide2 version. Try an older one, like 5.9 or 5.11
Hannes
@hannesdelbeke
had the same error in unreal.
using pyblish lite for now.
Marcus Ottosson
@mottosso
It's unrelated to Maya or Unreal, it's got to do with the version of PyQt5 is installed for the Python used for QML. Pyblish QML was written for Qt 5.12 or below.