Exemple #1
0
    def publish_content_hda(self, node):
        node_name = node.type().name()
        index = node_name.rfind('_')
        asset_name = node_name[:index]
        department = node_name[index + 1:]

        self.body = Project().get_body(asset_name)
        src = node.type().definition().libraryFilePath()
        user = Environment().get_user()

        comment = "publish by " + str(
            user.get_username()) + " in department " + str(department)

        self.publish_src_node_to_department(src, node, department, user,
                                            comment)

        success_message = "Success! Published " + asset_name + " to " + str(
            department)
        self.print_success_message(success_message)
Exemple #2
0
    def shot_results(self, value):
        chosen_asset = value[0]

        project = Project()
        self.body = project.get_body(chosen_asset)

        department = Department.LIGHTING
        element = self.body.get_element(department)  #, Element.DEFAULT_NAME)

        hou.hipFile.save()
        src = hou.hipFile.name()

        #Publish
        user = Environment().get_user()
        comment = "publish by " + str(
            user.get_username()) + " in department " + str(department)
        dst = self.publish_element(element, user, src, comment)

        message = "Successfully published " + str(self.body.get_name()) + "!"
        self.print_success_message(message)