Styling a PointCloud in Blender [Blender 2.93] | English
Channel: Jonathan Kron
Date: 2021-07-03

In this tutorial, I show you how to style a point cloud in Blender using a Python script.
Point Cloud Visualizer: https://github.com/uhlik/bpy
Gumroad: https://gumroad.com/jonathankron
Blender Market: https://blendermarket.com/creators/jonathan-kron

-----------------------------------------------------

Script:

import bpy
import bmesh
import mathutils

r_digit = 2

context = bpy.context

ob = context.object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)

counter = 0
for f in bm.faces:
    print(counter)
    counter += 1
    #print("Center: " + str(f.calc_center_median()))
    old_center = f.calc_center_median()
    new_center = [round(old_center[0],r_digit),round(old_center[1],r_digit),round(old_center[2],r_digit)]
    #print(new_center)
    
    x_offset = new_center[0] - old_center[0]
    y_offset = new_center[1] - old_center[1]
    z_offset = new_center[2] - old_center[2]
    
    #print(x_offset,y_offset,z_offset)
    
    for v in f.verts:
        #print(v.co)
        v.co += mathutils.Vector((x_offset, y_offset, z_offset))
        #print(v.co)
    #print("#")

bm.to_mesh(me)
me.update()

-----------------------------------------------------

**Products I use**

DECALmachine*: https://gumroad.com/a/1070707827

-----------------------------------------------------

**Partners**

EcraxOfficial:
https://www.youtube.com/channel/UCFItty350EG0qrd_IWVScnA

-----------------------------------------------------

*Affiliate links for products I use daily!