C++ (with python bindings) library for easily reading/writing/manipulating common animation particle formats such as PDB, BGEO, PTC. See the discussion group @ http://groups.google.com/group/partio-discuss

Related tags

Graphics partio
Overview

Partio - A library for particle IO and manipulation

This is the initial source code release of partio a tool we used for particle reading/writing. It started out as an abstraction for the commonalities in particle models (i.e. accessing many attributes associated with an index or entity).

Super impatient building guide

    # Install Location ~ adjust accordingly
    prefix=$HOME/local
    git clone https://github.com/wdas/partio.git
    cd partio
    make -j prefix=$prefix install

Getting Started

CMake is used to build the project, but we provide a top-level Makefile for convenience that takes care of all the steps.

See the Makefile for the user-tweakable variables and corresponding cmake options.

The typical usage for an installation into /usr/local with a temporary staging directory of /tmp/stage is:

make DESTDIR=/tmp/stage prefix=/usr/local install

Source code overview

    src/
       lib/      Library code (public API in root)
       lib/core  Core library (KDtree traversal, data representations)
       lib/io    Input/Output (Different file formats)
       py/       SWIG based python bindings
       doc/      Doxygen documentation and (the start of) a manual
       tests/    Start of regression tests (I need more)
       tools/    Useful tools
                 partconvert <input format> <output format>
                 partinfo <particle file>
                 partview <particle file>

Class Model

The goal of the library is to abstract the particle interface from the data representation. That is why Partio represents particles using three classes that inherit and provide more functionality

ParticlesInfo - Information about # of particles and attributes ParticlesData - Read only access to all particle data ParticlesDataMutable - Read/write access to all particle data

The functions used to get particle access are these:

    readHeaders()
       returns ParticlesInfo
       reads only the minimum data necessary to get number of particles and
       attributes

    readCached()
       returns ParticlesData
       For multiple users in different threads using the same particle file
       ParticlesData

    create() and read()
       returns ParticlesDataMutable
       allows read/write access

Behind the scenes you could implement these classes however you like. Headers only representation is called core/ParticleHeader.{h,cpp}. Simple non-interleaved attributes is core/ParticleSimple.{h,cpp}.

Attribute Data Model

All particles have the same data attributes. They have the model that they are of three basic types with a count of how many scalar values they have.

    VECTOR[3]
    FLOAT[d]
    INT[d]

    VECTOR[3] and FLOAT[3] have the same data representations.
    VECTOR[4] is invalid however FLOAT[4] is valid as is FLOAT[1...infinity]

This seems to encompass the most common file formats for particles

Iterating

There are multiple ways to access data in the API. Here are some tips

  • Use SIMD functions when possible prefer dataAsFloat(),data(arrayOfIndices) as opposed to data(int singleIndex) which accesses multiple pieces of data at once

  • Cache ParticleAttributes for quick access instead of calling attributeInfo() over a loop of particles

  • Use iterators to do linear operations over all particles They are much more optimized than both data() and the dataAsFloat or

Backends

Behind the scenes there are SimpleParticles, ParticleHeaders, and SimpleParticlesInterleaved. In the future I would like to write a disk-based cached back end that can dynamically only load the data that is necessary. create(), read() and readCached could be augmented to create different structures in these cases.

Readers/Writers

New readers and writers can be added in the io/ directory. You simply need to implement the interface ParticlesInfo, ParticlesData and ParticlesDataMutable (or as many as you need). Editing the io/readers.h to add prototypes and io/ParticleIO.cpp to add file extension bindings should be easy.

  • Andrew Selle, Walt Disney Animation Studios
Issues
  • Error reading maya2011 pdb files created under win7

    Error reading maya2011 pdb files created under win7

    Hello, I have problems reading pdb files from maya2011 created under win7. However I can read maya2009-win32 files with no problem. Here's an error message: Partio: Attribute 'pß↨ ' cannot map type

    The .pdb files are made from default emitter+particles and issuing: dynExport -mnf 1 -mxf 100 -atr position -atr velocity -f "pdb"

    I'll try to get to linux machine and generate pdb there to see if it helps...

    opened by ogre 15
  • fatal error: 'SeExpression.h' file  not found

    fatal error: 'SeExpression.h' file not found

    Hi I am building Partio without python bindings but I am getting this error:

    `Scanning dependencies of target partioSe [ 42%] Building CXX object src/lib/CMakeFiles/partioSe.dir/PartioSe.o In file included from /DEV/libs/partio/src/lib/PartioSe.cpp:35: /DEV/libs/partio/src/lib/PartioSe.h:36:10: fatal error: 'SeExpression.h' file not found

    include <SeExpression.h>

         ^
    

    1 error generated.`

    opened by sabotage3d 12
  • Add CI support, along with some fixes for Windows.

    Add CI support, along with some fixes for Windows.

    Other changes:

    • Replace OpenGL::OpenGL with OpenGL::GL, as OpenGL::OpenGL doesn't work on Windows.
    • Use ZLIB::ZLIB to reference ZLIB, and add it to the public dependencies.
    • Disable shared libraries by default. The library has no symbol visibility set, so on Visual C++ it will not produce a library by default as there are no symbols.

    I'm not 100% certain about the OpenGL::GL change, and I can easily make that conditional based on Windows if that's preferred, but I don't see use of EGL either so ... it's unclear if OpenGL::OpenGL is really needed. For the shared library, the correct fix would be to export all symbols that could be used by clients, but I'm not sure which ones those are so I'll rather err on the side of caution here.

    opened by Anteru 7
  • Redpawfx

    Redpawfx

    Went diving into all the other forks to find as many formats as I could, and hand merged them all together. Fixed them up and updated them to work with the latest version from WDAS. Now Partio Supports (Read/Write) BGEO R/W GEO R/W BIN (realflow) R/W MC (maya nCache) Read only PDA R/W PDB R/W PDC R/W PRT (krakatoa) R/W PTC R/W RIB Write only PTS ( simple text Lidar format ) Read only

    Additionally I continued updating and adding to partview GLUT controls and features adding to what crydalch added to also include the following features:

    -MUCH faster point interaction with milions of points -better color support (also toggle color on off with C/c) -multi-frame viewer support with keyboard controls (left right arrow keys) -point size control via keyboard controls (+/- keys) -Maya like tumble controls with alt-key including mouse wheel support -FOV control via Z/z keys -Overlays to display point count , frame number and FOV

    also started to investigate how to implement a loading feedback mechanism that eventually we'll be able to re-implement in whatever package partio is being used in. Right now this can be seen only in the PTS loader.

    Happy Holidays!

    opened by redpawfx 5
  • support for ncache

    support for ncache

    is anyone currently working on support for maya's pdc and ncache formats?

    http://download.autodesk.com/us/maya/2009help/index.html?url=Caching_nCloth_nCloth_cache_XML_description_file.htm,topicNumber=d0e484381

    i might start this, but i don't want to do it if someone else is already working on it!

    opened by chadrik 5
  • partio 1.14.0 osx build failure

    partio 1.14.0 osx build failure

    👋 trying to build the latest release, but run into some build issue.

    The error log is as below:

    build failure
    CMake Error at src/tools/CMakeLists.txt:38 (add_executable):
      Target "partview" links to target "OpenGL::OpenGL" but the target was not
      found.  Perhaps a find_package() call is missing for an IMPORTED target, or
      an ALIAS target is missing?
    
    
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        CMAKE_C_FLAGS_RELEASE
    

    Full build log is here, https://github.com/Homebrew/homebrew-core/runs/1547382827 relates to https://github.com/Homebrew/homebrew-core/pull/66889

    And help would be appreciated!

    opened by chenrui333 3
  • Python 3 support

    Python 3 support

    The 1.10.0 release claims to support Python 3 but scripts like partinspect and partedit still use print without parenthesis so they are not executable with Python 3.

    opened by fernape 3
  • Various fixes for .bin reading and saving

    Various fixes for .bin reading and saving

    • fixed read/writing the id channel (previously all 0s)
    • fixed read/writing the neighbor channel (float/int conversion was making this useless)
    • fixed writing of bin files so they can actually be loaded back into realflow without crashing (file format did not follow spec)
    • remove debug print statements
    • remove unnecessary float->double->float conversions
    opened by jamesvecore 3
  • Added getArray() python API method to get all particle attribute data in a single python tuple

    Added getArray() python API method to get all particle attribute data in a single python tuple

    This is a much faster way of getting the particle attribute data than iterating over particles in python using .get(). In my test case, loading a large point cloud for display in openGL, it's around a factor of 10 speedup.

    opened by mattebb 3
  • Plan to make a tag?

    Plan to make a tag?

    Hi,

    I would like to add Partio into Homebrew and it is asked for each package to have a version or tag instead of just the lastest development snpashot (HEAD). I am wondering if you are gonna make a versioning tag for that ;)

    • Drake
    opened by drakeguan 3
  • Adding Color to partview...

    Adding Color to partview...

    First of all, thanks for partio!

    I thought I'd get my feet wet by adding color support to partview; I referenced the code getting position, but for some reason, position is being read into the color. Where am I not understanding the documentation?

    Thanks!

    //glColor3f(1,1,1); glBegin(GL_POINTS); for(int i=0;inumParticles();i++){ const float\* pos=particles->data(positionAttr,i); const float\* color=particles->data(colorAttr, i); std::cout<<"Color: "<
    opened by crydalch 3
  • ZipFileHeader fileds overlap compiler warning

    ZipFileHeader fileds overlap compiler warning

    https://github.com/wdas/partio/blob/7cb3743c6e19c04ac049c05f8f81af2f24410ea3/src/lib/io/ZIP.cpp#L166

    Hello! These variables are overlap ZipFileHeader fields with same name. Should ZipFileHeader::Read method use version,flags fields or local variables? If local variables need maybe better to rename these

    opened by LevWi 0
  • Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)

    Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)

    when run:

    # on ubuntu20.04LTS
    make -j prefix=$prefix install
    

    It's raise:

    CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
      Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
    Call Stack (most recent call first):
      /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
      /usr/share/cmake-3.16/Modules/FindGLUT.cmake:130 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
      CMakeLists.txt:114 (find_package)
    

    How to solve this problem?

    opened by weiwenying 1
  • Build only the lib for subproject builds?

    Build only the lib for subproject builds?

    Hi there,

    When building partio as a subdirectory with CMake, it would be great if we could only build the main lib: https://github.com/wdas/partio/blob/9288fefd3b77085507171e5acdafc12cc8f44fae/CMakeLists.txt#L136 And skip the python/tools/etc. (i.e. don't require GLUT/OpenGL/Python).

    opened by jdumas 0
  • Error when make install

    Error when make install

    When I install this package it shows the following error message

    /usr/bin/ld: cannot find -lOpenGL::OpenGL collect2: error: ld returned 1 exit status src/tools/CMakeFiles/partview.dir/build.make:91: recipe for target 'src/tools/partview' failed make[2]: *** [src/tools/partview] Error 1 CMakeFiles/Makefile2:967: recipe for target 'src/tools/CMakeFiles/partview.dir/all' failed make[1]: *** [src/tools/CMakeFiles/partview.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2

    Is there any solution to this? Anything would help. When I search the internet I barely see any information regard to -lOpenGL::OpenGL. So I don't know how to solve this.

    I am using the cmake version exactly 3.15.0

    opened by songbaai 2
  • partio python ptc set format attribute

    partio python ptc set format attribute

    partio Community,

    Hello. Thanks for partio python!

    A noob question.

    In a .ptc I generated with partio python I see the PTC Header(?) attribute

    Format : 640x480x300

    Would anyone have an idea/example of how to set the 'Format' value using partio Python ?

    Thank you.

    opened by Martin-Odenell 0
Owner
Walt Disney Animation Studios
Walt Disney Animation Studios
Polyscope is a C++/Python viewer and user interface for 3D data such as meshes and point clouds

Polyscope is a C++/Python viewer and user interface for 3D data such as meshes and point clouds. It allows you to register your data and quickly generate informative and beautiful visualizations, either programmatically or via a dynamic GUI.

Nicholas Sharp 1.1k Jun 29, 2022
The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.

Open Asset Import Library (assimp) A library to import and export various 3d-model-formats including scene-post-processing to generate missing render

Open Asset Import Library 7.9k Jul 4, 2022
Easily view the unexplored korok seeds and locations in your BotW savefile on your Switch

BotW Unexplored Easily view what hasn't been discovered in your Breath of the Wild savefile, on your Nintendo Switch. The korok seeds that haven't bee

Ludvig Magnusson 80 Jun 3, 2022
NVRHI (NVIDIA Rendering Hardware Interface) is a library that implements a common abstraction layer over multiple graphics APIs

NVRHI Introduction NVRHI (NVIDIA Rendering Hardware Interface) is a library that implements a common abstraction layer over multiple graphics APIs (GA

NVIDIA GameWorks 381 Jun 19, 2022
Horde3D is a small 3D rendering and animation engine. It is written in an effort to create an engine being as lightweight and conceptually clean as possible.

Horde3D Horde3D is a 3D rendering engine written in C++ with an effort being as lightweight and conceptually clean as possible. Horde3D requires a ful

Volker Vogelhuber 1.2k Jul 3, 2022
SVG animation from multiple SVGs or single GIF using tracer

svgasm svgasm is a proof-of-concept SVG assembler to generate a self-contained animated SVG file from multiple still SVG files with CSS keyframes anim

Tom Kwok 156 Jun 28, 2022
A simple animation challenge made with Flutter

Slide Show - Flutter Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is your fi

Pedro Massango 24 Dec 2, 2021
Pencil2D is an animation/drawing software for Windows, macOS, Linux, and FreeBSD.

Pencil2D is an animation/drawing software for Windows, macOS, Linux, and FreeBSD. It lets you create traditional hand-drawn animation (cartoon) using both bitmap and vector graphics. Pencil2D is free and open source.

Pencil2D 1.1k Jul 1, 2022
animation2gltf2 is a command line tool for generating animation glTF 2.0 content.

Generate animation glTF 2.0 content animation2gltf2 is a command line tool for generating animation glTF 2.0 content. A rotation and translation can b

UX3D GmbH 7 Jan 9, 2022
Monster Mash: New Sketch-Based Modeling and Animation Tool

Monster Mash is a new sketch-based modeling and animation tool that allows you to quickly sketch a character, inflate it into 3D, and promptly animate it. You can perform all interactions in the sketching plane. No 3D manipulation is required.

Google 1.1k Jul 2, 2022
appleseed is an open source, physically-based global illumination rendering engine primarily designed for animation and visual effects.

appleseed is an open source, physically-based global illumination rendering engine primarily designed for animation and visual effects.

appleseedhq 1.9k Jul 1, 2022
ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources

ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources

null 2.3k Jun 30, 2022
The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++

DirectX Tool Kit for DirectX 11 http://go.microsoft.com/fwlink/?LinkId=248929 Copyright (c) Microsoft Corporation. All rights reserved. January 9, 202

Microsoft 2.1k Jul 2, 2022
🎮 C Bindings/Wrappers for Apple's METAL framework

Apple's Metal for C C Wrapper for Apple's METAL framework. This library is C bindings of Metal API (MetalGL). Since OpenGL is deprecated, this library

Recep Aslantas 104 Jun 24, 2022
Deno gl - WIP Low-level OpenGL (GLFW) bindings and WebGL API implementation for Deno.

deno_gl WIP Low-level OpenGL (GLFW) bindings and WebGL API implementation for Deno. Building Make dist directory if it doesn't exist. Build gl helper

DjDeveloper 14 Jun 11, 2022
ANSI C library for NURBS, B-Splines, and Bézier curves with interfaces for C++, C#, D, Go, Java, Lua, Octave, PHP, Python, R, and Ruby.

TinySpline TinySpline is a small, yet powerful library for interpolating, transforming, and querying arbitrary NURBS, B-Splines, and Bézier curves. Th

Marcel Steinbeck 797 Jun 27, 2022
HARFANG®3D is an all-in-one 3D visualization library usable in C++, Python, Lua and Go.

HARFANG® 3D engine HARFANG®3D is an all-in-one 3D visualization library usable in C++, Python, Lua and Go. Table of contents About Features Screenshot

HARFANG® 3D 133 Jun 30, 2022
Python binding for Grasp Pose Generator (pyGPG)

Python binding for Grasp Pose Generator (pyGPG) Grasp Pose Generator is a cpp package that creat grasp candidates for 3D point clouds. This package bi

Hongzhuo Liang 9 Jun 22, 2022
⚡High-performance rendering for python

ZenGL ZenGL is a minimalist Python module providing exactly one way to render scenes with OpenGL. pip install zengl Documentation zengl on Github zen

Szabolcs Dombi 121 Jun 18, 2022