Setting Up VSCode To Use As IDE With Blender In Windows - Blender Python Scripting

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024

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

  • @FrancoisSchnell
    @FrancoisSchnell 3 года назад +7

    Memo:
    In VScode:
    - install "Blender development" addon
    - in Terminal tab : pip install fake-bpy-module-2.80
    - make a project folder, create a test.py inside
    In Blender:
    - in a Text Editor window: locate and open test.py
    If you modify file in Blender do Alt+S in Blender's text editor to sync in VScode
    If you modify in VScode: click red question mark icon in Blender text editor bar, then "Reload form disk"
    Thanks for the great turorial, Just subed (800th) :)

  • @DerDirkBelana
    @DerDirkBelana 4 года назад +6

    As an engineer, without Blender skills and with the task of creating thousands of physics simulations and rendering the result. I came to this topic very quickly, namely to create an own addon for Blender. You did a great job, but now I'm a little sad that I have to wait for your next video.
    Keep the work up!

    • @MichaelBridges3D
      @MichaelBridges3D  4 года назад +1

      Thank you. Very encouraging. The wait won’t be long. 😀

  • @GrzegorzWronkowski
    @GrzegorzWronkowski 3 года назад +5

    What an amazin English speaker! This how people should speak

  • @worldkeyvideo9080
    @worldkeyvideo9080 2 года назад +2

    This is an amazing tutorial! I really appreciate how you walk through the steps so simply.

  • @olliveraira6122
    @olliveraira6122 2 года назад +1

    Hey look who I found :) I watched your UE4 C++ course!🌟
    I love that you put so much energy into helping people setting up an ideal development environment

  • @AssMK2
    @AssMK2 3 года назад +4

    Thank you for all the effort you've done. you saved my day!

  • @fleity
    @fleity 3 года назад

    Perfect tutorial, concise and to the point, clear and easily understandable audio. I watched this in 2x speed and was still able to follow. Thank you very much

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

    Well done!! I find what I was looking for your speech is fast and comprehensive

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

    This video should be on the official Blender Quick Start documentation, saves everyone's time

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

      High praise! Thank you.
      It can be certainly be challenging with python configurations being different on everyone’s system.

  • @ZBEARRockN
    @ZBEARRockN 3 года назад +10

    I can't understand why this great tutorial does not have the enough view count-! Scripting is also important as well as using the base features of blender. More people need to consider about using, making and sharing additional open source scripts for blender, and this will make the blender world bigger and more flexible for all users including new learning people

  • @dijjidog
    @dijjidog 3 года назад +5

    Really useful tutorial, just what I needed!

  • @christopherk4166
    @christopherk4166 2 года назад +4

    Great tutorial! That `fake-bpy-module` was exactly what I needed.
    Just to add one thing others might find helpful, there is a way to avoid clicking the "Reload from disk" button every time: On the top of the Blender text editing window click Templates > Python > External Script Stub. This will load a template that executes another script that you edit in your IDE.

    • @MichaelBridges3D
      @MichaelBridges3D  2 года назад +2

      Thanks for the info!

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

      You can also open Blender via the command "Blender: Start" (open the command panel with Ctrl+Shift+P), then VSC will open Blender and make a "bridge" between your current workspace and this running instance of Blender. You can then run your code via the command "Blender: Run Script".
      Using the usual Run Button (or Alt+P) doesn't work here because it only accesses the fake-bpy-module and not the Python interpreter/environment that Blender uses.

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

    Beautiful explanation. Thank you so much.

  • @jeremybaker5205
    @jeremybaker5205 3 года назад +2

    Extremely helpful!

  • @user-tz3qz6pb1j
    @user-tz3qz6pb1j 3 года назад

    Thank you very much. You have a talent for teaching. Keep it up!

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

    Thank you so much! This was just the help I needed to get everything working!

  • @Blend3d
    @Blend3d 3 года назад +1

    Awesome video Michael, thank you!

  • @rtdietrich
    @rtdietrich 3 года назад +1

    Exemplary explained and excellently visualized and presented

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

    Great tutorial! Thank you!

  • @superjarri
    @superjarri Год назад +3

    If you get stucked at 6:40. The code for installing the package is ""py -m pip install fake-bpy-module-2.79". Check your version if that doesn't work for you, hope it helps.

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

    Thanks, mate! That was useful!

  • @christophervaca7116
    @christophervaca7116 4 года назад +1

    Incredible video. You rock!

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

    Very Nice!!! Thank you for the video.

  • @YT775
    @YT775 2 года назад +1

    Very well presented, thank you!

  • @proudindian0212
    @proudindian0212 4 года назад +2

    You are a phenomenal techer Michael!! I am currently taking your blender course on udemy.

  • @nilupulperera
    @nilupulperera 2 года назад +1

    Great. Really useful awesome tutorial. Thank you very much

  • @reengineer2497
    @reengineer2497 2 года назад +1

    Thank you Michael !!!

  • @PrasadPathak-zm6wy
    @PrasadPathak-zm6wy 3 месяца назад

    Great That was really helpfull Michael Thanks

  • @paoloparker8991
    @paoloparker8991 3 года назад

    Thank you so much for this tutorial!

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

    thank you so much for you clear interesting video! subbed! :)

  • @tylerrodrigues62
    @tylerrodrigues62 4 года назад +1

    Great Video. Thanks!

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

    thank you so much

  • @szczesny1229
    @szczesny1229 2 года назад +1

    Thanks man...

  • @frigga
    @frigga 3 года назад +1

    Thanks for the video, there needs to be a better way though than switching back and forth and clicking the ?-icon on any iteration.

    • @MichaelBridges3D
      @MichaelBridges3D  3 года назад

      Haven’t found one yet, Blender stores a local, cached, copy of the script just like it does images and everything else.

  • @zaspanyflegmatyk2446
    @zaspanyflegmatyk2446 3 года назад +1

    thanks!!!!!!!!!

  • @hosseinse4079
    @hosseinse4079 2 года назад +1

    thank u

  • @vivekanandshanbhag462
    @vivekanandshanbhag462 3 года назад +1

    thanks

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

    You make courses for Udemy too? Amazing that I find this channel, love your content, excellent teaching. Thank you Sir!

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

    Yes i did it! i install all of them and now i can see all the avalaible methods on dot .. it's hard for me to understand why dot doesn't work in blender 's text editor

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

    ty

  •  3 года назад +1

    Great video! Did you probably managed to set up debugging as well so that you can run your code step by step from VS Code?

  • @derekgossett1134
    @derekgossett1134 3 года назад +2

    The only issue of Ninite i have found is that the programs install with no user input so you can not choose drive location nor does it give you the option to add python or vscode to PATH.
    P.s. great video, very informative.

    • @MichaelBridges3D
      @MichaelBridges3D  3 года назад

      Good point with ninite. Especially If you need that customisation.

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

    thx

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

    not having any luck getting fake-bpy-module to work in VS code with any version of it installed. I'm using blender 2.93 as well as fake-bpy-module-2.93 which says it installs correctly but I still get the "Import "bpy" could not be resolved" issue and reloading VS code doesn't seem to help and I've uninstalled python, blender, and vscode and reinstalled them to no avail.

  • @fernandofernandez8067
    @fernandofernandez8067 2 года назад +2

    Very good video! I cannot run the program on Visual Code, when I run the program, it shows run time errors. Is this the way it supposed to work. This is only to check synaxis but not debugging nor running on VC?

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

      If you open Blender via the command "Blender: Start" (open the command panel with Ctrl+Shift+P), then VSC will open Blender and make a "bridge" between your current workspace and this running instance of Blender. You can then run your code via the command "Blender: Run Script".
      Using the usual Run Button (or Alt+P) doesn't work here because it only accesses the fake-bpy-module and not the Python interpreter/environment that Blender uses.

  • @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.

  • @BinaryReader
    @BinaryReader 3 года назад

    Great Video, Thank you! Is there a way to execute the script from vscode?

    • @MichaelBridges3D
      @MichaelBridges3D  3 года назад

      I believe so, but it is a bit more involved and requires the script to be loaded as an actually Add-On and not just run as a script. It's been a while since I last did that though

    • @BinaryReader
      @BinaryReader 3 года назад

      @@MichaelBridges3D Actually, it might make for a awesome blender plugin to expose some kind of port for running REPL commands. I know you can interface with Blender REPL via the STDIN interface (have actually written a project to do that), but setting that up in such a way that commands can either be passed over named pipes, /dev/pipes or even just over a TCP socket would be pretty amazing.
      I might look at writing something like that.

  • @yugal-pz8nq
    @yugal-pz8nq Год назад +1

    Amazing video.. great help
    But what if I install bpy module instead of this one (fake-bpy-module)
    Before finding this video, I installed the bpy module through, pip install bpy, but then vscode won't show suggestions for the library

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

      To uninstall a package that you installed using pip, you can use the pip uninstall command followed by the package name. Here's a step-by-step guide:
      Open a terminal or command prompt on your computer.
      Run the following command, replacing package-name with the name of the package you want to remove:
      pip uninstall package-name
      You will be prompted to confirm the uninstallation. Type y and press Enter to proceed
      Keep in mind that if the package has any dependencies that were installed alongside it, they may not be removed automatically. You can use the pipdeptree tool to inspect the package's dependencies and remove them if necessary. To do this, first install pipdeptree:
      pip install pipdeptree
      Then, run the following command to view the dependency tree:
      pipdeptree
      This will show you a tree-like structure of all installed packages and their dependencies. You can then uninstall any unnecessary packages using the pip uninstall command.

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

    in vba you can access another application. From vba excel i can open autocad and draw everything (whole control) Is there any way to access blender from vs code directly ?

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

      Kind of, but I found it a little clunky and unreliable

  • @user-is2mc7hy4o
    @user-is2mc7hy4o 2 года назад +1

    Is there opportunity to run script form vscode directly? Because it a little annoying to reload it in blender every time

    • @MichaelBridges3D
      @MichaelBridges3D  2 года назад

      The Add on needs to be reloaded regardless of the path, but when I was using VSCode I could "run" the addon which in turn would load up Blender and refresh the add-on

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

    @Michael Bridges: This video lesson/explanation/tutorial is interesting about the Python language in Visual Basic, for point variables, if the user has adequate knowledge: - with the use of python and visual basic language, you could port blender software interface on android devices in 1080 x 2400 pixel screen resolution in .apk extension, with the help of Termux shell; but how?!. - my difficulty and problem is how to make Blender full of viewport, compatible on Nvidia NVS 5200M or Intel(r) hd 4000 regarding fps/lag/frames, but I can't find file/algorithm/line code in your Blender folder directory ; as far as i know about languages, i think it is accessible in this regard code line between blender viewport and graphics card model, if yes, how?!.

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

      Haha that’s beyond my knowledge at the moment. You need to ensure that whatever hardware you have meets the minimum requires for the graphic api.
      As of 3.4 that is open GL 4.3

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

      @@MichaelBridges3D however it was to have a chat, even if I was hoping that in the directory where I installed, there was a particular file, especially the line of code for compatibility in this regard fps and viewport, I don't find it a bad thing, if my notebook doesn't can update / or install in addition to Nvidia NVS 5200M, that's why I had thought of a modification, I have a saying: "if Mohammed can not reach the mountain, the mountain goes to Mohammed", if we compare the installed Nvida driver is Mohammed and the mountain is blender; anyway thanks for your reply.

  • @ckat609
    @ckat609 2 года назад +1

    Thanks for this! What about working on blender itself with C++? I'm not a fan of visual studio. I'd rather use vscode.

    • @MichaelBridges3D
      @MichaelBridges3D  2 года назад

      You can certainly do that especially with Blender being Open Source. That's beyond my remit at the moment though...but perhaps one day!

    • @ckat609
      @ckat609 2 года назад +1

      @@MichaelBridges3D thank you for your response!

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

    Sadly this doesn't work for me.
    The installing fas successful (for fake-bpy-module-3.1) but I still have the yellow lines around my code and the autocomplete doesn't work either. :/
    Maybe there was an update or such thing?

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

      It can be challenging since, everyone's setup is slightly different and other installs can cause issues.
      Update';s of course can cause things to fail as well.

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

    Can autosave in vscode.

  • @BadaBing_
    @BadaBing_ 2 месяца назад +1

    is there a way to do this with Sublime?

    • @MichaelBridges3D
      @MichaelBridges3D  2 месяца назад +1

      I don’t know sorry. I should imagine it might be possible given how flexible Sublime is.

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

    ok Michael a simple question for you? if you know -any help appreciated
    def abcd():
    print("cat")
    x = 'ab'
    y = 'cd'
    w = x + y
    print(w) #prints abcd
    w() #why isn't this callable as my abcd() function above, how do I make it callable?

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

      You haven’t defined the function w() so cannot call it yet.

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

      @@MichaelBridges3D Thanks Michael!, I just assumed I could imply function

  • @othoapproto9603
    @othoapproto9603 3 года назад +1

    My blender 2.92.0 was running fine. I installed VS and it broke blender or rather OpenGL, so beware it's an ugly road back.

  • @alexfullbrazil
    @alexfullbrazil 3 года назад

    Only Blender 2.8 is supported!!!!! :(

    • @MichaelBridges3D
      @MichaelBridges3D  3 года назад

      I’m sure it won’t be long before 2.9 and onwards is supported 🤞