How I build a Maya Yeti Tool with ChatGPT

I would love to share a positive experience I had while interacting with ChatGPT regarding its responsiveness and helpfulness.

For context, I am currently working on a project using Yeti – a grooming system from Peregrine Labs. While going through the Yeti, I came across a command frequently used to identify hair that is too close together or overlapping, and I decided to create a UI for it to make it easier to use. This is the result after only 15 minutes of interacting with chatGPT.

Source code:

import maya.cmds as cmds
import maya.mel as mel

# Define the function that runs the Yeti command
def run_yeti_command(*args):
    yeti_node_name = cmds.textField(yeti_node_name_field, query=True, text=True)
    remove_duplicates_value = cmds.floatField(min_distance_field, query=True, value=True)
    yeti_command = 'pgYetiCommand -removeDuplicates {} "{}";'.format(remove_duplicates_value, yeti_node_name)
    mel.eval(yeti_command)

# Define the function that sets the name of the selected object in the Yeti node name field
def set_selected_object_name(*args):
    selected = cmds.ls(selection=True)
    if selected:
        selected_name = selected[0] + "Shape"
        cmds.textField(yeti_node_name_field, edit=True, text=selected_name)

# Create the UI window
window = cmds.window(title="Yeti Command", sizeable=False, menuBar=True)

# Create a layout for the UI
layout = cmds.columnLayout(columnAlign="center", adjustableColumn=True)

# Create a text label for the removeDuplicates value
cmds.text(label="Minimum Distance:", font="boldLabelFont")

# Create a float field for the removeDuplicates value
min_distance_field = cmds.floatField(value=0.1, step=0.01, precision=2, width=120)

# Create a text field for the Yeti node name
cmds.separator(height=10)
cmds.text(label="Yeti Node Name:", font="boldLabelFont")
yeti_node_name_field = cmds.textField(width=200)

# Create a button that sets the name of the selected object in the Yeti node name field
cmds.separator(height=20)
set_selected_button = cmds.button(label="Set Selected Object Name", width=200, height=30, command=set_selected_object_name)

# Create a button that executes the given Python function
button = cmds.button(label="Run Yeti Command", width=200, height=50, command=run_yeti_command)

# Add padding to the layout
cmds.separator(height=10, style="none")

# Show the UI window
cmds.showWindow(window)

My initial idea was to develop a mini tool with a simple user interface to streamline this process. However, I was unsure if ChatGPT could understand my entire idea through a complete Design Document, so I opted to describe each step in detail.

The initial command from Yeti Peregrine Labs’s Documents

I often create small tools to help solve and speed up my own work as well as team members, the results achieved after only 15 minutes for me were truly amazing. If I do it myself, even writing a small tool takes at least a hour. I hate having to deal with the code for the UI part. This part is really time consuming for me.

In daily work, I usually work directly with the dev team to provide accurate requirements for the tools they need to build. Chatting alternately with ChatGPT to create a tool with it is really similar to the feeling of working directly with the dev team

On the technical aspect of my personal use. ChatGPT, although it looks easy to use, is not. Currently, ChatGPT still has many errors, for example:

  • When I request to write dual languages or require access to non-popular libraries such as MEL or Yeti API, it still needs to be corrected.
  • There are often misunderstandings in the requests. If you do not divide the problem small enough, the chat session will become very bad and you can hardly continue the conversation.
  • In this case I encountered was when I asked ChatGPT to make me a nicer UI version. It was wrong and a few times after that, I couldn’t continue to fix it. The solution is to take all the code from the error-free time and start a new conversation.
  • ChatGPT does not have a mechanism to admit when it does not know or gives false information. So most of the time it handles the problem in a “slash” way with a way of talking like it’s an expert. This makes it difficult to find the wrong action in a combination of both its right and wrong.
  • It would be much better if chatGPT could allow users to track back to the wrong data source of the model. This needs the AI itself to know well what it says is true or not. We can ask it back in the form of “how much of the information just given is correct?”, “Where did the wrong information come from?” or a way to remove a wrong learning step like “remove the information of the most recent message from short-term memory”

In conclusion, my experience with ChatGPT has been fascinating, and I’m excited to explore more of its capabilities in the future. The AI technology is continuously improving, I believe that with the right approach, it can be an excellent tool for many industries, including software development, customer service, and education. I’m not sure I’m using it properly, if you know a better way let me know. I look forward to seeing how ChatGPT and other AI models will advance and enhance our work.

What do you think about this topic? I’d love to hear your perspective in the comments below.

1 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x