Thursday, August 30, 2018

Develop Blender On Windows - 1. How to get started (build Blender) and why it seems difficult at the beginning for beginners?

This series of articles is ment to serve beginners as my self. I did a lot of python scripting in the past, but I have no idea how to develop software in C/C++. I do not have any experience with these language but I belive it can't be too hard. Why not to start learning C/C++ with developing Blender.

I wrote this article during my quest to build Blender which is the first step. My longest article so far. I tried to write it as it was happing and to write my first reactions (which could be changed later). After that I started to summarize what I experienced. So I'm going to write more in detail about it in the future. If you are a beginner and you want to avoid confusion about what we do and why we do that way you might want to check later articles (if there is). The information I write is valid now but I guess it will be obsolate after a couple of month or so. If you find something that I should have to update, please let me know!

Fortunatelly we are not alone. There is a page on blender.org which describes how to start:
https://wiki.blender.org/wiki/Developer_Intro/Advice


It says first: build Blender! So I'm going to do what it says step by step (for me it took around an afternoon (4-5 hour) to "finish"). I use Windows so I need to follow that:
https://wiki.blender.org/wiki/Building_Blender/Windows
I refer to this particlular page later when I write Blender Wiki.


I guess I'm not the only person who does not like to install lot of softwares on their computer. That's why I raise that question again and again: why these programs (how do we call them?) are necessary to develop Blender?

1. Visual Studio 2017 Community Edition
So as it says we have to install Visual Studio. More precisely: Visual Studio Community. It raises the first questions:
What is Visual Studio?
Why is it necessary to develop Blender?
Of course I could spend time to find the answares by myself but it would be nice to have couple of words about Visual Studio on Blender Wiki.
What I know at the moment that C/C++ differs from python that the code written in these languages have to compile to get the executable program. I guess that is the main reason.

Okay, just let it happen. There is the link:
https://visualstudio.microsoft.com/free-developer-offers/


It takes around 5 minutes to install.


Note: If you are installing right now please read the end of the article because I had a problem with compiling Blender so I had to install more so called workloads later to correct that.


Just to mention with Pyhton extension:
2 GB disk space

After that we have to restart the computer. The first start is a bit tricky. It says takes a few minutes to start and it really are few minutes. After around 30 minutes I had the feeling I was stuck at the very first step. With Task Manager I shut it down, but after that the program didn't start at all. Surprisingly after that I restarted the computer the Visual Studio started as it should.

2. Subversion for Windows
As far as I remember I heard about Subversion as a version control solution, but that's all what I know about it. Again: the Blender Wiki does not provide any information about what it is? Why it is  necessary to develop Blender? Of course if we have plenty of time to research we can read about Subversion a lot:
https://en.wikipedia.org/wiki/Apache_Subversion
On Blender Wiki we have only that link:
https://sliksvn.com/download/

As a matter of fact it is not Subversion but SlikSVN. So what a hack is that? Ok, I know that SVN is the abbreviation of Subversion. And we can read that on the website:

"We provide a standalone command-line Subversion client for Windows."
I guess for an experienced developer it is clear as the sky, but for me is definatelly not.
Okay, just let it happen.


To install SlikSVN is straithforward. I choosed Typical settings.

But...I guess when they write "command-line Subversion" it explains why I can't find the program in the Windows start menu. So I can't launch that program as usually do with softwares. Let's move on.

Just to mention it is around:
16 MB

3. Git for Windows
So what a hack is git? I'm convinced that in this case git has nothing to do with unpleasant persons (as the dictionary describes the word: git). Wikipedia is the better choice:
https://en.wikipedia.org/wiki/Git
I would really preciate if somebody took the time to explain all this stuff for beginners.

On Blender Wiki we have only that link:
https://gitforwindows.org/

And we have only one hint:
"In the installer, choose to add Git to your PATH to ensure the Git version is in the splash screen."

Installing Git for Windows is definatelly very very not straightforward. Plenty of settings without any guide, and during installation there is no option as mentioned on the Blender Wiki. We can hope that the default settings are fine. If it is the case why can't be there a short descrition on Blender Wiki: "Every time if you are not sure what is the right option to choose during the installation just hit the Next button."








The installer said it would be 230 MB but I checked the folder which was 500 MB.

4. CMake
So what a hack is Cmake? Wikipedia says:

"CMake is a cross-platform free and open-source software application for managing the build process of software using a compiler-independent method."

Definitely not what I can undersand at the moment. Just move on!

The Blender Wiki has a link to:
https://cmake.org/
giving a headache to find out which version to download. I hit Download Latest Release on that page I found this:



It seems there is zip version of Cmake (like Blender), so it is not necessary to install. I prefer that. But Blender Wiki says:
"In the installer, choose to add Git to your PATH to ensure the Git version is in the splash screen."
That means we have to install to get the right settings (I tried the other way and it didn't work :) I guess it could work somehow with setting Environment Variables). So we need to choose:

Windows win64-x64 Installer: Installer tool has changed. Uninstall CMake 3.4 or lower first!



To install CMake is straithforward. I choosed that PATH option and that was all.




The CUDA install is optional so I skip it for now.

SO WE DID IT!

Ready to get Blender source code and the other unknown but necessary stuff. We can follow the instruction. Have to make a folder. I stick to the description: C:\blender-git.
There is a thing: command line. For beginners it can be frightening to type commans but the description on Blender Wiki is pretty clear 😃. We have to lunch cmd which is basically pop up a new window with only text, the so called Command Prompt.



We have to type what Blender Wiki writes about it. Every line of the text is one command. So we have to hit Enter after each line. There are DOS specific commans and others...
There is another interesting thing (which is not very offen communicated) that the font type of a program code is always Courier. Why? I wrote about it here. We can recognize on Blender Wiki that these lines are commands.

5. Precompiled Libraries

This line of command: 
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/win64_vc14 lib/win64_vc14
tells me that the svn is the command and that's why we had to install SlikSVN. Forthermore on Blender Wiki below the Advanced Setup we can read that.
"Subversion is required for accessing precompiled libraries."
It is a little bit of help to understand what is going on, but somebody should tell me what are these precompiled libraries?
I run that svn command and it took around 15 minute to download (?) all the stuff and it required 7 GB discpace.




Now I have this structure below c:\blender-git\lib\win64_vc14\

So we can see libs are stuff in connection with CGI like openSubdiv and openExr.


6. The Blender Source Code

The next step is to "download" the Blender source code with git commnads. Of course only lines started with git are these.

It is much faster than te previous step and intrestingly it is only 746 MB.








7. Compile Blender
The final-final step of the begining of this long-long journey. The command:
make full
Simple as one, two, three. It should be. But I got an error message.

No explicit msvc version requested, autodetecting version.
Compiler Detection failed. Use verbose switch for more information.
Visual Studio not found (try with the 'verbose' switch for more information)


I had hard time to figure out how to use 'verbose' switch. According to my experience command switch or flags usually typed like -v or -verbose. Finally I suceeded with that:

make full verboes

And the verbose message was this:

"svn   : C:\Program Files\SlikSvn\bin\svn.exe
cmake : C:\Program Files\CMake\bin\cmake.exe
git   : C:\Program Files\Git\cmd\git.exe
No explicit msvc version requested, autodetecting version.
Detecting msvc 2017
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest  -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
Detecting msvc 2015
Visual Studio 2015 not found.
Compiler Detection failed. Use verbose switch for more information.
Visual Studio not found (try with the 'verbose' switch for more information)"


I had to have some help because I had no idea what to do. I felt that something with Visual Studio is not correct. As I wrote before there was a wierd stuff at the first launch. I subscribed to bf-committers@blender.org mailing list long time ago so I had the chance to ask about this problem. Fortunatelly I got an answer and it solved to problem.
I had to install another workload to Visual Studio called Desktop development with C++







With pyhton extension and C++ desktop development extension: 5.2 GB

After that it workd fine for me.




 BLENDER IS BUILT!

One little problem that I did not get the massage described on Blender Wiki:
Blender successfully built, run from: 
C:\blender-git\build_windows_Full_x64_vc14_Release\bin\Release
 Right now I don't know why but the complied version of Blender works fine. Yupee! It is the version 2.79 which is stable but 2.8 is comming soon, so I have to investigate how to get the source code of 2.8 and complie it.
To be continued...

Why Courier is the font of program codes?

As we all know VFX has to do with programming (basically everithing which is in connected with computers does). That's why this question arises
Is far as I know Courier font came from film making where the so called script or with an other word the screenplay is always written in Courier (size: 12 pt).



As a screenplay (or script) determines what will happen on stage or on screen, the programming script determines what will happen on the computer screen. Okay it's quite over simplfied explonation😃. But I think the reason of the Courier font is something like this. So whenever we see Courier font text and it is not film making context the text has to be program code

There is another explonation here:

https://www.quora.com/Why-do-some-programmers-use-the-Courier-typeface-in-coding


Tuesday, July 31, 2018

Making Of - Psyop Chameleon

Psyop made a CG chameleon with level of realism which has never been seen before. Okay, it sound like a PR article so far. I just want to say it is really-really cool. And the making of video is also an extraordinary.



Check this out here


What is missing here that Fabric Engine has shutted down for a while and nobody really knows what happened. Psyop was one of the key customers of Fabric Engine and they published a couple of excelent demo about how they use it. I guess they had to remove them all from the web.

What we know that on of the co-founders Paul Doyle went to MPC.


Tuesday, July 24, 2018

VFX Career - What professionals say about it

The Autodesk Area has an iteresting article about what VFX professionals say about their early careers and share their most important lessons.

https://area.autodesk.com/life-in-3d/want-to-land-a-job-in-vfx-take-notes-from-these-5-pros/

Monday, June 25, 2018

Blender - Everything Nodes

It is happeing! Jacques Lucke in da hauz! I was very upset when couple of month ago they talked about removing the Game Engine, but right no things looks so right. I don't feel to comment this:


Monday, April 16, 2018

Blender - Animation Nodes (AN)

If you heard about Blender you might hear about Animation Nodes (AN for short). Really-really awsome add-on for procedural workflows developed by an incerdibly young guy, Jacques Lucke.

You can find everything about AN here.

And here is the annual showreel of Animation Nodes (and Blender of course). I think now Blender is on the verge of spreading all over the CG/VFX industry. This clip shows with Blender you can really do anything.


You can find my name on the list of the supporters! Finally I became famous :)

Saturday, February 17, 2018

Blender 2.8 - You know...

Now is the time!

Blender Code Quest 

Pretty please with surag on the top, help to fund the Blender 2.8 project right here, right now!

Well if you don't know what I'm talking about (btw you live in a cave in this case) you can read about it here:

If you don't know what is Blender, in this case I have to ask: 
Are you a robot or an A.I. algorithm and you are about to crash my blog??