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
Datargsing is a data management and manipulation Python library

Datargsing What is It? Datargsing is a data management and manipulation Python library which is currently in deving Why this library is good? This Pyt

CHOSSY Lucas 10 Oct 24, 2022
Prop-based map editor for the Apex Legends mod, R5Reloaded

R5R Map Editor A tool to build maps out of props in the Apex Legends mod, R5Reloaded Instuctions Install R5R Download this program Get the prop spawne

7 Dec 16, 2022
The Great Autoencoder Bake Off

The Great Autoencoder Bake Off The companion repository to a post on my blog. It contains all you need to reproduce the results. Features Currently fe

Tilman Krokotsch 61 Jan 06, 2023
Мой первый калькулятор!!!!!!

my_first_calculator Первый калькулятор созданный мною на питоне Версия калькулятора: 0.0.4 Как скачать? TERMUX Для скрипта нужен питон, скачиваем pkg

Lesha Russkiyov 2 Dec 29, 2021
SMS-b0mber VANDALIZM developed for VK group

VANDALIZM SMS-b0mber VANDALIZM developed for VK group https://vk.com/dark__code if you come across this code, you can use it for your own purposes) ус

5 Jun 24, 2022
Hitchhikers-guide - The Hitchhiker's Guide to Data Science for Social Good

Welcome to the Hitchhiker's Guide to Data Science for Social Good. What is the Data Science for Social Good Fellowship? The Data Science for Social Go

Data Science for Social Good 907 Jan 01, 2023
Snakemake worflow to process and filter long read data from Oxford Nanopore Technologies.

Nanopore-Workflow Snakemake workflow to process and filter long read data from Oxford Nanopore Technologies. It is designed to compare whole human gen

5 May 13, 2022
VCM EE1.2 P-layer feature map anchor generation 137th MPEG-VCM

VCM EE1.2 P-layer feature map anchor generation 137th MPEG-VCM

IPSL 6 Oct 18, 2022
SWS Filters App - SWS Filters App With Python

SWS Filters App Fun 😅 ... Fun 😅 Click On photo and see 😂 😂 😂 Your Video rec

Sagar Jangid 3 Jul 07, 2022
Tracking development of the Class Schedule Siri Shortcut, an iOS program that checks the type of school day and tells you class scheduling.

Class Schedule Shortcut Tracking development of the Class Schedule Siri Shortcut, an iOS program that checks the type of school day and tells you clas

3 Jun 28, 2022
Launcher program to select which version of the Q-Sys software to launch.

QSC-QSYS Launcher Launcher program to select which version of the Q-Sys software to launch. Instructions To use the application simply save the "Q-Sys

Zach Lisko 2 Sep 28, 2022
Sardana integration into the Jupyter ecosystem.

sardana-jupyter Sardana integration into the Jupyter ecosystem.

Marc Espín 1 Dec 23, 2021
Fetch data from an excel file and create HTML file

excel-to-html Problem Statement! - Fetch data from excel file and create html file Excel.xlsx file contain the information.in multiple rows that is ne

Vivek Kashyap 1 Oct 25, 2021
Multtable is a collection of multiplication table generators in various languages.

Multtable Multtable is a collection of multiplication table generators in various languages. This project was created as a joke based on one of my bro

pollen__ 7 Mar 05, 2022
Automatic certificate unpinning for Android apps

What is this? Script used to perform automatic certificate unpinning of an APK by adding a custom network security configuration that permits user-add

Antoine Neuenschwander 5 Jul 28, 2021
Blender addons - A collection of Blender tools I've written for myself over the years.

gret A collection of Blender tools I've written for myself over the years. I use these daily so they should be bug-free, mostly. Feel free to take and

217 Jan 08, 2023
Alternative StdLib for Nim for Python targets

Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim

Juan Carlos 100 Jan 01, 2023
How to create the game Rock, Paper, Scissors in Python

Rock, Paper, Scissors! If you want to learn how to do interactive games using Python, then this is great start for you. In this code, You will learn h

SplendidSpidey 1 Dec 18, 2021
The Blinker Herald includes helpers to easily emit signals using the excellent blinker library.

Blinker Herald The Blinker Herald includes helpers to easily emit signals using the excelent blinker library. Decorate a function or method with @blin

SatelliteQE 7 Nov 03, 2022
CEI Natural Disaster Tracking Portal

CEI Natural Disaster Tracking Portal (cc) Climatic Eye of ISCI We are an initiative that conducts studies in the field of Space Science, publishes pro

Baris Dincer 7 Dec 24, 2022