Added alembic camera instance

This commit is contained in:
wikoreman 2018-09-19 10:40:32 +02:00
parent ad0f846a02
commit a3a32950d1

View file

@ -0,0 +1,36 @@
from collections import OrderedDict
from avalon import houdini
class CreateAlembicCamera(houdini.Creator):
name = "camera"
label = "Camera (Abc)"
family = "colorbleed.camera"
icon = "camera"
def __init__(self, *args, **kwargs):
super(CreateAlembicCamera, self).__init__(*args, **kwargs)
# create an ordered dict with the existing data first
data = OrderedDict(**self.data)
# Set node type to create for output
data["node_type"] = "alembic"
self.data = data
def process(self):
instance = super(CreateAlembicCamera, self).process()
parms = {"use_sop_path": True,
"build_from_path": True,
"path_attrib": "path",
"filename": "$HIP/%s.abc" % self.name}
if self.nodes:
node = self.nodes[0]
parms.update({"sop_path": node.path()})
instance.setParms(parms)