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

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

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

  • @KevinCBurke
    @KevinCBurke 18 часов назад

    Thank you SO much for this video. It helped me a ton! 🙏

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

    Hey friends,
    I just realized that I made a mistake in the edit
    The VSCode Command Palette is launched with
    Command + Shift + P

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

    Thank You so much. Now I am able to debug my Python-S/W for Blender.
    BTW: To run the S/W I had to make a change at the end and not to go over "main()".😀

  • @stindedesign
    @stindedesign День назад

    Thanks for the good and useful videos. I'm pretty new to Blender programming. I'm using homebrew to install a lot of useful s/w. The python3 - m pip install fake-bpy-module forces to use either brew or pipx. However, either of those works. Can you add the homebrew and pipx way in you video? I would help a lot.

    • @stindedesign
      @stindedesign День назад

      Hi. I got it sorted out. The easiest way is to create the virtual environment with VS code in the workspace and install the fake-bpy-module there.

  • @Winston-K
    @Winston-K Год назад

    I'm so happy to have found your videos. I enjoy making Blender art in short videos using Python. Having your videos available to explain how to use `bpy` has helped me clean up my code! Especially cleaning up the scene for multiple script runs.
    Look forward to more videos :)

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

      Hey Jason,
      I'm pleased to hear that! 😃

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

    Thanks, I hope you finish the Linux one. :)

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

    I could really use a video on how to install 3rd party Python libraries that will work from my blender scripts.

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

      have you seen this video
      ruclips.net/video/IVLPQYk0wv4/видео.html
      I go over how to package 3rd party Python packages with your Blender Extension add-ons.

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

    reopened blender after creating the __init__.py file but did not see the custom panel -- tried "Blender: Run Script" as well but no dice. Help?
    (I was able to get the other scripts (the ones that create and move cubes) working just fine. Thanks!

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

      Make sure to have that __init__.py file in a separate folder and then open that folder in VSCode.
      Also, make sure that you have the bl_info dictionary in the code (the part of the code that registers the add-on).
      If you have everything in place, the add-on will auto-load when you start Blender from VSCdoe, no need to run "Blender: Run Script

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

    A notification keeps popping up that says "No workspace folder found". Can you help?

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

      yes, I have a video on how to fix that
      ruclips.net/user/shortsK9Ft10KuLCA

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

    Is there a different procedure for Mac m1 devices? I installed the fake-bpy-module but when I try to run a script I'm getting No module named 'bpy'....is this because M1's use zsh instead of bash? cheers

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

      Hey,
      No it isn't because the M1, I'm running a Mac M2 here.
      The issue is that you can only launch the script in Blender if you run it from the VSCode Command Palette. The "Run & Debug" currently works only for scripts that you run outside of Blender.
      To run the script you need to do the following:
      1. Open the VSCode Command Palette with Command + Shift + P
      2. Start Blender using the "Blender: Start" command
      3. Open the Command Palette (again) with Command + Shift + P
      4. Select "Blender: Run Script"
      See 10:20 in the video

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

      @@CGPython Cheers I think VSC was using the wrong Python Interpreter, in any case, it's working now. Thank you!

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

      had the same - wrong version of Python - thanks@@kuzey3d767

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

    Thanks a million for all your efforts Victor!
    In getting the initial script to run from vsc... After starting blender from vsc and it installed debugpy ok, then trying to run the script from vsc I'm getting:
    Got POST: {'type': 'script', 'path': '/Users/marknielsen/Desktop/VSCode_Blender_Testing/my_bpy_script.py'}
    Traceback (most recent call last):
    File "/Users/marknielsen/.vscode/extensions/jacqueslucke.blender-development-0.0.18/pythonFiles/include/blender_vscode/utils.py", line 22, in always
    try: func()
    File "/Users/marknielsen/.vscode/extensions/jacqueslucke.blender-development-0.0.18/pythonFiles/include/blender_vscode/operators/script_runner.py", line 24, in run_script_action
    bpy.ops.dev.run_script(context, filepath=path)
    File "/Applications/Blender.app/Contents/Resources/4.0/scripts/modules/bpy/ops.py", line 106, in __call__
    C_exec, C_undo = _BPyOpsSubModOp._parse_args(args)
    File "/Applications/Blender.app/Contents/Resources/4.0/scripts/modules/bpy/ops.py", line 60, in _parse_args
    raise ValueError("1-2 args execution context is supported")
    ValueError: 1-2 args execution context is supported
    Any thoughts on troubleshooting?

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

      I uninstalled Jacques Blender Development extension and installed your experimental fork. It worked on the initial script run test so now I'll attempt to complete the rest of your video steps. I'm running VSCode 1.84.2, Blender 4.0.1, Python 3.12.0 installed blender using it's own

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

      yeah,
      There was a Blender Python update when Blender was released.
      I submitted a fix to the original Jacques Blender Development extension. It should be fixed there as well.
      I'm glad it is working for you now!