Data
We've briefly touched upon the fact that Context and Instance objects can store and retrieve data.
1
import pyblish.api
2
context = pyblish.api.Context()
3
context.data["key"] = "value"
Copied!
Data is a regular Python dictionary stored in the Context and is meant for sharing information amongst plug-ins, whereas data in an Instance is specific to the instance. In both cases, data uses mixedCase by convention, whereas standard Python variables use snake_case.
1
# wrong
2
context.data["my_key"] = True
3
4
# right
5
context.data["myKey"] = True
Copied!
Last modified 1yr ago
Copy link