Instance
Last updated
Last updated
An instance is a unit of data.
Inherits AbstractEntity
4 functions inherited from AbstractEntity
Instances are a core component of Pyblish. To get a sense of what they are, think of instances as the inverse of files; i.e. when you load a file into an application, you get an instance of that file.
Thus, when constructing an Instance
, simply ask yourself:
"What am I looking to store on disk?"
An instance may contain both content and metacontent.
You can think of the contents of an instance like how bytes are the contents of a file, whereas metacontent represents additional information about an instance, such as author and time last modified.
The word "instance" generally refers to "an occurence" of something. This something may occur multiple times, but it still refers to the same something.
Let's take an example.
Each file on your file-system refers to data in your disk. If you copy a file and paste it somewhere else, you end up with two files that refer to two different sets of data. This is because the copy you made of the file is also made of the data on disk.
You can confirm this by keeping an eye on the disk usage before and after you make the copy. It increases.
On the other hand, if you create what is known as a "hard link" to this file, you will also end up with two files. But this time, the two different files will refer to the same set of data.
Thus, no matter how many hard links you make, you will never spend any more disk space that what is required to store the handle to the file (a few bytes at most).
In Pyblish, this concept is very much the same.
In fact, you can think of an Instance
as the inverse of a file. When loading a file into an application, what you end up with is the instance of that file. No matter how many times you load the file, each instance will refer to the same file on disk.
Source
Added
0.1.6
Output
Property
Output
Method
append(object)
remove(object)