예제 #1
0
  /** @return The path of a node */
  private Path getNodePath(String nodeName) throws PipelineException {

    NodeID targetID = new NodeID(w.user, w.view, nodeName);
    NodeStatus targetStat = mclient.status(targetID);
    NodeMod targetMod = targetStat.getHeavyDetails().getWorkingVersion();
    if (targetMod == null)
      throw new PipelineException(
          "No working version of the Target Scene Node ("
              + nodeName
              + ") exists "
              + "in the ("
              + w.view
              + ") working area owned by ("
              + PackageInfo.sUser
              + ")!");

    Path targetPath;

    FileSeq fseq = targetMod.getPrimarySequence();
    String suffix = fseq.getFilePattern().getSuffix();
    if (!fseq.isSingle() || (suffix == null) || (!suffix.equals("ma") && !suffix.equals("mb")))
      throw new PipelineException("The target node (" + nodeName + ") must be a maya scene!");
    targetPath =
        new Path(PackageInfo.sProdPath, targetID.getWorkingParent() + "/" + fseq.getFile(0));

    // System.err.println("$WORKING"+nodeName+"."+suffix);
    return targetPath;
  } // end getNodePath(String)
예제 #2
0
  /**
   * Check that the user has properly selected a target node for this tool
   *
   * <p>
   *
   * @return The phase progress message or <CODE>null</CODE> to abort early.
   * @throws PipelineException If unable to validate the given user input.
   */
  public synchronized String collectPhaseInput() throws PipelineException {
    if (pPrimary == null) throw new PipelineException("Please select a node.");

    if (!pPrimary.matches(switchPattern))
      throw new PipelineException("This tool will only work on a switchLgt node!");

    File errFile;
    try {
      errFile = File.createTempFile("Dylanator.", ".err", PackageInfo.sTempPath.toFile());
      err = new PrintWriter(errFile);
      FileCleaner.add(errFile);
    } catch (IOException e) {
      e.printStackTrace();
    }

    NodeStatus status = pSelected.get(pPrimary);
    NodeID nodeID = status.getNodeID();
    pUser = nodeID.getAuthor();
    pView = nodeID.getView();

    //		OverallNodeState state = status.getDetails().getOverallNodeState();
    //		JToolDialog tool = new JToolDialog("Dylanator", new JPanel(), "Continue");
    //		if (!state.equals(OverallNodeState.Identical)) {
    //		JConfirmDialog dialog = new JConfirmDialog(tool,
    //		"This node is not identical to the checked in node.\n"
    //		+ "Using this tool could be a bad idea.\n Do you want to continue?");
    //		dialog.setVisible(true);
    //		if (!dialog.wasConfirmed()) {
    //		return null;
    //		}// end if
    //		}// end if

    return "...Oh Happy Day!";
  }
  /**
   * Check that the user has properly selected a target node for this tool
   *
   * <p>
   *
   * @return The phase progress message or <CODE>null</CODE> to abort early.
   * @throws PipelineException If unable to validate the given user input.
   */
  public synchronized String collectPhaseInput() throws PipelineException {
    if ((pPrimary == null) || (pSelected.size() != 1))
      throw new PipelineException("Please selected one node only.");

    // folder = nPath.getParent();
    // assetName = nPath.getName();
    Path nPath = new Path(pPrimary);
    nPath = nPath.getParentPath().getParentPath();

    if (!nPath.toString().matches(assetPattern))
      throw new PipelineException(
          "This tool only works on assets." + nPath.toString() + " " + nPath.toOsString());

    // if(!pPrimary.matches(matPattern))
    // throw new PipelineException("This tool will only work on a lgt node!");

    File errFile;
    try {
      errFile = File.createTempFile("MaterialsCheckOut", ".err", PackageInfo.sTempPath.toFile());
      err = new PrintWriter(errFile);
      FileCleaner.add(errFile);
    } catch (IOException e) {
      e.printStackTrace();
    }

    NodeStatus status = pSelected.get(pPrimary);
    NodeID nodeID = status.getNodeID();
    pUser = nodeID.getAuthor();
    pView = nodeID.getView();

    OverallNodeState state = status.getHeavyDetails().getOverallNodeState();
    JToolDialog tool = new JToolDialog("MaterialsCheckOut", new JPanel(), "Continue");
    if (!state.equals(OverallNodeState.Identical)) {
      JConfirmDialog dialog =
          new JConfirmDialog(
              tool,
              "This node is different from the checked in node. Do you want to continue with this check out?");
      dialog.setVisible(true);
      if (!dialog.wasConfirmed()) {
        return null;
      } // end if
    } // end if

    return "...Sing Hallelujah!";
  }