How to run the blender in test mode when developing in VS Code?

I just started thinking about putting some patches in the blender myself. I don’t fully understand how you can run the blender code in test mode. How does the blender development process work? I downloaded the blender sources from git, installed CMake, Visual Studio Code, Git Bash, and so on, which was described here Building Blender/Windows - Blender Developer Wiki .
And I can create a blender build, but how to run the blender in test mode without creating a build?

I do not quite understand what you are asking?

Also VS Code and Visual studio are different products, for ease of use we only recommend regular Visual Studio on the wiki.

Yes, I understand that)). I’m more interested in how to run the blender in test mode in VS Code, BUT if you know how to run it in VS 2019, it will also be useful for me

I’m still unsure what you are trying to do “test mode” ?

Are you just trying to run the code in the debugger? or are you looking to run the unit tests?

I don’t know the correct names yet, so please excuse me. I assume there is a way to start the VS blender. For example, I wrote part of the code and want to test it, so I don’t have to build a new blender every time)

You change code, you have to rebuild, that’s just how software development works.

So every time you change a line of code you make a new build of the blender to check? How does debugger work?

C/C++ Yes, if you are editing python it’s generally enough just to restart blender.

Debugger for blender works the same as any other C/C++ project, it is best you seek answers to basic questions like these elsewhere, the visual studio documentation has a pretty good tutorial for using it.

@LazyDodo Actually we do have instructions for VS Code in the wiki (I’ve tested them myself, they work).

Using the regular Visual Studio requires less fiddling with the configuration and plug-ins though.

I am aware, don’t get me wrong, VSCode is pretty awesome and if it is your tool of choice: good choice! I am however not going to recommend it for new users.

As you can see in this thread software development can be overwhelming for new developers, exposing them to a thousand knobs they can and sometimes need to fiddle with is going to do two things.

  1. New developers get confused or just have issues due to mis-configuration or just environmental oddities
  2. We have to spend time helping them.

The windows build wiki/make.bat is designed to get people building with the least amount of effort, you have never compiled anything in your life? odds are you’ll be able to build blender with minimal/no support from our end.

VS Code as awesome as it is (use it on a daily basis for various things) is just not something we could recommend for beginning developers without substantially increasing support costs.

Ok, I’ll use MSVS. But I don’t quite understand the development process. Do you create a blender build and rebuild the modified parts when you change them? or…

The compiler is smart enough to only rebuild the changed code.

So that’s what you do?

I Don’t understand the question. It’s not a choice i make, you don’t choose to just rebuild the changed files, thats just what the compiler does, you have no choice in it, there is no option to go ‘oh yeah i changed 3 files, but just rebuild this one over here’ you change it, the compiler will rebuild it, no exceptions.

@derksen try inserting a printf("hi there") statement in filelist.c, and rebuild and open file browser in blender. and check console.$2476
Just here.

I realized that we were at an impasse. I’ll re-ask the question a little differently. Is there a video or, as a last resort, an article that shows or describes the blender development process?

… an article that shows … these should be good

1 Like

thank you very much, I will study it. If something is unclear, I will clarify

We have specific documentation for getting blender building since that bit is different from building other software, there is documentation on the code structure, code style and the release process

However none of these will answer ‘How do i use the debugger’ since that is a generic software development question, there’s nothing specific about using the debugger to debug blender or your own hello world application. It will be exactly the same.


great, thanks for the answer. I will study)