Blender 3.1 Alpha (and later) PLY importer that correctly loads point clouds (and all PLY models as point clouds)

Overview

import-ply-as-verts

Blender 3.1 Alpha (and later) PLY importer that correctly loads point clouds (and all PLY models as point clouds)

Latest News

  • Mandelbulb3D - Recommended to use v1.99 for now. The BTracer2 module in v1.99.32 isn't compatible with the importer yet but it's an easy patch, will be fixed asap.
  • Updated .blend files to remove a HDRI I forgot was attached :) Also have both Cycles and Eevee versions.

Until I get the script correctly packaged as an addon, it will be necessary to replace the stock import module with the new one. See the Install.pdf file for more detail.

The stock PLY importer that ships with Blender was never intended for vertex-colored point clouds (ie, PLY files with zero edges and faces). Most of my fun math graphics are point clouds from Mandelbulb3D, J-Wildfire, and photogrammetry scans gone horribly wrong. Until now, getting these clouds into Blender has involved a great deal of heavy lifting. Since 2017 I have been developing a standalone app for this but with the recent functionality added in Blender 3.1 Alpha and newer, I happily abandon my project to throw full energy into the beauty of Geo Nodes.

I was able to sleuth out why the importer didn't work. For the technically minded, the issue was that the Vertex Color Data Block in Blender is intimately tied to Faces. One cannot exist without the other. However, the color data was still being read in. The tricky part was spending many quality hours with bpy.data. to ultimately find a useful data structure for said color data. Finally, a Custom Attribute was the answer!

And now instead of endlessly coding ON point clouds, we all get to PLAY with point clouds.

And hast thou slain the Jabberwock? Come to my arms, my beamish boy! O frabjous day! Callooh! Callay! He chortled in his joy.

Lewis Carroll, 'The Jabberwocky'

Demo Video: https://youtu.be/-OMV2LrTwVw

Node_Setup-03

Changelog:

  • Feb 5, 2022 - v1.01 patched to allow for certain J-Wildfire formulas that add extraneous data to the PLY file during export.
Comments
  • Colors problem

    Colors problem

    Hi! I've tryed writing on the youtube video but seems the commet are disappeared.

    The problem I was asking is that i can't get the color attribute to the points, I've defined the shader with the "attribute" "Col" as base color, and then the geometry node both with instance or mesh to points, but the points still has no colors

    May I ask for help? Thanks :) Cattura

    opened by Tonysa87 4
  • J-Wildfire Extraneous Data in PLY File

    J-Wildfire Extraneous Data in PLY File

    Certain JWF formulas will place additional nonstandard property fields into the PLY file when exporting. This was reported by Brad Stefanov on Feb 4 2022 and replicated on my end. Patched in v1.01, will revisit for more comprehensive solution.

    Feb 5, 2022 -MAP

    opened by TombstoneTumbleweedArt 0
  • Emission column after colors? (or just extra column in general)

    Emission column after colors? (or just extra column in general)

    I've been working on a ply writer for some particle simulation data which can map one attribute to RGB, another to alpha, and a third to emission. With very little coding experience myself, I've been working on a personal set of edits to this reader for an additional column but I figure this may be something useful to others as well, hence why I bring it as a suggestion here.

    opened by beanachew 0
  • does it change coordinates?

    does it change coordinates?

    Hello,

    Thanks for such nice tool.

    I have some problem when import the pointcloud as it seems it modifies the coordinates while importing. In the image, you can see that in blender (left) the two models do not overlap as they should. When open the models on meshlab it does work (right image). Is this a problem that can be solved?

    Screenshot from 2022-07-21 10-28-11

    Best, Bryan

    opened by bgpantojar 8
  • Auto generate geometry nodes and basic material

    Auto generate geometry nodes and basic material

    Hi, thanks for creating this updated ply importer! I wrote something that creates a material and geometry node tree:

    import bpy
    
    mat_name = "pointcloud"
    materials = bpy.data.materials    
    if materials.get(mat_name) is None: 
        print("creating pointcloud material")   
        mat = materials.new(mat_name)
        mat.use_nodes = True
        materialtree = mat.node_tree.nodes
        materialtree.remove(materialtree.get("Principled BSDF"))
        materialtree.remove(materialtree.get("Material Output"))
        
        attributenode = materialtree.new(type="ShaderNodeAttribute")
        attributenode.attribute_name="Col"
        outputnode = materialtree.new(type="ShaderNodeOutputMaterial")
        pbrnode = materialtree.new(type="ShaderNodeBsdfPrincipled")
        mat.node_tree.links.new(attributenode.outputs[0],pbrnode.inputs[0])
        mat.node_tree.links.new(pbrnode.outputs[0],outputnode.inputs[0])
    mat = materials.get(mat_name)
    
    #import object
    bpy.ops.import_mesh.ply(filepath=r"C:\Users\User\Desktop\file.ply")
    importedObject = bpy.context.active_object
    #create geometry node tree
    bpy.ops.object.modifier_add(type='NODES')
    nodeTree = bpy.context.active_object.modifiers[0].node_group
    
    cubenode = nodeTree.nodes.new(type="GeometryNodeMeshCube")
    CubeSize = 0.001
    cubenode.inputs[0].default_value[0] = CubeSize
    cubenode.inputs[0].default_value[1] = CubeSize
    cubenode.inputs[0].default_value[2] = CubeSize
    
    instancenode = nodeTree.nodes.new(type="GeometryNodeInstanceOnPoints")
    materialnode = nodeTree.nodes.new(type="GeometryNodeSetMaterial")
    materialnode.inputs[2].default_value = mat
    shadenode = nodeTree.nodes.new(type="GeometryNodeSetShadeSmooth")
    realizenode = nodeTree.nodes.new(type="GeometryNodeRealizeInstances")
    geonode = nodeTree.nodes[0]
    outnode = nodeTree.nodes[1]
    
    nodeTree.links.new( geonode.outputs['Geometry'] , instancenode.inputs['Points'])
    nodeTree.links.new( cubenode.outputs['Mesh'], shadenode.inputs['Geometry'])
    nodeTree.links.new( shadenode.outputs['Geometry'], materialnode.inputs['Geometry'])
    nodeTree.links.new( materialnode.outputs['Geometry'], instancenode.inputs['Instance'])
    nodeTree.links.new( instancenode.outputs['Instances'], realizenode.inputs['Geometry'])
    nodeTree.links.new( realizenode.outputs['Geometry'], outnode.inputs['Geometry'])
    
    
    opened by RH2 1
Releases(v2.1)
Owner
Michael Prostka
Michael Prostka
Hasklig - a code font with monospaced ligatures

Hasklig – Ligatures for code Programming languages are limited to relatively few characters. As a result, combined character operators surfaced quite

Ian Tuomi 5.3k Jan 03, 2023
Blender Light Manipulation - A script that makes it easier to work with light

Blender Light Manipulation A script that makes it easier to work with light 1. Wstęp W poniższej dokumentacji przedstawiony zostanie skrypt, który swo

Tomasz 1 Oct 19, 2021
PIP Manager written in python Tkinter

PIP Manager About PIP Manager is designed to make Python Package handling easier by just a click of a button!! Available Features Installing packages

Will Payne 9 Dec 09, 2022
A guy with a lot of useful things to do when doing AtCoder in Python

atcoder_python_env Python で AtCoder をやるときに便利な諸々を用意したやつ コンテスト用フォルダの作成 セットアップ 自動テス

2 Dec 28, 2021
LOC-FLOW is an “hands-free” earthquake location workflow to process continuous seismic records

LOC-FLOW is an “hands-free” earthquake location workflow to process continuous seismic records: from raw waveforms to well located earthquakes with magnitude calculations. The package assembles sever

Miao Zhang 71 Jan 09, 2023
Import some key/value data to Prometheus custom-built Node Exporter in Python

About the app In one particilar project, i had to import some key/value data to Prometheus. So i have decided to create my custom-built Node Exporter

Hamid Hosseinzadeh 1 May 19, 2022
🎴 LearnQuick is a flashcard application that you can study with decks and cards.

🎴 LearnQuick is a flashcard application that you can study with decks and cards. The main function of the application is to show the front sides of the created cards to the user and ask them to guess

Mehmet Güdük 7 Aug 21, 2022
LPCV Winner Solution of Spring Team

LPCV Winner Solution of Spring Team

22 Jul 20, 2022
Calc.py - A powerful Python REPL calculator

Calc - A powerful Python REPL calculator This is a calculator with a complex sou

Alejandro 8 Oct 22, 2022
Macros in Python: quasiquotes, case classes, LINQ and more!

MacroPy3 1.1.0b2 MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined fu

Li Haoyi 3.2k Jan 06, 2023
An Embedded Linux Project Build and Compile Tool -- An Bitbake UI Extension

Dianshao - An Embedded Linux Project Build and Compile Tool

0 Mar 27, 2022
Unfinished Python library based on ndspy, for Zelda: Phantom Hourglass and Spirit Tracks.

zed An unfinished library and toolset by me, for viewing and editing files from The Legend of Zelda: Phantom Hourglass and The Legend of Zelda: Spirit

4 Oct 13, 2022
Python Repository for Bachelor Ski Sign.

BachelorSkiSign Python Repository for Bachelor Ski Sign. This application reads data from https://bachelorapi.azurewebsites.net/ It is written in Ciru

Winston 1 Jan 04, 2022
Euler 021 Py - Euler Problem 021 solved in Python

Euler_021_Py Euler Problem 021 solved in Python Let d(n) be defined as the sum o

Ariel Tynan 1 Jan 24, 2022
Transform Python source code into it's most compact representation

Python Minifier Transforms Python source code into it's most compact representation. Try it out! python-minifier currently supports Python 2.7 and Pyt

Daniel Flook 403 Jan 02, 2023
Whatsapp Messenger master

Whatsapp Messenger master

Swarup Kharul 5 Nov 21, 2021
A similarity measurer on two programming assignments on Online Judge.

A similarity measurer on two programming assignments on Online Judge. Algorithm implementation details are at here. Install Recommend OS: Ubuntu 20.04

StardustDL 6 May 21, 2022
Package pyVHR is a comprehensive framework for studying methods of pulse rate estimation relying on remote photoplethysmography (rPPG)

Package pyVHR (short for Python framework for Virtual Heart Rate) is a comprehensive framework for studying methods of pulse rate estimation relying on remote photoplethysmography (rPPG)

PHUSE Lab 261 Jan 03, 2023
A docker container (Docker Desktop) for a simple python Web app few unit tested

Short web app using Flask, tested with unittest on making massive requests, responses of the website, containerized

Omar 1 Dec 13, 2021
A Brainfuck interpreter written in Python.

A Brainfuck interpreter written in Python.

Ethan Evans 1 Dec 05, 2021