def results(self, value): type = value[0] name = self.name # determine if asset was created or not. created = True if name is None or type is None: created = False if created: project = Project() body = project.create_asset(name, asset_type=type) if body == None: # print a message about failure/duplicate qd.error("Asset with name " + name + " already exists in pipeline.") else: assembler = Assembler() assembler.create_hda(name, body=body) qd.info("Asset created successfully.", "Success") else: qd.error("Asset creation failed.")
def results(self, value): type = value[0] name = self.name # determine if asset was created or not. created = True if name is None or type is None: created = False if created: project = Project() body = project.create_asset(name, asset_type=type) if body == None: # print a message about failure/duplicate qd.error("Asset with name " + name + " already exists in pipeline.") elif self.type == AssetType.SHOT: qd.info("Asset created successfully.", "Success") else: if self.type == AssetType.SET: # create whole_set.json setPath = os.path.join(Project().get_assets_dir(), str(name), "model", "main", "cache", "") exporter = JSONExporter() exporter.createWholeSetJSON(setPath) assembler = Assembler() assembler.create_hda(name, body=body) qd.info("Asset created successfully.", "Success") else: qd.error("Asset creation failed.")
def results(self, value): type = value[0] name = self.name # determine if asset was created or not. created = True if name is None or type is None: created = False if created: scene_file, new_file = get_scene_file() print("scene file, new file: ", scene_file, new_file) check_unsaved_changes() project = Project() body = project.create_asset(name, asset_type=type) if body == None: # print a message about failure/duplicate qd.error("Asset with name " + str(name) + " already exists in pipeline.") else: prepare_scene_file(body=body) department = "model" asset_list = body.list_elements(department) selected_element = body.get_element(department) user = Environment().get_user() print("name :", str(name)) print("department: ", department) setPublishEnvVar(name, department) post_publish(selected_element, user, self.export, published=True, comment="First publish!") qd.info("Asset created successfully!", "Success") else: qd.error("Asset creation failed.")
def results(self, value): type = value[0] name = self.name # determine if asset was created or not. created = True if name is None or type is None: created = False if created: project = Project() body = project.create_asset(name, asset_type=type) if body == None: # print a message about failure/duplicate qd.error("Asset with name " + str(name) + " already exists in pipeline.") else: prepare_scene_file() # show the gui, get the element. To list elements, get the body and get the department department = "model" # hard-coding model for now since this is Maya asset_list = body.list_elements(department) # get the element for the model dept and the user, and using that publish selected_element = body.get_element("model") user = Environment().get_user() post_publish( selected_element, user, published=True, comment="First commit." ) # FIXME: WE NEED TO FIGURE OUT TO WHICH DEPARTMENT(S) WE ACTUALLY NEED TO PUBLISH TO qd.info("Asset created successfully!", "Success") else: qd.error("Asset creation failed.")