diff --git a/pype/plugins/nukestudio/publish/collect_clips.py b/pype/plugins/nukestudio/publish/collect_clips.py index 94ec72a2ed..5625a471dc 100644 --- a/pype/plugins/nukestudio/publish/collect_clips.py +++ b/pype/plugins/nukestudio/publish/collect_clips.py @@ -57,19 +57,28 @@ class CollectClips(api.ContextPlugin): self.log.debug( "__ assets_shared: {}".format( context.data["assetsShared"])) - match_range = next( + + # Check for clips with the same range + # this is for testing if any vertically neighbouring + # clips has been already processed + clip_matching_with_range = next( (k for k, v in context.data["assetsShared"].items() if (v.get("_clipIn", 0) == clip_in) and (v.get("_clipOut", 0) == clip_out) ), False) - if asset in str(match_range): - match_range = False + # check if clip name is the same in matched + # vertically neighbouring clip + # if it is then it is correct and resent variable to False + # not to be rised wrong name exception + if asset in str(clip_matching_with_range): + clip_matching_with_range = False - assert (not match_range), ( + # rise wrong name exception if found one + assert (not clip_matching_with_range), ( "matching clip: {asset}" " timeline range ({clip_in}:{clip_out})" - " conflicting with {match_range}" + " conflicting with {clip_matching_with_range}" " >> rename any of clips to be the same as the other <<" ).format( **locals()) diff --git a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py index 0cb7e7f56a..38040f8c51 100644 --- a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py +++ b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py @@ -74,21 +74,25 @@ class CollectHierarchyInstance(pyblish.api.ContextPlugin): # and finding only hierarchical tag if "hierarchy" in t_type.lower(): - # check if any clip with the same clip range - # is alerady in asset shared so + # Check for clips with the same range + # this is for testing if any vertically neighbouring + # clips has been already processed match = next(( k for k, v in assets_shared.items() if (v["_clipIn"] == clip_in) and (v["_clipOut"] == clip_out) ), False) - self.log.warning("Clip matching name: {}".format(match)) self.log.debug( "__ assets_shared[match]: {}".format( assets_shared[match])) - # check if hierarchy key is in match + + # check if hierarchy key is present in matched + # vertically neighbouring clip if not assets_shared[match].get("hierarchy"): match = False + + # rise exception if multiple hierarchy tag found assert not match, ( "Two clips above each other with" " hierarchy tag are not allowed"