Skip to content

Commit b97cee5

Browse files
authored
Python particle API.
1 parent a78b3d8 commit b97cee5

25 files changed

Lines changed: 217 additions & 96 deletions

‎crates/processing_pyo3/examples/flocking_duck.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def setup():
6262
duck = gltf.geometry("LOD3spShape")
6363

6464
p = create_particles(
65-
geometry=duck,
65+
duck,
6666
attributes=[
6767
Attribute.position(),
6868
Attribute.rotation(),

‎crates/processing_pyo3/examples/flocking_gpu.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def setup():
6161
directional_light((0.95, 0.9, 0.85), 800.0)
6262

6363
p = create_particles(
64-
capacity=BOID_COUNT,
64+
BOID_COUNT,
6565
attributes=[
6666
Attribute.position(),
6767
Attribute.rotation(),

‎crates/processing_pyo3/examples/particles_animated.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def setup():
2323
for z in range(10):
2424
positions.extend([x - 4.5, y - 4.5, z - 4.5])
2525

26-
p = create_particles(capacity=capacity, attributes=[Attribute.position()])
26+
p = create_particles(capacity, attributes=[Attribute.position()])
2727
pos_buf = p.buffer("position")
2828
pos_buf.write(positions)
2929

‎crates/processing_pyo3/examples/particles_basic.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup():
1515

1616
source = Geometry.sphere(5.0, 32, 24)
1717
p = create_particles(
18-
geometry=source,
18+
source,
1919
attributes=[Attribute.position(), Attribute.uv(), Attribute.color()],
2020
)
2121

‎crates/processing_pyo3/examples/particles_density.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup():
1818
mode_3d()
1919

2020
p = create_particles(
21-
capacity=N,
21+
N,
2222
attributes=[
2323
Attribute.position(),
2424
Attribute.color(),

‎crates/processing_pyo3/examples/particles_emit.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setup():
1717

1818
capacity = 2000
1919
p = create_particles(
20-
capacity=capacity,
20+
capacity,
2121
attributes=[Attribute.position(), Attribute.color()],
2222
)
2323

‎crates/processing_pyo3/examples/particles_emit_gpu.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def setup():
2929
# so declare them (all built-in here). `velocity`/`age` are built-ins now, so
3030
# no custom `Attribute(...)` is needed.
3131
p = create_particles(
32-
capacity=CAPACITY,
32+
CAPACITY,
3333
attributes=[
3434
Attribute.position(),
3535
Attribute.velocity(),

‎crates/processing_pyo3/examples/particles_from_mesh.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup():
1515

1616
source = Geometry.sphere(5.0, 32, 24)
1717
p = create_particles(
18-
geometry=source,
18+
source,
1919
attributes=[Attribute.position(), Attribute.uv(), Attribute.color()],
2020
)
2121

‎crates/processing_pyo3/examples/particles_gpu_surface.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup():
1414
window_title("gpu index")
1515
mode_3d()
1616

17-
p = create_particles(capacity=NX * NY, attributes=[Attribute.position()])
17+
p = create_particles(NX * NY, attributes=[Attribute.position()])
1818
idx = p.index_buffer((NX - 1) * (NY - 1) * 6)
1919
gen = create_compute(load_shader("shaders/gen_surface.wesl"))
2020
gen.set(indices=idx)

‎crates/processing_pyo3/examples/particles_gpu_surface_lit.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup():
1515
mode_3d()
1616

1717
p = create_particles(
18-
capacity=NX * NY,
18+
NX * NY,
1919
attributes=[Attribute.position(), Attribute.color(), Attribute.normal()],
2020
)
2121
idx = p.index_buffer((NX - 1) * (NY - 1) * 6)

0 commit comments

Comments
 (0)