Exemplo n.º 1
0
    def post_reference(self, value):
        assets = value
        asset_filepaths = []

        # TODO: add crowd cycle capability
        crowd = False  # qd.yes_or_no("Are you referencing a crowd cycle?")

        if crowd:
            self.reference_crowd_cycle(asset_filepaths)
        else:

            for asset in assets:
                body = self.project.get_body(asset)

                model = qd.binary_option("Which department for " + str(asset) + " ?", "Model", "Rig", title="Select department")

                if model:
                    department = "model"
                else:
                    department = "rig"

                element = body.get_element(department)
                publish = element.get_last_publish()

                if publish:
                    filepath = publish[3]
                    asset_filepaths.append(filepath)

                else:
                    qd.warning("No publish exists for " + str(asset) + " in " + str(department) + ". Skipping.")

            print("files for reference: ", asset_filepaths)
            self.reference_asset(asset_filepaths)
Exemplo n.º 2
0
    def tag(self):
        response = qd.binary_option("Add Alembic tag to:\n" + str(self.selected_string), "Yes", "No", title='Add Alembic Tag')

        if response:
            for node in self.selected:
                tag_node_with_flag(node, "DCC_Alembic_Export_Flag")

            qd.info("tag successful!")
Exemplo n.º 3
0
    def untag(self):
        response = qd.binary_option("Remove Alembic tag from:\n" + str(self.selected_string), "Yes", "No", title='Remove Alembic Tag')

        if response:
            for node in self.selected:
                untag_node_with_flag(node, "DCC_Alembic_Export_Flag")

            qd.info("untag successful!")
Exemplo n.º 4
0
    def get_element_option(self, type,
                           body):  # FIXME: this would go better in Body()
        element = None

        if type == AssetType.PROP:
            element = body.get_element("model")
            self.department = "model"

        elif type == AssetType.ACTOR:
            response = qd.binary_option(
                "Which department for " + str(body.get_name()) + "?", "model",
                "rig")
            if response:
                element = body.get_element("model")
                self.department = "model"
            elif response is not None:
                element = body.get_element("rig")
                self.department = "rig"
            else:
                return None

        elif type == AssetType.SET:
            element = body.get_element("model")
            self.department = "model"

        elif type == AssetType.SHOT:
            response = qd.binary_option(
                "Which department for " + str(body.get_name()) + "?", "model",
                "anim")
            if response:
                element = body.get_element("model")
                self.department = "model"
            elif response is not None:
                element = body.get_element("anim")
                self.department = "anim"
            else:
                return None

        print("element: ", element)

        return element
Exemplo n.º 5
0
    def post_reference(self, value):
        assets = value
        asset_filepaths = []

        # TODO: add crowd cycle capability
        crowd = False  # qd.yes_or_no("Are you referencing a crowd cycle?")

        if crowd:
            self.reference_crowd_cycle(asset_filepaths)
        else:

            for asset in assets:
                body = self.project.get_body(asset)

                # TODO: change the choice to depend more on each individual asset. I.e. only ask model or rig for actors. Otherwise it's always going to be model.
                type = body.get_type()
                if type == AssetType.ACTOR:
                    model = qd.binary_option("Which department for " +
                                             str(asset) + "?",
                                             "Model",
                                             "Rig",
                                             title="Select department")
                else:
                    model = True

                if model:
                    department = "model"
                elif model is not None:
                    department = "rig"
                else:
                    qd.warning("Skipping " + str(asset))
                    continue

                element = body.get_element(department)
                filepath = element.get_app_filepath()

                if filepath:
                    asset_filepaths.append(filepath)

                else:
                    qd.warning("No publish exists for " + str(asset) + " in " +
                               str(department) + ". Skipping.")

            print("files for reference: ", asset_filepaths)
            self.reference_asset(asset_filepaths)