dependabot[bot] on bundler
Bump tzinfo from 1.2.2 to 2.0.5… (compare)
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
how do you currently store data in your instance?
instance.data["chocolateData"] = ["cocoa", "milk"]
instance.data["iceData"]=["cold", "water"]
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'])
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?
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"))
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
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()
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?
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.
# 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)
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.
python -m pyblish_qml --demo