by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:06
    zhengxingkai starred pyblish/pyblish-base
  • May 30 21:31
    JasonLoveCode starred pyblish/pyblish-houdini
  • May 30 21:31
    JasonLoveCode starred pyblish/pyblish
  • May 28 20:40
    Phalelashvili starred pyqt/python-qt5
  • May 25 16:15
    jboisvertrodeofx commented #365
  • May 25 16:09
    jboisvertrodeofx synchronize #365
  • May 25 08:16
    arunpillaii starred pyblish/pyblish-qml
  • May 25 08:16
    arunpillaii starred pyblish/pyblish-maya
  • May 25 08:13
    arunpillaii starred pyblish/pyblish-base
  • May 25 02:59
    rockywhisper starred pyqt/python-qt5
  • May 23 17:20
    attis159 starred pyqt/python-qt5
  • May 23 12:16
    mottosso commented #365
  • May 22 21:04
    jboisvertrodeofx commented #365
  • May 22 19:41
    mottosso commented #365
  • May 22 19:32
    jboisvertrodeofx commented #365
  • May 22 19:31
    jboisvertrodeofx commented #365
  • May 22 19:30
    jboisvertrodeofx commented #365
  • May 22 19:28
    jboisvertrodeofx commented #365
  • May 21 20:02
    jboisvertrodeofx edited #365
  • May 21 20:01
    jboisvertrodeofx opened #365
Andre Anjos
@andre.anjos_gitlab
But looking inside Pyblish, I'm not sure where would it be the best place to add this
I'm happy to make a request through GitHub if you prefer :)
Marcus Ottosson
@mottosso
Yes I've noticed this too, neither Lite and QML have support for DPI scaling

The solution differs between the two of them; QML is likely the easier one, as there is a global environment variable we could try and set that would automatically scale everything within the same process.

These are three you could try on your end and see if they make a difference for QML.

If so, it would be trivial to add this to the show() function.

Lite is more complicated, as we could need to multiply any explicit pixel size used with whatever scale is currently active on the given screen.
Andre Anjos
@andre.anjos_gitlab
@mottosso Thank you very much!
I'm giving it a go and having issues importing the modules. ImportError: DLL load failed: The specified module could not be found.
    from PyQt5 import QtCore
    from PyQt5.QtWidgets import QApplication

    os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
    app = QApplication(sys.argv)
    app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
Andre Anjos
@andre.anjos_gitlab
This clearly is not a good start for me :smile:
Marcus Ottosson
@mottosso
Oh, no, you can add this to your system environment variables, before launching Maya/Houdini/whatever
Later, they would be added to the Python process running Pyblish QML. It's possible it would get excluded from there.. have a look in the pyblish_qml/ipc/server.py for what variables are added, and maybe try adding it there instead.
Andre Anjos
@andre.anjos_gitlab
ahhh! I see, thank you very much for the explanation :)
Will have a look
col-one
@col-one
Hey there!
Maybe my question has an answer in the doc but I didn't find it...
How to manage an empty Collector as wrong "Validator". I mean if the object is not present in the scene how can I raise an error with pyblish.
Marcus Ottosson
@mottosso
Hm, if an object is not present. I suppose you could collect a placeholder, and check whether it contains all of what you expect in a validator
col-one
@col-one
hum maybe could be a workaround, like "if empty create_instance('empty')"
"if instance.name == 'empty': raise"
that is what you mean ?
Marcus Ottosson
@mottosso

Not quite, I was thinking.

  1. Collect an instance, e.g. context.create("myInstance") and gather nodes for that instance, if there are any
  2. In the validator, check those nodes. If there are none, throw an exception

Alternatively, you could make a validator that checks the context. If it's empty, throw an error.

David Lai
@davidlatwe
Something like this ?
import pyblish.api

class ValidateContextHasInstance(pyblish.api.ContextPlugin):
    order = pyblish.api.ValidatorOrder - 0.49  # First validator
    def process(self, context):
        msg = "No instance to publish, please create at least one instance."
        assert len(context), msg

        msg = "No instance to publish, please enable at least one instance."
        assert any(inst.data.get("publish", True) for inst in context), msg
And this one is an example for validating all collector plugin works without error

class ValidateCollectionProcesses(pyblish.api.ContextPlugin):
    """Validate previous collector plugins all processed without error
    """
    order = pyblish.api.ValidatorOrder - 0.49999

    def process(self, context):
        assert all(result["success"] for result in context.data["results"]), (
            "Collected with error, there must be bugs.")
col-one
@col-one
ok, gotcha thanks for the help
Tweekazoid
@Tweekazoid
Hi quick question. Using pyblish-lite in Maya and/or Nuke. Pyblish-lite is choppy, UI redraws are 3-4 times slower than if pyblish-lite is run directly from python (without parent application). Is there a way to mitigate this, and get better performance?
Jakub Trllo
@iLLiCiTiT
@Tweekazoid how would you run pyblish-lite without parent application and keep context of the application at the same time? (your question sounds like you know)
Tweekazoid
@Tweekazoid
For our needs I've had to make a few changes, basically publishing from the desktop... . Displaying 10 instances in 'artist' view gives me approx. 30fps, displaying 60 instances drops the performance to 4fps. With same number of instances in Nuke a get somewhere between 15 and 0.8 fps. I have a suspicion that the paintEvent is too taxing on the system and even more so under Nuke. So let me rephrase the question. Are you guys familiar with some approach to make paint event more performant?
Jakub Trllo
@iLLiCiTiT
well for this numbers is "no paint" the best :D
Tweekazoid
@Tweekazoid
cap.JPG
no luck without the paint here. I have to display far more information for each instance.
Jakub Trllo
@iLLiCiTiT
seems like you're using widget based view like QListWidget or QTreeWidget?
Tweekazoid
@Tweekazoid
QListView, thew view.Item class is the same as in the pyblish-lite master
Jakub Trllo
@iLLiCiTiT
Ok. Then it may be paint issue or data issue, hard to say without code, but it is possible your data getting approach (which is needed to repaint items) may be too heavy...
The issue is happening only during publishing or for whole time?
Tweekazoid
@Tweekazoid
Changing the count of index.data( ) accesses does speed up the performance, but there is still a big difference between running standalone and under application
Jakub Trllo
@iLLiCiTiT
Probably never changes, you can speed up performace only with reducing data approach, reducing repaint events or you can hide the list view during publishing.
To run pyblish gui outside main app means you have to able access application context with read and write ability(in most of publish use cases), which is possible but not easy. And nuke is old guy with old python and modules...
Tweekazoid
@Tweekazoid
Slight misunderstanding. I have no issue with Nuke performance, but with the performance of Pyblish-Lite UI under any application( performance like scrolling artist view, resizing the dialog, switching panels ... everything takes more time ). My standalone version of pyblish-lite is not connected to any application ( only drag/drop events and argv/kwargs...). It seems to me as if running under python directly (standalone) with newly created QApplication lets the Pyblish UI do whatever and whenever it wants, but running under QApplication.instance (Nuke) has some performance penalty. I will try to test under Blender with a newer version of python, if the issue persists.
Jakub Trllo
@iLLiCiTiT

Main issue is that each application does not draw only pyblish-gui but also it's gui and also have to care about it's threads.
Standalone pyblish gui works faster all the time, but is unusable for publishing because you need access to application memory during publishing, if you want access to application memory you have to run it inside application.
*Or you can find way how to access application memory in other way (e.g. with sockets, websockets or something similar).

Blender is much complicated BTW. Blender does not use Qt so you have to create new Qt application on top of blender's application.

If you need to have GUI for publishing you can't have same speed as standalone, you can only increase perforance of your GUI with reducing unnecesary parts.
*It seems that each item in your list view has 5 parts to paint: checkbox, icon, label, author and ?frames? each item has many rounded rectangles, different states and different backgrounds. That's what I can see from the prinscreen you've sent.

Marcus Ottosson
@mottosso
@Tweekazoid I struggled with this too; my solution was to not render to a widget via paintEvent directly, but instead render to a QPixmap only when necessary, and draw it with a QLabel. That way, the paintEvent of the QLabel will merely draw pre-rendered pixels, which is fast, and you can delegate the heavy rendering to when you actually need it. Otherwise, the paintEvent is called tens of thousands of times for all sorts of silly reasons.
Jakub Trllo
@iLLiCiTiT
I though about that, and one possible solution came up from my mind, which is similar to what Marcus said. Move from QListView to QListWidget. Pre-drawed items as widgets may be helpful in this case...
Marcus Ottosson
@mottosso
That should help too, unless you implement paintEvent for the widgets. The underlying issue is that paintEvent and everything going on in there is expensive from Python.
Tweekazoid
@Tweekazoid
I have to try the Qpixmap render, and signaling only on instance change
David Lai
@davidlatwe
Made a little tool in free time for help observing Pyblish data flow :D
https://github.com/davidlatwe/pyblish-plot
Marcus Ottosson
@mottosso
Nice one! :) There was a similar project a while back that I'm struggling to remember.. one that would draw the processing graph as ASCII art
Looks like a good complement
Maybe we could make a little button in the GUIs to bring up a window to visualise those things
David Lai
@davidlatwe
Or a Python IDE plugin that able to help browsing Pyblish plugin files in a new way :P
flowpipe indeed is something that can be put together !
Marcus Ottosson
@mottosso
Roy pointed out some similarities with Shotgun's publish2, and I've captured some of their ideas here: https://forums.pyblish.com/t/pyblish-and-shotguns-publish2/607
Has anyone used it? Would be good to hear your thoughts
Jasper van Nieuwenhuizen
@jasperges
Yes, I have used it, but only as standalone publisher. I will add my thoughts later this week to your forum post.
Marcus Ottosson
@mottosso
Very good! Maybe there's something we could learn from