pyblish / pyblish-base

Pyblish base library - see https://github.com/pyblish/pyblish for details.
Other
127 stars 59 forks source link

Renaming Instance to Asset #188

Closed mottosso closed 9 years ago

mottosso commented 9 years ago

Mirroring this from the forums for Git commit history. Do talk about it there, unless it's related to implementing it.


What do you think about renaming Instance to Asset?

I think Instance fits it's technical implementation, as an "occurence" of some set of data. But perhaps the way we've been using it is exactly how we would use an Asset. The difference being that we have an upfront understanding of what it is supposed to mean, as opposed to Instance which has to be unlearned (from particle instances or what not) and then relearned until we eventually get to the point where it clicks "Aha, so it's an asset".

By calling it Asset to begin with, we might make it easier to grasp first-hand, whilst providing a stronger continued understanding of what it is.

Here's a look at an alternate reality where this has already happened.

import pyblish.api

class SelectCharacters(pyblish.api.Selector):
  def process(self, context):
    for objset in cmds.ls(type="objectSet"):
      name = cmds.getAttr(objset + ".name")
      asset = context.create_asset(name)
      asset.set_data("family", "character")

class ValidateColor(pyblish.api.Validator):
  families = ["character"]
  def process(self, asset):
    assert asset.data("color") == "blue", "%s isn't red" % asset
mottosso commented 9 years ago

Available in 1.1, but not yet finalised. See release notes (bottom).

mottosso commented 9 years ago

Discarded, do not use.