5 Steps to setup VSCode for Blender Python (on Windows)

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • Learn how to set up and install VSCode on Windows for efficient Blender Python development with this step-by-step tutorial. This easy-to-follow guide covers everything from downloading and installing VSCode to configuring it for seamless integration with Blender.
    5 Steps to setup VSCode for Blender Python (on macOS)
    • 5 Steps to setup VSCod...
    5 Steps to setup VSCode for Blender Python (on Linux)
    • 5 Steps to setup VSCod...
    Visual Studio Code Download
    code.visualstudio.com/Download
    Python Download
    www.python.org/downloads/
    Fake Blender Python API module
    github.com/nutti/fake-bpy-module
    Blender Python scripting: Creating custom operators from scratch
    • Blender Python scripti...
    00:00 - Intro
    01:22 - Step 1 install Python
    03:15 - Step 2 install VSCode
    03:50 - Step 3 Configure VScode for Python
    05:57 - Step 4 Configure VScode for Blender Python
    07:18 - Step 5 Configure Blender/VSCode integration
    #blender #python #scripting #tutorial #vscode

Комментарии • 175

  • @j.overstreet3666
    @j.overstreet3666 Год назад +15

    Wow. Finally someone figured out how to run blender with vscode! This is huge! Thank you.

    • @CGPython
      @CGPython  Год назад +6

      Yeah, Jacques Lucke did a lot of work to make this happen!

  • @mind_of_a_darkhorse
    @mind_of_a_darkhorse Год назад +12

    I am glad you are taking the time to show you are not limited to just the Blender editor to create scripts! This is a big help for people and will speed up the scripting process!

    • @CGPython
      @CGPython  Год назад +4

      Thank you! 😀
      Yes, I'm really hoping this will help speed up not only the scripting but also help with understanding how Python works.

  • @anunnakidreamer
    @anunnakidreamer 3 месяца назад +1

    Thank you so much! Clear and straight to the point instructions.

  • @grimecase8818
    @grimecase8818 10 месяцев назад +2

    Darkfall and CG python is must watch, you guys are the best!

  • @nicholasgonzalez
    @nicholasgonzalez Год назад +2

    Great tutorial, very helpful. Thanks!

  • @atetraxx
    @atetraxx 11 месяцев назад +2

    This is new favorite channel. I love vs code.

  • @MrRabbit954
    @MrRabbit954 4 месяца назад +1

    just what I was looking for to get started, 👍

  • @thedebapriyakar
    @thedebapriyakar Год назад +2

    Absolutely brilliant tutorial, and the timing could not have been more perfect. Amazing channel, found this out today!

  • @johannes3424
    @johannes3424 3 месяца назад +1

    needed so long to find any kind of instructions for it. Thanks a lot!!!

    • @CGPython
      @CGPython  3 месяца назад

      You're welcome!

  • @brunodemasi381
    @brunodemasi381 Год назад +1

    Thank you. Very useful tutorial

  • @shantanuvgodbole
    @shantanuvgodbole 6 месяцев назад +1

    A really nice and concise video covering everything to get an IDE connected to Blender. Thanks !!!

    • @CGPython
      @CGPython  6 месяцев назад

      You're very welcome! ❤️

  • @DanielLobo
    @DanielLobo 3 месяца назад +1

    Good tutorial. This channel help me a lot. I will go try to config VSCode at Linux.

    • @CGPython
      @CGPython  3 месяца назад +1

      Glad I could help!

  • @bagadavid9477
    @bagadavid9477 Год назад +1

    It's a masterpiece indeed. Thank you for your sharing!😃

  • @jakubpietrucha2128
    @jakubpietrucha2128 Год назад +1

    Thanks! Great tutorial! :D

  • @HarryMcKenzieTV
    @HarryMcKenzieTV 6 месяцев назад +2

    for those installing VS Code take note that Microsoft made a mistake and inverted the User and Systemwide installers. Use the Systemwide installer as the User installer.

  • @maniphaces
    @maniphaces 7 месяцев назад +1

    Brooo, this is clutch! I hope more devs realize how convenient this is. And more content creators like you spread the word. Preciate-cha!

    • @CGPython
      @CGPython  6 месяцев назад

      yeah, it is a game changer! 💯

  • @galdocstutorials
    @galdocstutorials Месяц назад

    This is exactly what I needed, thank you. :) I'm familiar with VS Code, Blender and Python, but it's hard to know how to get all of the pieces to play nicely together. Thank you!

    • @CGPython
      @CGPython  25 дней назад

      You're very welcome!

  • @nana_studio_kr
    @nana_studio_kr Год назад +1

    Wow. This is what I'm looking for!!!

  • @miname6283
    @miname6283 Год назад +1

    thanks for the video. Just in time.

  • @LeiffNathanAMendoza
    @LeiffNathanAMendoza 6 месяцев назад +1

    Awesome steps so easy indeed

    • @CGPython
      @CGPython  6 месяцев назад

      Glad you think so!

  • @ahmedsalih2308
    @ahmedsalih2308 Год назад +1

    Thank you! Great stuff

  • @user-dv1vh9vz7s
    @user-dv1vh9vz7s 8 месяцев назад +1

    Awesome! many thanks =)

  • @sonu-jangir
    @sonu-jangir 9 месяцев назад +1

    You are Awesome...
    🎉🎉🎉
    ❤❤❤

  • @wobius
    @wobius Год назад +1

    great video! thank you

    • @CGPython
      @CGPython  Год назад

      I'm happy you liked it! 😊

  • @vivektyagi6848
    @vivektyagi6848 2 дня назад

    It finally worked. Wonder what I was doing wrong earlier. Many Many Thanks. Now a request - Could you please show how to add a Folder that has multiple folders with code. Each folder with its own class and utilities. I need to add the folder and Debug on the Press of a button. Could you please help.

  • @mrshodz
    @mrshodz 6 месяцев назад +1

    Great video

  • @williamanim4267
    @williamanim4267 Год назад +1

    I was struggling so hard of using VSC with blender that i gave up and was using the text editor by default. F
    but with this vid you helped me to solve the problems i had
    Thanks u so much

    • @CGPython
      @CGPython  Год назад +1

      I'm glad this helped!! Woohoo!

  • @AgnaktoreX
    @AgnaktoreX 4 месяца назад +1

    tyvm!

  • @HarryMcKenzieTV
    @HarryMcKenzieTV 6 месяцев назад +2

    whoops you failed to mention that you need to install pip first. or else it is not recognized. Overall excellent guide on how to setup this stuff amazing thank you so much!

  • @torus1183
    @torus1183 2 месяца назад

    thank you

    • @CGPython
      @CGPython  2 месяца назад

      You're welcome

  •  Год назад +1

    Nice editor, thanks. Another alternative is vim.

    • @toapyandfriends
      @toapyandfriends Год назад +1

      I really love emacs myself....but VS CODE is indispensable!

  • @ExcaliburCanon-eh3lu
    @ExcaliburCanon-eh3lu 6 месяцев назад

    🙀 u can do that, am humbled n greatful for your content 🥺👍

  • @OnTheWayToTheDirection
    @OnTheWayToTheDirection 10 месяцев назад

    Thank you!! BROOO

    • @CGPython
      @CGPython  10 месяцев назад

      Happy to help

  • @user-ef7nn2nx8u
    @user-ef7nn2nx8u Год назад

    thank you :)

  • @user-yj6qh1gp2v
    @user-yj6qh1gp2v 25 дней назад

    cool!

  • @spirosmarinis2510
    @spirosmarinis2510 Год назад

    Great tutorial thank you!!! vs code cannot be compared with blender's text editor it is 1000 times better

  • @scipio1943
    @scipio1943 Год назад

    yes fake-bpy-module can work!

  • @ced9302
    @ced9302 Год назад

    Hi thank you. Exactly what I was looking for ! Just a question : I do not find the others videos you mentionned to do the same on Linux.. Thank you

    • @CGPython
      @CGPython  Год назад +1

      Hi
      I'm still editing the other versions, they should be out soon
      Thank you for your patience!

  • @aaronvdw
    @aaronvdw 3 месяца назад

    Great video and explanation of steps. Well done. My question is about why people prefer this over editing in Blender itself. Totally get that VS code is a wayyy better editor and has git integration and all that stuff, but the first impression I get from doing it this way is that it's a bit.. clumsy? Having to start Blender specifically from the extension, then Shift-Alt-P → blender run script every time, and switching back and for between VS code and blender constantly really got to me after a while. I'm just starting out, so maybe I just need more time with this method, but seeing things in one place - the repl console, editor, viewport, and info panel - felt really nice and I missed that. What are you thoughts about that?

    • @CGPython
      @CGPython  3 месяца назад +1

      Thanks!
      Great question!
      I agree that the workflow is not as smooth as it would be if you were working in Blender's script editor.
      I actually got annoyed with this and made an and-on to auto-reload/rerun my code when I save the code
      ruclips.net/video/t3YWMAJURIw/видео.html
      VSCode also gives a lot of features that the Blender devs will probably never add:
      debugging
      autocomplete
      advanced syntax highlighting
      AI assistant integrations ruclips.net/video/rGSWz1SL16Y/видео.html
      and other things a dedicated IDE is great at
      Every feature in Blender requires maintenance and support. I think it would benefit more people if the Blender developers worked on cool new features in the renders, animation workflows, particle system workflows, and geo nodes rather than spending time improving the script editor.

    • @aaronvdw
      @aaronvdw 3 месяца назад

      @@CGPython Thanks for that thoughtful response, I'll have a look at those other videos of yours and give it some more time. Also simply having Blender available on another screen may make things feel a little more connected.

    • @aaronvdw
      @aaronvdw 3 месяца назад

      @@CGPython I found a setting in the Blender Development VS Code extension called Reload On Save.
      And I totally agree that the blender devs should really focus on the core product and not the script editor!

  • @Merqos
    @Merqos 11 месяцев назад

    Thanks for the tutorial! I was wondering if it is possible to run other libraries, such as pandas, numpy etc in VS code. Been trying to do it directly in Blender, but it does not work :/

    • @CGPython
      @CGPython  11 месяцев назад

      Are you talking about creating Blender Python scripts that use numpy and pandas?
      numpy is shipped with Blender, so you can just import numpy in your Blender scripts
      With pandas you will need to install it into Blender's built-in Python interpreter.

  • @spirosmarinis2510
    @spirosmarinis2510 Год назад

    yes i did it ! But i think there is something good to mention If you try to run the script from F5 or the menu start debugging to run the script - fails
    always have to ctrl+shif+p + run script to run . it took me a long to figure it out and I was ready to give up

    • @CGPython
      @CGPython  Год назад +1

      This is a good point! ❤️
      I sometimes find myself pressing that out of habit 🙃
      I have an add-on that I use that runs my scripts on save.
      I'm planning to do a tutorial at some point about it.

    • @RealisiticEdgeMod
      @RealisiticEdgeMod 8 месяцев назад

      @@CGPython at the end of my script i have "if __name__ == "__main__": register()" so that the plugin gets registered when its executed. But if i run it from vscode the plugin isnt registered.

  • @ckat609
    @ckat609 6 месяцев назад

    Thank you for this. I know this is a python for blender channel but, is there any chance you might teach us how to do stuff in c++ to make changes to blender itself?

    • @CGPython
      @CGPython  6 месяцев назад

      I might touch the Python API bindings in C++ but that would be as far as I like to go on this channel.
      I have seen a number of great talks on that subject
      ruclips.net/video/gSIgW_N7o3U/видео.html
      ruclips.net/video/OxwrSdt6I4w/видео.html
      Also there are great articles like this
      aras-p.info/blog/2022/02/03/Speeding-up-Blender-.obj-export/

    • @ckat609
      @ckat609 6 месяцев назад

      @@CGPython I understand. Thank you so much for your super fast response! I've love all of the videos I've seen. Please, keep them coming.

  • @Szyszz
    @Szyszz 3 месяца назад +1

    Hi, im a complete noob in the addon creation.Thank you for your tutorials, they're very helpful in learning scripting for blender.
    I've been working on an addon and i have decided to use VSC as my IDE. I've noticed that as i try to run the addon from VSC, Blender doesn't seem to add the panel into the region. The same code run from built-in blender script editor works without any problems. Is there any known cause for this issue?

    • @CGPython
      @CGPython  3 месяца назад

      Do you have the 'bl_info' dictionary at the top of the file?
      For example:
      bl_info = {
      "name": "My Custom Panel",
      "author": "Victor Stepanov",
      "version": (0, 0, 1),
      "blender": (2, 80, 0),
      "location": "3D Viewport > Sidebar > My Custom Panel category",
      "description": "My custom operator buttons",
      "category": "Development",
      }

  • @AVA-NIELS
    @AVA-NIELS 9 месяцев назад

    amazing tutorial. I am a bit dumb though, it all works, but when I press run code in vscode (ive done Blender: run script properly) it gives ModuleNotFoundError for the blender specific imports like bpy

    • @CGPython
      @CGPython  9 месяцев назад

      Thank you!
      The catch here is that you can't run these Blender Python scripts as you would run the regular Python scripts that don't use `bpy`.
      You can only run them in Blender. This is done by selecting the `Blender: Run Script` command from the VSCode command palette.

  • @toapyandfriends
    @toapyandfriends Год назад +1

    How do you color fix your screen recorded webpages...they are awesome...can't figure it yet?

    • @CGPython
      @CGPython  Год назад +1

      I don't have any settings/filters in my OBS or Davinchi.
      Maybe Davinchi Resolve does something autocorrecting?

    • @toapyandfriends
      @toapyandfriends Год назад +1

      @CGPython thanks for letting me know...since I use Adobe if you find a link of how I can CC a website if you can post it here......I couldn't find one...and since there seems to be no way to move a preferences window to the center of the screen when you make a show user preferences function for your addon....so it looks nice...can u make a tutorial. On how I can split view3d and open user pref in the left hand pane and figure out a nice system for the end user to close this new split pane....like a button that joins the panes. Or better...seems to be the only workaround...for a nice ui that displays windows to end users

    • @CGPython
      @CGPython  Год назад +1

      @@toapyandfriends That is interesting!
      I'll need to think about how that would be done

    • @toapyandfriends
      @toapyandfriends Год назад +1

      @CGPython Thanks! If you can you would be hero to all is Blender UX guys!

  • @lishiavergeer3211
    @lishiavergeer3211 23 дня назад +1

    Hi! Thank you for the tutorial. I have a question. Could I also update my user interface panels without restarting Blender?

    • @CGPython
      @CGPython  22 дня назад

      Hello,
      Thank you!
      You should be able to run `Blender: Reload Addons` in the command palette for VSCode

    • @lishiavergeer3211
      @lishiavergeer3211 18 дней назад

      @@CGPython Thank you!

  • @dhrumil5977
    @dhrumil5977 Год назад

    Hiiii, can you make a video on how to install python packages like mediapipe in blender?

    • @CGPython
      @CGPython  Год назад

      Good idea!
      Installing Python packages is on my list of things to film

  • @robertoalvira626
    @robertoalvira626 Год назад

    Thanks for the video! Have you seen where blender shuts down right after it opens with the python code? Getting a could not install debugpy message.

    • @CGPython
      @CGPython  Год назад +1

      I explain how to fix that here
      ruclips.net/video/YUytEtaVrrc/видео.html
      link with timestamp

    • @robertoalvira626
      @robertoalvira626 Год назад

      @@CGPython still getting the message 🙁

    • @CGPython
      @CGPython  Год назад

      @@robertoalvira626 you should try getting the portable version of Blender for windows.
      www.blender.org/download/
      You can find that download option under the "Mac, Linux, and other versions" drop down

  • @tedbundy8712
    @tedbundy8712 Месяц назад

    Hey I need an advice
    I want to do a project where i can extract features from a image using machine learning and put it on my blender model
    Eg:consider a cloth 3d model and now adding color i want to extract it froma image and put it on my cloth model can i do it?

    • @CGPython
      @CGPython  Месяц назад

      You would need to create an image of what you want to put on the model.
      Load that texture in blender and then do a UV unwrap.
      See 10 minutes in to this video
      ruclips.net/video/aSkgwf0SX_k/видео.htmlsi=-eLBlRpY0V7S590r

  • @guyjanssen1751
    @guyjanssen1751 6 дней назад

    Great tutorial, but, despite following meticulously your 5 steps, I always encounter following attribute error:
    import bpy
    obj = bpy.context.object
    Exception has occurred: AttributeError
    module 'bpy' has no attribute 'context'
    File "H:\Stoommachine\Cornish\ThomaShaftProject\Scripting\context.py", line 3, in
    obj = bpy.context.object
    ^^^^^^^^^^^
    AttributeError: module 'bpy' has no attribute 'context'
    When executed directly in Blender 4.1, this error does not occur.
    What went wrong?
    Thanks in advance
    Guy

  • @cristicode4301
    @cristicode4301 5 месяцев назад

    When you pressed "Run Script", what interpreter did you choose, the Blender python interpreter or the python version installed on your machine?

    • @CGPython
      @CGPython  5 месяцев назад

      This runs the Blender python interpreter.
      The extension installs an operator that allows VSCode to send messages to the running operator inside of Blender

  • @Nieverton69
    @Nieverton69 5 месяцев назад

    when I go to download python 3.10.13 (the version that appears in the blender 4.0 console), there is no option to download it for windows, would it be a problem to use a newer version?

    • @CGPython
      @CGPython  5 месяцев назад

      If you install Python 3.10.11 you should be fine
      www.python.org/downloads/windows/

  • @shouptikdey2089
    @shouptikdey2089 4 дня назад

    Even after installing installing Fake bpy i am getting this error Import "bpy" could not be resolved

  • @jwx6351
    @jwx6351 Год назад

    nice video, but if i disconnect the debug client by accident, how to re connect ? close blender and reboot it ?

    • @CGPython
      @CGPython  Год назад

      Yeah, you just close blender and start the debugging session again

  • @JayeshSarvaiya
    @JayeshSarvaiya Месяц назад

    Thank you for the video, for import bpy I am not getting error but if I write from bpy.types import Operator I get error ImportError: cannot import name 'Operator' from 'bpy.types' (unknown location). (Please note I followed fake bpy installation video properly, even referred similar videos on Ytube). Any hint will help.

    • @CGPython
      @CGPython  Месяц назад +1

      I think you are running the script using the Python that you installed on Windows. This Python is only there to help with syntax highlighting and auto-complete.
      You need to run the script by starting Blender and then calling "Run Script" from the command pallet.

    • @JayeshSarvaiya
      @JayeshSarvaiya Месяц назад

      @@CGPython Oh... okayyy.... Thank you... !

  • @wjyzxcv
    @wjyzxcv Год назад

    I've been using this setup for a week, and I noticed that if the script is written like
    def main():
    ...
    if __name__ == "__main__"
    main()
    then the "Blender: Run script" command won't run main(). Is it possible to make it work?

    • @iplai
      @iplai Год назад

      @Silas if _name_ == "__main__" is not True,
      >>> print(__name__)
      >>>
      the codes in the if statements never run!

    • @CGPython
      @CGPython  Год назад

      Yeah, I also ran into that but never took the time to dig into the root cause of the issue. (I would just workaround the issue...)
      I just did some digging and published a potential fix to the fork I made of the Blender Development extension by Jacques Lucke.
      marketplace.visualstudio.com/items?itemName=CGPython.blender-development-experimental-fork
      You would need to disable the original Blender Development extension in VSCode before installing the fork.
      If this works for everyone, I'll create a pull request for the original extension.

  • @MidtownMadness1
    @MidtownMadness1 11 месяцев назад +1

    At 8:21, after doing the necessary steps I get the error in VScode "no workspace folder found". This error occurs after I do CTRL + SHIFT + P --> Blender: Start --> {path}.blender.exe.
    Any idea how solve this?
    Edit: solved problem by first doing: Blender: new script and then paste the contents of my script in that script. Then Blender: Start booted up Blender

    • @CGPython
      @CGPython  11 месяцев назад +1

      I recorded a quick fix for that
      ruclips.net/user/shortsK9Ft10KuLCA
      It is all about not having a folder open in VSCode

    • @MidtownMadness1
      @MidtownMadness1 11 месяцев назад

      @@CGPython 👍

  • @lishiavergeer3211
    @lishiavergeer3211 19 дней назад

    I encountered some troubles for which I thought I should reinstall the fake-bpy-module. However, since then I got certain problems. When I create an addon, the program cannot find it. Thereafter, Blender cannot be opened. It says that it cannot create a file when that file already exists and the terminal will be reused by tasks. I think the fake-bpy-module stores the files in the wrong place? It would be amazing if you could help me

    • @CGPython
      @CGPython  17 дней назад

      Hello,
      Sure!
      I would need some more info to be able to help.
      What Blender version are you using?
      How are you creating your add-on?
      Can you try to follow this video to create an add-on and try to use VSCode with it
      ruclips.net/video/Qyy_6N3JV3k/видео.html
      Note: this ^ add-on will work in Blender 4.1, there were some updates done in 4.2 that changes the process of creating an add-on extension.

  • @chriskiepfer450
    @chriskiepfer450 Год назад

    I have completed all the steps in your video (thank you) but I am getting a message after I run the side panel code in vs (You do not have IntelliSense configured. Unless you set your own configurations, IntelliSense may not be functional.) and the side bar does not appear in blender. What compiler should I install?

    • @CGPython
      @CGPython  Год назад

      Hi!
      Sorry, this isn't working for you out of the box!
      Did you use the __init__.py file for the side panel code?
      If the code isn't in a separate folder and isn't in a __init__.py file, this won't work.
      Something to check:
      Can you run the side panel code from Blender's text editor to make sure that it works without VSCode?
      > You do not have IntelliSense configured. Unless you set your own configurations, IntelliSense may not be functional.
      The Blender Development extension does depend on the C++ extension, but you shouldn't need a C/C++ compiler for this to work.

    • @chriskiepfer450
      @chriskiepfer450 Год назад

      @@CGPython Thanks for the quick reply! I tried again, but no luck, so I added the add on in Blender and it works. Thanks again!

    • @CGPython
      @CGPython  Год назад

      @@chriskiepfer450 Ah! That is sad that it isn't working for you.
      Does script debugging work for you at least?

    • @escifi
      @escifi Год назад

      ​@@CGPython As I was facing the same issue, and all of IntelliSense's preferences referred to C/C++ programming (it seems to require the presence of a compiler for those languages), I tried installing Visual Studio Community Edition alongside Visual Studio Code, too, only selecting its C/C++ programming components.🤔
      Once done, Visual Studio Code's IntelliSense for Python seems to work without any complaint.
      (Maybe there's a simpler way to do it from inside VSCode itself yet, by installing some C/C++-related Extension? Or through some smallish compiler installer from Microsoft?)

  • @ahmedsalih2308
    @ahmedsalih2308 8 месяцев назад

    Hello!
    Blender 4.0 just released - would you kindly do a video on how to get it to work for this?
    Unfortunately it does not seem to work straight of the box!

    • @matiasgarate2387
      @matiasgarate2387 8 месяцев назад

      Same for me. Even running an empty script throws the following error: ValueError: 1-2 args execution context is supported

    • @CGPython
      @CGPython  8 месяцев назад

      I submitted a fix proposal to the primary Blender Development's extension to fix this:
      github.com/JacquesLucke/blender_vscode/pull/154
      Hopefully, we can ship this fix soon after Jacques reviews this change.
      The latest version of the extension fork already has this fix (if you are blocked and need this ASAP, you can use that)
      marketplace.visualstudio.com/items?itemName=cgpython.blender-development-experimental-fork

  • @NightVisionOfficial
    @NightVisionOfficial 8 месяцев назад +1

    Is there a way to have all this for blender 4.0?
    Update: There's an experimental build, sorry.

    • @CGPython
      @CGPython  8 месяцев назад

      I submitted a fix proposal to the primary Blender Development's extension to fix this:
      github.com/JacquesLucke/blender_vscode/pull/154
      Hopefully, we can ship this fix soon after Jacques reviews this change.
      The latest version of the extension fork already has this fix (if you are blocked and need this ASAP, you can use that)
      marketplace.visualstudio.com/items?itemName=cgpython.blender-development-experimental-fork

    • @NightVisionOfficial
      @NightVisionOfficial 8 месяцев назад

      @@CGPython Blocked? Btw, yeah, I saw there was an update and didn't see it on VSCode, so I downloaded the experimental branch, I forgot I made this comment, and just updated as you put the heart xD.
      Thx anyway, this can help if someone has the same problem ^^

  • @Coin3D
    @Coin3D Год назад

    hi i dont know if this is a common problem but i did the pip install for both the latest version and 3.4 and when i type bpy. it doesn't prompt anything in terms of autocomplete. Am i doing it wrong?

    • @CGPython
      @CGPython  Год назад

      IIRC you need to restart VSCode after you install via pip.
      Is it still not working for you?

    • @satyaa999
      @satyaa999 Год назад

      @@CGPython same problem for me also, I restarted my vs code, but its not showing bpy module as installed, but when I do ''pip install fake-bpy-module-latest'', its saying requirement already satisfied, can u pls give me a solution

    • @CGPython
      @CGPython  Год назад +1

      There is a way to install the autocomplete manually.
      You would download the zip, extract it, and make VSCode use in (via settings)
      Here is how
      github.com/nutti/fake-bpy-module/blob/master/docs/setup_visual_studio_code.md

  • @Nieverton69
    @Nieverton69 5 месяцев назад

    another problem I'm having, when I press ctrl+shift+p and search for blender.exe in blender start, it returns this error "no workspace folder found"

    • @CGPython
      @CGPython  5 месяцев назад

      I have a short video how to fix that
      ruclips.net/user/shortsK9Ft10KuLCA

  • @Adrian-mu8gg
    @Adrian-mu8gg 5 месяцев назад

    my addon works fine if i install it in blender,
    but in debug vscode i get
    ModuleNotFoundError: No module named 'xxxxx'
    what might be wrong there?

    • @CGPython
      @CGPython  5 месяцев назад

      Are you using a separate folder with __init__.py for your add-on?
      Where is the xxxxx module located?
      Are you using "Run Script" or just "Blender: start" ?

  • @thenewnpc
    @thenewnpc 11 месяцев назад

    This is what I was looking for, but there is one problem. In order to make the script work I need to put the code in the Blender editor. If the files in VSCode are not the same as the code in Blender editor, the script will not run.

    • @CGPython
      @CGPython  11 месяцев назад

      Hi!
      Can you share your script?
      It is hard to know what is going on without looking at the code.

    • @cristicode4301
      @cristicode4301 5 месяцев назад

      @@CGPython hi, is still me, @thenewnpc with another account. I found out that if we write python for Blender in VS Code we cannot import other files/modules as text blocks, configs = bpy.data.texts["configs.py"].as_module(), because that is syntax for Blender Text Editor that declares files as text blocks. And that is why I was getting that error, it couldn't find the modules imported like that. So naturally when I copied the code inside Blender Text Editor it worked again because the syntax was accepted by the interpreter/ compiler...whatever. Bottom line, when writing python for Blender externally, ex: VS Code, we can use normal python imports, "from file import some_method".

  • @sonu-jangir
    @sonu-jangir 9 месяцев назад

    How can I do the same things for Sublime text?

    • @CGPython
      @CGPython  8 месяцев назад

      Have you seen this github.com/clawjelly/SublimeBlenderAddon
      It might be a bit old but maybe it still works?

  • @Floreum
    @Floreum 19 дней назад

    I'm having an issue where for some reason creating panels will not appear when trying to run script from VSC. I can spawn in a cube and move it just fine, but panels will not run. If I copy the code to Blenders text editor and run it it will work. To make sure the panel script from VSC is working I added "bpy.ops.mesh.primitive_cube_add" and it still spawns in a cube

    • @CGPython
      @CGPython  17 дней назад +1

      I think you need to convert your add-on into a folder + __init__.py file
      I explain this here
      github.com/JacquesLucke/blender_vscode/issues/134#issuecomment-1626898526
      let me know if this does not make sense.

    • @Floreum
      @Floreum 17 дней назад

      @@CGPython it actually ended up being something to do with the extension install or something. I've installed Python and the extension in the past but never did anything with it so I reinstalled everything and it started working. Thanks for the help though.

  • @blendertutorialdotnet
    @blendertutorialdotnet Год назад

    Please help me! I'm a total beginner and i'm lost! I wnet through your video and everything is ok, the cube is moving etc. But, i want to use this for different things and that is not working.
    A similar example is in the Blender scripting workspace, there are templates, and there are a UI template python file. If i copy that into Visual Studio and run, it is not doing it's thing, just nothing. If i run it in Blender, it works.
    So what's the problem? Why these UI example files do not work in VS? I really badly need that :(

    • @CGPython
      @CGPython  Год назад +1

      Hey!
      You need to creat a new folder and a __init__.py for this and add bl_info dictionary at the top of the script. Basically you need to create an add-on.
      I’ll make a shot this week on this topic.
      Take a look at the end of this video
      Exploring the Pie Menu Template in Blender with Python
      ruclips.net/video/zAMVFPr8ZIE/видео.html

    • @blendertutorialdotnet
      @blendertutorialdotnet Год назад

      @@CGPython I've made it!!! Thank YOU SO MUCH!!!!!!!!!!

    • @blendertutorialdotnet
      @blendertutorialdotnet Год назад

      @@CGPython In this setup, i can't open blender's system console, so the "print" command writes to where? Into Visual Studio somewhere? Can't find...

    • @CGPython
      @CGPython  Год назад

      You can see the print() output in the "Terminal" panel (at the bottom of VSCode). If you don't see the "Terminal" panel, you can open it via View >Terminal.

  • @sukantamanna75
    @sukantamanna75 10 месяцев назад

    I get an error message "The file can not be accessed by the system" when trying to start the Blender app( C:\Users\USER\AppData\Local\Microsoft\WindowsApps\blender-launcher.exe) from VS Code. I am using Windows 10.

    • @CGPython
      @CGPython  9 месяцев назад

      Hey,
      Did you install Blender from the Windows Store?
      I'm not 100% sure that is supported by this extension.
      Is there a blender.exe in that folder?

  • @scipio1943
    @scipio1943 Год назад

    Install nutti/fake-bpy-module but couldn’t work warning: There was an error checking the latest version of pip. Why?

    • @CGPython
      @CGPython  Год назад

      You can try this
      bobbyhadz.com/blog/python-warning-there-was-an-error-checking-the-latest-version-of-pip

  • @oseibonsu2377
    @oseibonsu2377 3 месяца назад

    I'm trying to connect blender to vscode but when I run the code and select the exe, it says "no workplace found" pls help 😔

    • @CGPython
      @CGPython  3 месяца назад

      I explain how to resolve it here
      ruclips.net/user/shortsK9Ft10KuLCA

  • @DenisTrebushnikov
    @DenisTrebushnikov Год назад

    Hi, what about PyCharm for Blender Python?

    • @CGPython
      @CGPython  Год назад +2

      Hey!
      PyCharm is a great editor as well!
      I think this is what you would need to use
      github.com/BlackStartx/PyCharm-Blender-Plugin
      b3d.interplanety.org/en/using-external-ide-pycharm-for-writing-blender-scripts/

  • @peaj5088
    @peaj5088 Месяц назад

    Its a great workflow, but sadly it does not work well with Extensions in Blender 4.2 Beta. Does anybody have a workflow already for developing blender Extensions instead of Addons. Right now the vscode Blender Development Plugin will add the Extension as an additional Addon so it gets loaded twice.

    • @CGPython
      @CGPython  16 дней назад +1

      There was a fix submitted to support Blender 4.2
      github.com/JacquesLucke/blender_vscode/pull/166

    • @peaj5088
      @peaj5088 16 дней назад

      @@CGPython Thats great. Thanks for the follow up 🙂

  • @mwparker1969
    @mwparker1969 2 месяца назад

    I am a newbie. Sorry to bother, but I set up Python 3.11 plus VSCode and I get this error when trying to install the fake_bpy_module:
    Loading configuration....
    Done loading configuration
    Checking for valid pip....
    WARNING Python not found for [PythonPath: [none] | EnvName: [none] | PathToEnvs: [none]]; this environment will be ignored
    Done checking for valid pip
    Setting up specified environments....
    ERROR no valid environments exist! Update aborted.
    ***UPDATE FAILED TO COMPLETE***
    Python 3.11 is in the system path. Any suggestions would be helpful. Thank you!

    • @CGPython
      @CGPython  Месяц назад +1

      How did you install Python 3.11?
      You might have installed it via the Windows store
      stackoverflow.com/a/58773979
      double check where the Python.exe is located by running this:
      where python
      in your Command Prompt

    • @mwparker1969
      @mwparker1969 Месяц назад

      @@CGPython It took a few days, but I figured it out. Once I set up an environment with venv, pip starting working. I also downloaded conda. I like conda better so far, but I haven't enough experience to really argue the point. The conda syntax seems a bit simpler. Thanks for looking into it.

  • @satyaa999
    @satyaa999 Год назад

    its not working for me, after installing fake bpy module, it is not showing up

    • @satyaa999
      @satyaa999 Год назад

      unable to get auto complete

    • @CGPython
      @CGPython  Год назад

      have you restarted VSCode?
      if you run this command
      pip show fake-bpy-module-latest
      what does it print?

    • @satyaa999
      @satyaa999 Год назад

      @@CGPythonyes restarted the vscode, it's showing requirement is already satisfied, blender development run script is working fine in blender, but that auto complete is not showing up in vs code, it behaves like bpy module is not installed

    • @CGPython
      @CGPython  Год назад +1

      The only thing that comes to mind that might be an issue is that
      1 VSCode is out of date
      2 The Python VSCode extension is not installed/is out of date
      3 The selected Python interpreter (bottom right status bar) is not the Python interpreter where you installed fake-bpy
      I'm going to guess these ^ are not the issues.
      There is a way to install the autocomplete manually.
      You would download the zip, extract it, and make VSCode use in (via settings)
      Here is how
      github.com/nutti/fake-bpy-module/blob/master/docs/setup_visual_studio_code.md

    • @MajinVegeto89
      @MajinVegeto89 Месяц назад

      @@CGPython I had the same issue and for me it was that I had several Python versions installed and VSCode used the wrong interpreter.
      If anyone else is having this issue, just type in your terminal (the same terminal where you ran the pip install command for fake-bpy) "which python". It will print the path for the Python used when installing fake-bpy.
      Next, in VSCode use Ctrl+Shift+P then type in "Select interpreter" and there should be an option there to select Python interpreter, just use the same as was printed when you ran the "which python" command

  • @dolmenbretagne9060
    @dolmenbretagne9060 Год назад

    Still so interesting. Thanks for this tutorial. Note: I found a way to make bevels on specified edges. If you're interested, it's at the end of my last tutorial: ruclips.net/video/s8Y4AjP9GuU/видео.html

    • @CGPython
      @CGPython  Год назад

      That is cool! 😃
      BTW
      not sure if you saw my last reply (on your question when you were asking about the bevel) with example code
      gist.github.com/CGArtPython/bc10b8a9b6e4934458bb664d8f45f1e1
      I guess you didn't see it 🙂

    • @dolmenbretagne9060
      @dolmenbretagne9060 Год назад

      @@CGPython By the way... Do you know a tutorial on how to use the blf module in python to write on the 3D View panel of blender?

    • @CGPython
      @CGPython  Год назад

      I haven't seen any tutorials on blf :(

    • @dolmenbretagne9060
      @dolmenbretagne9060 Год назад

      @@CGPython Thank you ! I will keep looking

  • @nelsonmouatvergara
    @nelsonmouatvergara 4 месяца назад +1

  • @petedejager
    @petedejager 10 месяцев назад

    Fantastic tutorial, many thanks!

    • @CGPython
      @CGPython  10 месяцев назад

      Glad you enjoyed it!