unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36977: Add OpenSubdiv library, and add as Blender dependency
@ 2019-08-08 15:28 Christopher Lemmer Webber
  2019-08-11 11:32 ` Carlo Zancanaro
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Lemmer Webber @ 2019-08-08 15:28 UTC (permalink / raw)
  To: 36977

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#36977: Add OpenSubdiv library, and add as Blender dependency
  2019-08-08 15:28 bug#36977: Add OpenSubdiv library, and add as Blender dependency Christopher Lemmer Webber
@ 2019-08-11 11:32 ` Carlo Zancanaro
  2019-08-12 10:21   ` Carlo Zancanaro
  0 siblings, 1 reply; 4+ messages in thread
From: Carlo Zancanaro @ 2019-08-11 11:32 UTC (permalink / raw)
  To: 36977

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

On Fri, Aug 09 2019, Christopher Lemmer Webber wrote:
> 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!


[-- Attachment #2: 0001-gnu-Add-opensubdiv.patch --]
[-- Type: text/x-diff, Size: 2781 bytes --]

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(+)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#36977: Add OpenSubdiv library, and add as Blender dependency
  2019-08-11 11:32 ` Carlo Zancanaro
@ 2019-08-12 10:21   ` Carlo Zancanaro
  2019-08-13 18:44     ` Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: Carlo Zancanaro @ 2019-08-12 10:21 UTC (permalink / raw)
  To: 36977

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

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!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-blender-Add-opensubdiv-as-an-input.patch --]
[-- Type: text/x-diff, Size: 1248 bytes --]

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(+)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#36977: Add OpenSubdiv library, and add as Blender dependency
  2019-08-12 10:21   ` Carlo Zancanaro
@ 2019-08-13 18:44     ` Leo Famulari
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2019-08-13 18:44 UTC (permalink / raw)
  To: Carlo Zancanaro; +Cc: 36977-done

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

On Mon, Aug 12, 2019 at 08:21:44PM +1000, Carlo Zancanaro wrote:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-13 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 15:28 bug#36977: Add OpenSubdiv library, and add as Blender dependency Christopher Lemmer Webber
2019-08-11 11:32 ` Carlo Zancanaro
2019-08-12 10:21   ` Carlo Zancanaro
2019-08-13 18:44     ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).