Alembic I/O.

Thanks so much. Really looking forward to this!

Look at the first post. (hint: https://www.dropbox.com/sh/7tmfto1hruax2yw/AACAHtvXp1k6ElI7DoNEy6zWa?dl=0)

Thank you!

Windows is updated again with hash 921e428.

@KWD, I always apply a small patch to compile on windows, can you implement something like it?
Basically, it moves the library detection block to its corresponding place inside unix config and creates a windows lib config (no hdf5).
It also enables WITH_ALEMBIC by default, after all it’s the alembic branch.
It’s the minimal modification I need to compile on windows, sure it can be better.


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 918b965..0428179 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -324,23 +324,9 @@ option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.org)" ${_i
 option(WITH_CODEC_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
 
 # Alembic support
-option(WITH_ALEMBIC             "Enable Alembic Support" OFF)
+option(WITH_ALEMBIC             "Enable Alembic Support" ON)
 option(WITH_ALEMBIC_HDF5        "Enable Legacy Alembic Support" OFF)
 
-# alembic
-if(WITH_ALEMBIC AND NOT APPLE) # LIBDIR not yet set, so cannot set root dirs for lookup !
-    find_package(Alembic)
-
-    if(WITH_ALEMBIC_HDF5)
-        find_package(HDF5)
-    endif()
-
-    if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
-        set(WITH_ALEMBIC OFF)
-        set(WITH_ALEMBIC_HDF5 OFF)
-    endif()
-endif()
-
 if(APPLE)
     option(WITH_CODEC_QUICKTIME     "Enable Quicktime Support" ON)
 endif()
@@ -1109,6 +1095,19 @@ if(UNIX AND NOT APPLE)
         endif()
     endif()
 
+    if(WITH_ALEMBIC)
+        find_package(Alembic)
+
+        if(WITH_ALEMBIC_HDF5)
+            find_package(HDF5)
+        endif()
+
+        if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
+            set(WITH_ALEMBIC OFF)
+            set(WITH_ALEMBIC_HDF5 OFF)
+        endif()
+    endif()
+
     if(WITH_BOOST)
         # uses in build instructions to override include and library variables
         if(NOT BOOST_CUSTOM)
@@ -1679,6 +1678,13 @@ elseif(WIN32)
             set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
         endif()
 
+        if(WITH_ALEMBIC)
+            set(ALEMBIC ${LIBDIR}/alembic)
+            set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC}/include)
+            set(ALEMBIC_LIBRARIES Alembic)
+            set(ALEMBIC_LIBPATH ${LIBDIR}/alembic/lib)
+        endif()
+
         if(WITH_MOD_CLOTH_ELTOPO)
             set(LAPACK ${LIBDIR}/lapack)
             # set(LAPACK_INCLUDE_DIR ${LAPACK}/include)


Thats not a good idea, Why not just use the findmodule but feed it with the right root dir in libdir as i did for osx ( which you break with you patch btw. )

Jens

I am not asking for this exact patch to be implemented but something like it. But if using findmodule can be made to work with windows, I have nothing against it.

Did not use findmodule because all other windows libs seem to be coded like this, with hard-coded LIBDIR paths, just check the libs before and after the windows lib config. I just followed what was coded around in the WIN32 lib config.

Why do you say this breaks the osx patch? I may have missed something but I don’t think it breaks the osx code.
Currently the alembic findmodule code is around line 320+, just after option values are set. I moved it to line 1100+, inside a if UNIX and not APPLE with the rest of unix findmodules and in a part of the code where it will be able to use the appropriate find_package macro for dynamic or static libs. The osx code you added is untouched in the APPLE part of ‘Main Platform Checks’ code.

You are right, you removed the whole common lookup which only worked for linux, so osx was not affected. Sorry, overlooked this.

I propose for win do the same as i did for osx, The ALEMBIC_ROOT_DIR is the first lookup in the findmodule, so just set this in win, aka = ${LIBDIR}/alembic.
For linux the /opt/lib will succes in most cases.

BTW. just cause some libs are done hardcoded means nothing but these may not have ( cmake or custom ) find modules.

Jens

Makes sense, now I understand. I was just surprised that almost everything on the WIN32 part was hardcoded, so I did the same for alembic. Will try to use find_package later.

Edit:

Tested and compiled successfully with this patch. Basically copying the same code from APPLE to WIN32, works right away. Also, replaced find_package with find_package_wrapper in unix code to match all other unix libs. But whatever you think is best will do for me as long as windows compiles without patching the branch.


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 918b965..543671f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -324,23 +324,9 @@ option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.org)" ${_i
 option(WITH_CODEC_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
 
 # Alembic support
-option(WITH_ALEMBIC             "Enable Alembic Support" OFF)
+option(WITH_ALEMBIC             "Enable Alembic Support" ON)
 option(WITH_ALEMBIC_HDF5        "Enable Legacy Alembic Support" OFF)
 
-# alembic
-if(WITH_ALEMBIC AND NOT APPLE) # LIBDIR not yet set, so cannot set root dirs for lookup !
-    find_package(Alembic)
-
-    if(WITH_ALEMBIC_HDF5)
-        find_package(HDF5)
-    endif()
-
-    if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
-        set(WITH_ALEMBIC OFF)
-        set(WITH_ALEMBIC_HDF5 OFF)
-    endif()
-endif()
-
 if(APPLE)
     option(WITH_CODEC_QUICKTIME     "Enable Quicktime Support" ON)
 endif()
@@ -1109,6 +1095,19 @@ if(UNIX AND NOT APPLE)
         endif()
     endif()
 
+    if(WITH_ALEMBIC)
+        find_package_wrapper(Alembic)
+
+        if(WITH_ALEMBIC_HDF5)
+            find_package_wrapper(HDF5)
+        endif()
+
+        if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
+            set(WITH_ALEMBIC OFF)
+            set(WITH_ALEMBIC_HDF5 OFF)
+        endif()
+    endif()
+
     if(WITH_BOOST)
         # uses in build instructions to override include and library variables
         if(NOT BOOST_CUSTOM)
@@ -1679,6 +1678,20 @@ elseif(WIN32)
             set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
         endif()
 
+        if(WITH_ALEMBIC)
+            set(ALEMBIC_ROOT_DIR ${LIBDIR}/alembic)
+            find_package(Alembic)
+            if(WITH_ALEMBIC_HDF5)
+                set(HDF5_ROOT_DIR ${LIBDIR}/hdf5)
+                find_package(HDF5)
+            endif()
+
+            if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
+                set(WITH_ALEMBIC OFF)
+                set(WITH_ALEMBIC_HDF5 OFF)
+            endif()
+        endif()
+
         if(WITH_MOD_CLOTH_ELTOPO)
             set(LAPACK ${LIBDIR}/lapack)
             # set(LAPACK_INCLUDE_DIR ${LAPACK}/include)


Hi,

Problems with importing RealFlow Hybrido VDB Mesh. Don’t import at all. Newest build from Fjuhec.

https://drive.google.com/open?id=0BxDlpIQ_JtW2OTBPUi1KRUszajg

If that give You something. It’s just a Dyverso simulation, converted then to Hybrido simulation (get particles- set particles), and added splash hybrido. It shouldn’t make a difference I believe what You do in RF. It anyway is later meshed with Hybrido VDB. But there is specifically a Hybrido mesher for this. Maybe it helps.

EDIT:
NOPE it’s not because of Hybrido bla bla thing, I saved ABC from Dyverso, and also not working. Earlier it was working, 1, 2 or 3 builds earlier from Fjuhec.

This is a legacy HDF5 file, which is not supported anymore (since the update to Alembic 1.6), you need to save it to Ogawa or convert it using abcconvert.

KWD- how to convert? abcconvert ?

I know it’s better to have 1.6 and everything will be anyway supported later. But yeah I need it now.
Can You give any clues how to convert this?

Fjuhec- Can I ask for last HDF5 build? I really need it.

Regards,
Kamil.

EDIT- Get it worked with exporting from Houdini. But anyway please explain KWD this “abcconvert” thing. ALSO SMOOTHING ISN’T WORKING on meshes, known issue?

Updated the OSX build.

– PACKAGE-INFORMATION –
Branch: alembic_basic_io
Revision: ebfc3f3
Shasum: a38c3061bcd03d78cccd19a7fbc6b43690606dcc
URL: http://www.linesofjasper.com/blender/blender_alembic_basic_io_osx64_latest.zip

jasper

When you build Alembic, you end up with the library and a few executables to inspect and/or manipulate Alembic archives. For example there is abcstitcher which output a single archive from a file sequence. Using abcconvert you can convert an HDF5 archive to an Ogawa one (abcconvert -toOgawa file.abc). These executables should be shipped with Houdini, not sure if other software also ship them.

Smoothing is working as long as the normals are saved as polygon data in the archive (Blender only does smooth normals for face polygon, not vertex normals).

Linux with latest vertex color and curve changes:

– PACKAGE-INFORMATION –
Branch: alembic_basic_io
Revision: ebfc3f3
Submodules: locale a87cfb8 addons 75fb4e0 addons_contrib 72c24a1
OS: GNU/Linux, Architecture: x86_64, GLIBC: 2.19
Builddate: Mi 6. Jul 09:05:27 UTC 2016
Filesize: 72218372 byte
Shasum: 99270751812a75c3e2ac8e3f35599fe7baa5043c
URL: http://www.jensverwiebe.de/Blender/blender_alembic_basic_io_linux64_latest.tar.xz

For the former discussed problem with now not supported hdf5 files, i put testwise the alembic binaries here:
URL: www.jensverwiebe.de/Blender/alembic_utilities_linux64.tar.xz
Shasum: 4e4affcf8ea2f6725674ca0173ea99336e985dff

Example: the alembic_octopus.abc will not work with our newest builds because it is of ( an older version ) hdf5 type. Unpack the utilities where you want and then in terminal, do from the alembic_utilities dir:

./abcconvert -toOgawa <path_to_file>/alembic_octopus.abc <path_to_file>/alembic_octopus_ogawa.abc

Then load the created alembic_octopus_ogawa.abc as usual.

BTW: the binaries will show their options and usage typically with: ./<binaryname> --help

Jens

I added initial support for motion blur in Cycles, though there are a couple of issues:

  • half the data seems to be missing
  • the motion vectors needs to be scaled, and I’m not sure what metrics to use here (scale by object dimension? FPS (frame duration)?), so if people have ideas here, based on usage in other software, or how they were exported, I’d be interested to here them. Maybe we should expose a setting in the UI (in the modifier)?

Updated windows build with latest commit d4c60d6.

Dito Linux:

– PACKAGE-INFORMATION –
Branch: alembic_basic_io
Revision: d4c60d6
Submodules: locale a87cfb8 addons 75fb4e0 addons_contrib 72c24a1
OS: GNU/Linux, Architecture: x86_64, GLIBC: 2.19
Builddate: Do 7. Jul 14:30:27 UTC 2016
Filesize: 72258080 byte
Shasum: b2ba1a3f585c48e5797073bf4aaf3c4044ec2b95
URL: http://www.jensverwiebe.de/Blender/blender_alembic_basic_io_linux64_latest.tar.xz

Jens

Updated the OSX build to latest revision.

– PACKAGE-INFORMATION –
Branch: alembic_basic_io
Revision: c4922d7
Shasum: bde73716e411b6582973f89c9f94622eba2ca6f1
URL: http://www.linesofjasper.com/blender/blender_alembic_basic_io_osx64_latest.zip

jasper

– PACKAGE-INFORMATION –
Branch: alembic_basic_io
Revision: 3e13b9d
Submodules: locale a87cfb8 addons 75fb4e0 addons_contrib 72c24a1
OS: GNU/Linux, Architecture: x86_64, GLIBC: 2.19
Builddate: Fr 8. Jul 10:17:43 UTC 2016
Filesize: 72395272 byte
Shasum: 864f9597bd931200ad8e30fac749b25de4198566
URL: http://www.jensverwiebe.de/Blender/blender_alembic_basic_io_linux64_latest.tar.xz

Just for everyone’s attention this is latest HEAD and contains the following changes since my latest post:

  • Implemented the CacheFile in the dependency graph, so that when you change CacheFile related data (e.g. Frame Offset), the scene/viewport is updated as well. For now (and probably forever), this is only implemented in the new dependency graph, so you have to enable it when launching blender (using --enable-new-depsgraph)
  • Fixed curves draw issues.
  • Streaming curves with a variable number of points are now supported.
  • Scale motion vectors by the FPS.