def process(self, context): # Workaround bug pyblish-base#250 if not contextplugin_should_run(self, context): return # test if we have environment set (redundant as this plugin shouldn' # be active otherwise). try: MUSTER_REST_URL = os.environ["MUSTER_REST_URL"] except KeyError: self.log.error("Muster REST API url not found.") raise ValueError("Muster REST API url not found.") # Load credentials try: self._load_credentials() except RuntimeError: self.log.error("invalid or missing access token") assert self._token is not None, "Invalid or missing token" # We have token, lets do trivial query to web api to see if we can # connect and access token is valid. params = {'authToken': self._token} api_entry = '/api/pools/list' response = self._requests_get(MUSTER_REST_URL + api_entry, params=params) assert response.status_code == 200, "invalid response from server" assert response.json()['ResponseData'], "invalid data in response"
def process(self, context): # Workaround bug pyblish-base#250 if not contextplugin_should_run(self, context): return invalid = self.get_invalid(context) if invalid: raise RuntimeError("Found invalid VRay Translator settings!")
def process(self, context): # Workaround bug pyblish-base#250 if not contextplugin_should_run(self, context): return layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True) cameras = cmds.ls(type="camera", long=True) renderable = any(c for c in cameras if cmds.getAttr(c + ".renderable")) assert renderable, ("Current render layer '%s' has no renderable " "camera" % layer)
def process(self, context): # Workaround bug pyblish-base#250 if not contextplugin_should_run(self, context): return deadline_url = (context.data["system_settings"]["modules"]["deadline"] ["DEADLINE_REST_URL"]) # Check response response = self._requests_get(deadline_url) assert response.ok, "Response must be ok" assert response.text.startswith("Deadline Web Service "), ( "Web service did not respond with 'Deadline Web Service'")
def process(self, context): """Inject the current working file""" # Workaround bug pyblish-base#250 if not contextplugin_should_run(self, context): return user = deadline_command("GetCurrentUserName").strip() if not user: self.log.warning("No Deadline user found. " "Do you have Deadline installed?") return self.log.info("Found Deadline user: {}".format(user)) context.data['deadlineUser'] = user
def process(self, context): # Workaround bug pyblish-base#250 if not contextplugin_should_run(self, context): return try: DEADLINE_REST_URL = os.environ["DEADLINE_REST_URL"] except KeyError: self.log.error("Deadline REST API url not found.") raise ValueError("Deadline REST API url not found.") # Check response response = self._requests_get(DEADLINE_REST_URL) assert response.ok, "Response must be ok" assert response.text.startswith("Deadline Web Service "), ( "Web service did not respond with 'Deadline Web Service'" )