Giter Site home page Giter Site logo

blendergpt's Introduction

BlenderGPT

Header

Blender can be controlled using program scripts written in Python. Recent Large Language Models like OpenAI's GPT-4 can generate these Python scripts from simple English and execute them. This plugin provides an easy to use interface that integrates OpenAI's GPT-4/GPT-3.5 right in the UI, allowing you to use natural language commands to control Blender.

Note

Access to GPT-4 in this addon can ONLY be obtained through the OpenAI waitlist (https://openai.com/waitlist/gpt-4-api), which in turn grants your account access to this model via the API.

GPT-4 access via the API is different from GPT-4 access via ChatGPT-Plus ($20/month subscription). This addon will only work with GPT-4 if you have been accepted into the waitlist (https://openai.com/waitlist/gpt-4-api) and have access to the API via your OpenAI API key

Installation

  1. Clone this repository by clicking Code > Download ZIP on GitHub
  2. Open Blender, go to Edit > Preferences > Add-ons > Install
  3. Select the downloaded ZIP file and click Install Add-on
  4. Enable the add-on by checking the checkbox next to GPT-4 Blender Assistant
  5. Paste your OpenAI API key in the Addon preferences menu.
  6. To view the code generations in realtime, go to Window > Toggle System Console

Usage

  1. In the 3D View, open the sidebar (press N if not visible) and locate the GPT-4 Assistant tab
  2. Type a natural language command in the input field, e.g., "create a cube at the origin"
  3. Click the Execute button to generate and execute the Blender Python code

Requirements

Demonstration

GPT-4.Blender.Demo.mov

blendergpt's People

Contributors

flipphillips avatar gd3kr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blendergpt's Issues

I am not a Dev I'm not sure what's happening so I"ll paste the code here. Thank you!

Read prefs: C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\config\userpref.blend
reloading addon: BlenderGPT-main 1679702816.4737766 1679703196.22019 'C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\init.py'
Modules Installed () from 'D:\BlenderGPT-main.zip' into 'C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons'
Warning: 1 x Draw window and swap: 6.9263 ms, average: 6.92630000 ms
Traceback (most recent call last):
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 91, in generate_blender_code
response = openai.ChatCompletion.create(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model: gpt-4 does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 236, in execute
blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 98, in generate_blender_code
response = openai.ChatCompletion.create(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 682, in interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.
Error: Python: Traceback (most recent call last):
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init
.py", line 91, in generate_blender_code
response = openai.ChatCompletion.create(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model: gpt-4 does not exist

The model: `gpt-4` does not exist

I'm getting this error on Blender v3.4.1 with a paid account I just opened with 0 usage. (It's a "Plus" ChatGPT account with billing tied to the openAI organization as well).

GPT-4:
Error: Python: Traceback (most recent call last):
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 174, in execute
blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history, context, system_prompt)
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\utilities.py", line 51, in generate_blender_code
response = openai.ChatCompletion.create(
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model: gpt-4 does not exist

GPT-3.5:
Error: Python: Traceback (most recent call last):
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 174, in execute
blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history, context, system_prompt)
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\utilities.py", line 51, in generate_blender_code
response = openai.ChatCompletion.create(
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "C:\Users\Brian\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

Copy or edit prompts

Thanks for this great plugin.

I'd like to be able to to go back and edit or copy an earlier prompt to tweak and re-run it, or to remove a single entry from the history. Is this doable? Thanks

Conflicts with other Blender add-ons

BlenderGPT/utilities.py

Lines 31 to 32 in 1ba2316

bpy.types.PropertyGroup.type = bpy.props.StringProperty()
bpy.types.PropertyGroup.content = bpy.props.StringProperty()

This code sets a custom property of "type" "content" for a PropertyGroup. However, this causes all classes that inherit from this PropertyGroup to have "type" "content" replaced with a StringProperty. Since "type" "content" is a common name and may be used for other purposes besides StringProperty, this implementation is prone to conflicts with other add-ons in Blender. Therefore, it would be necessary to fix this implementation.

The model: `gpt-4` does not exist

Python: Traceback (most recent call last):
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 174, in execute
    blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history, context, system_prompt)
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\utilities.py", line 51, in generate_blender_code
    response = openai.ChatCompletion.create(
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 619, in _interpret_response
    self._interpret_response_line(
  File "C:\Users\Laptop\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 682, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model: `gpt-4` does not exist

**System Information**
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.17

**Blender Version**
Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: `rBa95bf1ac01be`
Worked: (newest version of Blender that worked as expected)

No module named 'openai.object_classes'

Python: Traceback (most recent call last):
File "C:\Users\andre\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 174, in execute
blender_code = generate_blender_code(self.natural_language_input)
File "C:\Users\andre\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main_init_.py", line 109, in generate_blender_code
for event in response:
File "C:\Users\andre\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT\lib\openai\api_resources\abstract\engine_api_resource.py", line 167, in
File "C:\Users\andre\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT\lib\openai\util.py", line 132, in convert_to_openai_object
File "C:\Users\andre\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT\lib\openai\util.py", line 96, in get_object_classes
ModuleNotFoundError: No module named 'openai.object_classes'

Report: Error

When i type in a prompt this will happen. Any Ideas what I'm doing wrong? Thank You!

Bildschirmยญfoto 2023-03-22 um 12 29 38

Add Option to Choose Model: ChatGPT Turbo vs GPT-4

Currently, the default model is GPT-4, which is slower and more expensive than other available models. In my experience, ChatGPT Turbo performs comparably for various tasks but at a fraction of the cost (10x cheaper) and with significantly faster response times.

I propose adding an option for users to choose their preferred AI model when using the add-on. This feature will enable users to select between ChatGPT Turbo and GPT-4, depending on their needs and budget. By providing this choice, users can optimize their experience based on speed, cost, and performance considerations.

ไธ€็›ดๆ˜พ็คบๆŠฅๅ‘Š้”™่ฏฏ๏ผŒๅฏไปฅๅธฎๅฟ™็œ‹ไธ€ไธ‹ๅ—

returm self.urlopen(
File "C:\Program Files\Blender Foundation\Blender 3.13. lIpython\Vib\site packageslurllib3\connectionpool.py", line 813, in urlopen
returm self.urlopen(
File "C:\Program Files\Blender Foundation\Blender 3.1\3. 1lpythonN\iblsite-packageslurlib3\connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "C:Program Files\Blender FoundationBlender 3.13.1pythonNibisite pacasuliblutiretry ,py", line 592, in increment
raise MaxRetryError(. pool, url, error or ResponseError(cause))
urlib3.exceptions. MaxRetryError: HTTPSConnectionPool(host= api.openai.com', port=443): Max retries exceeded with url: /N1/chat/completions (Caused by SSLError(SSL EOFError(8, 'EOF occurred in violation of protocol ( sl.9979))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\pcAppData\RoamingBlender Foundation\Blender\3. 1lscripts\addons\BlenderGPT-mainliblopenailapi requestor,py", line 516, in request raw
result =. thread context.session.request(
File "C:\Program Files\Blender Foundation\Blender 3.1\3.1python\ibsite packageslrequests\sessions.py", line 529, in request
resp = slf.sendiprep. *send kwargs)
File "C:Program FilesBlender Foundation\Blender 3.13.1pythonlibsite packageslrequestslsessions.py", line 645, in send
r= adapter send(request, **kwargs)
File "C:Program Files\Blender Foundation\Blender 3.13.1pthonibisitepackageslrequests\adapters.py", line 517, in send
raise SSL Erorle, request-request)
requests. exceptions .SSL Error: HTTPSConnectionPoo(host= api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSL Err(SSL EOFError(8, 'EOF occurred in violation of protocol ( sl,.99))))
The above exception was the direct cause of the fllowing exception:
Traceback (most recent call last):
File "C:\Users\pcAppData\Roaming\Blender Foundation\Blender\3.1lscripts\addons\BlenderGPT-main
init_ .py", line 236, in execute
blender. code = generate. blender code(context.scene gpt4 chat input, context.scene.gpt4 _chat history)
File "C:\Users\pcAppData\Roaming\Blender Foundation\Blender\3. lscripts\addons\BlenderGPT-main_ init .py", line 98, in generate blender. code
File "C:Users\pclAppDatalRoaminglBlender Foundation\Blendern3.1lscriptsladdons\BlenderGPT-mainliblopenalapi resourceslchat completion.py", line 25, in create
returm super().create(*args, **kwargs)
File "C:lUsers)pcCAppDatalRoaminglBlender Foundation\Blenden3.1scriptsladdons)BlenderGPT-mainlibopenalapi resourceslabstractengine. api resource.py", line 153, in create
response, , api key = requestor.request(
File "C:\Users\pclAppDatalRoaming\Blender Foundation\Blender\3. lscriptsaddons\BlenderGPT-mainliblopenaiapi requestor.py", line 216, in request
result = self.request raw(
File "C:\Users\pcAppData\Roaming\Blender Foundation\Blender\3. lscripts\addons\BlenderGPT-mainViblopenailapi requestor.py", line 528, in request raw
raise er.APlConnectionError(
openaierror.APlConnectinError: Error communicating with OpenAl: HTTPSConnectionPool(host= api.openai.com, port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSL EOFError(8, 'EOF occurred in violation of protocol ( sl.c99))
location: :-1

Does this require chat gpt-4 access in order to work?

I'm getting this error when I attempt.

Python: Traceback (most recent call last): File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/__init__.py", line 91, in generate_blender_code response = openai.ChatCompletion.create( File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_resources/abstract/engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 226, in request resp, got_stream = self._interpret_response(result, stream) File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 619, in _interpret_response self._interpret_response_line( File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 682, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: The model: gpt-4` does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/init.py", line 236, in execute
blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history)
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/init.py", line 98, in generate_blender_code
response = openai.ChatCompletion.create(
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/Users/codybrown/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.
`

Plane" not found

Create a tower of 50 spheres falling from 10 meters, the size of 1 m, which from the impact on the origin crumbles into individual spheres.

Failed to generate Blender Python code
Error executing generated code: 'bpy_prop_collection[key]: key "Plane" not found'
Error executing generated code: Converting py args to operator properties: : keyword "size" unrecognized

Error: Not freed memory blocks: 26145, total unfreed memory 8.857952 MB

Using the program code, I tried to create blender scripts. I was unable to run it on Windows due to a number of library problems. Upon switching to Linux OS, the libraries problem was resolved, but I received an error message "Error: Not freed memory blocks: 26145, total unfreed memory 8.857952 MB".

How can this be resolved?

syntax error?

Appears to be functioning now, but with lengthy sequences of words, such as the example you showcased on Twitter, it eventually gives this error:

"Error executing generated code: invalid syntax (, line 1)"

The line:
"Create a rigid body physics demo with a tower of 50 1x1x1 cubes 5 meters above a 20x20 plane"

Any clue what could be the issue?

Plan and Billing

Quite possible because I have no Pro account, I cannot make a request. But there seems like no "free quota" at OpenAI.

Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/__init__.py", line 53, in generate_blender_code
    response = openai.ChatCompletion.create(
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_requestor.py", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_requestor.py", line 619, in _interpret_response
    self._interpret_response_line(
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_requestor.py", line 682, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model: `gpt-4` does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/__init__.py", line 146, in execute
    blender_code = generate_blender_code(self.natural_language_input)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/__init__.py", line 65, in generate_blender_code
    response = openai.ChatCompletion.create(
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_requestor.py", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_requestor.py", line 619, in _interpret_response
    self._interpret_response_line(
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/BlenderGPT-main-2/lib/openai/api_requestor.py", line 682, in _interpret_response_line
    raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

Allow a new query in case of error

IF there is a query error (e.g. quota exceeded), I see no way to run another query without closing Blender. Please report the error and add a new "query" line to the tool pane.

Error when using BlenderGPT with a proxy

Hello,

I am using the BlenderGPT plugin and encountered an error when trying to use it with a proxy. Here is the error message:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connectionpool.py", line 700, in urlopen
    self._prepare_proxy(conn)
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connectionpool.py", line 994, in _prepare_proxy
    conn.connect()
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connection.py", line 364, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connection.py", line 501, in _connect_tls_proxy
    socket = ssl_wrap_socket(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\ssl.py", line 512, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\ssl.py", line 1070, in _create
    self.do_handshake()
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\ssl.py", line 1341, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\requests\adapters.py", line 440, in send
    resp = conn.urlopen(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connectionpool.py", line 813, in urlopen
    return self.urlopen(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connectionpool.py", line 813, in urlopen
    return self.urlopen(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\urllib3\util\retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 516, in request_raw
    result = _thread_context.session.request(
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\requests\sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\requests\sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\requests\adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)')))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\__init__.py", line 174, in execute
    blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history, context, system_prompt)
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\utilities.py", line 51, in generate_blender_code
    response = openai.ChatCompletion.create(
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\lib\openai\api_resources\chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 216, in request
    result = self.request_raw(
  File "C:\Users\qizhi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 528, in request_raw
    raise error.APIConnectionError(
openai.error.APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)')))


Is there a way to use BlenderGPT with a proxy? Any help would be appreciated.

Thank you.

freeCAD

Could you integrate chatGTP with freeCAD as well?
The thing is that when installing blender, it suggests to install:
spacenavd and freeCAD here in my debian, and, I think, in all linux distros...
Thx a lot

Error installing/enabling the addon.

When I install the addon and enable it, I get this error message.
The secret key request box still does not appear, the error appears when I try to enable the addon.
Captura de pantalla 2023-04-06 153329

How can I fix this error?

I hope one day this could be used to create model and auto-topology

At present, when inputting "create a cat", the GPT3.5 would output something like this:
image

I know this weird output is not due to this extension.

I just want to say this extension has great potential with the official gpt model, and maybe oneday could replace the
dream-textures.

One suggestion: maybe it is better to create the "discussion tab", so that users could share different usage with it!

wow this is amazing.

loving this so so much, thank you.

two things, one and i think it was mentioned, would be cool to be able to have the same prompt again, like a copy paste the previous promt, maybe even a way to go back...

secondly and more importantly, im finding myself having to paste in the errors when they come up, so wrong syntax or wrong technic,
but gpt is so good at debuging, if i just write "hey the error was theres no object attribute X" it fixes itself after a try or two, or like ok there no "function look at" add a constraint.
but it would be awesome if this was somewhat automated, maybe a button to address errors or even a prompt pop up, saying address errors, and if you want to add an explanation for gpt you can if not it just sends the error and tries agian.

how can we donate to the projct?

Error

Screenshot 2023-03-26 at 18 40 55

I get these errors by just executing a simple prompt

KeyError: 'bpy_prop_collection[key]: key "BlenderGPT-main" not found'

Blender 3.4

Python: Traceback (most recent call last):
  File "C:\Users\brech\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 227, in execute
    openai.api_key = get_api_key(context)
  File "C:\Users\brech\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 58, in get_api_key
    addon_prefs = preferences.addons[__name__].preferences
KeyError: 'bpy_prop_collection[key]: key "BlenderGPT-main" not found'

after which typing key in box provides:

No API key detected. Please set the API key in the addon preferences.

also doesn't save key

GPT install Error Steam 2.83.19 LTSC Stable

  File "C:\Steam\steamapps\common\Blender\2.83\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\__init__.py", line 25, in <module>
    import openai
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\lib\openai\__init__.py", line 9, in <module>
    from openai.api_resources import (
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\lib\openai\api_resources\__init__.py", line 1, in <module>
    from openai.api_resources.audio import Audio  # noqa: F401
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\lib\openai\api_resources\audio.py", line 4, in <module>
    from openai import api_requestor, util
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\lib\openai\api_requestor.py", line 21, in <module>
    import aiohttp
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\lib\aiohttp\__init__.py", line 5, in <module>
    from . import hdrs as hdrs
  File "C:\Users\maz1lovo\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGPT\lib\aiohttp\hdrs.py", line 13, in <module>
    from typing_extensions import Final
ModuleNotFoundError: No module named 'typing_extensions'```

No API key detected.

When I typed something and clicked Execute, the error popped out saying 'No API key detected. Please set the API key in the addon preferences.' Does anyone know how to deal with this issue? Thanks a lot.

Ok got it.

error help me

Traceback (most recent call last):
File "D:\Download\2.92\scripts\modules\addon_utils.py", line 351, in enable
mod = import(module_name)
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main_init_.py", line 53, in
import openai
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main\lib\openai_init_.py", line 9, in
from openai.api_resources import (
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main\lib\openai\api_resources_init_.py", line 1, in
from openai.api_resources.audio import Audio # noqa: F401
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main\lib\openai\api_resources\audio.py", line 4, in
from openai import api_requestor, util
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main\lib\openai\api_requestor.py", line 21, in
import aiohttp
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main\lib\aiohttp_init_.py", line 5, in
from . import hdrs as hdrs
File "C:\Users\12345\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\BlenderGPT-main\lib\aiohttp\hdrs.py", line 13, in
from typing_extensions import Final
ModuleNotFoundError: No module named 'typing_extensions'

Apple M2 ValueError: register_class(.): already registered as a subclass 'GPT4 OT ShowCode'

Traceback (most recent call last):
File "/Applications/Blender.app/Contents/Resources/3.3/scripts/modules/addon utils.py", line 421, in disable mod.unregister()
File "/Users/anatoliismirnov/Library/Application Support/Blender/3.3/scripts/addons/BlenderGPT-main/ init py", lin bpy.utils.register_class(GPT4_OT _ ShowCode)
ValueError: register_class(.): already registered as a subclass 'GPT4 OT ShowCode'

Blender 3.4.1 BrokenPipeError

Blender version: 3.4.1
Error:

Python: Traceback (most recent call last):
  File "/home/drewdru/.config/blender/3.4/scripts/addons/BlenderGPT-main/__init__.py", line 236, in execute
    blender_code = generate_blender_code(context.scene.gpt4_chat_input, context.scene.gpt4_chat_history)
  File "/home/drewdru/.config/blender/3.4/scripts/addons/BlenderGPT-main/__init__.py", line 119, in generate_blender_code
    print(completion_text, flush=True, end='\r')
BrokenPipeError: [Errno 32] Broken pipe

Additional info:

bpy.context.scene.gpt4_chat_input = "add moving in a circle animation to the Cube"
bpy.ops.gpt4.send_message()

error key

Blender 3.4

Python: Traceback (most recent call last):
  File "C:\Users\brech\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 227, in execute
    openai.api_key = get_api_key(context)
  File "C:\Users\brech\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 58, in get_api_key
    addon_prefs = preferences.addons[__name__].preferences
KeyError: 'bpy_prop_collection[key]: key "BlenderGPT-main" not found'

after which typing key in box provides:

No API key detected. Please set the API key in the addon preferences.

also doesn't save key

Where to input OpenAI API Key?

Where do we actually set as an environment variable OPENAI_API_KEY? Would be nice if the option is in the addon setting.

Troubleshooting : RateLimitError: You exceeded your current quota, please check your plan and billing details.

Python: Traceback (most recent call last):
File "/Users/mannediaz/Library/Application Support/Blender/3.5/scripts/addons/BlenderGPT-main/ init py", line 174, in execute
blender_code = generate_blender_code(context.scene.gpt4_chat input, context.scene.gt4 chat history, context, system_prompt)
File "/Users/mannediaz/Library/Application Support/Blender/3.5/scripts/addons/BlenderGPT-main/utilities.py", line 51, in generate blender code
response = openai. ChatCompletion. create(
File "/Users/mannediaz/Library/Application Support/Blend
<img width="990" alt="Screenshot 2023-06-09 at 17 36 27" src="https://github.com/gd3kr/BlenderGPT/assets/10931032/48f918f1-1570-4fe0-8
Screenshot 2023-06-09 at 17 38 17
403-6380f11411cd">
er/3.5/scripts/addons/BlenderGPT-main/lib/openai/api_resources/chat_completion.py", line 25, in create return super).create(*args, **kwargs)
File "/Users/mannediaz/Library/Application Support/Blender/3.5/scripts/addons/BlenderGPT-main/lib/openai/api resources/abstract/engine api resource.py", line 153, in create response,
_, api key = requestor. request
File "/Users/mannediaz/Library/Application Support/Blender/3.5/scripts/addons/BlenderGPT-main/lib/openai/api requestor. py", line 226, in request
resp, got
stream = self. interpret response(result, stream)
File "Users/mannediaz/Library/Application Support/Blender/3.5/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.y", line 619, in interpret response self. interpret response line
File "Users/mannediaz/Library/Application Support/Blender/3.5/scripts/addons/BlenderGPT-main/lib/openai/api_requestor.py", line 682, in _interpret response line raise self. handle error response
openai. error. RateLimitError: You exceeded your current quota, please check your plan and billing details.

Key error api key

Blender 3.4

Python: Traceback (most recent call last):
  File "C:\Users\brech\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 227, in execute
    openai.api_key = get_api_key(context)
  File "C:\Users\brech\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\BlenderGPT-main\__init__.py", line 58, in get_api_key
    addon_prefs = preferences.addons[__name__].preferences
KeyError: 'bpy_prop_collection[key]: key "BlenderGPT-main" not found'

after which typing key in box provides:

No API key detected. Please set the API key in the addon preferences.

also doesn't save key

ModuleNotFoundError: No module named 'openai'

Traceback (most recent call last):
File "E:\3d animation for Blender\3.0\scripts\modules\addon_utils.py", line 351, in enable
mod = import(module_name)
File "C:\Users\Veeckman\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderGPT-main_init_.py", line 6, in
import openai
ModuleNotFoundError: No module named 'openai'

Whats going on here ( im not shure if i need to have Python set up or whats the problem)

building a chair

Let's say I want to build a chair...
Should I just write: "build a chair" in the chatGPT field?
Or I should have a template for that with specific measures...
I have written just: "build a chair", but it gives me a pile of gibberish python error codes...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.