2

SVG

If I do changes on SVG file located in ~/blender-build/blender/release/datafiles folder, save it and run commands

cd ~/blender-build/blender make icons

it ends with

FileNotFoundError: [Errno 2] No such file or directory: 'blender': 'blender' make: *** [icons] Error 1

Wiki has a note which I don't understand: "... both inkscape and blender must be in the system PATH for this command to execute properly." Official Blender build and Inkscape are located in /Applications folder, but only Blender arised as error.

  • What is that system PATH?

  • How can I recognise if PATHs are set right? (how they should looks like?)

vklidu
  • 36,165
  • 1
  • 61
  • 135

2 Answers2

1

Blender uses uncompress bitmaps for the icons, which are generated from the svg with a python script which depends on inkscape and blender. See this for details.

The basic workflow should be something like:

  1. Edit svg

  2. Run the python script in

    blender/release/datafiles/blender_icons_update.py
    

    If you are on linux, you can also run make icons instead.

  3. Compile

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
  • @vklidu It generates .dat files from the png files using blender, then deletes the pngs. The system path bit means that running "blender" or "inkscape" at the CLI should start blender or inkscape, without the full path to the executables. – gandalf3 Oct 04 '14 at 17:49
  • @vklidu If it's still not working, could you post the output of the python script? – gandalf3 Oct 05 '14 at 22:12
  • OK, I put outputs as a more drastic changes in my Q. It's result of yesterday search. Seems like the understanding of the "PATH" is key. Thanks for patience. I can erase parts "PATH" and "BUILD" that are my messy tries. And I will keep only first part with questions if it will be solved in answer. – vklidu Apr 04 '18 at 11:22
  • @vklidu I don't have a mac to test on, but I don't see anything obviously wrong with your PATH adjustment. You could try setting the path to blender directly in the icon script (see lines 34 and 49) and running it manually. Re: cmake, is cmake installed? – gandalf3 Apr 05 '18 at 01:38
  • In my "blender_icons_update.py" I don't think I can do that on lines 34,49. See http://pasteall.org/blend/index.php?id=49271 Re: cmake, yes installed. Via cmake I generated Xcode project and compile blender with Xcode as described on wiki. – vklidu Apr 06 '18 at 23:06
  • Blender needs to be installed. It does the job of slicing the iconsheet in the background. Under windows there is a place for the system variables. Google search for Path and environment variables in Windows. Both, Blender and Inkscape needs to have an entry in the path item. Normally this happens automatically at installing both software. – Tiles Apr 07 '18 at 13:07
  • 1
    @vklidu Your file is different from mine; in your case it looks like you want line 15 – gandalf3 Apr 07 '18 at 18:50
  • @gandalf3: thanks, works! There should be a note on wiki. It was a pain. Quite interesting is that Inkscape has written whole path in script, so if I would install app somewhere else, script would be broken again, right? Also I set alias for blender to be executable by word "blender" (and it works), so isnt this line 15 for that? - execute blender by word? So it should work witout full path, right? – vklidu Apr 07 '18 at 20:16
  • @vklidu It only uses that if a file exists at that location. If it doesn't, it falls back to just calling "inkscape", hoping it's in the PATH. Perhaps the reason for that being done was to workaround the same kind of situation you're running into with blender now.. – gandalf3 Apr 07 '18 at 20:18
  • @vklidu Aliases only work in the shell they are defined in. Python will create a new shell (which knows nothing about other shell's aliases) and run "blender" there. If "blender" isn't found in the PATH environment variable, then it's "command not found". Environment variables are inherited from process to process, so if you set PATH in your shell and then run python (which then runs it's own shell in order to call "blender"), the PATH you set should be carried down the chain and also be set for python's subshell. Try running python -c 'import os;os.system("echo $PATH")' to test it. – gandalf3 Apr 07 '18 at 20:23
  • Output is the same as for echo $PATH in my answer (Note 1) -path to blender is there, I set permanent PATH to blender already. I just expected that alias and PATH is created for a reason - to be accesible for any new Shell. If you say alias is not visible for new shell created by Python, OK its enough to know for me :) thanks – vklidu Apr 07 '18 at 20:47
0

system PATH

On command echo $PATH are displayed these paths by default. Each path is separated by colon and specificaly these are stored in etc/paths file:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

add PATH

export PATH="/Applications/Blender/Blender.app/Contents/MacOS":"$PATH"
echo PATH="/Applications/Blender/Blender.app/Contents/MacOS":"\$PATH" >> ~/.profile

It creates a new line with PATH into .profile file.

... to be sure

If I'm right you should have listed Blender, Inkscape and CMake in this file to be able regenerate new blender icons and compile Blender. If you open hidden .profile file (located in home directory) via mac TextEdit or via Terminal's editor sudo nano ~/.profile it should consist from this text:

PATH=/Applications/Blender/Blender.app/Contents/MacOS:$PATH
PATH=/Applications/Inkscape.app/Contents/MacOS:$PATH
PATH=/Applications/CMake.app/Contents/bin:$PATH

On echo $PATH you should see now: /Applications/CMake.app/Contents/bin:/Applications/Inkscape.app/Contents/MacOS:/Applications/Blender/blender.app/Contents/MacOS:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin


Note 1: After XQuartz installation (needed to run Inkscape) you can see on echo $PATH also /opt/X11/bin path that is located in etc/paths.d/40XQuartz file. So, if you close and open a new Shell (Terminal window) you should see these path on echo $PATH command like this

/Applications/Blender/blender.app/Contents/MacOS:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

Note 2: You can add PATH also by editing ".profile" file from Finder. Let "Show hidden files" with Cmd+Shift+. Go to Macintosh HD > Users > "youraccount" folder and open ".profile" file in TextEdit and copy paste PATH=/Applications/Blender/blender.app/Contents/MacOS:$PATH and save it. If you open a new Shell you can see the path on echo $PATH command.

Note 3: I saw paths can be stored in other files like ".bash_profile" if any, but since I already created alias for blender, it make sence to me store also this PATH in one file. Also other app generated the path to this .profile file, so I hope it's correct :)

Note 4: path /Applications/Blender/blender.app/Contents/MacOS works only in case your blender.app is in "Applications" directory. If you placed your app somewhere else edit the text acording to your path. You can get the path by drag&drop "MacOS" folder into Terminal window. To get such deep directory click on blender app icon with RMB and choose "Show package content".

Note 5: Be carefull with quotation marks. They has to be traight "abc" Pasting them from text editor they can be also 6-9 type, looks like angeled “abc”. These are not working!

vklidu
  • 36,165
  • 1
  • 61
  • 135