ChatGPT + Blender is MADNESS

I am dumbfounded, completely impressed, and a little scared
I thought I’d ask ChatGPT this:

write a custom panel in python for Blender that includes a button to duplicate an object, a button to deselect all objects, and a button to select the scene’s active camera

It’s verbatim immediate response:

Here is an example of a custom panel in Blender that includes buttons to duplicate an object, deselect all objects, and select the scene’s active camera:

import bpy

class CustomPanel(bpy.types.Panel):
    """A custom panel in the Object properties window"""
    bl_label = "Custom Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    def draw(self, context):
        layout = self.layout

        obj = context.object

        row = layout.row()
        row.label(text="Active object is: " + obj.name)
        row = layout.row()
        row.operator("object.duplicate_move")
        row = layout.row()
        row.operator("object.select_all", text="Deselect All").action = 'DESELECT'
        row = layout.row()
        row.operator("object.select_camera")

def register():
    bpy.utils.register_class(CustomPanel)

def unregister():
    bpy.utils.unregister_class(CustomPanel)

if __name__ == "__main__":
    register()

And the result when I ran in Blender (no errors and all buttons work):

image

This is crazy, and of course some of the prompts I gave resulted in scripts with some errors, but for the most part this one is flawless. And it even gives a readout of the selected object as a label, which I didn’t ask for, but with the buttons here, this is contextually appropriate in my opinion.

I even tried some prompts for UPGBE with some success. When I pushed it to “create a grappling hook mechanic for a first-person game using UPBGE python”. I got more errors, but insane that it could even theorize how to do this, and the result helped me get on the right direction.

I’ve seen a lot of this online for C# coding, but not much for blender, and I have not seen anyone create a panel with it yet.

Thoughts? Scared yet?

5 Likes

That is pretty impressive. I am still curious how the ethical/legal quandary of a robot reading other peoples code, then essentially copying it on a molecular level will pan out long term, but it’s pretty amazing what “AI” can do.

2 Likes

Yes, this is a huge debate, and will only get more and more important in coming years. I love the idea of using it as a learning tool, but it really cheapens the process kills creativity when AI ‘creates’ for you. Especially on the art-side, like AI Image Generation.

Also concerned for students using this type of thing to cheat the learning process, but maybe I’m just jaded because I didn’t have this in college.

1 Like

One more step toward humans becoming simple consumers encased in a bubble of digital delight like in Wall-E (though it remains to be seen if the flying chairs become reality as well). It is either that or we trap ourselves in an endless cycle of fantastical play and no work within the Metaverse (in which the aim of some companies is to turn The Matrix or Ready Player One into scientific fact).

1 Like

I think it is a fantastic tool to help/assist wannabe developers (but also experienced ones) write their Blender add-ons.
It’s also kind of bluffing to be able to “chat” with a bot to get tips or answers about coding (and GPT-4 will probably go a step further about the interaction between the user and the bot).

I am a bit less worried about the license issues when ChatGPT generates Blender scripts. Mostly because even if its dataset is based on several sources (from internet), it’s very likely that it reuses code (Blender scripts) published on GitHub or StackExchange (or elsewhere). But since all Blender Python scripts must be released under the GPL license (which allows anyone to read, reuse, modify, copy the source code), I think that using ChatGPT for this task (in this case, to write Blender scripts) is probably fine.

1 Like

That’s pretty good.

It looks promising to me because while I’m a programmer, I don’t know Python and have stayed away from scripting in Blender because I don’t have time to acquire that skill right now – looks like AI can do some of the simple things I’d like to script, which would be great. It also looks like it might be quite some help in learning to code.

Because you asked: it doesn’t scare me more than I was already, but then I am long past the age of basic coding, and something like this will not be driving me out of a job. My general level of worry is pretty much sky-high already because I don’t trust humans to be sensible in reaction to existential threats.

Not gonna further discuss AI vs humans or the legal aspects here since we already have several threads for that, and it just makes more work for the mods (since AI is apparently not yet capable of sensibly herding us cats).

1 Like

I’m looking forward to the inevitable flood of posts here from complete novices asking for help with their 5000 line ai-generated monstrosities.

2 Likes

Yeah, the problem with drawing from the Blender addon code base is that there’s a lot of half baked, non-functional garbage floating around GitHub. I’ve already seen several instances of AI-generated Blender Python that doesn’t work being enthusiastically shared here and on StackExchange, but to be fair people did that before AI generation as well :wink:

Demand for scrips, apps, plugins, addons and others raise the programmers value. AI generated script will help all kind of professionals but eventually will also cap their salaries. Researchers that developed deserve congratulations, yet I believe should at least exist a reference to credit people since AI works on a database, or a paid option, similar to social media system, that invites programmers to be part of their database to create ‘content’. This is a very polemic topic and some affected digital artists already began posting against it in ArtStation.

2 Likes

So if we flooded the internet with garbage, ChatGPT can be neutered before it takes off?

Does anyone have any garbage art from their early days for Midjourney’s AI database to pick up?

I think it will be a fantastic tools as a teaching / coding assistant. Emphasis on tool.
We’re witnessing what people witnessed during the eighties / nineties when computers took over the world.There is no going back, and if you try to fight it you’ll be left behind, sorry. How many architects still draw their designs on a drawing board ? How many accountants are still using a paper ledger ?
I’ve already used it successfully a couple of times for simple prompts when stack exchange doesn’t immediately yield a convincing result. Of course it also threw some garbage in my way, but so do humans when prompted for an answer, and so do I when I try new ideas.

Of course we’ll get a swathe of newbies asking us to fix their AI generated code, and it will be a new challenge for us, but in doing so we’ll embark a whole new generation of brethren programmers. Yay !

Here’s an interesting read about the current limitations of this tool https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned

Personnally I see two reasons why SO would ban it, one because it confidently generates garbage answers which look like they work, and two because it is a serious competitor to their entire ecosystem.

Your job won’t go away. But you need to be willing to learn to use a new tool. Very much like the most skilled midjourney artists need to learn a whole new language to generate good images from their prompts, we’ll need to learn how to get good results from this tool.

Remember, this is just the beginning. In a few months (weeks ?) time the “AI” will generate UV unwrapped believable 3D models, LOD included. We need to be ready to leave some space in our workflow for these tools.

1 Like

Yeah, these AIs would be completely incapable of doing anything if they weren’t trained on billions of man-hours of copyrighted human labor.

The AI art generators don’t even have a style of their own: To get good output, you need to specify in the prompt which artists you want them to plagiarize.

The creators of the AIs claim “fair use”, but if you look at the four factors that determine fair use, I don’t think that defense flies (especially “the effect of the use upon the potential market for or value of the copyrighted work”).

Open source code still has requirements. GPL requires that you provide attribution and license your code under the same license as the original. BSD/MIT code requires attribution. If you copy BSD-licensed code and don’t include the original license and author information, you are violating their copyright.

Clean-room design exists to make sure that no amount of creative content from the original is being copied.

4 Likes

The crazy thing is, if the script throws errors in Blender, you can just copy/past the error from the python console into ChatGPT, and it will try to fix the script based on that. Sometimes it takes a few iterations of copy/pasting errors until a script works. And since it’s a a “chat”, it always remembers the previous discussion, so you can just tell him to do that instead of that, add a variable instead of a hardcoded value, etc.

It’s already absolutely mind-blowing, and it’s still in its infancy.

4 Likes

I talked to Bing for couple of hours and he did a small script for me that adds arches to selected edges. I don’t know Python or any other language.

You have to be pretty precise in what you ask it. It sometimes stops printing the answer when the code becomes too long. There’s also character limit for user, so at some point it becomes impossible to paste it in its entirety. But you can just tell Bing that you’ll paste it in parts, and he’ll review it no problem.

Couple of weeks ago I tried to do the same in ChatGPT but with less luck. I don’t know if it’s that recent upgrade from GPT 3 to 4 or maybe the fact that Bing can browse Internet. It didn’t seem to look for answers on the web. When it does it typically prints links to websites.

The script is not perfect, It can create some zero area faces. I wanted to add more advanced features, but it gets harder.

add_arches_to_selected_edges.txt (3.9 KB)

1 Like

Greetings. I recently became a fan of ChatGPT in the Visual Basic world, and then saw a YouTube video about using it for python. So, I searched BA, and found this thread…

In 1976, I was told by the university that accepted me that I would need a calculator. I thought that would be cheating, however… just like in this case, you have to understand what you’re doing with a tool to arrive at the right answer.

1 Like

Recently I received an email from CGtrader saying that they have changed their default license to allow sales to companies using the models for AI training.

If you do not agree you have to opt out.

I am not scared but I do not earn a living from it.

So they’re prepping their business model for designers and artists to allow CGT to efficiently provide content to people, so that they will no longer need the services of designers and artists.

CGtrader is now on the list of vendors we’ll completely avoid doing business with.

2 Likes

When you see your neighbors beard on fire, wet yours!

Also they do not realize that they won’t need CGtrader either.

Oh and see this:

I wonder how they train their AI
:thinking:

2 Likes