diff --git a/colorbleed/plugins/houdini/create/create_alembic_camera.py b/colorbleed/plugins/houdini/create/create_alembic_camera.py index c548a6309a..96449fb3db 100644 --- a/colorbleed/plugins/houdini/create/create_alembic_camera.py +++ b/colorbleed/plugins/houdini/create/create_alembic_camera.py @@ -21,11 +21,25 @@ class CreateAlembicCamera(houdini.Creator): def process(self): instance = super(CreateAlembicCamera, self).process() - parms = {"use_sop_path": True, - "filename": "$HIP/pyblish/%s.abc" % self.name} + parms = { + "filename": "$HIP/pyblish/%s.abc" % self.name, + "use_sop_path": False + } if self.nodes: node = self.nodes[0] - parms.update({"sop_path": node.path()}) + path = node.path() + + # Split the node path into the first root and the remainder + # So we can set the root and objects parameters correctly + _, root, remainder = path.split("/", 2) + parms.update({ + "root": "/" + root, + "objects": remainder + }) instance.setParms(parms) + + # Lock the Use Sop Path setting so the + # user doesn't accidentally enable it. + instance.parm("use_sop_path").lock(True) diff --git a/colorbleed/plugins/houdini/publish/collect_output_node.py b/colorbleed/plugins/houdini/publish/collect_output_node.py index a3f49761b9..d90898944f 100644 --- a/colorbleed/plugins/houdini/publish/collect_output_node.py +++ b/colorbleed/plugins/houdini/publish/collect_output_node.py @@ -5,7 +5,8 @@ class CollectOutputSOPPath(pyblish.api.InstancePlugin): """Collect the out node's SOP Path value.""" order = pyblish.api.CollectorOrder - families = ["*"] + families = ["colorbleed.pointcache", + "colorbleed.vdbcache"] hosts = ["houdini"] label = "Collect Output SOP Path" diff --git a/colorbleed/plugins/houdini/publish/validate_camera_rop.py b/colorbleed/plugins/houdini/publish/validate_camera_rop.py new file mode 100644 index 0000000000..bf09b26df4 --- /dev/null +++ b/colorbleed/plugins/houdini/publish/validate_camera_rop.py @@ -0,0 +1,41 @@ +import pyblish.api +import colorbleed.api + + +class ValidateIntermediateDirectoriesChecked(pyblish.api.InstancePlugin): + """Validate Camera ROP settings.""" + + order = colorbleed.api.ValidateContentsOrder + families = ['colorbleed.camera'] + hosts = ['houdini'] + label = 'Camera ROP' + + def process(self, instance): + + import hou + + node = instance[0] + if node.parm("use_sop_path").eval(): + raise RuntimeError("Alembic ROP for Camera export should not be " + "set to 'Use Sop Path'. Please disable.") + + # Get the root and objects parameter of the Alembic ROP node + root = node.parm("root").eval() + objects = node.parm("objects").eval() + assert root, "Root parameter must be set on Alembic ROP" + assert root.startswith("/"), "Root parameter must start with slash /" + assert objects, "Objects parameter must be set on Alembic ROP" + assert len(objects.split(" ")) == 1, "Must have only a single object." + + # Check if the object exists and is a camera + path = root + "/" + objects + camera = hou.node(path) + + if not camera: + raise ValueError("Camera path does not exist: %s" % path) + + if not camera.type().name() == "cam": + raise ValueError("Object set in Alembic ROP is not a camera: " + "%s (type: %s)" % (camera, camera.type().name())) + + diff --git a/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py b/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py index 1a83565d11..a66c6754be 100644 --- a/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py +++ b/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py @@ -6,7 +6,8 @@ class ValidateIntermediateDirectoriesChecked(pyblish.api.InstancePlugin): """Validate Create Intermediate Directories is enabled on ROP node.""" order = colorbleed.api.ValidateContentsOrder - families = ['colorbleed.pointcache'] + families = ['colorbleed.pointcache', + 'colorbleed.camera'] hosts = ['houdini'] label = 'Create Intermediate Directories Checked' diff --git a/colorbleed/plugins/houdini/publish/validate_output_node.py b/colorbleed/plugins/houdini/publish/validate_output_node.py index bb9eec508e..8a088afec9 100644 --- a/colorbleed/plugins/houdini/publish/validate_output_node.py +++ b/colorbleed/plugins/houdini/publish/validate_output_node.py @@ -13,7 +13,8 @@ class ValidateOutputNode(pyblish.api.InstancePlugin): """ order = pyblish.api.ValidatorOrder - families = ["*"] + families = ["colorbleed.pointcache", + "colorbleed.vdbcache"] hosts = ["houdini"] label = "Validate Output Node" @@ -39,10 +40,9 @@ class ValidateOutputNode(pyblish.api.InstancePlugin): # Check if type is correct type_name = output_node.type().name() - if type_name not in ["output", "cam"]: - cls.log.error("Output node `%s` is not an accepted type." - "Expected types: `output` or `camera`" % - output_node.path()) + if type_name != "output": + cls.log.error("Output node `%s` is not an `output` type node." + % output_node.path()) return [output_node.path()] # Check if output node has incoming connections