Skip to content
forked from zenustech/zeno

ZEn NOde system - a simulation & rendering engine in nodes

License

Notifications You must be signed in to change notification settings

python3kgae/zeno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZENO

CMake License Version

Open-source node system framework, to change your algorithmic code into useful tools to create much more complicated simulations!

rigid3.zsg

Features

Integrated Toolbox, from volumetric geometry process tools (OpenVDB), to state-of-art, commercially robust, highly optimized physics solvers and visualization nodes, and various VFX and simulation solutions based on our nodes (provided by .zsg file in arts/ folder). //better have some screenshot here

ZenCompute (@littlemine)

Open-source code development framework to easily develop high-performance physical simulation code that both run on cpu and gpu with out too much effort. //better have some screenshot here

Motivation

Nowadays, many CG artists have reached an agreement that creating arts (especially physics simulation and animation) using visual-programming tool is very convinent and flexible.

This repo aims to provide a great tool for both technical artists and CG developers, and researchers from physics simulation.

Easy Plug, Easy Go

One may create complicated simulation scenarios by simply connecting the nodes provided by the system. For example, here's a molecular simulation built by our users:

lennardjones.zsg

This is the charm of visual-programming, not only the direction of data-flow, but also the logic-flow of the solution algorithm is presented at no more clarity. In fact, building this molecular simulation from scratch took no more than 7 minutes!

Flexible

One can easily change or adjust a solution by simply break and reconnect of the nodes. Unlike many simulation softwares that have fixed functionality, we provide the building blocks of algorithms in the form of nodes at a relatively low granularity. By connecting these nodes, you can literally create your unique solver that best fits your need, rather than being limited by the imagination of software programmers.

[TODO: rigid_pool.zsg to demo solid-fluid couple]

Performant

ZENO nodes are mainly written in C++. By connecting nodes in our Qt5 editor, you are invoking our highly optimized programs by our senior engineers. And all you need to do is to explore in your mind-space without bothering to tackle low-level details. Performance-wisely, it's shown by @zhxx1987 that our FLIP solver is 4x faster than Houdini at large scale.

FLIPSolver.zsg

Control-flows

Unlike many pure functional node systems (e.g. Blender), ZENO has a strong time-order and provide a lot of control-flow nodes including CachedOnce, BeginForEach, EndFor, etc. This enable you to make turing-equivalent programs that fit real-world problems.

forloop.zsg

Unified

Despite we already have many node systems today, but the are usually bound to specific softwares, e.g. Blender, Houdini, Unreal, etc.. These softwares usually already contains a lot of nodes and assumptions and thus hard to use for developers to extend it. What's more, a user who wrote a cloth simulation node for Blender cannot couple with a user who wrote a fluid simulation in Houdini. So, we want to create a unified framework customized for simulation with nodes.

Extensible

As a comparison, the ZENO node system is very extensible. Although ZENO itself doesn't provide any solvers, instead it allows users to write their own nodes using its C++ or Python API. Here's some of the node libraries that have been implemented by our developers:

  • basic primitive ops (by @archibate)
  • basic OpenVDB ops (by @zhxx1987)
  • OpenVDB FLIP fluids (by @zhxx1987)
  • Tree-code N-body (by @archibate)
  • Molocular Dynamics (by @victoriacity)
  • GPU MPM with CUDA (by @littlemine)
  • Bullet3 rigid solver (by @archibate)

Loading these libraries would add corresponding functional nodes into ZENO, after which you can creating node graphs with them for simulation. You may also add your own solver nodes to ZENO with this workflow if you'd like.

rigid3.zsg

Integratable

Not only you can play ZENO in our official Qt5 editor, but also we may install ZENO as a Blender addon! With that, you can enjoy the flexibilty of ZENO node system and all other powerful tools in Blender. See Blender addon section for more information.

blender.blend

Build & Run

Installation requirements

You need a C++17 compiler, CMake 3.12+, and Python 3.6+ to build ZENO; NumPy and PyQt5 to run ZENO editor. Other requirements like Pybind11 or GLAD are self-contained and you don't have to worry installing them manually.

  • Arch Linux
sudo pacman -S gcc make cmake python python-pip python-numpy python-pyqt5 qt5-base libglvnd mesa
  • Ubuntu 20.04
sudo apt-get install gcc make cmake python-is-python3 python-dev-is-python3 python3-pip libqt5core5a qt5dxcb-plugin libglvnd-dev libglapi-mesa libosmesa6

python --version  # make sure Python version >= 3.7
sudo python -m pip install -U pip
sudo python -m pip install numpy PyQt5
  • Windows 10
  1. Install Python 3.8 64-bit. IMPORTANT: make sure you Add Python 3.8 to PATH! After that rebooting your computer would be the best.
  2. Start CMD in Administrator mode and type these commands:
python -m pip install numpy PyQt5

(Fun fact: you will be redirected to Microsoft Store if python is not added to PATH properly :) Make sure it starts to downloading and installing successfully without ERROR (warnings are OK though).

If you got ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'c:\\python38\\Lib\\site-packages\\PyQt5\\Qt5\\bin\\d3dcompiler_47.dll'': Quit anti-virus softwares (e.g. 360), they probably prevent pip from copying DLL files.

If you got ImportError: DLL load failed while importing QtGui: Try install Microsoft Visual C++ Redistributable.

  1. Install Visual Studio 2019 Community Edition or later version (for C++17 support in MSVC).

Build ZENO

  • Linux
cmake -B build
make -C build -j8
  • Windows
cmake -B build

Then open build/zeno.sln in Visual Studio 2019, and switch to Release mode in build configurations, then run Build -> Build All.

IMPORTANT: In MSVC, Release mode must always be active when building ZENO, since MSVC uses different allocators in Release and Debug mode. If a DLL of Release mode and a DLL in Debug mode are linked together in Windows, it will crash when passing STL objects.

Run ZENO for development

  • Linux
./run.sh
  • Windows
run.bat

Install ZENO globally for Python

python setup.py install

Packing ZENO into PyPI wheel

sudo python -m pip install wheel
python setup.py bdist_wheel
ls dist/*.whl

Upload ZENO to PyPI.org (password required)

sudo python -m pip install twine
twine upload dist/*.whl

Extensions

ZENO is extensible which means we may write extensions (node libraries) for it. The source code of all our official extensions are provided in projects/.

Build extensions

For now, official extensions will be built by default when running the ALL_BUILD target of CMake.

FastFLIP

Note that the extensions: ZenVDB and FastFLIP are not built by default. You can use

cmake -B build -DEXTENSION_zenvdb:BOOL=ON -DEXTENSION_FastFLIP:BOOL=ON

to enable them.

GMPM

You need to update git submodules before building @littlemine's GPU MPM. To do so:

git submodule update --init --recursive

Then:

cmake -B build -DEXTENSION_gmpm:BOOL=ON

to enable it.

Major dependencies

Building them require some dependencies:

  • Rigid (bullet3 rigid dynamics)

    • no dependencies!
  • ZMS (molocular dynamics)

    • OpenMP (optional)
  • ZenBASE (deprecated mesh operations)

    • OpenMP (optional)
  • ZenVDB (OpenVDB ops and tools)

    • OpenVDB
    • IlmBase
    • TBB
    • OpenMP (optional)
  • FastFLIP (zhxx's OpenVDB FLIP solver)

    • OpenVDB
    • IlmBase
    • Eigen3
    • TBB
    • OpenBLAS
    • ZenVDB (see above)
    • ZenBASE (see above)
  • GMPM (wxl's GPU MPM solver)

    • CUDA toolkit
    • OpenVDB (optional)

Other extensions are built by default because their dependencies are self-contained and portable to all platforms.

Write your own extension!

See demo_project/ for an example on how to write custom nodes in ZENO.

Installing extensions

To install a node library for ZENO just copy the .so or .dll files to zeno/autoload/. See demo_project/CMakeLists.txt for how to automate this in CMake.

Blender addon

Work in progress, see assets/blender.blend. The source code of our blender addon is under zenblend/. Contributions are more than welcome!

About

ZEn NOde system - a simulation & rendering engine in nodes

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 62.9%
  • C 29.8%
  • Cuda 5.7%
  • CMake 0.9%
  • HTML 0.5%
  • Python 0.2%