Add OpenSubdiv library, and add as Blender dependency

  • Done
  • quality assurance status badge
Details
3 participants
  • Carlo Zancanaro
  • Christopher Lemmer Webber
  • Leo Famulari
Owner
unassigned
Submitted by
Christopher Lemmer Webber
Severity
normal

Debbugs page

Christopher Lemmer Webber wrote 6 years ago
(name . bug-guix)(address . bug-guix@gnu.org)
87mugj1xt6.fsf@dustycloud.org
I was surprised to open Blender 2.80 and find that subdivision surfaces
(necessary for organic modeling) were doing nothing. I couldn't figure
out why this was, until I found out that Blender now uses OpenSubdiv
for subdivision surfaces.

Don't think I have time to package it right now, but if someone was
willing to package this and add it as a Blender dependency, I'd be
extremely grateful to them.

- Chris
Carlo Zancanaro wrote 6 years ago
(address . bug-guix@gnu.org)(address . 36977@debbugs.gnu.org)
87o90wkkea.fsf@zancanaro.id.au
On Fri, Aug 09 2019, Christopher Lemmer Webber wrote:
Toggle quote (5 lines)
> I was surprised to open Blender 2.80 and find that subdivision
> surfaces (necessary for organic modeling) were doing nothing. I
> couldn't figure out why this was, until I found out that Blender
> now uses OpenSubdiv for subdivision surfaces.

I gave this a go, but it didn't go as smoothly as I had hoped. I
packaged opensubdiv, which I have attached, but adding it to the
Blender inputs didn't cause the subdivision modifier to work. I'm
not really able to take this any further, but this is at least
something to start with!
From 959496bd6461474a30ce0e28ee0f6765a7523671 Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
Date: Sun, 11 Aug 2019 21:25:14 +1000
Subject: [PATCH] gnu: Add opensubdiv.

* gnu/packages/graphics.scm (opensubdiv): New variable.
---
gnu/packages/graphics.scm | 43 +++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index bc3a418e99..11ea550039 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2018 Alex Kost <alezost@gmail.com>
;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2019 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -77,6 +78,48 @@
#:use-module (guix packages)
#:use-module (guix utils))
+(define-public opensubdiv
+ (package
+ (name "opensubdiv")
+ (version "3.4.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_4_0.tar.gz"))
+ (sha256
+ (base32
+ "1r3ki5lql9i71c775n6d8gxix4svg9f17ck0i58wfw9kz29b4cnr"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-before 'configure 'set-glew-location
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
+ #t))
+ (add-before 'check 'start-xorg-server
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; The test suite requires a running X server.
+ (system (string-append (assoc-ref inputs "xorg-server")
+ "/bin/Xvfb :1 &"))
+ (setenv "DISPLAY" ":1")
+ #t)))))
+ (native-inputs
+ `(("xorg-server" ,xorg-server)))
+ (inputs
+ `(("glew" ,glew)
+ ("libxrandr" ,libxrandr)
+ ("libxcursor" ,libxcursor)
+ ("libxinerama" ,libxinerama)
+ ("libxi" ,libxi)
+ ("zlib" ,zlib)
+ ("glfw" ,glfw)))
+ (home-page "http://graphics.pixar.com/opensubdiv/")
+ (synopsis "High performance subdivision surface evaluation")
+ (description
+ "OpenSubdiv is a set of libraries that implement high performance
+subdivision surface (subdiv) evaluation on massively parallel CPU and GPU
+architectures.")
+ (license license:asl2.0)))
+
(define-public blender
(package
(name "blender")
--
2.22.0
Carlo Zancanaro wrote 6 years ago
(address . bug-guix@gnu.org)(address . 36977@debbugs.gnu.org)
87pnlar8ef.fsf@zancanaro.id.au
On Sun, Aug 11 2019, Carlo Zancanaro wrote:
Toggle quote (3 lines)
> ... adding it to the Blender inputs didn't cause the subdivision
> modifier to work. ...

Well, it turns out I just had to add the -DWITH_OPENSUBDIV=ON
configure flag. Here's a new patch to do that!
From 231763df5b336118dae973da9dbde362dd1c1465 Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
Date: Mon, 12 Aug 2019 20:15:11 +1000
Subject: [PATCH] gnu: blender: Add opensubdiv as an input

* gnu/packages/graphics.scm (blender)[inputs]: Add opensubdiv.
[arguments]: Add "-DWITH_OPENSUBDIV=ON" to #:configure-flags.
---
gnu/packages/graphics.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (22 lines)
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 11ea550039..b9207f284d 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -147,6 +147,7 @@ architectures.")
"-DWITH_INSTALL_PORTABLE=OFF"
"-DWITH_JACK=ON"
"-DWITH_MOD_OCEANSIM=ON"
+ "-DWITH_OPENSUBDIV=ON"
"-DWITH_PYTHON_INSTALL=OFF"
(string-append "-DPYTHON_LIBRARY=python" ,python-version "m")
(string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
@@ -182,6 +183,7 @@ architectures.")
("libx11" ,libx11)
("openimageio" ,openimageio)
("openexr" ,openexr)
+ ("opensubdiv" ,opensubdiv)
("ilmbase" ,ilmbase)
("openjpeg" ,openjpeg)
("libjpeg" ,libjpeg)
--
2.22.0
Leo Famulari wrote 6 years ago
(name . Carlo Zancanaro)(address . carlo@zancanaro.id.au)(address . 36977-done@debbugs.gnu.org)
20190813184431.GA20996@jasmine.lan
On Mon, Aug 12, 2019 at 08:21:44PM +1000, Carlo Zancanaro wrote:
Toggle quote (7 lines)
> On Sun, Aug 11 2019, Carlo Zancanaro wrote:
> > ... adding it to the Blender inputs didn't cause the subdivision
> > modifier to work. ...
>
> Well, it turns out I just had to add the -DWITH_OPENSUBDIV=ON configure
> flag. Here's a new patch to do that!

Thanks! Pushed as 588a0a335d09311197352c7f49d5541ef2717cc8
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAl1TBQ8ACgkQJkb6MLrK
fwhTEA/8Cr19icgKFnefmlhZYa7f6p6fqwCa+HpTVblvENkGWVXth0g3XHB8i40P
ug3/4VPx4UDgh3SmKcCrt9jJm29ik47vznMLIMFy8b/K51eAzvX22NTtmjU8dHw6
9O6ZNrz1qAK8BmGuvIENkNUHy4AxnrdlDY3f7jPxrNo5wPXJX32oEtZS1D3/kZsA
U/BL8uODzPyHhoL7ujtuyeE6ACy60OufZ1gO3cYfNY2nlXcgX4aPrEYD2L2B06U6
46xd6/uChSH8fxz5No9BRedn0WiNPeNwxcvdoTX7261bDWicvGebPZ9sBviKvAPY
M2TPwQvq9Omq93HNkoSxc3JdMZSw6x2nkOFwBKMvIySFghl7b7eHt/cppmWhmmzx
cUW/Iiw74BPp7cwPAN4hfNMH/jRolWiOHe4MSVl5GcnNoOvb41S+rmx4GcdF8Qo6
6TED2clT7vU0vTRTcsVitgBQ+AbvIByykpZt4DGsJRVTh2cWSP8lGE1+D7jEYemF
8drHAgmTVVF3kTX9HGOr0I5IFZ0dqHdybZCqipobwRLiF0tSMxKlHQcPf+1agKmv
zQxtldGvRICNLGxFSQJ51yJsumLTIser07lWiDSfn/OfngX58EYfGWOW3eWJdqGt
OKEpeb423l2BWlPyaLzF1UTXSdbfuaVVukg7C4EpAFHKH7NRhus=
=KE4t
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 36977@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 36977
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help