New port: graphics/sverchok-blender: Add-on for Blender: parametric tool for architects and designers
ClosedPublic

Authored by yuri on Mon, Jan 1, 12:20 AM.

Details

Summary

It allows to design 3D scenes in a very nice GUI visually, by constructing individual functional nodes.
Here is the screenshot: https://cloud.githubusercontent.com/assets/284644/5981635/a75e5a74-a8dd-11e4-9d1f-64e19da8f01a.png

Test Plan

Verified that Blender works fine with python-3.6, as expected.
I tried the add-on, and it also seems to work fine.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
yuri created this revision.Mon, Jan 1, 12:20 AM
yuri added a comment.EditedMon, Jan 1, 12:27 AM

This patch also makes the following supporting modifications to graphics/blender:

  • Creates Makefile.list with its own version, and python version for use by plugins
  • Updates it to python-3.6, which is currently a default version in python-3 series
  • Added USES=fortran, because plugins can use python packages built with fortran
  • Bumps PORTREVISION
yuri edited the test plan for this revision. (Show Details)Mon, Jan 1, 12:29 AM
yuri updated this revision to Diff 37337.Mon, Jan 1, 12:35 AM
yuri edited the test plan for this revision. (Show Details)

.

yuri edited the summary of this revision. (Show Details)Mon, Jan 1, 12:46 AM
yuri updated this revision to Diff 37338.Mon, Jan 1, 1:04 AM
yuri edited the summary of this revision. (Show Details)

.

yuri retitled this revision from New port: graphics/sverchok-blender: Plugin for Blender: parametric tool for architects and designers to New port: graphics/sverchok-blender: Add-on for Blender: parametric tool for architects and designers.Mon, Jan 1, 2:01 AM
yuri edited the summary of this revision. (Show Details)
yuri edited the test plan for this revision. (Show Details)

While the blender code only tests a minimum python version, newer versions aren't officially supported. v2.79 was released 12/9 using python 3.5.3. Since that release the minimum has been increased to 3.6.2 for the next release, so there has only been a couple of months testing with py3.6. See the install_deps.sh used for 2.79 and the commit made a week later updateing this to 3.6.2 for the next release.

There is no need for the cmake_Modules_FindPythonLibsUnix patch - to make the current blender build against python 3.6 all you need to add is CMAKE_ARGS+= -DPYTHON_VERSION:STRING=3.6 to the port Makefile and change USES= python:3.6 for the dependencies.

Blender doesn't use fortran and doesn't need any dependency for it. Ports like py-numpy are dependant on fortran and will have it installed. Now that flavours has hit ports I am able to add py-numpy as a dependancy, but haven't submitted that update. There have been fortran issues with using py-numpy, see bug 207750. So far the best solution seems to be to define LD_LIBRARY_PATH, personally I have a shell script in ~/bin that does this before starting blender. The addition of devel/flang may help resolve this but I haven't tested it yet. You may find this page helpful.

As for sverchok, I haven't used it a lot but the current head seems to still work fine with py3.5, the docs have only been updated today to say it requires 3.6 - math/py-numpy and www/py-requests can be installed for any python version.

While I install sverchok and animation nodes into my personal between release builds, I hadn't thought of adding them as a port, probably a good idea for both.

yuri added a comment.EditedMon, Jan 1, 7:57 AM

There is no need for the cmake_Modules_FindPythonLibsUnix patch - to make the current blender build against python 3.6 all you need to add is CMAKE_ARGS+= -DPYTHON_VERSION:STRING=3.6 to the port Makefile and change USES= python:3.6 for the dependencies.

Ok, I will update this. 3.5 seemed to be hardcoded there.

Blender doesn't use fortran and doesn't need any dependency for it. Ports like py-numpy are dependant on fortran and will have it installed.

Individual libraries using fortran can't be used unless the overall executable has been built with USES=fortran. So USES=fortran is needed.

So far the best solution seems to be to define LD_LIBRARY_PATH, personally I have a shell script in

Changing LD_LIBRARY_PATH is what USES=fortran does.

As for sverchok, I haven't used it a lot but the current head seems to still work fine with py3.5

Ports only support py3.5 for a limited subset of py-* ports, and py-requests isn't supported. py36 is considered a default python3 flavor, so we need to upgrade blender to py36.

graphics/sverchok-blender/Makefile
29 ↗(On Diff #37338)

I think it would be better to install extra addons into scripts/addons_contrib to keep them separate from official release addons.

yuri added inline comments.Mon, Jan 1, 8:09 AM
graphics/sverchok-blender/Makefile
29 ↗(On Diff #37338)

Ok, I will update this.

yuri marked 2 inline comments as done.Mon, Jan 1, 8:33 AM
yuri added inline comments.
graphics/sverchok-blender/Makefile
29 ↗(On Diff #37338)

Blender doesn't find the add-on when it is installed into share/blender/2.79/scripts/addons_contrib/sverchok/

yuri updated this revision to Diff 37343.Mon, Jan 1, 8:45 AM

Simplified Python version selection according to Shane's suggestion.
The alternative path for Blender add-on didn't work. Can always change later.

yuri marked an inline comment as done.Mon, Jan 1, 8:46 AM
mat added inline comments.Tue, Jan 2, 12:07 PM
graphics/sverchok-blender/Makefile
31 ↗(On Diff #37343)

Don't use do- and post-. Do everything in the do- target.

yuri marked an inline comment as done.Tue, Jan 2, 5:37 PM
mat added inline comments.Wed, Jan 3, 12:59 PM
graphics/sverchok-blender/Makefile
33 ↗(On Diff #37414)

As you only install stuff in share/blender/${BLENDER_BL_VERSION}/scripts/addons/${PORTNAME}, I think that you should limit both find to this directory. The second find seems most bogus.

yuri marked an inline comment as done.Wed, Jan 3, 5:05 PM
tcberner requested changes to this revision.Tue, Jan 9, 9:17 PM

blender/Makefile.versions is missing.

This revision now requires changes to proceed.Tue, Jan 9, 9:17 PM
yuri updated this revision to Diff 37697.Tue, Jan 9, 10:09 PM

The graphics/blender part was missing, sorry.

tcberner accepted this revision.Mon, Jan 15, 5:13 PM
This revision is now accepted and ready to land.Mon, Jan 15, 5:13 PM
This revision was automatically updated to reflect the committed changes.